A set of SPARQL examples that are used in different SIB resources
Retrieve the rank and the scientific name of an taxonomic record. Not all taxonomic records have a rank associated with them.
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