sub:assertion {
sub:get-coauthors dct:description "This query returns the co-authors of a given author." ;
dct:license <
http://www.apache.org/licenses/LICENSE-2.0> ;
a <
https://w3id.org/kpxl/grlc/grlc-query> ;
rdfs:label "Get co-authors" ;
<
https://w3id.org/kpxl/grlc/endpoint> <
https://w3id.org/np/l/nanopub-query-1.1/repo/full> ;
<
https://w3id.org/kpxl/grlc/sparql> """prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix fabio: <http://purl.org/spar/fabio/>
prefix bibo: <http://purl.org/ontology/bibo/>
prefix foaf: <http://xmlns.com/foaf/0.1/>
select ?coauthor_id ?coauthor_label (count(distinct ?paper) as ?paper_count) where {
values ?_author_multi_iri {}
graph npa:graph {
?np npx:hasNanopubType fabio:ScholarlyWork .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
?np np:hasAssertion ?a .
?np npx:introduces ?paper .
}
graph ?a {
?paper dct:title ?paper_label .
?paper bibo:authorList ?author_list .
?paper dct:date ?publication_date .
?author_list ?rdfseqpred1 ?_author_multi_iri .
filter(strstarts(str(?rdfseqpred1), \"http://www.w3.org/1999/02/22-rdf-syntax-ns#_\"))
?author_list ?rdfseqpred2 ?coauthor .
filter(strstarts(str(?rdfseqpred2), \"http://www.w3.org/1999/02/22-rdf-syntax-ns#_\"))
?coauthor foaf:name ?coauthor_label .
bind(if(strstarts(str(?coauthor), \"https://orcid.org/\"), ?coauthor, ?coauthor_label) as ?coauthor_id)
filter(?coauthor != ?_author_multi_iri)
optional {
?paper dct:isPartOf ?journal .
?journal dct:title ?journal_label .
}
}
}
group by ?coauthor_id ?coauthor_label
order by desc(?paper_count)""" .
}