Make compatbile with rdflib and python 2/3
authorDiane Trout <diane@testing.woldlab.caltech.edu>
Wed, 8 Mar 2017 00:32:36 +0000 (16:32 -0800)
committerDiane Trout <diane@testing.woldlab.caltech.edu>
Wed, 8 Mar 2017 00:32:36 +0000 (16:32 -0800)
* remove old get_model redland code.
* add_default_namespaces needs ConjunctiveGraph
* serialize returns bytes in python 3, which needs to be
  converted to a string for later functions

htsworkflow/util/rdfhelp.py

index be17dbea6dbb406ae4734964861bb090d12a2f14..28ce8c57d1787e65d529021ce100097bf5e9c600 100644 (file)
@@ -316,9 +316,9 @@ def add_default_namespaces(model):
 def get_turtle_header():
     """Return a turtle header with our typical namespaces
     """
-    empty = get_model()
-    add_default_namespaces(model)
-    return model.serialize(format='turtle')
+    empty = ConjunctiveGraph()
+    add_default_namespaces(empty)
+    return empty.serialize(format='turtle').decode()
 
 def dump_model(model, destination=None):
     if destination is None: