jsonld.js
jsonld.js copied to clipboard
@base in remote context not ignored
For this document in the JSON-LD Playground:
{
"@context": [
"https://raw.githubusercontent.com/monarch-initiative/monarch-app/master/conf/monarch-context.jsonld",
{
"ex": "http://example.org/",
"ex:friendOf": {
"@type": "@id"
},
"ex:hasFriend": {
"@type": "@id"
}
}
],
"@id": "3456",
"ex:name": "Jim",
"ex:friendOf": "1234",
"ex:hasFriend": "9876"
}
The value of @base
found in the remote context is used to expand IRIs, like http://monarch-initiative.org/1234
.
This seems to be disallowed by the spec: "Please note that the @base
will be ignored if used in external contexts."
I've observed this behavior as well. Is this a bug in the spec or a bug in this implementation of a JSON-LD processor? I like the behavior that @base in a remote context expands IRIs (because then my @context can be a simple string/URI), but I don't know what issues that causes for recursively specified contexts.
@davidlehn -- can you look into this?