diff options
author | Munyoki Kilyungi | 2023-05-29 12:11:47 +0300 |
---|---|---|
committer | Munyoki Kilyungi | 2023-05-29 12:12:13 +0300 |
commit | 8e5cbef647d1c38b0be74c0c7a4b8c2e355a95a9 (patch) | |
tree | b0f0ba4288e52b9800a60b890477f8b190feb6b9 /topics | |
parent | 77fc976f7359dbc23e8ae7475ef5a41ff39e9cb0 (diff) | |
download | gn-gemtext-8e5cbef647d1c38b0be74c0c7a4b8c2e355a95a9.tar.gz |
Add more examples
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'topics')
-rw-r--r-- | topics/RDF/example-sparql-queries.gmi | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/topics/RDF/example-sparql-queries.gmi b/topics/RDF/example-sparql-queries.gmi index 993e6db..ee80263 100644 --- a/topics/RDF/example-sparql-queries.gmi +++ b/topics/RDF/example-sparql-queries.gmi @@ -1,13 +1,15 @@ -# Querying GeneRIF using SPARQL +# Sparql Examples -## GeneRIF Metadata => https://sparql.genenetwork.org/sparql?default-graph-uri=http%3A%2F%2Fgenenetwork.org&qtxt=PREFIX%20gn%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2F%3E%0APREFIX%20dct%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20generif%3A%20%3Chttps%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fgene%3FDb%3Dgene%26Cmd%3DDetailsSearch%26Term%3D%3E%0A%0ASELECT%20%3Fsymbol%20%3FspeciesBinomialName%20%3FgnEntry%20%3FcreatedOn%20(GROUP_CONCAT(%3Fpmid%3B%20SEPARATOR%3D%22%5Cn%22)%20AS%20%3FPubMedId)%20%20WHERE%20%7B%0A%20%20%3Fgenerif%20gn%3Asymbol%20%3Fsymbol%20.%0A%20%20%3Fgenerif%20gn%3AgeneWikiEntryOfNCBI%20%5B%20gn%3AgeneWikiEntry%20%3FgnEntry%20%3B%20dct%3Acreated%20%3FcreatedOn%3B%20dct%3Asource%20%3Fpmid%5D%20.%0A%20%20OPTIONAL%20%7B%0A%20%20%20%20%3Fgenerif%20gn%3AwikiEntryOfSpecies%20%3FspeciesName%20.%0A%20%20%20%20%3Fspecies%20gn%3Aname%20%3FspeciesName%20%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20gn%3AbinomialName%20%3FspeciesBinomialName%20.%20%20%20%20%0A%20%20%7D%20.%0A%20%20FILTER(%20lcase(%3Fsymbol)%20%3D%20%22a2m%22%20)%0A%7D%20GROUP%20BY%20%3FcreatedOn%20%3FgnEntry%20%3Fgenerif%20%3Fsymbol%20%3FspeciesBinomialName%20ORDER%20BY%20ASC(%3FcreatedOn)&format=text%2Fhtml&timeout=0&signal_void=on Get all NCBI GeneWiki metadata for a particular symbol E.g. "A2m" => https://sparql.genenetwork.org/sparql?default-graph-uri=http%3A%2F%2Fgenenetwork.org&qtxt=PREFIX%20gn%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2F%3E%0APREFIX%20dct%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20generif%3A%20%3Chttps%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fgene%3FDb%3Dgene%26Cmd%3DDetailsSearch%26Term%3D%3E%0A%0ASELECT%20%3Fsymbol%20%3FgnEntry%20%3FcreatedOn%20(GROUP_CONCAT(%3Fpmid%3B%20SEPARATOR%3D%22%5Cn%22)%20AS%20%3FPubMedId)%20%3Fweburl%20WHERE%20%7B%0A%20%20%3Fgenerif%20gn%3Asymbol%20%3Fsymbol%20.%0A%20%20%3Fgenerif%20gn%3AgeneWikiEntryOfGn%20_%3AgnEntry%20.%0A%20%20_%3AgnEntry%20gn%3AgeneWikiEntry%20%3FgnEntry%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20dct%3Acreated%20%3FcreatedOn%20.%0A%20%20OPTIONAL%20%7B%20_%3AgnEntry%20foaf%3Ahomepage%20%3Fweburl%20%7D%20.%0A%20%20OPTIONAL%20%7B%20_%3AgnEntry%20dct%3Asource%20%3Fpmid%7D%20.%0A%20%20OPTIONAL%20%7B%0A%20%20%20%20%3Fgenerif%20gn%3AwikiEntryOfSpecies%20%3FspeciesName%20.%0A%20%20%20%20%3Fspecies%20gn%3Aname%20%3FspeciesName%20%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20gn%3AbinomialName%20%3FspeciesBinomialName%20.%20%20%20%20%0A%20%20%7D%20.%0A%20%20FILTER(%20lcase(%3Fsymbol)%20%3D%20%22epha2%22%20)%0A%7D%20GROUP%20BY%20%3FcreatedOn%20%3FgnEntry%20%3Fgenerif%20%3Fsymbol%20%3Fweburl%20ORDER%20BY%20ASC(%3FcreatedOn)&format=text%2Fhtml&timeout=0&signal_void=on Get all GN GeneWiki metadata for a particular symbol E.g. "Epha2" => https://sparql.genenetwork.org/sparql?default-graph-uri=http%3A%2F%2Fgenenetwork.org&qtxt=PREFIX%20gn%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2F%3E%0APREFIX%20dct%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20generif%3A%20%3Chttps%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fgene%3FDb%3Dgene%26Cmd%3DDetailsSearch%26Term%3D%3E%0A%0ASELECT%20DISTINCT%20%3Fsubject%20%3Fpredicate%20%3Frelation%20%3Fdescription%20WHERE%20%7B%0A%20%20%3Fsubject%20%3Fpredicate%20%3Fsymbol%20.%0A%20%20%3Fpredicate%20%3Frelation%20%3Fdescription%20.%0A%20%20FILTER(%20lcase(str(%3Fsymbol))%20%3D%20%22a2m%22)%0A%7D&format=text%2Fhtml&timeout=0&signal_void=on Finding out relationships of a symbol E.g. "a2m" +=> https://sparql.genenetwork.org/sparql?default-graph-uri=&qtxt=PREFIX%20chebi%3A%20%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FCHEBI_%3E%0APREFIX%20dct%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0APREFIX%20generif%3A%20%3Chttp%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fgene%3Fcmd%3DRetrieve%26dopt%3DGraphics%26list_uids%3D%3E%0APREFIX%20gn%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2F%3E%0APREFIX%20hgnc%3A%20%3Chttp%3A%2F%2Fbio2rdf.org%2Fhgnc%3A%3E%0APREFIX%20homologene%3A%20%3Chttps%3A%2F%2Fbio2rdf.org%2Fhomologene%3A%3E%0APREFIX%20kegg%3A%20%3Chttp%3A%2F%2Fbio2rdf.org%2Fns%2Fkegg%23%3E%0APREFIX%20molecularTrait%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2Fmolecular-trait%2F%3E%0APREFIX%20nuccore%3A%20%3Chttps%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fnuccore%2F%3E%0APREFIX%20omim%3A%20%3Chttps%3A%2F%2Fwww.omim.org%2Fentry%2F%3E%0APREFIX%20owl%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%0APREFIX%20phenotype%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2Fphenotype%2F%3E%0APREFIX%20pubchem%3A%20%3Chttps%3A%2F%2Fpubchem.ncbi.nlm.nih.gov%2F%3E%0APREFIX%20pubmed%3A%20%3Chttp%3A%2F%2Frdf.ncbi.nlm.nih.gov%2Fpubmed%2F%3E%0APREFIX%20rdf%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0APREFIX%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0APREFIX%20taxon%3A%20%3Chttp%3A%2F%2Fpurl.uniprot.org%2Ftaxonomy%2F%3E%0APREFIX%20uniprot%3A%20%3Chttp%3A%2F%2Fpurl.uniprot.org%2Funiprot%2F%3E%0APREFIX%20up%3A%20%3Chttp%3A%2F%2Fpurl.uniprot.org%2Fcore%2F%3E%0APREFIX%20xsd%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0A%0ASELECT%20%3Fp%20%3Fo%20WHERE%20%7B%0Apubmed%3A2760876%20%3Fp%20%3Fo%20.%0A%7D%0A&format=text%2Fhtml&timeout=0&signal_void=on Get all metadata about a publication with pmid:2760876 +=> https://sparql.genenetwork.org/sparql?default-graph-uri=&qtxt=PREFIX%20chebi%3A%20%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FCHEBI_%3E%0APREFIX%20dct%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0APREFIX%20generif%3A%20%3Chttp%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fgene%3Fcmd%3DRetrieve%26dopt%3DGraphics%26list_uids%3D%3E%0APREFIX%20gn%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2F%3E%0APREFIX%20hgnc%3A%20%3Chttp%3A%2F%2Fbio2rdf.org%2Fhgnc%3A%3E%0APREFIX%20homologene%3A%20%3Chttps%3A%2F%2Fbio2rdf.org%2Fhomologene%3A%3E%0APREFIX%20kegg%3A%20%3Chttp%3A%2F%2Fbio2rdf.org%2Fns%2Fkegg%23%3E%0APREFIX%20molecularTrait%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2Fmolecular-trait%2F%3E%0APREFIX%20nuccore%3A%20%3Chttps%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fnuccore%2F%3E%0APREFIX%20omim%3A%20%3Chttps%3A%2F%2Fwww.omim.org%2Fentry%2F%3E%0APREFIX%20owl%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%0APREFIX%20phenotype%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2Fphenotype%2F%3E%0APREFIX%20pubchem%3A%20%3Chttps%3A%2F%2Fpubchem.ncbi.nlm.nih.gov%2F%3E%0APREFIX%20pubmed%3A%20%3Chttp%3A%2F%2Frdf.ncbi.nlm.nih.gov%2Fpubmed%2F%3E%0APREFIX%20rdf%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0APREFIX%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0APREFIX%20taxon%3A%20%3Chttp%3A%2F%2Fpurl.uniprot.org%2Ftaxonomy%2F%3E%0APREFIX%20uniprot%3A%20%3Chttp%3A%2F%2Fpurl.uniprot.org%2Funiprot%2F%3E%0APREFIX%20up%3A%20%3Chttp%3A%2F%2Fpurl.uniprot.org%2Fcore%2F%3E%0APREFIX%20xsd%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0A%0ASELECT%20DISTINCT%20%3Fp%20%3Fo%20WHERE%20%7B%0A%3Fs%20gn%3AbinomialName%20%22Mus%20musculus%22%20.%0A%3Fs%20%3Fp%20%3Fo%20.%0A%7D&format=text%2Fhtml&timeout=0&signal_void=on Get all data for a species with the binomial name: "Mus musculus" +=> https://sparql.genenetwork.org/sparql?default-graph-uri=&qtxt=PREFIX%20chebi%3A%20%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FCHEBI_%3E%0APREFIX%20dct%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0APREFIX%20generif%3A%20%3Chttp%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fgene%3Fcmd%3DRetrieve%26dopt%3DGraphics%26list_uids%3D%3E%0APREFIX%20gn%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2F%3E%0APREFIX%20hgnc%3A%20%3Chttp%3A%2F%2Fbio2rdf.org%2Fhgnc%3A%3E%0APREFIX%20homologene%3A%20%3Chttps%3A%2F%2Fbio2rdf.org%2Fhomologene%3A%3E%0APREFIX%20kegg%3A%20%3Chttp%3A%2F%2Fbio2rdf.org%2Fns%2Fkegg%23%3E%0APREFIX%20molecularTrait%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2Fmolecular-trait%2F%3E%0APREFIX%20nuccore%3A%20%3Chttps%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fnuccore%2F%3E%0APREFIX%20omim%3A%20%3Chttps%3A%2F%2Fwww.omim.org%2Fentry%2F%3E%0APREFIX%20owl%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%0APREFIX%20phenotype%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2Fphenotype%2F%3E%0APREFIX%20pubchem%3A%20%3Chttps%3A%2F%2Fpubchem.ncbi.nlm.nih.gov%2F%3E%0APREFIX%20pubmed%3A%20%3Chttp%3A%2F%2Frdf.ncbi.nlm.nih.gov%2Fpubmed%2F%3E%0APREFIX%20rdf%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0APREFIX%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0APREFIX%20taxon%3A%20%3Chttp%3A%2F%2Fpurl.uniprot.org%2Ftaxonomy%2F%3E%0APREFIX%20uniprot%3A%20%3Chttp%3A%2F%2Fpurl.uniprot.org%2Funiprot%2F%3E%0APREFIX%20up%3A%20%3Chttp%3A%2F%2Fpurl.uniprot.org%2Fcore%2F%3E%0APREFIX%20xsd%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0A%0ACONSTRUCT%20%7B%0A%20%20%20%20%3Fs%20%3Fp%20%3Fo%0A%7D%20WHERE%20%7B%0A%20%20%20%20%3Fs%20rdf%3Atype%20gn%3Aspecies%20.%0A%20%20%20%20%3Fs%20%3Fp%20%3Fo%20.%0A%7D&format=text%2Fx-html%2Btr&timeout=0&signal_void=on Get all metadata for all species - +=> https://sparql.genenetwork.org/sparql?default-graph-uri=&qtxt=PREFIX%20chebi%3A%20%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FCHEBI_%3E%0APREFIX%20dct%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0APREFIX%20generif%3A%20%3Chttp%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fgene%3Fcmd%3DRetrieve%26dopt%3DGraphics%26list_uids%3D%3E%0APREFIX%20gn%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2F%3E%0APREFIX%20hgnc%3A%20%3Chttp%3A%2F%2Fbio2rdf.org%2Fhgnc%3A%3E%0APREFIX%20homologene%3A%20%3Chttps%3A%2F%2Fbio2rdf.org%2Fhomologene%3A%3E%0APREFIX%20kegg%3A%20%3Chttp%3A%2F%2Fbio2rdf.org%2Fns%2Fkegg%23%3E%0APREFIX%20molecularTrait%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2Fmolecular-trait%2F%3E%0APREFIX%20nuccore%3A%20%3Chttps%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fnuccore%2F%3E%0APREFIX%20omim%3A%20%3Chttps%3A%2F%2Fwww.omim.org%2Fentry%2F%3E%0APREFIX%20owl%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%0APREFIX%20phenotype%3A%20%3Chttp%3A%2F%2Fgenenetwork.org%2Fphenotype%2F%3E%0APREFIX%20pubchem%3A%20%3Chttps%3A%2F%2Fpubchem.ncbi.nlm.nih.gov%2F%3E%0APREFIX%20pubmed%3A%20%3Chttp%3A%2F%2Frdf.ncbi.nlm.nih.gov%2Fpubmed%2F%3E%0APREFIX%20rdf%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0APREFIX%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0APREFIX%20taxon%3A%20%3Chttp%3A%2F%2Fpurl.uniprot.org%2Ftaxonomy%2F%3E%0APREFIX%20uniprot%3A%20%3Chttp%3A%2F%2Fpurl.uniprot.org%2Funiprot%2F%3E%0APREFIX%20up%3A%20%3Chttp%3A%2F%2Fpurl.uniprot.org%2Fcore%2F%3E%0APREFIX%20xsd%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0A%0ACONSTRUCT%20%7B%0A%20%20%20%20%3Fs%20%3Fp%20%3Fo%20.%0A%20%20%20%20%3Fs%20gn%3AhasInbredSet%20%3FinbredSet%20.%0A%7D%20WHERE%20%7B%0A%20%20%20%20%3Fs%20rdf%3Atype%20gn%3Aspecies%20.%0A%20%20%20%20%3Fs%20%3Fp%20%3Fo%20.%0A%20%20%20%20%3FinbredSet%20gn%3AinbredSetOfSpecies%20%3Fs%20.%0A%7D&format=text%2Fx-html%2Btr&timeout=0&signal_void=on Get all metadata for all species and include InbredSets information |