https://w3id.org/np/RA3WTyukTXXay4LVl1HV3EtvP1Mz2shZ-ygZ6QNlKQsRw
.trig | .trig.txt | .jelly | .jelly.txt | .jsonld | .jsonld.txt | .nq | .nq.txt | .xml | .xml.txt
@prefix this: <https://w3id.org/np/RA3WTyukTXXay4LVl1HV3EtvP1Mz2shZ-ygZ6QNlKQsRw> .
@prefix sub: <https://w3id.org/np/RA3WTyukTXXay4LVl1HV3EtvP1Mz2shZ-ygZ6QNlKQsRw/> .
@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-space-institutions a grlc:grlc-query;
dct:description "Returns one row per institution involved in the projects of a space: the institutions declared as lead or partner institution (ff:has-lead-institution, ff:has-partner-institution) in the space definitions of the space itself and of every space whose IRI extends it with a slash, the same sub-space convention the sibling 'all projects' views use. Each row gives the institution with its label (taken from the labels recorded in the pubinfo of the space definitions), the number of projects it is involved in, how many of those it leads and in how many it is a partner, Rows are ordered by the number of projects, then by the number led. Funders are left out, since the funding body is the same for every project of a programme. Only space definitions signed by a current admin, maintainer or member of a space in the subtree count, with invalidated, superseded and example nanopublications skipped; the membership lookup is a federated sub-select sharing no variables with the rest of the query, so it runs once. This version drops the project-links column of the previous version.";
dct:license <http://www.apache.org/licenses/LICENSE-2.0>;
rdfs:label "Get the institutions per space and its sub-spaces, with project counts";
grlc:endpoint <https://w3id.org/np/l/nanopub-query-1.1/repo/full>;
grlc:sparql """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/>
prefix ff: <https://w3id.org/fair/ff/terms/>
select ?institution ?institution_label ?projects ?lead ?partner
where {
{
select ?institution (min(?lbl) as ?institution_label)
(count(distinct ?project) as ?projects)
(count(distinct if(?relation = ff:has-lead-institution, ?project, ?undefined)) as ?lead)
(count(distinct if(?relation = ff:has-partner-institution, ?project, ?undefined)) as ?partner)
where {
values ?_space_multi_iri {}
# One row holding every member pubkey hash of the space and its sub-spaces; a
# sub-select sharing no variables with the rest, so it is evaluated once.
{
select (group_concat(distinct ?mpk; separator=\" \") as ?memberPubkeys) where {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
select ?mpk where {
values ?_space_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 ?rt .
filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole))
?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk .
}
filter(?sp = ?_space_multi_iri || strstarts(str(?sp), concat(str(?_space_multi_iri), \"/\")))
}
}
}
}
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?npPubkey .
filter not exists { ?invNp npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?npPubkey . }
filter not exists { ?supNp npx:supersedes ?np . }
filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }
?np np:hasAssertion ?a .
?np np:hasPublicationInfo ?pi .
}
filter(contains(?memberPubkeys, ?npPubkey))
# Institutions are asserted in each project's own space definition.
graph ?a {
?project a gen:Space .
?project ?relation ?institution .
}
filter(?relation in (ff:has-lead-institution, ff:has-partner-institution))
filter(?project = ?_space_multi_iri || strstarts(str(?project), concat(str(?_space_multi_iri), \"/\")))
optional { graph ?pi { ?institution rdfs:label|nt:hasLabelFromApi ?lbl } }
}
group by ?institution
}
}
order by desc(?projects) desc(?lead) ?institution_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-13T05:18:18Z"^^xsd:dateTime;
dct:creator orcid:0000-0002-1267-0234;
dct:license <https://creativecommons.org/licenses/by/4.0/>;
npx:embeds sub:get-space-institutions;
npx:supersedes <https://w3id.org/np/RArAiBwj9YzUHPF8u9SwleS-ielHNiprbgBidTYG1bxRM>;
rdfs:label "Get the institutions per space and its sub-spaces, with project counts";
nt:wasCreatedFromProvenanceTemplate <https://w3id.org/np/RA7lSq6MuK_TIC6JMSHvLtee3lpLoZDOqLJCLXevnrPoU>;
nt:wasCreatedFromPubinfoTemplate <https://w3id.org/np/RACJ58Gvyn91LqCKIO9zu1eijDQIeEff28iyDrJgjSJF8>,
<https://w3id.org/np/RAoTD7udB2KtUuOuAe74tJi1t3VzK0DyWS7rYVAq1GRvw>, <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 "BWPIs+GqkwcrT6W5wBn5ImGHBz82HlCkiuYUDlFZwboNODbO7YKBuMcE7s6G0tZSRj2+O4ioG2ZiqNhGKfcFjZI0VNzft1CmjtjyouWzHBNiqAtcUT0s2CaaWU+0mr0rdinpm8Qdl+NvC28Exy2B+x2yvSCxd3zVUGu5vaLor+s=";
npx:hasSignatureTarget this:;
npx:signedBy orcid:0000-0002-1267-0234 .
}