sparql-examples

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

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

Query_144

rq turtle/ttl

Names of all the species of sturgeons represented in Cellosaurus

Use at


PREFIX cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/>
PREFIX db: <https://purl.expasy.org/cellosaurus/rdf/db/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
# All Taxonomy names with a  child of  Taxid:7900 (Acipenseridae)
select distinct ?xref_db ?xref_ac ?xref_label where {
  ?species  cello:isIdentifiedByXref ?xref .
  ?xref cello:more_specific_than+ ?generic_concept .
  ?generic_concept skos:notation "7900" ; skos:inScheme db:NCBI_TaxID . # Acipenseridae
  ?xref cello:accession ?xref_ac ; cello:database ?xref_db; skos:prefLabel ?xref_label . # we have always one and only one skos:prefLabel
}
limit 100
    
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?generic_concept")
  v1("?species")
  v2("?xref")
  v4("?xref_ac"):::projected 
  v5("?xref_db"):::projected 
  v6("?xref_label"):::projected 
  c6([https://purl.expasy.org/cellosaurus/rdf/db/NCBI_TaxID]):::iri 
  c4(["7900"]):::literal 
  v1 --"cello:isIdentifiedByXref"-->  v2
  v2 --"cello:more_specific_than"-->  v3
  v3 --"skos:notation"-->  c4
  v3 --"skos:inScheme"-->  c6
  v2 --"cello:accession"-->  v4
  v2 --"cello:database"-->  v5
  v2 --"skos:prefLabel"-->  v6