sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

7

Retrieve all genes that are orthologous to HUMAN22169 OMA protein (identifier) and their cross-reference links to OMA and Uniprot.

Use at

PREFIX dc: <http://purl.org/dc/terms/>
PREFIX lscr: <http://purl.org/lscr#>
PREFIX orth: <http://purl.org/net/orth#>

SELECT ?protein2 ?Uniprot_link
WHERE {
    ?cluster a orth:OrthologsCluster ;
        orth:hasHomologousMember ?node1 ;
        orth:hasHomologousMember ?node2 .
    ?node2 orth:hasHomologousMember* ?protein2 .
    ?node1 orth:hasHomologousMember* ?protein1 .
    ?protein1 a orth:Protein ;
        dc:identifier 'HUMAN22169' .
    ?protein2 a orth:Protein ;
        lscr:xrefUniprot ?Uniprot_link .
    FILTER(?node1 != ?node2)
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v6("?Uniprot_link"):::projected 
  v3("?cluster")
  v1("?node1")
  v2("?node2")
  v5("?protein1")
  v4("?protein2"):::projected 
  c4(["orth:Protein"]):::iri 
  c6(["HUMAN22169"]):::literal 
  c2(["orth:OrthologsCluster"]):::iri 
  f0[["?node1 != ?node2"]]
  f0 --> v1
  f0 --> v2
  v3 --"a"-->  c2
  v3 --"orth:hasHomologousMember"-->  v1
  v3 --"orth:hasHomologousMember"-->  v2
  v2 --"orth:hasHomologousMember"-->  v4
  v1 --"orth:hasHomologousMember"-->  v5
  v5 --"a"-->  c4
  v5 --"dc:identifier"-->  c6
  v4 --"a"-->  c4
  v4 --"lscr:xrefUniprot"-->  v6