jsonld.js
jsonld.js copied to clipboard
`@nest` and scoped context do not work as expected
Example on the playground
A scoped context in a @nest attribute seems to be ignored.
Given this:
{
"@context": {
"@vocab": "http://example.org/vocab#",
"p1": {
"@id": "@nest",
"@context": {
"p2": "http://example.org/ns#P2"
}
}
},
"p1": {
"p2": "foo"
}
}
I would expect
[
{
"http://example.org/ns#P2": [
{
"@value": "foo"
}
]
}
]
but the playground gives me
[
{
"http://example.org/vocab#p2": [
{
"@value": "foo"
}
]
}
]
Note that removing the @vocab in the context results in the playground returning an empty array, which is consistent with the fact that it ignores the scoped context of p1, while I would expect the same result as the one I expect with the @vocab present.