Nanopublication

< Home

ID

https://w3id.org/np/RARnrZa1x82N7NjW5G6-0MpJp_DvLro4bOCE8mzFADvew

Formats

.trig | .trig.txt | .jelly | .jelly.txt | .jsonld | .jsonld.txt | .nq | .nq.txt | .xml | .xml.txt

Content

@prefix this: <https://w3id.org/np/RARnrZa1x82N7NjW5G6-0MpJp_DvLro4bOCE8mzFADvew> .
@prefix sub: <https://w3id.org/np/RARnrZa1x82N7NjW5G6-0MpJp_DvLro4bOCE8mzFADvew/> .
@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-people a grlc:grlc-query;
    dct:description "Returns one row per person involved in the projects of a space: everybody granted a project role (principal investigator, project leader, data steward or participant, the ff:has-* role relations) in the space itself or in any space whose IRI extends it with a slash, the same sub-space convention the sibling 'all projects' views use. Each row gives the person with their name (from the pubinfo of the role nanopublications), the number of projects they are involved in, and the distinct roles they hold across those projects. Rows are ordered by the number of projects, then by name. Institutions, which the previous version of this query listed alongside the people, now have their own view. Only role nanopublications 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.";
    dct:license <http://www.apache.org/licenses/LICENSE-2.0>;
    rdfs:label "Get the people 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/>
prefix foaf: <http://xmlns.com/foaf/0.1/>

select ?person ?person_label ?projects ?roles
where {
  {
    select ?person (min(?name) as ?person_label)
           (count(distinct ?project) as ?projects)
           (group_concat(distinct ?roleLabel; separator=\", \") as ?roles)
    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))
      # People: one role-instantiation nanopub per person and project role.
      graph ?pi { ?np npx:hasNanopubType gen:RoleInstantiation }
      graph ?a { ?project ?relation ?person }
      filter(?relation in (ff:has-principal-investigator, ff:has-project-leader,
                           ff:has-data-steward, ff:has-participant))
      filter(?project = ?_space_multi_iri || strstarts(str(?project), concat(str(?_space_multi_iri), \"/\")))
      optional { graph ?pi { ?person foaf:name|nt:hasLabelFromApi ?name } }
      bind(replace(strafter(str(?relation), \"https://w3id.org/fair/ff/terms/has-\"), \"-\", \" \") as ?roleLabel)
    }
    group by ?person
  }
}
order by desc(?projects) ?person_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:50:30Z"^^xsd:dateTime;
    dct:creator orcid:0000-0002-1267-0234;
    dct:license <https://creativecommons.org/licenses/by/4.0/>;
    npx:embeds sub:get-space-people;
    npx:supersedes <https://w3id.org/np/RAWtow_SBqWNLAVApAfZ3ipoC-VTPdAAFFvt2R-vL3ASg>;
    rdfs:label "Get the people 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 "ftRzN+JKOjetCBbmUhardQchb8m1ggemgDimjB+2fS3Y36eR5vUipoKdsRB+GC/h3pDa38SGnfGBv6RxI/xcTtynYn933PtG5sZTC5cENGl9j0lIdatXNg0W47gqHo5qCwMYMyQIPGgjny30t5pi4UDHohcS4La6V6MHxhDnnQU=";
    npx:hasSignatureTarget this:;
    npx:signedBy orcid:0000-0002-1267-0234 .
}