sparql-examples

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

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

021

Which species the Mt-co1 gene is present (without considering synonyms)?

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX obo: <http://purl.obolibrary.org/obo/>

SELECT ?name
WHERE {
    ?gene a orth:Gene ;
        rdfs:label ?geneName ;
        orth:organism ?organism .
    ?organism obo:RO_0002162 ?taxon . # in taxon
    ?taxon up:scientificName ?name .
    FILTER ( UCASE(?geneName) = UCASE('Mt-co1') )
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?gene")
  v1("?geneName")
  v5("?name"):::projected 
  v3("?organism")
  v4("?taxon")
  c3(["orth:Gene"]):::iri 
  f0[["upper-case(?geneName) = upper-case('Mt-co1')"]]
  f0 --> v1
  v2 --"a"-->  c3
  v2 --"rdfs:label"-->  v1
  v2 --"orth:organism"-->  v3
  v3 --"obo:RO_0002162"-->  v4
  v4 --"up:scientificName"-->  v5