jsonld.js
jsonld.js copied to clipboard
@base
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?
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.