sub:assertion {
sub:get-top-creators-last30d dct:description "This query returns the 10 creators who created most nanopublications during the last 30 days." ;
dct:license <
http://www.apache.org/licenses/LICENSE-2.0> ;
a <
https://w3id.org/kpxl/grlc/grlc-query> ;
rdfs:label "Get the top-10 creators of the last 30 days" ;
<
https://w3id.org/kpxl/grlc/endpoint> <
https://w3id.org/np/l/nanopub-query-1.1/repo/last30d> ;
<
https://w3id.org/kpxl/grlc/sparql> """prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix dct: <http://purl.org/dc/terms/>
prefix prov: <http://www.w3.org/ns/prov#>
prefix foaf: <http://xmlns.com/foaf/0.1/>
select distinct ?userid (count(distinct ?np) as ?count) where {
{ graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
?np dct:creator ?userid .
} }
union
{
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
?np np:hasAssertion ?assertion .
?np np:hasProvenance ?prov .
}
graph ?prov {
?assertion prov:wasAttributedTo ?userid .
}
}
filter(?userid != <https://orcid.org/1234-1234-1234-1234>)
filter(?userid != <https://orcid.org/0000-0000-0000-0000>)
filter(!regex(str(?userid), '[^A-Za-z0-9-_]RA[A-Za-z0-9-_]{43}$'))
}
group by ?userid
order by desc(?count)
limit 10""" .
}