When @base and a prefix declaration have a common domain, JSON-LD framing converts the prefix declaration into an incorrect relative IRI. For example:
[
{
"https://example.com/ontology/a#bar": [
{
"@value": "foo"
}
]
}
]
And a frame:
{
"@context": {
"@base": "https://example.com/resource/a/",
"ex": "https://example.com/ontology/a#"
}
}
Produce:
{
"@context": {
"@base": "https://example.com/resource/a/",
"ex": "../../../ontology/a"
},
"@graph": [
{
"@id": "_:b0",
"ex:bar": "foo"
}
]
}
Note that the ex prefix points to a relative IRI with the hash dropped, so that the original property https://example.com/ontology/a#bar becomes https://example.com/ontology/abar.
When the same data and frame are used in the JSON-LD Playground, the hash is preserved, with the following output:
{
"@context": {
"@base": "https://example.com/resource/a/",
"ex": "https://example.com/ontology/a#"
},
"@graph": [
{
"@id": "_:b0",
"ex:bar": "foo"
}
]
}
When
@baseand a prefix declaration have a common domain, JSON-LD framing converts the prefix declaration into an incorrect relative IRI. For example:[ { "https://example.com/ontology/a#bar": [ { "@value": "foo" } ] } ]And a frame:
{ "@context": { "@base": "https://example.com/resource/a/", "ex": "https://example.com/ontology/a#" } }Produce:
{ "@context": { "@base": "https://example.com/resource/a/", "ex": "../../../ontology/a" }, "@graph": [ { "@id": "_:b0", "ex:bar": "foo" } ] }Note that the
exprefix points to a relative IRI with the hash dropped, so that the original propertyhttps://example.com/ontology/a#barbecomeshttps://example.com/ontology/abar.When the same data and frame are used in the JSON-LD Playground, the hash is preserved, with the following output:
{ "@context": { "@base": "https://example.com/resource/a/", "ex": "https://example.com/ontology/a#" }, "@graph": [ { "@id": "_:b0", "ex:bar": "foo" } ] }