mnot / sparta

a Simple API for RDF
29 stars 4 forks source link

_pythonToRdf is manhandling rdflib.Identifier instances #2

Open chimezie opened 15 years ago

chimezie commented 15 years ago

_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:

mnot commented 15 years ago

Just to confirm, that's:

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

   elif isinstance(obj, ID):
       return obj

? Or keep the else afterwards?

mnot commented 14 years ago

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