Exception when serializing QuotedGraphs to N3 · Issue #291 · RDFLib/rdflib (original) (raw)

Attempting to N3-serialize a graph with a formula in it (as shown by this quick and dirty test case) results in the following error:

Traceback (most recent call last):
  File "/home/eric/src/rdflib/test/test_n3.py", line 208, in testModel
    g.serialize(format="n3")
  File "/home/eric/src/rdflib/rdflib/graph.py", line 903, in serialize
    serializer.serialize(stream, base=base, encoding=encoding, **args)
  File "/home/eric/src/rdflib/rdflib/plugins/serializers/turtle.py", line 206, in serialize
    subjects_list = self.orderSubjects()
  File "/home/eric/src/rdflib/rdflib/plugins/serializers/turtle.py", line 64, in orderSubjects
    recursable.sort()
  File "/home/eric/src/rdflib/rdflib/term.py", line 168, in __lt__
    return _ORDERING[type(self)] < _ORDERING[type(other)]
KeyError: <class 'rdflib.graph.QuotedGraph'>

3.4.0 doesn't exhibit this bug.