sub:assertion {
sub:get-sub-resources dct:description "This query returns the sub-resources of a Space or Maintained Resource." ;
dct:license <
http://www.apache.org/licenses/LICENSE-2.0> ;
a <
https://w3id.org/kpxl/grlc/grlc-query> ;
rdfs:label "Get sub-resources of Space or Maintained Resource" ;
<
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/>
select ?resource ?resource_label ?entity_main_type ?np where {
graph npa:graph {
values ?entity_main_type { gen:Space gen:MaintainedResource }
?np npx:hasNanopubType ?entity_main_type .
?np npx:introduces ?resource .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
?np np:hasAssertion ?a .
}
graph ?a {
{ {
values ?_super_resource_multi_iri {}
?resource a ?entity_main_type .
filter(strstarts(str(?resource), concat(str(?_super_resource_multi_iri), \"/\")))
bind(substr(str(?resource), strlen(str(?_super_resource_multi_iri)) + 2, strlen(str(?resource)) - strlen(str(?_super_resource_multi_iri)) - 1) as ?suffix)
filter(!contains(?suffix, \"/\"))
} union {
values ?_super_resource_multi_iri {}
?resource a gen:Space .
?resource dct:isPartOf ?_super_resource_multi_iri .
} union {
values ?_super_resource_multi_iri {}
?resource a gen:MaintainedResource .
?resource gen:isMaintainedBy ?_super_resource_multi_iri .
} }
filter exists { ?resource a ?__resource_type_iri }
?resource rdfs:label ?resource_label .
}
} order by ?resource_label""" .
}