Simplify linking fastq files to their library id.
[htsworkflow.git] / htsworkflow / templates / geo_fastqs.sparql
index de9097ba9962849dde661bbd9ebd38521573f781..3ca5ab0cdf40d2f0b14091a381fac6e389d1aceb 100644 (file)
@@ -3,21 +3,22 @@ PREFIX submissionOntology: <http://jumpgate.caltech.edu/wiki/UcscSubmissionOntol
 PREFIX ucscDaf: <http://jumpgate.caltech.edu/wiki/UcscDaf#>
 PREFIX ncbiTaxon: <http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=>
 PREFIX geoSoft: <http://www.ncbi.nlm.nih.gov/geo/info/soft2.html#>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
 
-select distinct ?lane ?filename, ?md5sum, ?file_type ?file_type_label ?flowcell_id ?read_length ?flowcell_type ?image_software ?image_version ?basecall_software ?basecall_version ?sequencer_model
+select distinct ?library ?filename, ?md5sum, ?file_type ?file_type_label ?flowcell_id ?read_length ?flowcell_type ?image_software ?image_version ?basecall_software ?basecall_version ?sequencer_model
 WHERE {
-  <{{submission}}> submissionOntology:library ?library ;
+  <{{submission}}> ucscDaf:has_file ?file ;
+                   submissionOntology:library ?library ;
                    a submissionOntology:submission .
 
   ?file ucscDaf:filename ?filename ;
         ucscDaf:md5sum ?md5sum ;
-        libraryOntology:library ?library ;
+        libraryOntology:flowcell_id ?flowcell_id ;
         a ?file_type .
+        
   ?file_type a <{{file_class}}> ;
              geoSoft:fileTypeLabel ?file_type_label .
 
-  ?library libraryOntology:has_lane ?lane .
-  ?lane libraryOntology:flowcell ?flowcell .
   ?flowcell libraryOntology:flowcell_id ?flowcell_id ;
             libraryOntology:read_length ?read_length ;
             libraryOntology:flowcell_type ?flowcell_type ;