@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:062 a sh:SPARQLExecutable,
       sh:SPARQLSelectExecutable ;
    rdfs:label "All Contributors"@en ;
    rdfs:comment "Counts the number of pathways each first author (ordinal 1) contributes to, sorted by descending pathway count."@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
PREFIX dc:    <http://purl.org/dc/elements/1.1/>
PREFIX foaf:  <http://xmlns.com/foaf/0.1/>
PREFIX wpq:   <http://www.wikidata.org/prop/qualifier/>
PREFIX pav:   <http://purl.org/pav/>

SELECT (COUNT(DISTINCT ?pathway) AS ?count) ?name ?orcid ?page WHERE {
  VALUES ?ordinal { "1" }
  ?author_ a foaf:Person ;
    wp:hasAuthorship ?authorship .
  ?authorship ^wp:hasAuthorship ?pathway ;
    wpq:series_ordinal ?ordinal .
  ?pathway pav:hasVersion ?pathway_ .
  ?pathway_ a wp:Pathway ; dcterms:identifier ?version .
  OPTIONAL { ?author_ foaf:homepage ?page }
  OPTIONAL { ?author_ foaf:name ?name }
  OPTIONAL { ?author_ dc:identifier ?orcid }
} GROUP BY ?ordinal ?name ?orcid ?page
  ORDER BY DESC(?count)""" ;
    schema:target <https://sparql.wikipathways.org/sparql> ;
    schema:keywords "authors" ;
    dcterms:source <https://github.com/wikipathways/SPARQLQueries/blob/85c9912c600413a9ae0f5f9a3529420e38747f04/J.%20Authors/contributors.rq> ;
    dcterms:modified "2026-03-08"^^xsd:date ;
    dcterms:license <https://www.gnu.org/licenses/gpl-3.0.html> .
