sub:assertion {
sub:get-top-underrated dct:description "This query returns the top things being claimed to be underrated." ;
dct:license <
http://www.apache.org/licenses/LICENSE-2.0> ;
a <
https://w3id.org/kpxl/grlc/grlc-query> ;
rdfs:label "Get top underrated things" ;
<
https://w3id.org/kpxl/grlc/endpoint> <
https://w3id.org/np/l/nanopub-query-1.1/repo/full> ;
<
https://w3id.org/kpxl/grlc/sparql> """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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix foaf: <http://xmlns.com/foaf/0.1/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
prefix opo: <https://w3id.org/kpxl/opo/terms/>
select distinct (count(distinct ?person) as ?count) ?thing (min(?thingLabel) as ?thingLabel) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np npx:hasNanopubType opo:thinksIsUnderrated .
?np dct:created ?date .
?np dct:creator ?person .
?np np:hasAssertion ?a .
?np np:hasPublicationInfo ?i.
}
graph ?a {
?person opo:thinksIsUnderrated ?thing .
}
optional { graph ?i {
?thing nt:hasLabelFromApi ?thingLabel1 .
} }
optional { graph <http://purl.org/np/RA6p8TsYKPUmy6yoKuxjBKn2vRKczjIWrcS2lyyX61myE#assertion> {
?thing rdfs:label ?thingLabel2 .
} }
bind(coalesce(?thingLabel2, ?thingLabel1) as ?thingLabel)
}
group by ?thing
order by desc(?count)""" .
}