@prefix ex:<https://purl.expasy.org/sparql-examples/neXtProt/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .

ex:NXQ_00223 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "100 most-cited publications in neXtProt and the corresponding number of associated entries"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX : <http://nextprot.org/rdf/>
PREFIX db: <http://nextprot.org/rdf/db/>

select (str(?publiid) as ?PMID) (str(?tt) as ?title) (count(distinct ?entry) as ?ecnt)
where {
 ?entry a :Entry .
 ?entry :reference ?ref .
 ?ref a :Publication.
 ?ref :title ?tt .
 ?ref :from ?xref .
 ?xref :accession ?publiid .
 ?xref :provenance db:PubMed .
}
group by ?publiid ?tt
order by desc(?ecnt)
limit 100""" ;
    schema:keywords "publication",
        "tutorial" ;
    schema:target <https://sparql.nextprot.org/sparql> .

