From: Diane Trout Date: Wed, 8 Mar 2017 00:32:36 +0000 (-0800) Subject: Make compatbile with rdflib and python 2/3 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=f181eb8ab89e0af5e8475340b65c4fbc66924f06 Make compatbile with rdflib and python 2/3 * 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 --- diff --git a/htsworkflow/util/rdfhelp.py b/htsworkflow/util/rdfhelp.py index be17dbe..28ce8c5 100644 --- a/htsworkflow/util/rdfhelp.py +++ b/htsworkflow/util/rdfhelp.py @@ -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: