sparql-examples

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

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

Query_126

rq turtle/ttl

Top 100 population (ethnic grouping) of the individual from which human cell lines were sampled

Use at


PREFIX cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/>
select ?population_name (count(?cl) as ?cl_count) where {
        ?cl cello:derivedFromIndividualBelongingToPopulation ?pop.
        ?pop cello:name ?population_name .
  filter not exists { ?cl cello:hasParentCellLine ?any_parent }
}
group by ?population_name
order by desc(count(?cl))
limit 100
    
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v5("?_anon_39b94405334d4c98a94d4349b2e25270468")
  v2("?any_parent")
  v1("?cl"):::projected 
  v6("?cl_count")
  v3("?pop")
  v4("?population_name"):::projected 
  a1((" "))
  f0[["not  "]]
  subgraph f0e0["Exists Clause"]
    e0v1 --"cello:hasParentCellLine"-->  e0v2
    e0v2("?any_parent"):::projected 
    e0v1("?cl"):::projected 
  end
  f0--EXISTS--> f0e0
  f0 --> v1
  f0 --> c1
  f0 --> v2
  v1 --"cello:hasParentCellLine"-->  v2
  v1 --"cello:derivedFromIndividualBelongingToPopulation"-->  v3
  v3 --"cello:name"-->  v4
  bind3[/"count(?cl)"/]
  v1 --o bind3
  bind3 --as--o v5
  bind4[/"count(?cl)"/]
  v1 --o bind4
  bind4 --as--o v6