jsonld.js icon indicating copy to clipboard operation
jsonld.js copied to clipboard

@base

Open bertvannuffelen opened this issue 5 years ago • 1 comments

I do not find in the specification if there is any restriction on @base values, but

{"@version": 1.1,
  "@context": {
  "Persoon": "http://www.w3.org/ns/person#Person",
  

  "type2" : {
    "@id": "https://example.com/ns/voc#type",
    "@type": "@id",
    "@context": { "@base": "http://www.w3.org/ns/person#"
              }
  }

},
 "@id": "https://example.com/id/pete",
 "@type": "Persoon",

 "type2": "Pers"
}

returns the value "http://www.w3.org/ns/Pers" for type2.

@base resolution thus remove the last thing to the last / while for many ontologies/vocabularies the practice is to use fragment identifiers.

It is this a specification issue? Or is this a implementation issue?

bertvannuffelen avatar Dec 17 '20 09:12 bertvannuffelen

Yes, this is correct, and my distiller gets the same result.

"type2" is treated as "@id", and the normal rules apply when resolving "Pers" against "http://www.w3.org/ns/person#"; the "person#" has no special meaning in resolving IRIs.

gkellogg avatar Dec 18 '20 23:12 gkellogg