Last active
September 19, 2017 19:59
-
-
Save bpow/b3af1e454c51fae7b7c2d1e4980da408 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from pyld import jsonld | |
import json | |
j = json.loads(''' | |
{ | |
"@context": "http://schema.org/", | |
"@type": "Person", | |
"name": "Jane Doe", | |
"jobTitle": "Professor", | |
"telephone": "(425) 123-4567", | |
"@id": "http://www.janedoe.com", | |
"knows": { | |
"name": "John Smith", | |
"@type": "Person", | |
"@id": "http://www.johnsmith.me", | |
"knows": { | |
"@id": "http://www.janedoe.com" | |
} | |
} | |
}''') | |
# this works fine | |
frame = {'@context': 'http://schema.org', '@embed': '@last'} | |
print json.dumps(jsonld.frame(j, frame), indent=2) | |
# this results in a RuntimeError for exceeding recursion depth | |
frame['@embed'] = '@link' | |
print jsonld.frame(j, frame) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment