Simplify linking fastq files to their library id.
[htsworkflow.git] / htsworkflow / templates / geo_fastqs.sparql
1 PREFIX libraryOntology: <http://jumpgate.caltech.edu/wiki/LibraryOntology#>
2 PREFIX submissionOntology: <http://jumpgate.caltech.edu/wiki/UcscSubmissionOntology#>
3 PREFIX ucscDaf: <http://jumpgate.caltech.edu/wiki/UcscDaf#>
4 PREFIX ncbiTaxon: <http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=>
5 PREFIX geoSoft: <http://www.ncbi.nlm.nih.gov/geo/info/soft2.html#>
6 PREFIX dc: <http://purl.org/dc/elements/1.1/>
7
8 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
9 WHERE {
10   <{{submission}}> ucscDaf:has_file ?file ;
11                    submissionOntology:library ?library ;
12                    a submissionOntology:submission .
13
14   ?file ucscDaf:filename ?filename ;
15         ucscDaf:md5sum ?md5sum ;
16         libraryOntology:flowcell_id ?flowcell_id ;
17         a ?file_type .
18         
19   ?file_type a <{{file_class}}> ;
20              geoSoft:fileTypeLabel ?file_type_label .
21
22   ?flowcell libraryOntology:flowcell_id ?flowcell_id ;
23             libraryOntology:read_length ?read_length ;
24             libraryOntology:flowcell_type ?flowcell_type ;
25   OPTIONAL { ?flowcell libraryOntology:image_software ?image_software ;
26                        libraryOntology:image_version ?image_version . }
27   OPTIONAL {?flowcell  libraryOntology:basecall_software ?basecall_software ;
28                        libraryOntology:basecall_version ?basecall_version . }
29   OPTIONAL {?flowcell  libraryOntology:sequenced_by ?sequencer .
30              ?sequencer libraryOntology:sequencer_model ?sequencer_model . }
31 }
32