sub:assertion {
sub:get-dggs-nanopubs dct:description "List nanopublications related to Discrete Global Grid Systems (DGGS)." ;
dct:license <
http://www.apache.org/licenses/LICENSE-2.0> ;
a <
https://w3id.org/kpxl/grlc/grlc-query> ;
rdfs:label "Get nanopublications related to DGGS" ;
<
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/>
select distinct ?np ?pubkey ?date ?label ?title ?text
?supersedes ?supersedes_count where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
# Valid signature and not invalidated
filter not exists {
?npx npx:invalidates ?np ;
npa:hasValidSignatureForPublicKeyHash ?pubkey_inv .
}
# This is the LATEST version (nothing supersedes it)
filter not exists {
?newer_np npx:supersedes ?np ;
npa:hasValidSignatureForPublicKeyHash ?pubkey_super .
}
# Not retracted
filter not exists {
?retraction_np npx:retracts ?np ;
npa:hasValidSignatureForPublicKeyHash ?pubkey_ret .
}
?np dct:created ?date .
?np np:hasAssertion ?a .
}
# Check if this nanopub supersedes others (to show version history)
optional {
graph npa:graph {
?np npx:supersedes ?supersedes .
}
}
graph ?a {
?s ?p ?o .
filter(
isLiteral(?o) && regex(str(?o), \"DGGS|Discrete Global Grid|discrete global grid\", \"i\")
)
}
optional {
graph ?a { ?s rdfs:label ?label }
}
optional {
graph ?a { ?s dct:title ?title }
}
bind(?o as ?text)
}
order by desc(?date)""" .
}