Skip to content

Instantly share code, notes, and snippets.

@maulikkamdar
Last active January 13, 2021 13:59
Show Gist options
  • Save maulikkamdar/a47fbecddecc6ba4b373 to your computer and use it in GitHub Desktop.
Save maulikkamdar/a47fbecddecc6ba4b373 to your computer and use it in GitHub Desktop.
Examples of SPARQL Queries for LinkedPPI Retrieval from http://srvgal78.deri.ie/sparql . The first three SPARQL Queries correspond to the use cases discussed in the paper, and the rest are used by the Protein-Protein Interaction Visualization Dashboard available at http://srvgal78.deri.ie/linkedppi for search and aggregative summarization.
/* SPARQL Queries for the Use Cases */
/* Use Case 1 SPARQL Query */
PREFIX ppi: <http://data.bioinfo.deri.ie/>
PREFIX entrezgene: <http://linkedlifedata.com/resource/entrez-gene/>
SELECT DISTINCT ?requestedDomainName ?interactingDomainName ?interactingProteinName
?validatedProtein ?validatedProteinName ?publication WHERE {
entrezgene:3280 ppi:hasDomain ?requestedDomain.
?requestedDomain ppi:officialSymbol ?requestedDomainName .
{
?interaction ppi:left ?requestedDomain; ppi:right ?interactingDomain
} UNION {
?interaction ppi:right ?requestedDomain; ppi:left ?interactingDomain
}
?interactingProtein ppi:hasDomain ?interactingDomain; ppi:officialSymbol ?interactingProteinName .
?interactingDomain ppi:officialSymbol ?interactingDomainName .
?interaction ppi:score ?score .
{
?biogridInteraction ppi:left ?interactingProtein; ppi:right ?validatedProtein.
} UNION {
?biogridInteraction ppi:right ?interactingProtein; ppi:left ?validatedProtein.
}
?validatedProtein ppi:officialSymbol ?validatedProteinName .
OPTIONAL {?biogridInteraction ppi:published_in ?publication}.
} LIMIT 100
/* Use Case 2 SPARQL Query */
PREFIX ppi: <http://data.bioinfo.deri.ie/>
PREFIX pfam: <http://linkedlifedata.com/resource/pfam/>
SELECT DISTINCT ?desiredDomainName ?interactingDomain ?interactingDomainName
?validatedScore ?inferredScore WHERE {
pfam:PF00010 ppi:officialSymbol ?desiredDomainName .
{
?interaction ppi:left pfam:PF00010; ppi:right ?interactingDomain
} UNION {
?interaction ppi:right pfam:PF00010; ppi:left ?interactingDomain
}
?interactingDomain ppi:officialSymbol ?interactingDomainName .
OPTIONAL {?interaction ppi:score ?validatedScore} .
OPTIONAL {?interaction ppi:inferredScore ?inferredScore}.
}
/* Use Case 3 SPARQL Query */
PREFIX ppi: <http://data.bioinfo.deri.ie/>
PREFIX entrezgene: <http://linkedlifedata.com/resource/entrez-gene/>
SELECT * WHERE {
entrezgene:3280 ppi:partOfIdeogram ?ideogramA ; ppi:officialSymbol ?proteinNameA .
entrezgene:23411 ppi:partOfIdeogram ?ideogramB ; ppi:officialSymbol ?proteinNameB .
{
?interaction ppi:left ?ideogramA ; ppi:right ?ideogramB
} UNION {
?interaction ppi:left ?ideogramB ; ppi:right ?ideogramA
}
?interaction ppi:inferredScore ?inferredScore.
}
/* ------------------------------------------------------------------------ */
/* SPARQL Queries executed by the PPI Visualization Dashboard http://srvgal78.deri.ie/linkedppi */
/* Generic BioGRID Query */
PREFIX ppi: <http://data.bioinfo.deri.ie/>
PREFIX entrezgene: <http://linkedlifedata.com/resource/entrez-gene/>
SELECT * WHERE {{
?biogridInt ppi:left entrezgene:3280; ppi:right ?geneTos.
} UNION {
?biogridInt ppi:right entrezgene:3280; ppi:left ?geneTos.
}
?geneTos ppi:officialSymbol ?geneSym .
OPTIONAL {?biogridInt ppi:published_in ?pub}.
OPTIONAL {?biogridInt ppi:qualification ?qual}.
OPTIONAL {?biogridInt ppi:confidence_score ?score}
}
/* Generic CORUM Query */
PREFIX ppi: <http://data.bioinfo.deri.ie/>
PREFIX entrezgene: <http://linkedlifedata.com/resource/entrez-gene/>
SELECT * WHERE {
?corumInt ppi:componentsSynonyms entrezgene:3280; ppi:componentsSynonyms ?k; ppi:name ?name.
?k ppi:officialSymbol ?geneSym .
OPTIONAL {?corumInt ppi:published_In ?pub}.
OPTIONAL {?corumInt ppi:functionalComment ?comment} .
FILTER (?k != entrezgene:3280)
}
/* Generic COXPRESdb Query */
PREFIX ppi: <http://data.bioinfo.deri.ie/>
PREFIX ns1: <http://coxpresdb.jp/rdf/def/0.1/>
PREFIX entrezgene: <http://linkedlifedata.com/resource/entrez-gene/>
SELECT DISTINCT ?it ?name ?pcc WHERE {{
?coexpressInt ns1:gene_id_1 entrezgene:3280;
ns1:gene_id_2 ?it; ns1:pcc ?pcc
} UNION {
?coexpressInt ns1:gene_id_2 entrezgene:3280;
ns1:gene_id_1 ?it; ns1:pcc ?pcc
}
?it ppi:officialSymbol ?name
} ORDER BY desc(?pcc)
/* Generic 3did Query */
PREFIX ppi: <http://data.bioinfo.deri.ie/>
PREFIX entrezgene: <http://linkedlifedata.com/resource/entrez-gene/>
SELECT DISTINCT ?name ?domain ?interDomain ?intername ?interGene ?geneName WHERE {
entrezgene:3280 ppi:hasDomain ?domain.
?domain ppi:officialSymbol ?name .
{
?inter ppi:left ?domain; ppi:right ?interDomain
} UNION {
?inter ppi:right ?domain; ppi:left ?interDomain
}
?interGene ppi:hasDomain ?interDomain .
?interDomain ppi:officialSymbol ?intername .
?interGene ppi:officialSymbol ?geneName .
?inter ppi:score ?score .
}
/* Generic GO Query */
PREFIX ppi: <http://data.bioinfo.deri.ie/>
PREFIX entrezgene: <http://linkedlifedata.com/resource/entrez-gene/>
SELECT * WHERE {
GRAPH <http://srvgal78.deri.ie:8890/goLinks> {
entrezgene:3280 ppi:GO ?go.
?geneComp ppi:GO ?go.
}
?go ppi:name ?name; ppi:namespace ?namespace; ppi:description ?description .
FILTER (?geneComp != entrezgene:3280)
}
@NehaThawani44
Copy link

I am trying to query my jsonld with Sparql Query if there is something you have implemented than please let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment