sub:assertion {
sub:get-all-resource-views dct:description "Returns all resource view declarations with their basic structure: view ID, kind, type, label, query, template count, first template, and date." ;
dct:license <
http://www.apache.org/licenses/LICENSE-2.0> ;
a <
https://w3id.org/kpxl/grlc/grlc-query> ;
rdfs:label "Get all resource views" ;
<
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 gen: <https://w3id.org/kpxl/gen/terms/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
select ?view ?view_label ?viewKind ?type ?query (count(distinct ?actionTemplate) as ?template_count) (min(?actionTemplate) as ?first_template) (min(?actionLabel) as ?first_template_label) ?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 np:hasAssertion ?a .
?np np:hasPublicationInfo ?pi .
}
graph ?pi {
?np nt:wasCreatedFromTemplate <https://w3id.org/np/RARLsTlqbTesu1b0WJZ-zL1z96xumOiqbK3l_vV6iZoww> .
}
graph ?a {
?view a gen:ResourceView .
optional {
?view a ?type .
filter(?type != gen:ResourceView)
}
optional { ?view rdfs:label ?view_label . }
optional { ?view dct:isVersionOf ?viewKind . }
optional { ?view gen:hasViewQuery ?query . }
optional {
?view gen:hasViewAction ?action .
?action gen:hasActionTemplate ?actionTemplate .
optional { ?action rdfs:label ?actionLabel . }
}
}
} group by ?view ?view_label ?viewKind ?type ?query ?date ?np
order by desc(?date)""" .
}