json-ld
json-ld copied to clipboard
Decide what to do with value entries in node objects.
For now in src/expansion/node.rs, is the expanded node only contains value entries (i.e. @language or @direction entries), then it is ignored (None is returned and the node is dropped).
It is not clear if this is the correct behavior or not.
- Should we throw an error?
- Should we keep ignoring it?
The JSON-LD API expansion algorithm only covers the case where the node only contains a @language entry, in which case it is ignored:
If result is a map that contains only the entry
@language, return null.
More complex cases are not covered. In the playground, only the d map is dropped.
{
"http://a": {
"@id": "http://a",
"@language": "fr"
},
"http://b": {
"@id": "http://b",
"@language": "en",
"@direction": "ltr"
},
"http://c": {
"@id": "http://c",
"@direction": "ltr"
},
"http://d": {
"@language": "fr"
},
"http://e": {
"@language": "en",
"@direction": "ltr"
},
"http://f": {
"@direction": "ltr"
}
}
See https://github.com/w3c/json-ld-api/issues/535