sparta icon indicating copy to clipboard operation
sparta copied to clipboard

_pythonToRdf is manhandling rdflib.Identifier instances

Open chimezie opened this issue 15 years ago • 2 comments

_pythonToRdf is assuming the object is a python data representation when it is not. The tuple of terms yielded from rdflib.Graph.Graph.triple, for instance is a tuple of rdflib.Identifier instances. So line 263 should be:

    elif isinstance(obj,ID):
        return obj

And the else afterwards should never be reached:

chimezie avatar Oct 01 '09 18:10 chimezie

Just to confirm, that's:

< else: < return self._pythonToLiteral(obj, obj_types)

   elif isinstance(obj, ID):
       return obj

? Or keep the else afterwards?

mnot avatar Oct 02 '09 22:10 mnot

... or feel free to fork and fix it; I'll pull it back in.

mnot avatar Feb 26 '10 10:02 mnot