Skip to content

Extended JSON-LD context notation for synonyms #12

@simontaurus

Description

@simontaurus

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"
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions