%META:TOPICPARENT{name="VirtTipsAndTricksGuide"}%
---+LinkedData SPARQL Reference Collection Using the Gene Ontology
%TOC%
The following guide presents collection of LinkedData SPARQL Query Examples Using the Gene Ontology:
---++Example Find Genes and their links to Gene Ontology terms
PREFIX psys:
PREFIX rdf:
PREFIX gene:
SELECT *
WHERE
{
?gene rdf:type gene:Gene .
?gene gene:goTerm ?go .
}
LIMIT 10
* [[http://bit.ly/14PKiJh][View the SPARQL Query Definition via SPARQL Protocol URL]]
* [[http://bit.ly/YnSgE5][View the SPARQL Query Results via SPARQL Protocol URL]]
---++Example Find interacting partners for specified protein
PREFIX biopax2:
PREFIX rdf:
SELECT DISTINCT ?protein ?interactor_uri ?interactor_name
WHERE
{
?i rdf:type biopax2:interaction .
?i biopax2:PARTICIPANTS ?p .
?p biopax2:PHYSICAL-ENTITY ?protein .
?protein biopax2:NAME "Phytochrome A" .
?i biopax2:PARTICIPANTS ?p1 .
?p1 biopax2:PHYSICAL-ENTITY ?interactor_uri .
?interactor_uri rdf:type biopax2:protein .
?interactor_uri biopax2:NAME ?interactor_name .
}
* [[http://bit.ly/X4Hnqw][View the SPARQL Query Definition via SPARQL Protocol URL]]
* [[http://bit.ly/12IxrtU][View the SPARQL Query Results via SPARQL Protocol URL]]
---++Example Find Interactions where Participates Specified Protein
PREFIX biopax2:
PREFIX rdf:
SELECT ?interaction ?protein
WHERE
{
?interaction rdf:type biopax2:interaction .
?interaction biopax2:PARTICIPANTS ?p .
?p biopax2:PHYSICAL-ENTITY ?protein .
?protein biopax2:NAME "Phytochrome A" .
}
* [[http://bit.ly/14PKp7H][View the SPARQL Query Definition via SPARQL Protocol URL]]
* [[http://bit.ly/Vd7n5N][View the SPARQL Query Results via SPARQL Protocol URL]]
---++Example Find All Proteins That are Linked to a Curated Interaction from the Literature and to Inflammatory Response
PREFIX rdf:
PREFIX skos:
PREFIX biopax2:
PREFIX uniprot:
SELECT distinct ?fullname
WHERE
{
?interaction rdf:type biopax2:physicalInteraction .
?interaction biopax2:PARTICIPANTS ?participant .
?participant biopax2:PHYSICAL-ENTITY ?physicalEntity .
?physicalEntity skos:exactMatch ?protein .
?protein uniprot:classifiedWith .
?protein uniprot:recommendedName ?name .
?name uniprot:fullName ?fullname .
}
* [[http://bit.ly/WGnABt][View the SPARQL Query Definition via SPARQL Protocol URL]]
* [[http://bit.ly/WXFRbP][View the SPARQL Query Results via SPARQL Protocol URL]]
---++Example Find All Proteins that are Linked to a Curated Molecular Interaction, to Inflammatory Response and to a Target of Existing Drug
PREFIX rdf:
PREFIX skos:
PREFIX biopax2:
PREFIX uniprot:
PREFIX drugbank:
SELECT distinct ?fullname
WHERE
{
?interaction rdf:type biopax2:physicalInteraction .
?interaction biopax2:PARTICIPANTS ?participant .
?participant biopax2:PHYSICAL-ENTITY ?physicalEntity .
?physicalEntity skos:exactMatch ?protein .
?protein uniprot:classifiedWith .
?protein uniprot:recommendedName ?name.
?name uniprot:fullName ?fullname .
?protein uniprot:mnemonic ?mnemonic .
?target drugbank:swissprotName ?mnemonic .
}
* [[http://bit.ly/12aOyoe][View the SPARQL Query Definition via SPARQL Protocol URL]]
* [[http://bit.ly/YnSo6C][View the SPARQL Query Results via SPARQL Protocol URL]]
---++Example Fund Drugs Related to Asthma that are Linked to a Molecular Interaction
PREFIX skos:
PREFIX biopax2:
PREFIX uniprot:
PREFIX drugbank:
SELECT distinct ?fullname ?drugname ?indication
WHERE
{
?participant biopax2:PHYSICAL-ENTITY ?physicalEntity .
?physicalEntity skos:semanticRelation ?protein .
?protein uniprot:recommendedName ?name.
?name uniprot:fullName ?fullname .
?target skos:exactMatch ?protein .
?drug drugbank:target ?target.
?drug drugbank:genericName ?drugname.
?drug drugbank:indication ?indication.
filter(regex(?indication, "asthma", "i"))
}
* [[http://bit.ly/Z7o8Tq][View the SPARQL Query Definition via SPARQL Protocol URL]]
* [[http://bit.ly/Y9idZe][View the SPARQL Query Results via SPARQL Protocol URL]]
---++Example Find Drugs Related to Asthma that are Linked to a Curated Molecular Interaction in the Literature where the Protein is Known to cause Inflammatory Response
PREFIX rdf:
PREFIX skos:
PREFIX biopax2:
PREFIX uniprot:
PREFIX drugbank:
SELECT DISTINCT ?fullname ?drugname
WHERE
{
?interaction rdf:type biopax2:physicalInteraction .
?interaction biopax2:PARTICIPANTS ?participant .
?participant biopax2:PHYSICAL-ENTITY ?physicalEntity .
?physicalEntity skos:exactMatch ?protein .
?protein uniprot:classifiedWith .
?protein uniprot:recommendedName ?name.
?name uniprot:fullName ?fullname .
?target skos:exactMatch ?protein .
?drug drugbank:target ?target .
?drug drugbank:genericName ?drugname .
?drug drugbank:indication ?indication .
}
* [[http://bit.ly/X1PrLQ][View the SPARQL Query Definition via SPARQL Protocol URL]]
* [[http://bit.ly/XFR7c9][View the SPARQL Query Results via SPARQL Protocol URL]]
---++Example Find All Located in Y-chromosome Human Genes
PREFIX rdf:
PREFIX gene:
PREFIX uniprot:
PREFIX core:
SELECT ?genedescription ?taxonomy
WHERE
{
?geneid gene:description ?genedescription .
?geneid gene:uniprotAccession ?uniprotaccession .
?geneid gene:chromosome 'Y' .
?uniprotaccession core:organism ?taxonomy .
?taxonomy core:scientificName 'Homo sapiens' .
}
* [[http://bit.ly/WXGlP3][View the SPARQL Query Definition via SPARQL Protocol URL]]
* [[http://bit.ly/Xyl5Nc][View the SPARQL Query Results via SPARQL Protocol URL]]
---++Example Find All Located in Y-chromosome Human Genes with Known Molecular Interactions
PREFIX rdf:
PREFIX skos:
PREFIX gene:
PREFIX core:
PREFIX biopax2:
SELECT ?genedescription ?taxonomy ?interactionname
WHERE
{
?interaction rdf:type biopax2:interaction .
?interaction biopax2:PARTICIPANTS ?p .
?interaction biopax2:NAME ?interactionname .
?p biopax2:PHYSICAL-ENTITY ?protein .
?protein skos:exactMatch ?uniprotaccession .
?uniprotaccession core:organism ?taxonomy .
?taxonomy core:scientificName 'Homo sapiens' .
?geneid gene:uniprotAccession ?uniprotaccession .
?geneid gene:description ?genedescription .
?geneid gene:chromosome 'Y' .
}
* [[http://bit.ly/V2Q6hS][View the SPARQL Query Definition via SPARQL Protocol URL]]
* [[http://bit.ly/12aOQLR][View the SPARQL Query Results via SPARQL Protocol URL]]
---++Example Find All Located in Y-chromosome, Human Genes with Known Molecular Interactions, which are analyzed with Molecular Techniques
PREFIX rdf:
PREFIX skos:
PREFIX gene:
PREFIX core:
PREFIX biopax2:
PREFIX lifeskim:
PREFIX umls:
PREFIX pubmed:
SELECT distinct ?genedescription ?prefLabel
WHERE
{
?interaction rdf:type biopax2:interaction .
?interaction biopax2:PARTICIPANTS ?p .
?p biopax2:PHYSICAL-ENTITY ?protein .
?protein skos:exactMatch ?uniprotaccession .
?uniprotaccession core:organism .
?geneid gene:uniprotAccession ?uniprotaccession .
?geneid gene:description ?genedescription .
?geneid gene:pubmed ?pmid .
?geneid gene:chromosome 'Y' .
?pmid lifeskim:mentions ?umlsid .
?umlsid skos:prefLabel ?prefLabel .
?umlsid rdf:type .
}
* [[http://bit.ly/WXGPEP][View the SPARQL Query Definition via SPARQL Protocol URL]]
* [[http://bit.ly/XylbVb][View the SPARQL Query Results via SPARQL Protocol URL]]
---++Example Find All Located in Y-chromosome, Human Genes with Known Molecular Interactions, which are analyzed with 'Transfection'
PREFIX rdf:
PREFIX skos:
PREFIX gene:
PREFIX core:
PREFIX biopax2:
PREFIX lifeskim:
PREFIX umls:
PREFIX pubmed:
SELECT distinct ?genedescription ?prefLabel
WHERE
{
?interaction rdf:type biopax2:interaction .
?interaction biopax2:PARTICIPANTS ?p .
?p biopax2:PHYSICAL-ENTITY ?protein .
?protein skos:exactMatch ?uniprotaccession .
?uniprotaccession core:organism .
?geneid gene:uniprotAccession ?uniprotaccession .
?geneid gene:description ?genedescription .
?geneid gene:pubmed ?pmid .
?geneid gene:chromosome 'Y' .
?pmid lifeskim:mentions ?umlsid .
?umlsid skos:prefLabel 'Transfection' .
?umlsid skos:prefLabel ?prefLabel .
}
* [[http://bit.ly/X4HVgd][View the SPARQL Query Definition via SPARQL Protocol URL]]
* [[http://bit.ly/Vd7GO2][View the SPARQL Query Results via SPARQL Protocol URL]]
---++Example Show All White blood Cell Types
PREFIX umls-concept:
PREFIX skos:
PREFIX lld:
SELECT ?concept ?prefLabel
WHERE
{
{ ?concept skos:prefLabel "Leukocytes" .
?concept skos:inScheme lld:umls .
?concept skos:prefLabel ?prefLabel }
UNION
{ ?concept1 skos:prefLabel "Leukocytes" .
?concept1 skos:inScheme lld:umls .
?concept skos:broaderTransitive ?concept1 .
?concept skos:inScheme lld:umls .
?concept skos:prefLabel ?prefLabel }
}
* [[http://bit.ly/11DxdF9][View the SPARQL Query Definition via SPARQL Protocol URL]]
* [[http://bit.ly/VQHXxa][View the SPARQL Query Results via SPARQL Protocol URL]]
---++Example Show Respirations Disorder Types
PREFIX umls-concept:
PREFIX skos:
PREFIX lld:
SELECT ?concept ?prefLabel
WHERE
{
{ ?concept skos:prefLabel "Respiration Disorders" .
?concept skos:inScheme lld:umls .
?concept skos:prefLabel ?prefLabel }
UNION
{ ?concept1 skos:prefLabel "Respiration Disorders" .
?concept1 skos:inScheme lld:umls .
?concept skos:broaderTransitive ?concept1 .
?concept skos:inScheme lld:umls .
?concept skos:prefLabel ?prefLabel }
}
* [[http://bit.ly/WXKUJ2][View the SPARQL Query Definition via SPARQL Protocol URL]]
* [[http://bit.ly/VQI0ZR][View the SPARQL Query Results via SPARQL Protocol URL]]
---++Related
* [[http://linkedlifedata.com/sparql][The Linked Life Data SPARQL Endpoint]]
* [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]]
* [[http://docs.openlinksw.com/virtuoso/rdfsparql.html][Virtuoso Documentation]]