https://w3id.org/np/RAO_Zx86Dtliwpz1liEw8-1LGfnmj7HAG1GD-L1tZCsYQ
type: Nanopublication
has assertion: assertion
has provenance: provenance
has publication info: pubinfo
created: 2026-07-15T06:13:33Z
creator: Tobias Kuhn
license: https://creativecommons.org/licenses/by/4.0/
embeds: Get sub-classes for class (from space members)

Get sub-classes for class (from space members)
type: grlc-query
description: This query returns the sub-classes of the given class, restricted to sub-classes that are part of the same space and published by admins, maintainers, or members of that space.
license: LICENSE-2.0
endpoint: full
sparql: prefix owl: <http://www.w3.org/2002/07/owl#> prefix dct: <http://purl.org/dc/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?subclass (coalesce(min(?untaggedLabel), min(?anyLabel)) as ?subclass_label) ?date ?np where { # the resource/ontology that the given (parent) class belongs to graph ?pg { ?_class_iri dct:isPartOf ?resource . } # collect the public keys of admins, maintainers, and members of the space maintaining that resource service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select ?resource (group_concat(?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?resource npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } group by ?resource } # sub-classes of the given class, that are part of the same resource and signed by a space member graph ?g { ?subclass rdfs:subClassOf ?_class_iri . ?subclass dct:isPartOf ?resource . } graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np npa:hasGraph ?g . ?np np:hasPublicationInfo ?i . ?np dct:created ?date . } filter(contains(?memberPubkeys, ?pubkey)) optional { graph ?g { ?subclass rdfs:label ?subclassLabel1 . } } optional { graph ?g { ?subclass dct:title ?subclassLabel2 . } } optional { graph ?i { ?subclass rdfs:label ?subclassLabel3 . } } optional { graph ?i { ?subclass nt:hasLabelFromApi ?subclassLabel4 . } } bind(coalesce(?subclassLabel1, ?subclassLabel2, ?subclassLab…

sig
has algorithm: RSA
signed by: Tobias Kuhn