https://w3id.org/np/RAACDhEU3OF8BF52aaHDMfs-djySEp_i-yv1Yb5We6zxc
.trig | .trig.txt | .jelly | .jelly.txt | .jsonld | .jsonld.txt | .nq | .nq.txt | .xml | .xml.txt
@prefix this: <https://w3id.org/np/RAACDhEU3OF8BF52aaHDMfs-djySEp_i-yv1Yb5We6zxc> .
@prefix sub: <https://w3id.org/np/RAACDhEU3OF8BF52aaHDMfs-djySEp_i-yv1Yb5We6zxc/> .
@prefix np: <http://www.nanopub.org/nschema#> .
@prefix grlc: <https://w3id.org/kpxl/grlc/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix nt: <https://w3id.org/np/o/ntemplate/> .
@prefix npx: <http://purl.org/nanopub/x/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix orcid: <https://orcid.org/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
sub:Head {
this: a np:Nanopublication;
np:hasAssertion sub:assertion;
np:hasProvenance sub:provenance;
np:hasPublicationInfo sub:pubinfo .
}
sub:assertion {
sub:list-maintained-resources-pending-approval a grlc:grlc-query;
dct:description "Lists the definitions (views, templates and the like) whose versions say they are governed by the given space (space) but whose kind the space does not maintain yet, so their gen:governedBy has no effect. One row per kind: its newest version declaring gen:governedBy <space>, embedded in a nanopublication signed by a current admin, maintainer or member of the space and not invalidated by its own key. Left out are kinds the space already maintains (npa:isMaintainedBy in the current space state), kinds that were re-minted (the nanopublication minting the kind supersedes a version of another kind), and versions whose latest verdict by an admin of the space is npx:disapprovesOf (a later npx:approvesOf by an admin brings them back). Hidden columns pre-fill the admin actions: approve_* for declaring the kind a maintained resource of the space, disapprove_target and disapproval_choice for disapproving of the version. Hosted on the full repo; the space state comes from the spaces repo in one single-row federated call.";
dct:license <http://www.apache.org/licenses/LICENSE-2.0>;
rdfs:label "List maintained resources pending approval";
grlc:endpoint <https://w3id.org/np/l/nanopub-query-1.1/repo/full>;
grlc:sparql """prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix dct: <http://purl.org/dc/terms/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
select ?definition (sample(?dlabel) as ?definition_label) (min(?dtype) as ?type) ?proposed_by ?date ?np ('^' as ?np_label)
(str(?kind) as ?approve_resource) (sample(?klabel) as ?approve_label) (sample(?kdesc) as ?approve_description)
(sample(?atype) as ?approve_type) (str(?np) as ?disapprove_target) (str(npx:disapprovesOf) as ?disapproval_choice)
where {
# The space's current state in one row: the keys of its admins, of all its admins, maintainers
# and members, and the resources it already maintains. One federated call for the whole query.
{
select (sample(?mk) as ?memberKeys) (sample(?ak) as ?adminKeys) (sample(?mr) as ?maintained) where {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
select (group_concat(distinct ?pk; separator=' ') as ?mk)
(group_concat(distinct ?apk; separator=' ') as ?ak)
(group_concat(distinct str(?r); separator=' ') as ?mr) where {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }
graph ?g {
{ ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_iri ; npa:hasRoleType ?tier ; npa:forAgent ?agent .
filter(?tier in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole))
?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?pk . }
union
{ ?ria a gen:RoleInstantiation ; npa:forSpace ?_space_iri ; npa:hasRoleType gen:AdminRole ; npa:forAgent ?admin .
?aacct a npa:AccountState ; npa:agent ?admin ; npa:pubkey ?apk . }
union
{ ?r npa:isMaintainedBy ?_space_iri . }
}
}
}
}
}
# Versions naming this space as governing, signed by one of its members, not invalidated,
# whose kind the space does not maintain yet.
graph ?a { ?definition gen:governedBy ?_space_iri ; dct:isVersionOf ?kind . }
graph npa:graph {
?np np:hasAssertion ?a ; npx:embeds ?definition ; dct:created ?date ;
npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
}
filter(contains(?memberKeys, ?pubkey))
filter(!contains(concat(' ', ?maintained, ' '), concat(' ', str(?kind), ' ')))
# Only the newest such version of each kind.
optional {
graph ?a2 { ?d2 gen:governedBy ?_space_iri ; dct:isVersionOf ?kind . }
graph npa:graph {
?np2 np:hasAssertion ?a2 ; npx:embeds ?d2 ; dct:created ?date2 ;
npa:hasValidSignatureForPublicKeyHash ?pubkey2 .
filter not exists { ?inv2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }
}
filter(contains(?memberKeys, ?pubkey2) && concat(str(?date2), '>', str(?np2)) > concat(str(?date), '>', str(?np)))
}
filter(!bound(?np2))
# Not a re-minted kind: the nanopublication minting it must not supersede a version of another kind.
optional {
graph npa:graph { ?kn npx:introduces ?kind . }
filter(strstarts(str(?kind), concat(str(?kn), '/')))
graph npa:networkGraph { ?kn npx:supersedes ?old . }
graph npa:graph { ?old np:hasAssertion ?oa . }
graph ?oa { ?ov dct:isVersionOf ?oldKind . }
filter(?oldKind != ?kind)
}
filter(!bound(?oldKind))
# Admin verdicts on this version, for the latest one to decide below: a version whose latest
# admin verdict is a disapproval drops out.
optional {
values ?vpred { npx:approvesOf npx:disapprovesOf }
graph ?va { ?vagent ?vpred ?np . }
graph npa:graph {
?vnp np:hasAssertion ?va ; dct:created ?vdate ; npa:hasValidSignatureForPublicKeyHash ?vpk .
filter not exists { ?vinv npx:invalidates ?vnp ; npa:hasValidSignatureForPublicKeyHash ?vpk . }
}
filter(contains(?adminKeys, ?vpk))
bind(concat(str(?vdate), '>', if(?vpred = npx:disapprovesOf, 'd', 'a')) as ?verdict)
}
# What the rows show, and what the actions pre-fill.
optional { graph npa:graph { ?np npx:signedBy ?proposed_by . } }
optional { graph ?a { ?definition dct:title ?title . } }
optional { graph ?a { ?definition rdfs:label ?label . } }
optional { graph ?a { ?definition dct:description ?description . } }
optional { graph ?a { ?definition a ?rdftype . filter(?rdftype in (gen:ResourceView, nt:AssertionTemplate, nt:ProvenanceTemplate, nt:PubinfoTemplate, gen:Preset)) } }
optional { graph ?a { ?definition a ?atype . filter(?atype = nt:AssertionTemplate) } }
bind(coalesce(if(?rdftype = gen:ResourceView, 'view', if(?rdftype = nt:AssertionTemplate, 'assertion template',
if(?rdftype = nt:ProvenanceTemplate, 'provenance template', if(?rdftype = nt:PubinfoTemplate, 'pubinfo template',
if(?rdftype = gen:Preset, 'preset', 'definition'))))), 'definition') as ?dtype)
bind(coalesce(?title, ?label, str(?definition)) as ?dlabel)
bind(coalesce(?label, ?title, str(?kind)) as ?baseLabel)
bind(if(?dtype = 'view', concat(str(?baseLabel), ' kind'), concat(str(?baseLabel), ' (', ?dtype, ' kind)')) as ?klabel)
bind(coalesce(?description, concat('The kind of the ', ?dtype, ' «', str(?dlabel), '», maintained by this space so that any of its members can publish the next version.')) as ?kdesc)
}
group by ?definition ?kind ?proposed_by ?date ?np
having (coalesce(!strends(max(?verdict), 'd'), true))
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-09-24T12:58:00Z"^^xsd:dateTime;
dct:creator orcid:0000-0002-1267-0234;
dct:license <https://creativecommons.org/licenses/by/4.0/>;
npx:embeds sub:list-maintained-resources-pending-approval;
rdfs:label "List maintained resources pending approval";
nt:wasCreatedFromProvenanceTemplate <https://w3id.org/np/RA7lSq6MuK_TIC6JMSHvLtee3lpLoZDOqLJCLXevnrPoU>;
nt:wasCreatedFromPubinfoTemplate <https://w3id.org/np/RA0J4vUn_dekg-U1kK3AOEt02p9mT2WO03uGxLDec1jLw>,
<https://w3id.org/np/RAukAcWHRDlkqxk7H2XNSegc1WnHI569INvNr-xdptDGI>;
nt:wasCreatedFromTemplate <https://w3id.org/np/RAEFAt-QcFK0ZhqfvlsmS10BnzGJA0xwOICZXkO-ai87k> .
sub:sig npx:hasAlgorithm "RSA";
npx:hasPublicKey "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB";
npx:hasSignature "TRSnQZsw0gynlU1hfYmVc8EUtexTQ7bRK95E6GAlCE2fA15ycR0PZtGZcS++7q090oibexADZnXQ22SLLY7NSUr4JynxERXbOZ4J37UQLRYBvKCSLxh/jUof0d/X4Utddhx4/+aAnthT61BY02HWU1UAJN3fQWJ4OLATojW78io=";
npx:hasSignatureTarget this:;
npx:signedBy orcid:0000-0002-1267-0234 .
}