w3c / w3c/json-ld-syntax

Why are value objects ineligible to be type map values?

Open
#440 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

defer-future-version ms:future-work spec:substantive substantive:class 3
Dominant language
HTML
Stars
139
Forks
23
PR merge metrics
No merged PRs in 30d

Description

I am guessing that the answer is related to #77 and that a type map is using node object @type as keys, rather than value object @types.

My use case is this: I would like to attach skos:notation values to my resources. Because skos:notation uses locally coined datatypes to distinguish the context of the notation, I would like to be tagging the @type into these values. This is simple enough in the case of a single notation: just use type coercion on a term like nickname or reference. However, if I want to use different notations for different kinds of resources, or using multiple notations on a single resource, the coercion becomes more complex.

Instead, I would like to use a type map to briefly tag the notation, and perhaps provide "coordinates" in the form of multiple notations. The JSON playground makes this look like it almost works:

 {
  "@context": {
    "skos": "http://www.w3.org/2004/02/skos/core#",
    "ex": "http://www.example.com/vocab/",
    "recordId": "ex:recordId",
    "nick": {
      "@id": "skos:notation",
      "@container": "@type"
    }
  },
  
  "nick": {
    "recordId": 17
  } 
}

Playground link

I note that the expanded version has an array for @type however, which I understand is not allowed for a value object.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading issue #77 and the JSON playground example linked here, then compare the expanded output with the JSON-LD 1.1 rules for type maps and value objects. Determine whether value objects can be valid type-map values and whether the specification needs clarification or a behavioral change; done means a resolved specification decision with supporting examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.