sub:assertion {
sub:get-publications dct:description "This query returns all publications with their authors, returning author IDs concatenated by spaces and author names concatenated by newlines (with backslashes and newlines escaped)." ;
dct:license <
http://www.apache.org/licenses/LICENSE-2.0> ;
a <
https://w3id.org/kpxl/grlc/grlc-query> ;
rdfs:label "Get all publications" ;
<
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 ?paper ?paper_label ?journal ?journal_label ?publication_date
(group_concat(str(?author_id); separator=\" \") as ?authors_multi_iri)
(group_concat(replace(replace(?author_name, \"\\\\\\\\\", \"\\\\\\\\\\\\\\\\\"), \"\\\\n\", \"\\\\\\\\n\"); separator=\"\\n\") as ?authors_label_multi)
?np (\"^\" as ?np_label)
where {
graph npa:graph {
?np npx:hasNanopubType fabio:ScholarlyWork .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np np:hasAssertion ?a .
?np npx:introduces ?paper .
}
graph ?a {
?paper dct:title ?paper_label .
?paper bibo:authorList ?author_list .
optional { ?paper dct:date ?publication_date . }
?author_list ?rdfseqpred ?author_id .
filter(strstarts(str(?rdfseqpred), \"http://www.w3.org/1999/02/22-rdf-syntax-ns#_\"))
?author_id foaf:name ?author_name .
optional {
?paper dct:isPartOf ?journal .
?journal dct:title ?journal_label .
}
}
}
group by ?paper ?paper_label ?journal ?journal_label ?publication_date ?np
order by desc(?publication_date)""" .
}