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

Extended JSON-LD context notation for synonyms #12

Open
simontaurus opened this issue Jul 28, 2024 · 0 comments
Open

Extended JSON-LD context notation for synonyms #12

simontaurus opened this issue Jul 28, 2024 · 0 comments
Assignees

Comments

@simontaurus
Copy link
Contributor

simontaurus commented Jul 28, 2024

Problem:
In general JSON-LD allows exactly one mapping of a prefix/keyword to an IRI.

To express alternative vocabular terms we introduced the * notation, e.g. schema:name = skos:prefLabel:

{
  "@context": {
    "name": "http://schema.org/name",
    "name*": "http://www.w3.org/2004/02/skos/core#prefLabel",
    "name**": "... additional IRI"
  },
  "name": "The Empire State Building"
}

Of course name* and name** are ignored by any standard JSON-LD algorithm (while name is processed normally since it's still a valid context) but OO-LD aware tools can make use of the extended syntax (e.g. to create enriched RDF or mappings between vocabulars).
This also allows to remove definitions by assigning null, e.g. "name*": null will remove this alias in a more specific subclass.

However, in a deep inheritance hierarchy it's hard to know how many stars were already used up- and downwards the hierarchy.
But using an array or object e.g. with + and - syntax to add/remove IRIs will not result in a valid JSON-LD context:

{
  "@context": {
    "name": "http://schema.org/name",
    "name+": ["http://www.w3.org/2004/02/skos/core#prefLabel", "... additional IRI"],
    "name-":  ["http://www.w3.org/2004/02/skos/core#prefLabel"],
  },
  "name": "The Empire State Building"
}

Another option is to add a random id after the * (e.g. a part of the schemas UUID). This will still be a valid JSON-LD context while no additional knowledge about imported definitions is needed to add IRIs. Removing IRIs will required to lookup the exact ID, which seems reasonable.

{
  "@context": {
    "name": "http://schema.org/name",
    "name*tfh45764": "http://www.w3.org/2004/02/skos/core#prefLabel",
    "name*g6hfdf55": "... additional IRI",
    "name*tfh45764": null,
  },
  "name": "The Empire State Building"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants