-
Notifications
You must be signed in to change notification settings - Fork 577
Closed
Labels
bugSomething isn't workingSomething isn't workingformat: JSON-LDRelated to JSON-LD format.Related to JSON-LD format.regressionSomething stopped workingSomething stopped workingserializationRelated to serialization.Related to serialization.
Description
The to_dict()
method is missing on Context
:
Though this seems to have been implemented and merged before: RDFLib/rdflib-jsonld#51 , it is no longer present in the current codebase. However, it is still referenced: https://github.com/RDFLib/rdflib/blob/main/rdflib/plugins/serializers/jsonld.py#L126 , so this leads to an error if you pass an explicit Context
instance:
>>> g.serialize(format='json-ld', auto_compact=True,context=c3)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/proycon/work/codemetapy/env/lib/python3.10/site-packages/rdflib/graph.py", line 1186, in serialize
serializer.serialize(stream, base=base, encoding="utf-8", **args)
File "/home/proycon/work/codemetapy/env/lib/python3.10/site-packages/rdflib/plugins/serializers/jsonld.py", line 84, in serialize
obj = from_rdf(
File "/home/proycon/work/codemetapy/env/lib/python3.10/site-packages/rdflib/plugins/serializers/jsonld.py", line 126, in from_rdf
context_data = context.to_dict()
AttributeError: 'Context' object has no attribute 'to_dict'
Perhaps the solution is to re-apply the old pull request?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingformat: JSON-LDRelated to JSON-LD format.Related to JSON-LD format.regressionSomething stopped workingSomething stopped workingserializationRelated to serialization.Related to serialization.