store flowcell name in the triple store if its known
authorDiane Trout <diane@caltech.edu>
Fri, 27 Mar 2015 18:05:05 +0000 (11:05 -0700)
committerDiane Trout <diane@caltech.edu>
Fri, 27 Mar 2015 18:13:12 +0000 (11:13 -0700)
htsworkflow/submission/submission.py

index ed4d898ec919fdb66909ad810bd249e860f38b2a..9cd9dc8d38e0ad08a027d17c64113c65072f42b5 100644 (file)
@@ -34,6 +34,7 @@ class Submission(object):
         self.submissionSet = get_submission_uri(self.name)
         self.submissionSetNS = RDF.NS(str(self.submissionSet) + '#')
         self.libraryNS = RDF.NS('{0}/library/'.format(host))
+        self.flowcellNS = RDF.NS('{0}/flowcell/'.format(host))
 
         self.__view_map = None
 
@@ -195,6 +196,11 @@ class Submission(object):
                 s = RDF.Statement(fileNode, model_term, toTypedNode(value))
                 self.model.append(s)
 
+        if 'flowcell' in fqname:
+            value = self.flowcellNS[fqname['flowcell'] + '/']
+            s = RDF.Statement(fileNode, libraryOntology['flowcell'], value)
+            self.model.append(s)
+
     def add_label(self, file_type, file_node, lib_node):
         """Add rdfs:label to a file node
         """