sparql-examples

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

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

002

What are the species present in Bgee and their scientific and common names?

Use at

PREFIX up: <http://purl.uniprot.org/core/>

SELECT ?species ?sci_name ?common_name WHERE {
    ?species a up:Taxon ;
        up:scientificName ?sci_name ;
        up:rank up:Species .
    OPTIONAL { ?species up:commonName ?common_name . }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?common_name"):::projected 
  v2("?sci_name"):::projected 
  v1("?species"):::projected 
  c2(["up:Taxon"]):::iri 
  c5(["up:Species"]):::iri 
  v1 --"a"-->  c2
  v1 --"up:scientificName"-->  v2
  v1 --"up:rank"-->  c5
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v1 -."up:commonName".->  v3
  end