sub:assertion {
sub:get-messages-about-resource-and-parts dct:description "This query returns plain-text messages about the given resource, including messages about things that are declared to be part of it or whose URI starts with the resource URI." ;
dct:license <
http://www.apache.org/licenses/LICENSE-2.0> ;
a <
https://w3id.org/kpxl/grlc/grlc-query> ;
rdfs:label "Get messages about resource and its parts" ;
<
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 schema: <https://schema.org/>
select ?about ?text (group_concat(concat('<span><a href=\"', str(?link), '\">link</a></span>'); separator=\", \") as ?link) ?user ?date ?np (\"^\" as ?np_label) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
?np dct:creator ?user .
?np np:hasAssertion ?a .
}
graph ?a {
?a rdfs:label ?text .
?a schema:about ?about .
values ?_resource_multi_iri {}
filter(
strstarts(str(?about), str(?_resource_multi_iri))
|| exists {
graph npa:graph {
?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 .
filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }
?np2 np:hasAssertion ?a2 .
}
graph ?a2 {
{ ?about dct:isPartOf ?_resource_multi_iri . }
union
{ ?_resource_multi_iri dct:hasPart ?about . }
}
}
)
optional { ?a rdfs:seeAlso ?link . }
}
}
group by ?about ?text ?user ?date ?np
order by desc(?date)""" .
}