For this document and jsonld-java 0.8.2:
{
"@context": [
"https://raw.githubusercontent.com/monarch-initiative/monarch-app/master/conf/monarch-context.jsonld",
{
"@base": "http://example.org/base/",
"ex": "http://example.org/",
"ex:friendOf": {
"@type": "@id"
}
}
],
"@id": "3456",
"ex:name": "Jim",
"ex:friendOf": "1234",
"@type": "Person"
}
The value of @base is not used when calling JsonLdProcessor.expand(). I get this result:
[ {
"@id" : "3456",
"@type" : [ "Person" ],
"http://example.org/friendOf" : [ {
"@id" : "1234"
} ],
"http://example.org/name" : [ {
"@value" : "Jim"
} ]
} ]
If I remove the reference to the external context to create this document:
{
"@context": [
{
"@base": "http://example.org/base/",
"ex": "http://example.org/",
"ex:friendOf": {
"@type": "@id"
}
}
],
"@id": "3456",
"ex:name": "Jim",
"ex:friendOf": "1234",
"@type": "Person"
}
the @base is used to expand IRIs like http://example.org/base/1234:
[ {
"@id" : "http://example.org/base/3456",
"@type" : [ "http://example.org/base/Person" ],
"http://example.org/friendOf" : [ {
"@id" : "http://example.org/base/1234"
} ],
"http://example.org/name" : [ {
"@value" : "Jim"
} ]
} ]
Is this expected behavior? This is not the behavior of JSON-LD Playground, which does use the @base from the embedded context when used with a remote context (I posted a question to the JSON-LD mailing list but haven't gotten an answer there). JSON-LD Playground will even make use of @base in a remote context, which seems to be disallowed by the spec: "Please note that the @base will be ignored if used in external contexts."
For this document and jsonld-java 0.8.2:
{ "@context": [ "https://raw.githubusercontent.com/monarch-initiative/monarch-app/master/conf/monarch-context.jsonld", { "@base": "http://example.org/base/", "ex": "http://example.org/", "ex:friendOf": { "@type": "@id" } } ], "@id": "3456", "ex:name": "Jim", "ex:friendOf": "1234", "@type": "Person" }The value of
@baseis not used when callingJsonLdProcessor.expand(). I get this result:[ { "@id" : "3456", "@type" : [ "Person" ], "http://example.org/friendOf" : [ { "@id" : "1234" } ], "http://example.org/name" : [ { "@value" : "Jim" } ] } ]If I remove the reference to the external context to create this document:
{ "@context": [ { "@base": "http://example.org/base/", "ex": "http://example.org/", "ex:friendOf": { "@type": "@id" } } ], "@id": "3456", "ex:name": "Jim", "ex:friendOf": "1234", "@type": "Person" }the
@baseis used to expand IRIs likehttp://example.org/base/1234:[ { "@id" : "http://example.org/base/3456", "@type" : [ "http://example.org/base/Person" ], "http://example.org/friendOf" : [ { "@id" : "http://example.org/base/1234" } ], "http://example.org/name" : [ { "@value" : "Jim" } ] } ]Is this expected behavior? This is not the behavior of JSON-LD Playground, which does use the
@basefrom the embedded context when used with a remote context (I posted a question to the JSON-LD mailing list but haven't gotten an answer there). JSON-LD Playground will even make use of@basein a remote context, which seems to be disallowed by the spec: "Please note that the @base will be ignored if used in external contexts."