sparql-examples

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

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

Query_129

rq turtle/ttl

Top 100 most referenced publications in Cellosaurus

Use at


PREFIX cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?publi ?publi_identifiers (count(distinct(?cl_ac)) as ?cl_count) where {
  select
  	?publi
  	(group_concat(distinct ?pac; separator = ', ') as ?publi_identifiers)
    ?cl_ac
  	where {
      ?cl a / rdfs:subClassOf cello:CellLine .
  	  ?cl cello:primaryAccession ?cl_ac .
      ?cl cello:references ?publi.
      ?publi a ?publiClass .
      ?publi cello:seeAlsoXref / cello:accession ?pac.
    }
    group by ?publi ?cl_ac
}
group by ?publi ?publi_identifiers
order by desc(count(distinct(?cl_ac)))
limit 100
    
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v7("?_anon_39b94405334d4c98a94d4349b2e2527030")
  v1("?cl")
  v2("?cl_ac"):::projected 
  v8("?cl_count")
  v5("?pac")
  v3("?publi"):::projected 
  v4("?publiClass")
  v6("?publi_identifiers"):::projected 
  a2((" "))
  a3((" "))
  a1((" "))
  c3(["cello:CellLine"]):::iri 
  v1 --"a"-->  a2
  a2 --"rdfs:subClassOf"-->  c3
  v1 --"cello:primaryAccession"-->  v2
  v1 --"cello:references"-->  v3
  v3 --"a"-->  v4
  v3 --"cello:seeAlsoXref"-->  a3
  a3 --"cello:accession"-->  v5
  bind1[/"?pac"/]
  v5 --o bind1
  bind1 --as--o v6
  bind4[/"count(?cl_ac)"/]
  v2 --o bind4
  bind4 --as--o v7
  bind5[/"count(?cl_ac)"/]
  v2 --o bind5
  bind5 --as--o v8