From 4c01351f3c35d0163cb10d924847f17f6588ba15 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Fri, 31 Aug 2012 14:39:45 -0700 Subject: [PATCH] Older rdf library doesn't like unicode strings as nodes so manually encode as utf8 --- htsworkflow/pipelines/sequences.py | 4 +++- htsworkflow/submission/condorfastq.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htsworkflow/pipelines/sequences.py b/htsworkflow/pipelines/sequences.py index 462c034..5baf1b5 100644 --- a/htsworkflow/pipelines/sequences.py +++ b/htsworkflow/pipelines/sequences.py @@ -161,7 +161,9 @@ class SequenceFile(object): model.add_statement(RDF.Statement(s, p, toTypedNode(o))) def add(model, s, p, o): model.add_statement(RDF.Statement(s,p,o)) - fileNode = RDF.Node(RDF.Uri('file://' + os.path.abspath(self.path))) + # a bit unreliable... assumes filesystem is encoded in utf-8 + path = os.path.abspath(self.path.encode('utf-8')) + fileNode = RDF.Node(RDF.Uri('file://' + path)) add(model, fileNode, rdfNS['type'], libNS['raw_file']) add_lit(model, fileNode, libNS['flowcell_id'], self.flowcell) add_lit(model, fileNode, libNS['lane_number'], self.lane) diff --git a/htsworkflow/submission/condorfastq.py b/htsworkflow/submission/condorfastq.py index 5ed9243..71b7090 100644 --- a/htsworkflow/submission/condorfastq.py +++ b/htsworkflow/submission/condorfastq.py @@ -157,7 +157,8 @@ class CondorFastqExtract(object): def import_libraries(self, result_map): for lib_id in result_map.keys(): - liburl = urljoin(self.host, 'library/%s/' % (lib_id,)) + lib_id_encoded = lib_id.encode('utf-8') + liburl = urljoin(self.host, 'library/%s/' % (lib_id_encoded,)) library = RDF.Node(RDF.Uri(liburl)) self.import_library(library) -- 2.30.2