sparql-examples

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

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

4

Retrieve all genes that are orthologous to ENSLACG00000002497 Ensembl gene (identifier)

Use at

PREFIX ensembl: <http://rdf.ebi.ac.uk/resource/ensembl/>
PREFIX lscr: <http://purl.org/lscr#>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sio: <http://semanticscience.org/resource/>

SELECT ?protein2 ?OMA_LINK
WHERE {
    # The three that contains Orthologs. The leafs are proteins.
    # This graph pattern defines the relationship protein1 is Orthologs to protein2
    ?cluster a orth:OrthologsCluster ;
        orth:hasHomologousMember ?node1 ;
        orth:hasHomologousMember ?node2 .
    ?node2 orth:hasHomologousMember* ?protein2 .
    ?node1 orth:hasHomologousMember* ?protein1 .

    # Specify the protein to look for its orthologs
    ?protein1 sio:SIO_010079/lscr:xrefEnsemblGene ensembl:ENSLACG00000002497 .

    # The OMA link to the second protein
    ?protein2 rdfs:seeAlso ?OMA_LINK .

    filter(?node1 != ?node2)
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v6("?OMA_LINK"):::projected 
  v3("?cluster")
  v1("?node1")
  v2("?node2")
  v5("?protein1")
  v4("?protein2"):::projected 
  a1((" "))
  c2(["orth:OrthologsCluster"]):::iri 
  c6(["ensembl:ENSLACG00000002497"]):::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 --"sio:SIO_010079"-->  a1
  a1 --"lscr:xrefEnsemblGene"-->  c6
  v4 --"rdfs:seeAlso"-->  v6