pyld icon indicating copy to clipboard operation
pyld copied to clipboard

Compacting with @vocab does not include already compacted terms

Open Fak3 opened this issue 6 years ago • 0 comments

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.

Fak3 avatar Jun 10 '18 15:06 Fak3