sparql-examples

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

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

12

Find orthologous human and mouse genes in the group(s) annotated with GO MF GO:0005164 (tumor necrosis factor receptor binding) and GO BP GO:0045739 (positive regulation of DNA repair)

Use at

PREFIX up: <http://purl.uniprot.org/core/>
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
PREFIX GO: <http://purl.obolibrary.org/obo/GO_>
PREFIX : <http://purl.orthodb.org/>

SELECT ?og ?og_description ?gene_m ?gene_m_name ?gene_h ?gene_h_name
WHERE {
    ?gene_m a :Gene.
    ?gene_h a :Gene.
    ?gene_m up:organism/a [up:scientificName "Mus musculus"].
    ?gene_h up:organism/a taxon:9606.
    ?gene_m :name ?gene_m_name.
    ?gene_h :name ?gene_h_name.
    ?gene_m :memberOf ?og.
    ?gene_h :memberOf ?og.
    ?og a :OrthoGroup; :name ?og_description.
    ?og :xref [a :Xref; :xrefResource GO:0005164],[a :Xref; :xrefResource GO:0045739].
} ORDER BY ?og

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?gene_h"):::projected 
  v5("?gene_h_name"):::projected 
  v2("?gene_m"):::projected 
  v4("?gene_m_name"):::projected 
  v1("?og"):::projected 
  v6("?og_description"):::projected 
  a2((" "))
  a1((" "))
  a3((" "))
  a4((" "))
  a5((" "))
  c4(["Mus musculus"]):::literal 
  c10([":Xref"]):::iri 
  c2([":Gene"]):::iri 
  c9([":OrthoGroup"]):::iri 
  c12(["GO:0005164"]):::iri 
  c6(["taxon:9606"]):::iri 
  c13(["GO:0045739"]):::iri 
  v2 --"a"-->  c2
  v3 --"a"-->  c2
  a1 --"up:scientificName"-->  c4
  v2 --"up:organism"-->  a2
  a2 --"a"-->  a1
  v3 --"up:organism"-->  a3
  a3 --"a"-->  c6
  v2 --":name"-->  v4
  v3 --":name"-->  v5
  v2 --":memberOf"-->  v1
  v3 --":memberOf"-->  v1
  v1 --"a"-->  c9
  v1 --":name"-->  v6
  a4 --"a"-->  c10
  a4 --":xrefResource"-->  c12
  a5 --"a"-->  c10
  a5 --":xrefResource"-->  c13
  v1 --":xref"-->  a4
  v1 --":xref"-->  a5