pyld
pyld copied to clipboard
Compacting with @vocab does not include already compacted terms
print(jsonld.compact(
{'name': 'Bob'},
{"@vocab": "http://example.org#"}
))
I would expect this to return
{
"@context": {
"@vocab": "http://example.org#"
},
"name": "Bob"
}
But instead i got just context:
{
"@context": {
"@vocab": "http://example.org#"
}
}
I checked https://json-ld.org/playground/ - it handles this case correctly.