Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why are value objects ineligible to be type map values? #440

Open
nyarly opened this issue Aug 19, 2024 · 2 comments
Open

Why are value objects ineligible to be type map values? #440

nyarly opened this issue Aug 19, 2024 · 2 comments
Labels
class-3 Class-3 change defer-future-version Defer this issue until a future version of JSON-LD ms:future-work spec:substantive

Comments

@nyarly
Copy link

nyarly commented Aug 19, 2024

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.

@gkellogg gkellogg added defer-future-version Defer this issue until a future version of JSON-LD class-3 Class-3 change labels Nov 7, 2024
@gkellogg
Copy link
Member

gkellogg commented Nov 7, 2024

From the definition of Type Maps, they are designed specifically for node objects, not value objects. This would have been discussed at the time. Supporting type maps for value objects would be an enhancement, but we'd need to re-consider the contemporaneous discussions to see why this was not pursued before. The discussions should all be in https://json-ld.org/minutes/ somewhere and in the issues and pull requests in the various repositories.

@gkellogg gkellogg moved this from Discuss-Call to Future Work in JSON-LD Management Nov 7, 2024
@nyarly
Copy link
Author

nyarly commented Nov 7, 2024

Got it. I'll see what I can find in the minutes. I think I caught discussion as I was trying to figure this out that made it sound like this was a consequence of using @type as the name - that there's a confusion between it being an RDFa style type vs a scalar datatype.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
class-3 Class-3 change defer-future-version Defer this issue until a future version of JSON-LD ms:future-work spec:substantive
Projects
Status: Future Work
Development

No branches or pull requests

2 participants