@prefix this: . @prefix sub: . @prefix np: . @prefix dct: . @prefix nt: . @prefix npx: . @prefix xsd: . @prefix rdfs: . @prefix orcid: . @prefix prov: . @prefix foaf: . sub:Head { this: a np:Nanopublication; np:hasAssertion sub:assertion; np:hasProvenance sub:provenance; np:hasPublicationInfo sub:pubinfo . } sub:assertion { sub:get-subclasses-simple a ; dct: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."; dct:license ; rdfs:label "Get sub-classes for class (from space members)"; ; """prefix owl: prefix dct: prefix rdfs: prefix np: prefix npa: prefix npx: prefix nt: prefix gen: 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 { 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, ?subclassLabel3, ?subclassLabel4) as ?anyLabel) bind(if(lang(?anyLabel) = \"\", ?anyLabel, ?noLabel) as ?untaggedLabel) } group by ?subclass ?date ?np order by desc(?date)""" . } sub:provenance { sub:assertion prov:wasAttributedTo orcid:0000-0002-1267-0234 . } sub:pubinfo { orcid:0000-0002-1267-0234 foaf:name "Tobias Kuhn" . this: dct:created "2026-07-15T06:13:33Z"^^xsd:dateTime; dct:creator orcid:0000-0002-1267-0234; dct:license ; npx:embeds sub:get-subclasses-simple; prov:wasDerivedFrom , ; nt:wasCreatedFromProvenanceTemplate ; nt:wasCreatedFromPubinfoTemplate , , , ; nt:wasCreatedFromTemplate . sub:sig npx:hasAlgorithm "RSA"; npx:hasPublicKey "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB"; npx:hasSignature "jxywuMBc4w1nfJtWYPWMYu84V++UfJf7cytuj3ru9maHk+VWSY+r2a84GPNg1XwI2KahmS80LPXCvzm/bXQuJinyAni7sFE1HKPbWf1Yz1TY2t+sygXvREkzwaqM8Lqu9j8/oTYShTX/VGrISUjchdirx9Z+lTt9P97cP5Spbw8="; npx:hasSignatureTarget this:; npx:signedBy orcid:0000-0002-1267-0234 . }