@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-concepts-of-a-skos-scheme-from-space-members a ; dct:description "Returns the concepts (skos:Concept) that declare themselves to be in the given SKOS concept scheme or vocabulary via skos:inScheme, restricted to nanopublications published by an admin, maintainer or member of the space that maintains the scheme. The maintaining space and its validated member public-key hashes are resolved server-side from the spaces repo (/repo/spaces); observers are excluded, since that tier is self-attestable. Each concept URI appears at most once: of all non-invalidated member-published definitions of a concept in this scheme, only the latest one by nanopublication timestamp is kept (ties broken by nanopublication URI), so an in-place override of a definition replaces the earlier one in the listing rather than adding a second row. The broader concepts are given as a multi-valued column: the IRIs in broader_concepts_multi_iri and the matching labels in broader_concepts_label_multi, in the same order, so a view renders them as a list of links. A broader concept's label is its own skos:prefLabel wherever that concept is defined (not necessarily in the same scheme), falling back to the IRI. Labels and definitions prefer an untagged literal but fall back to a language-tagged one, so a concept labelled only in a tagged language still shows a label and never duplicates its row across languages. The status column is a multi-value literal listing the curation states that apply to the winning definition: \"deprecated\" (owl:DeprecatedClass, or owl:deprecated true), \"withdrawn\" (gen:WithdrawnTerm), \"draft\" (npx:DraftNanopub) and \"example\" (npx:ExampleNanopub), in that order. Unlike the sibling queries for OWL classes and terms, this query applies no approval mechanism: every member-published definition is listed. The override_target column is action data rather than content: it carries the row's nanopublication so that a view can offer a per-row in-place re-edit action. The last_modified_by/last_modified columns give the signer and timestamp of the winning definition; the signer name is resolved from the trust repo (/repo/trust) or left blank."; dct:license ; rdfs:label "Get the concepts of a SKOS scheme from space members"; ; """prefix owl: prefix rdfs: prefix dct: prefix np: prefix npa: prefix npx: prefix skos: prefix gen: prefix foaf: select ?concept (strafter(?labelWin, \"|\") as ?concept_label) (strafter(?descWin, \"|\") as ?description) ?broader_concepts_multi_iri ?broader_concepts_label_multi ?status_multi ?last_modified_by (sample(?lmbl) as ?last_modified_by_label) ?last_modified (?np as ?override_target) ?np ?np_label where { { select ?concept (min(?labelRank) as ?labelWin) (min(?descRank) as ?descWin) ?status_multi (sample(?user) as ?last_modified_by) (sample(?date) as ?last_modified) ?np (\"^\" as ?np_label) where { values ?_scheme_multi_iri {} service { select (group_concat(?mpk; separator=\" \") as ?memberPubkeys) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } values ?_scheme_multi_iri {} graph ?stateG { ?_scheme_multi_iri 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 . } } } graph npa:graph { ?np npx:hasNanopubType skos:Concept . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np dct:created ?date . ?np npx:introduces ?concept . ?np np:hasAssertion ?a . optional { ?np npx:signedBy ?user . } } filter(contains(?memberPubkeys, ?pubkey)) graph ?a { ?concept skos:inScheme ?_scheme_multi_iri . optional { ?concept skos:prefLabel ?label . } optional { ?concept skos:definition ?definition . } } bind(concat(if(lang(?label) = \"\", \"1\", \"2\"), \"|\", str(?label)) as ?labelRank) bind(concat(if(lang(?definition) = \"\", \"1\", \"2\"), \"|\", str(?definition)) as ?descRank) bind(replace(concat( if(exists { graph ?a { ?concept a owl:DeprecatedClass } } || exists { graph ?a { ?concept owl:deprecated true } }, \"deprecated\\n\", \"\"), if(exists { graph ?a { ?concept a gen:WithdrawnTerm } }, \"withdrawn\\n\", \"\"), if(exists { graph npa:graph { ?np npx:hasNanopubType npx:DraftNanopub } }, \"draft\\n\", \"\"), if(exists { graph npa:graph { ?np npx:hasNanopubType npx:ExampleNanopub } }, \"example\\n\", \"\") ), \"\\n$\", \"\") as ?status_multi) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType skos:Concept . ?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 . filter not exists { ?np2x npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } ?np2 dct:created ?date2 . ?np2 npx:introduces ?concept . ?np2 np:hasAssertion ?a2 . } filter(contains(?memberPubkeys, ?pubkey2)) graph ?a2 { ?concept skos:inScheme ?_scheme_multi_iri . } filter(?date2 > ?date || (?date2 = ?date && str(?np2) > str(?np))) } } group by ?concept ?status_multi ?np } optional { select ?np ?concept (group_concat(?bIri; separator=\" \") as ?broader_concepts_multi_iri) (group_concat(?bLabel; separator=\"\\n\") as ?broader_concepts_label_multi) where { values ?_scheme_multi_iri {} graph npa:graph { ?np npx:hasNanopubType skos:Concept ; npx:introduces ?concept ; np:hasAssertion ?a . } graph ?a { ?concept skos:inScheme ?_scheme_multi_iri ; skos:broader ?broader . } filter(isIRI(?broader)) optional { select ?broader (min(?bRank) as ?bWin) where { graph npa:graph { ?bnp npx:hasNanopubType skos:Concept ; npx:introduces ?broader ; np:hasAssertion ?ba . } graph ?ba { ?broader skos:prefLabel ?blbl . } bind(concat(if(lang(?blbl) = \"\", \"1\", \"2\"), \"|\", str(?blbl)) as ?bRank) } group by ?broader } bind(str(?broader) as ?bIri) bind(replace(replace(coalesce(strafter(?bWin, \"|\"), str(?broader)), \"\\\\\\\\\", \"\\\\\\\\\\\\\\\\\"), \"[\\r\\n]+\", \"\\\\\\\\n\") as ?bLabel) } group by ?np ?concept } optional { service { select ?last_modified_by ?lmbl where { graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?tg . } graph ?tg { ?last_modified_by foaf:name ?lmbl . } } } } } group by ?concept ?labelWin ?descWin ?broader_concepts_multi_iri ?broader_concepts_label_multi ?status_multi ?last_modified_by ?last_modified ?np ?np_label order by ?concept_label""" . } 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-09-04T05:26:14Z"^^xsd:dateTime; dct:creator orcid:0000-0002-1267-0234; dct:license ; npx:embeds sub:get-concepts-of-a-skos-scheme-from-space-members; rdfs:label "Get the concepts of a SKOS scheme from space members"; prov:wasDerivedFrom ; nt:wasCreatedFromProvenanceTemplate ; nt:wasCreatedFromPubinfoTemplate , , ; nt:wasCreatedFromTemplate . sub:sig npx:hasAlgorithm "RSA"; npx:hasPublicKey "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB"; npx:hasSignature "FXF8BStfytx5HTPt9CRYm1bB+ZAfkdn5J4KU731SjdsV4qIBwrCEBgrjNCXakzcH1muQBL8Hdfzmbthr/GqGkLBseJYKOwRTGM9OfEDvySvhV4IyEmTAR9ZgIN37Q4RxIXzGcCLGdDzPcR6g+Fezk4xdfjXjiAn0KRW2fpkape0="; npx:hasSignatureTarget this:; npx:signedBy orcid:0000-0002-1267-0234 . }