I am new to json-ld and rdflib usage. I have json-ld file with @context and @graph sections inside. I want to use rdflib open to load this graph. When I try using parse() method, with format='n3', I am getting error
BadSyntax: at line 5 of <>:
Bad syntax (expected '.' or '}' or ']' at end of statement) at ^ in:
If I give format='json-ld', it says No plugin registered for (json-ld, )
If I don't give any format parameter then it says, SAXParseException: file:composition.json-ld:1:0: not well-formed (invalid token)
rdflib.Graph().load('composition.json-ld')
Error SAXParseException: not well-formed (invalid token)
rdflib.Graph().load('composition.json-ld', format='json-ld')
Error PluginException: No plugin registered for (json-ld, <class 'rdflib.parser.Parser'>)
f= open('filename.json-ld', 'rb')
rdflib.Graph().parse(data=f.read(), format='json-ld') ==> Error PluginException: No plugin registered for (json-ld, <class 'rdflib.parser.Parser'>)
I checked json-ld file in json-ld playground. It is correct. Am I missing something in syntax for parsing here?
Did you install the JSON-LD plugin? If not, do a
pip install rdflib-jsonld