sparql-examples

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

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

65_distinct_extinct_organisms_in_uniprotkb

How many distinct extinct organisms are represented in UniProtKB

Use at

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

SELECT 
  ?taxon
  (SAMPLE(?name) AS ?anName)
  (COUNT(DISTINCT ?protein) AS ?entriesPerExtinctTaxon)
WHERE
{
  GRAPH<http://sparql.uniprot.org/taxonomy>{
    ?taxon a up:Taxon ;
           up:scientificName ?name .
  }
  ?protein up:organism ?taxon ;
           up:classifiedWith keywords:952 .
} GROUP BY ?taxon ORDER BY ?taxon
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?anName")
  v5("?entriesPerExtinctTaxon")
  v2("?name"):::projected 
  v3("?protein"):::projected 
  v1("?taxon"):::projected 
  c7(["keywords:952"]):::iri 
  c2(["up:Taxon"]):::iri 
  v1 --"a"-->  c2
  v1 --"up:scientificName"-->  v2
  v3 --"up:organism"-->  v1
  v3 --"up:classifiedWith"-->  c7
  bind2[/"sample(?name)"/]
  v2 --o bind2
  bind2 --as--o v4
  bind3[/"count(?protein)"/]
  v3 --o bind3
  bind3 --as--o v5