From f181eb8ab89e0af5e8475340b65c4fbc66924f06 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Tue, 7 Mar 2017 16:32:36 -0800 Subject: [PATCH] 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 --- htsworkflow/util/rdfhelp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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: -- 2.30.2