You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import rdflib
from pyontutils.core import makeGraph
g = makeGraph('buggraph', graph=rdflib.Graph())
g.g.add((rdflib.Literal('UT OH'), rdflib.RDFS.comment, rdflib.Literal('This will end badly.')))
g.write()
Produces a key error since subject literals don't seem to make it into the global sort keys.
The default turtle serializer produces the following.
The issue is in CustomTurtleSerializer._globalSortKey where, not surprisingly, a literal value is not ranked, because there should not be any literal values there. I'm ruling that this is not a bug because it is consistent with the RDF spec, even though it is not consistent with rdflib behavior. The current behavior is hard to debug, because a bad value can creep in e.g. via a parse because rdflib is too permissive, and only later will the error appear, however, since these are literals in the subject position, they shouldn't be particularly difficult to track down.
Produces a key error since subject literals don't seem to make it into the global sort keys.
The default turtle serializer produces the following.
The text was updated successfully, but these errors were encountered: