Properly constructing the geo soft file really needed multiple sparql queries.
[htsworkflow.git] / htsworkflow / templates / geo_samples.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 cells: <http://encodewiki.ucsc.edu/EncodeDCC/index.php/Cell_lines#>
7
8 select distinct ?name ?cell ?antibody ?sex ?control ?strain ?controlId ?library_id ?treatment ?protocol ?readType ?insertLength ?replicate, ?mapAlgorithm ?species_name ?taxon_id ?extractMolecule ?growthProtocol ?extractProtocol ?dataProtocol ?experiment_type ?library_selection ?library_source
9 WHERE {
10   <{{submission}}> a submissionOntology:submission .
11
12   OPTIONAL { <{{submission}}> ucscDaf:control ?control }
13   OPTIONAL { <{{submission}}> ucscDaf:controlId ?controlId }
14   OPTIONAL { ?library libraryOntology:antibody ?antibody }
15   OPTIONAL { ?library libraryOntology:cell_line ?cell .
16              ?cell_line cells:cell ?cell ;
17                         cells:documents ?growthProtocol . }
18   OPTIONAL { ?library ucscDaf:sex ?sex }
19   OPTIONAL { ?library libraryOntology:library_id ?library_id }
20   OPTIONAL { ?library libraryOntology:replicate ?replicate }
21   OPTIONAL { ?library libraryOntology:species ?species_name }
22   OPTIONAL { ?library libraryOntology:condition_term ?treatment }
23   OPTIONAL { ?library libraryOntology:experiment_type ?experiment_type }
24   OPTIONAL { ?library libraryOntology:librarySelection ?library_selection }
25   OPTIONAL { ?library libraryOntology:librarySource ?library_source }
26   OPTIONAL { <{{submissionSet}}> geoSoft:data_processing ?dataProtocol }
27   OPTIONAL { ?library libraryOntology:extractMolecule ?extractMolecule }
28   OPTIONAL { ?library libraryOntology:extractProtocol ?extractProtocol }
29   OPTIONAL { ?library ucscDaf:protocol ?protocol }
30   OPTIONAL { ?library ucscDaf:readType ?readType }
31   OPTIONAL { ?library ucscDaf:strain ?strain }
32   OPTIONAL { ?library libraryOntology:insert_size ?insertLength }
33   OPTIONAL { ?library ucscDaf:mapAlgorithm ?mapAlgorithm }
34
35   <{{submission}}> submissionOntology:library ?library ;
36                    submissionOntology:name ?name .
37   ?species libraryOntology:species ?species_name ;
38            libraryOntology:taxon_id ?taxon_id .
39
40
41 }