@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix ex: <https://bigcat-um.github.io/sparql-examples/WikiPathways/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix spex: <https://purl.expasy.org/sparql-examples/ontology#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:042 a sh:SPARQLExecutable,
       sh:SPARQLSelectExecutable ;
    rdfs:label "Reference Count per Pathway"@en ;
    rdfs:comment "Counts the number of PubMed publication references per pathway, sorted by descending reference count."@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>

SELECT DISTINCT ?pathway (COUNT(?pubmed) AS ?numberOfReferences)
WHERE
     {?pubmed a       wp:PublicationReference .
      ?pubmed dcterms:isPartOf ?pathway }
GROUP BY ?pathway
ORDER BY DESC(?numberOfReferences)""" ;
    schema:target <https://sparql.wikipathways.org/sparql> ;
    schema:keywords "literature" ;
    dcterms:source <https://github.com/wikipathways/SPARQLQueries/blob/f9de718ebdcca57dadb773d47fa4e342cf386857/E.%20Literature/countRefsPerPW.rq> ;
    dcterms:modified "2026-11-10"^^xsd:date ;
    dcterms:license <https://www.gnu.org/licenses/gpl-3.0.html> .
