sparql-examples

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

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

86_taxonomy_rank_and_scientific_name

Retrieve the rank and the scientific name of an taxonomic record. Not all taxonomic records have a rank associated with them.

Use at

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

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