https://w3id.org/np/RAORMCDcAK5I7nJoFN5f0Ccs77k6EHH5kPQGZsEFZo6q8
.trig | .trig.txt | .jelly | .jelly.txt | .jsonld | .jsonld.txt | .nq | .nq.txt | .xml | .xml.txt
@prefix this: <https://w3id.org/np/RAORMCDcAK5I7nJoFN5f0Ccs77k6EHH5kPQGZsEFZo6q8> .
@prefix sub: <https://w3id.org/np/RAORMCDcAK5I7nJoFN5f0Ccs77k6EHH5kPQGZsEFZo6q8/> .
@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:get-projects-linked-to-statement a grlc:grlc-query;
dct:description "Given a statement (an AIDA sentence), this query returns the projects it is linked to, one row per project: either directly, because the statement declares itself relevant for the project via gen:isRelevantFor, or indirectly, because a more specific statement it generalises via hycl:hasMoreGeneralMeaningThan is relevant for the project. The 'direct' column says whether there is a direct link, and the more specific statements through which the project is reached are listed as links. Projects are identified by the last segment of their IRI, which for the ZonMw programme spaces is the grant number. It is meant as a part-level view on a statement page, where the page's context resource is filled into the context parameter automatically; only nanopublications signed by a current admin, maintainer or member of the context space or one of its sub-spaces count, with invalidated, superseded and example nanopublications skipped. The member check is applied after the union of the direct and indirect branches, because a filter inside a union branch cannot see the pubkeys collected outside it.";
dct:license <http://www.apache.org/licenses/LICENSE-2.0>;
rdfs:label "Get the projects linked to a statement";
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 gen: <https://w3id.org/kpxl/gen/terms/>
prefix hycl: <http://purl.org/petapico/o/hycl#>
select ?project ?project_label ?direct ?via_statement_multi_iri ?via_statement_label_multi
where {
{
select ?project (max(?isDirect) as ?directFlag)
(group_concat(distinct str(?via); separator=\"\\n\") as ?via_statement_multi_iri)
(group_concat(distinct ?viaLabel; separator=\"\\n\") as ?via_statement_label_multi)
where {
{
select (group_concat(?mpk; separator=\" \") as ?memberPubkeys) where {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
select ?mpk where {
values ?__context_multi_iri {}
graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . }
graph ?stateG {
?ri a gen:RoleInstantiation ; npa:forSpace ?sp ; npa:forAgent ?agent ; npa:hasRoleType ?roleType .
filter(?roleType in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole))
?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk .
}
# The context is the space itself or a resource it maintains; the space and its
# sub-spaces (IRI extended with a slash) are matched in a filter rather than with
# a zero-length property path, because when the optional context is absent an
# unbound path subject scans the whole state graph and times out, while the
# bound() guard short-circuits to an empty gate.
filter(bound(?__context_multi_iri) && (
?sp = ?__context_multi_iri || strstarts(str(?sp), concat(str(?__context_multi_iri), \"/\"))
|| exists { graph ?stateG { ?__context_multi_iri npa:isMaintainedBy ?mb .
filter(?sp = ?mb || strstarts(str(?sp), concat(str(?mb), \"/\"))) } }))
}
}
}
}
{
graph npa:graph {
?rnp np:hasAssertion ?ra ; npa:hasValidSignatureForPublicKeyHash ?rpk .
filter not exists { ?rInv npx:invalidates ?rnp ; npa:hasValidSignatureForPublicKeyHash ?rpk }
filter not exists { ?rSup npx:supersedes ?rnp }
filter not exists { ?rnp npx:hasNanopubType npx:ExampleNanopub }
}
graph ?ra { ?_statement_iri gen:isRelevantFor ?project . }
bind(1 as ?isDirect)
} union {
graph npa:graph {
?gnp np:hasAssertion ?ga ; npa:hasValidSignatureForPublicKeyHash ?gpk .
filter not exists { ?gInv npx:invalidates ?gnp ; npa:hasValidSignatureForPublicKeyHash ?gpk }
filter not exists { ?gSup npx:supersedes ?gnp }
filter not exists { ?gnp npx:hasNanopubType npx:ExampleNanopub }
}
graph ?ga { ?_statement_iri hycl:hasMoreGeneralMeaningThan ?via . }
graph npa:graph {
?vnp np:hasAssertion ?va ; npa:hasValidSignatureForPublicKeyHash ?vpk .
filter not exists { ?vInv npx:invalidates ?vnp ; npa:hasValidSignatureForPublicKeyHash ?vpk }
filter not exists { ?vSup npx:supersedes ?vnp }
filter not exists { ?vnp npx:hasNanopubType npx:ExampleNanopub }
}
graph ?va { ?via gen:isRelevantFor ?project . }
bind(0 as ?isDirect)
bind(replace(replace(replace(replace(replace(replace(replace(strafter(str(?via), \"http://purl.org/aida/\"), \"[+]\", \" \"), \"%2C\", \",\"), \"%3A\", \":\"), \"%28\", \"(\"), \"%29\", \")\"), \"%2F\", \"/\"), \"%25\", \"%\") as ?viaLabel)
}
# The member gate is joined outside the union: a filter inside a union branch
# only sees the variables bound in that branch, so the pubkeys must be checked here.
filter(coalesce(contains(?memberPubkeys, ?rpk), true))
filter(coalesce(contains(?memberPubkeys, ?gpk), true))
filter(coalesce(contains(?memberPubkeys, ?vpk), true))
}
group by ?project
}
bind(if(?directFlag = 1, \"yes\", \"\") as ?direct)
bind(replace(str(?project), \"^.*/\", \"\") as ?project_label)
}
order by ?project""" .
}
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-11T13:00:09Z"^^xsd:dateTime;
dct:creator orcid:0000-0002-1267-0234;
dct:license <https://creativecommons.org/licenses/by/4.0/>;
npx:embeds sub:get-projects-linked-to-statement;
rdfs:label "Get the projects linked to a statement";
nt:wasCreatedFromProvenanceTemplate <https://w3id.org/np/RA7lSq6MuK_TIC6JMSHvLtee3lpLoZDOqLJCLXevnrPoU>;
nt:wasCreatedFromPubinfoTemplate <https://w3id.org/np/RACJ58Gvyn91LqCKIO9zu1eijDQIeEff28iyDrJgjSJF8>,
<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 "MVm5Ez9dQiNT1ExNVscJ6tKBg9p/HklifK4MKoIqukLsCBLKp5diKaNUo/IZbWBOnRQSBm0HVuFiTdvI53vc7suHfeE0roofttypWJzsuKGe0dY9Bo3sqnNJWtbqa4a+yeP2+aMq6GnuXNLj99KGg+bw6Jz4WqhdEY+I/3czWnE=";
npx:hasSignatureTarget this:;
npx:signedBy orcid:0000-0002-1267-0234 .
}