#
# example SPARQL query 130
#

@prefix schema: <https://schema.org/> . 
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . 
@prefix sh: <http://www.w3.org/ns/shacl#> . 
@prefix cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/> .


cello:Query_130 a sh:SPARQLExecutable ;
    sh:prefixes _:sparql_examples_prefixes ;
    rdfs:comment """Top 100 authors of publications referenced in Cellosaurus"""@en ; 
    schema:keywords "author" , "contributor" , "publication" , "stats" ; 
    schema:target <https://sparql.cellosaurus.org/sparql> ; 
    sh:select """
PREFIX cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX schema: <https://schema.org/>
select ?person_name (count(distinct ?publi) as ?publi_count)
where {
  ?cl a / rdfs:subClassOf cello:CellLine .
  ?cl cello:references ?publi .
  ?publi ?p ?contr .
  ?contr a schema:Person .
  ?contr cello:name ?person_name .
}
group by ?person_name
order by desc(count(distinct(?publi)))
limit 100
    """
    .

