Nanopublication

< Home

ID

https://w3id.org/np/RASoSJHTqFbstPGUNIdxyUUl-1VUbJY4YfMgVMHbGWM_Y

Formats

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

Content

@prefix this: <https://w3id.org/np/RASoSJHTqFbstPGUNIdxyUUl-1VUbJY4YfMgVMHbGWM_Y> .
@prefix sub: <https://w3id.org/np/RASoSJHTqFbstPGUNIdxyUUl-1VUbJY4YfMgVMHbGWM_Y/> .
@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-project-summary-svg a grlc:grlc-query;
    dct:description "Computes an SVG summary diagram of a FAIR project: the studies and other activities in the middle, the reused datasets that feed them on the left, the outputs they produce on the right, the findings and insights they yield above, and the people and their institutions below. Every box links to the resource it stands for.";
    dct:license <http://www.apache.org/licenses/LICENSE-2.0>;
    rdfs:label "Get project summary diagram as SVG";
    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 dct: <http://purl.org/dc/terms/>
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 ff: <https://w3id.org/fair/ff/terms/>
prefix obo: <http://purl.obolibrary.org/obo/>
prefix hycl: <http://purl.org/petapico/o/hycl#>
prefix cito: <http://purl.org/spar/cito/>
prefix foaf: <http://xmlns.com/foaf/0.1/>
select (concat(
    '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 744 ', str(((((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) + 44) + (floor((?nppl + 2) / 3) * 28 + 14) + 36) + (floor((?ninst + 2) / 3) * 28 + 14) + 12)),
      '\" width=\"', str(744 * 3 / 2), '\" height=\"', str(((((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) + 44) + (floor((?nppl + 2) / 3) * 28 + 14) + 36) + (floor((?ninst + 2) / 3) * 28 + 14) + 12) * 3 / 2), '\" font-family=\"Noto Emoji, Inter, Verdana, Helvetica, sans-serif\">',
    '<text x=\"372\" y=\"', str(26 - 9), '\" text-anchor=\"middle\" font-size=\"11\" font-weight=\"bold\" fill=\"#444\" letter-spacing=\"0.8\">KNOWLEDGE</text>',
    '<rect x=\"32\" y=\"', str(26), '\" width=\"680\" height=\"', str((floor((?nkno + 1) / 2) * 28 + 14)),
      '\" rx=\"4\" fill=\"#f4f4f4\" stroke=\"#888\"></rect>',
    '<g transform=\"translate(44,', str(26 + 6), ')\">', ?boxeskno, '</g>',
    '<text x=\"120\" y=\"', str((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) - 9), '\" text-anchor=\"middle\" font-size=\"11\" font-weight=\"bold\" fill=\"#444\" letter-spacing=\"0.8\">INPUTS</text>',
    '<rect x=\"10\" y=\"', str((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44)), '\" width=\"220\" height=\"', str(((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14)),
      '\" rx=\"4\" fill=\"#f4f4f4\" stroke=\"#888\"></rect>',
    '<g transform=\"translate(22,', str((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + 6), ')\">', ?boxesin, '</g>',
    '<text x=\"372\" y=\"', str((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) - 9), '\" text-anchor=\"middle\" font-size=\"11\" font-weight=\"bold\" fill=\"#444\" letter-spacing=\"0.8\">ACTIVITIES</text>',
    '<rect x=\"262\" y=\"', str((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44)), '\" width=\"220\" height=\"', str(((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14)),
      '\" rx=\"4\" fill=\"#f4f4f4\" stroke=\"#888\"></rect>',
    '<g transform=\"translate(274,', str((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + 6), ')\">', ?boxesact, '</g>',
    '<text x=\"624\" y=\"', str((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) - 9), '\" text-anchor=\"middle\" font-size=\"11\" font-weight=\"bold\" fill=\"#444\" letter-spacing=\"0.8\">OUTPUTS</text>',
    '<rect x=\"514\" y=\"', str((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44)), '\" width=\"220\" height=\"', str(((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14)),
      '\" rx=\"4\" fill=\"#f4f4f4\" stroke=\"#888\"></rect>',
    '<g transform=\"translate(526,', str((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + 6), ')\">', ?boxesout, '</g>',
    '<text x=\"372\" y=\"', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) + 44) - 9), '\" text-anchor=\"middle\" font-size=\"11\" font-weight=\"bold\" fill=\"#444\" letter-spacing=\"0.8\">PEOPLE</text>',
    '<rect x=\"44\" y=\"', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) + 44)), '\" width=\"656\" height=\"', str((floor((?nppl + 2) / 3) * 28 + 14)),
      '\" rx=\"4\" fill=\"#f4f4f4\" stroke=\"#888\"></rect>',
    '<g transform=\"translate(56,', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) + 44) + 6), ')\">', ?boxesppl, '</g>',
    '<text x=\"372\" y=\"', str((((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) + 44) + (floor((?nppl + 2) / 3) * 28 + 14) + 36) - 9), '\" text-anchor=\"middle\" font-size=\"11\" font-weight=\"bold\" fill=\"#444\" letter-spacing=\"0.8\">INSTITUTIONS</text>',
    '<rect x=\"44\" y=\"', str((((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) + 44) + (floor((?nppl + 2) / 3) * 28 + 14) + 36)), '\" width=\"656\" height=\"', str((floor((?ninst + 2) / 3) * 28 + 14)),
      '\" rx=\"4\" fill=\"#f4f4f4\" stroke=\"#888\"></rect>',
    '<g transform=\"translate(56,', str((((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) + 44) + (floor((?nppl + 2) / 3) * 28 + 14) + 36) + 6), ')\">', ?boxesinst, '</g>',
    '<line x1=\"234\" y1=\"', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) / 2)), '\" x2=\"252\" y2=\"', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) / 2)), '\" stroke=\"#666\" stroke-width=\"1.5\"></line>',
    '<path d=\"M 262 ', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) / 2)), ' L 250 ', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) / 2) - 5), ' L 250 ', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) / 2) + 5), ' Z\" fill=\"#666\"></path>',
    '<line x1=\"486\" y1=\"', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) / 2)), '\" x2=\"504\" y2=\"', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) / 2)), '\" stroke=\"#666\" stroke-width=\"1.5\"></line>',
    '<path d=\"M 514 ', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) / 2)), ' L 502 ', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) / 2) - 5), ' L 502 ', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) / 2) + 5), ' Z\" fill=\"#666\"></path>',
    '<line x1=\"372\" y1=\"', str((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) - 22), '\" x2=\"372\" y2=\"', str(26 + (floor((?nkno + 1) / 2) * 28 + 14) + 10), '\" stroke=\"#666\" stroke-width=\"1.5\"></line>',
    '<path d=\"M 372 ', str(26 + (floor((?nkno + 1) / 2) * 28 + 14) + 2), ' L ', str(372 - 5), ' ', str(26 + (floor((?nkno + 1) / 2) * 28 + 14) + 14), ' L ', str(372 + 5), ' ', str(26 + (floor((?nkno + 1) / 2) * 28 + 14) + 14), ' Z\" fill=\"#666\"></path>',
    '<line x1=\"372\" y1=\"', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) + 44) - 22), '\" x2=\"372\" y2=\"', str((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14)), '\" stroke=\"#bbb\" stroke-width=\"1.5\" stroke-dasharray=\"3 3\"></line>',
    '<line x1=\"372\" y1=\"', str((((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) + 44) + (floor((?nppl + 2) / 3) * 28 + 14) + 36) - 22), '\" x2=\"372\" y2=\"', str(((26 + (floor((?nkno + 1) / 2) * 28 + 14) + 44) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 28 + 14) + 44) + (floor((?nppl + 2) / 3) * 28 + 14)), '\" stroke=\"#bbb\" stroke-width=\"1.5\" stroke-dasharray=\"3 3\"></line>',
    '</svg>') as ?svg) (\"FAIR project summary\" as ?title)
where {
  {
    select (group_concat(distinct ?boxkno; separator=\"\") as ?boxeskno) (count(*) as ?nkno) where {
      {
        select ?irikno (min(?labelkno) as ?lblkno) (min(?iconkno) as ?icokno)
            (group_concat(distinct ?typekno; separator=\" / \") as ?typkno)
            (count(distinct ?okno) as ?iykno) where {
          values ?_project_multi_iri {}
      service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
        select (group_concat(?mpk; separator=\" \") as ?memberPubkeys) where {
          graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . }
          values ?_project_multi_iri {}
          graph ?stateG {
            ?_project_multi_iri npa:isMaintainedBy? ?space .
            ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; 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 .
          }
        }
      }
      graph npa:graph {
        ?npskno np:hasAssertion ?askno ;
          npa:hasValidSignatureForPublicKeyHash ?pkskno .
        filter not exists { ?ixskno npx:invalidates ?npskno ; npa:hasValidSignatureForPublicKeyHash ?pkskno . }
        filter not exists { ?sxskno npx:supersedes ?npskno . }
      }
      graph ?askno {
        ?studykno a obo:OBI_0000066 ; dct:isPartOf ?_project_multi_iri .
      }
      graph npa:graph {
        ?npkno np:hasAssertion ?akno ;
          np:hasPublicationInfo ?pikno ;
          npa:hasValidSignatureForPublicKeyHash ?pkkno .
        filter not exists { ?ixkno npx:invalidates ?npkno ; npa:hasValidSignatureForPublicKeyHash ?pkkno . }
        filter not exists { ?sxkno npx:supersedes ?npkno . }
      }
      graph ?akno {
        ?irikno a hycl:AIDA-Sentence ; cito:obtainsSupportFrom ?studykno .
      }
      optional { graph ?pikno { ?npkno rdfs:label ?lpkno } }
      bind(coalesce(?lpkno, \"(finding)\") as ?labelkno)
      bind(\"finding\" as ?typekno)
      bind(\"��\" as ?iconkno)
          filter(contains(?memberPubkeys, ?pkkno))
          optional {
      graph npa:graph {
        ?onpskno np:hasAssertion ?oaskno ;
          npa:hasValidSignatureForPublicKeyHash ?opkskno .
        filter not exists { ?oixskno npx:invalidates ?onpskno ; npa:hasValidSignatureForPublicKeyHash ?opkskno . }
        filter not exists { ?osxskno npx:supersedes ?onpskno . }
      }
      graph ?oaskno {
        ?ostudykno a obo:OBI_0000066 ; dct:isPartOf ?_project_multi_iri .
      }
      graph npa:graph {
        ?onpkno np:hasAssertion ?oakno ;
          np:hasPublicationInfo ?opikno ;
          npa:hasValidSignatureForPublicKeyHash ?opkkno .
        filter not exists { ?oixkno npx:invalidates ?onpkno ; npa:hasValidSignatureForPublicKeyHash ?opkkno . }
        filter not exists { ?osxkno npx:supersedes ?onpkno . }
      }
      graph ?oakno {
        ?okno a hycl:AIDA-Sentence ; cito:obtainsSupportFrom ?ostudykno .
      }
            filter(str(?okno) < str(?irikno) && contains(?memberPubkeys, ?opkkno))
          }
        } group by ?irikno
      }
      bind((?iykno - floor(?iykno / 2) * 2) * 336 as ?bxkno)
      bind(floor(?iykno / 2) * 28 as ?bykno)
      bind(if(strlen(?lblkno) > 52, concat(substr(?lblkno, 1, 51), \"…\"), ?lblkno) as ?tkno)
      bind(replace(replace(replace(?tkno, \"&\", \"&amp;\"), \"<\", \"&lt;\"), \">\", \"&gt;\") as ?esckno)
      bind(replace(replace(replace(?lblkno, \"&\", \"&amp;\"), \"<\", \"&lt;\"), \">\", \"&gt;\") as ?fullkno)
      bind(concat('<a href=\"/part?id=', encode_for_uri(str(?irikno)), '\">',
        '<title>', ?fullkno, '</title>',
        '<text x=\"', str(?bxkno + 160), '\" y=\"', str(?bykno + 12), '\" text-anchor=\"middle\" font-size=\"10\" ',
        'fill=\"#111\">', ?icokno, '  ', ?esckno, '</text>',
        '<text x=\"', str(?bxkno + 160), '\" y=\"', str(?bykno + 22), '\" text-anchor=\"middle\" font-size=\"8\" ',
        'fill=\"#777\">', ?typkno, '</text>',
        '</a>') as ?boxkno)
    }
  }
  {
    select (group_concat(distinct ?boxin; separator=\"\") as ?boxesin) (count(*) as ?nin) where {
      {
        select ?iriin (min(?labelin) as ?lblin) (min(?iconin) as ?icoin)
            (group_concat(distinct ?typein; separator=\" / \") as ?typin)
            (count(distinct ?oin) as ?iyin) where {
          values ?_project_multi_iri {}
      service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
        select (group_concat(?mpk; separator=\" \") as ?memberPubkeys) where {
          graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . }
          values ?_project_multi_iri {}
          graph ?stateG {
            ?_project_multi_iri npa:isMaintainedBy? ?space .
            ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; 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 .
          }
        }
      }
      graph npa:graph {
        ?npin np:hasAssertion ?ain ;
          np:hasPublicationInfo ?piin ;
          npa:hasValidSignatureForPublicKeyHash ?pkin .
        filter not exists { ?ixin npx:invalidates ?npin ; npa:hasValidSignatureForPublicKeyHash ?pkin . }
        filter not exists { ?sxin npx:supersedes ?npin . }
      }
      graph ?ain {
        ?_project_multi_iri ff:reuses ?iriin .
      }
      optional { graph ?ain { ?iriin rdfs:label ?lain } }
      optional { graph ?piin { ?iriin foaf:name ?lfin } }
      optional { graph ?piin { ?iriin rdfs:label ?lqin } }
      bind(coalesce(?lain, ?lfin, ?lqin, replace(str(?iriin), \"^.*[/#]\", \"\")) as ?labelin)
      bind(\"reused dataset\" as ?typein)
      bind(\"��\" as ?iconin)
          filter(contains(?memberPubkeys, ?pkin))
          optional {
      graph npa:graph {
        ?onpin np:hasAssertion ?oain ;
          np:hasPublicationInfo ?opiin ;
          npa:hasValidSignatureForPublicKeyHash ?opkin .
        filter not exists { ?oixin npx:invalidates ?onpin ; npa:hasValidSignatureForPublicKeyHash ?opkin . }
        filter not exists { ?osxin npx:supersedes ?onpin . }
      }
      graph ?oain {
        ?_project_multi_iri ff:reuses ?oin .
      }
            filter(str(?oin) < str(?iriin) && contains(?memberPubkeys, ?opkin))
          }
        } group by ?iriin
      }
      bind((?iyin - floor(?iyin / 1) * 1) * 212 as ?bxin)
      bind(floor(?iyin / 1) * 28 as ?byin)
      bind(if(strlen(?lblin) > 30, concat(substr(?lblin, 1, 29), \"…\"), ?lblin) as ?tin)
      bind(replace(replace(replace(?tin, \"&\", \"&amp;\"), \"<\", \"&lt;\"), \">\", \"&gt;\") as ?escin)
      bind(replace(replace(replace(?lblin, \"&\", \"&amp;\"), \"<\", \"&lt;\"), \">\", \"&gt;\") as ?fullin)
      bind(concat('<a href=\"/part?id=', encode_for_uri(str(?iriin)), '\">',
        '<title>', ?fullin, '</title>',
        '<text x=\"', str(?bxin + 98), '\" y=\"', str(?byin + 12), '\" text-anchor=\"middle\" font-size=\"10\" ',
        'fill=\"#111\">', ?icoin, '  ', ?escin, '</text>',
        '<text x=\"', str(?bxin + 98), '\" y=\"', str(?byin + 22), '\" text-anchor=\"middle\" font-size=\"8\" ',
        'fill=\"#777\">', ?typin, '</text>',
        '</a>') as ?boxin)
    }
  }
  {
    select (group_concat(distinct ?boxact; separator=\"\") as ?boxesact) (count(*) as ?nact) where {
      {
        select ?iriact (min(?labelact) as ?lblact) (min(?iconact) as ?icoact)
            (group_concat(distinct ?typeact; separator=\" / \") as ?typact)
            (count(distinct ?oact) as ?iyact) where {
          values ?_project_multi_iri {}
      service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
        select (group_concat(?mpk; separator=\" \") as ?memberPubkeys) where {
          graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . }
          values ?_project_multi_iri {}
          graph ?stateG {
            ?_project_multi_iri npa:isMaintainedBy? ?space .
            ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; 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 .
          }
        }
      }
      graph npa:graph {
        ?npact np:hasAssertion ?aact ;
          np:hasPublicationInfo ?piact ;
          npa:hasValidSignatureForPublicKeyHash ?pkact .
        filter not exists { ?ixact npx:invalidates ?npact ; npa:hasValidSignatureForPublicKeyHash ?pkact . }
        filter not exists { ?sxact npx:supersedes ?npact . }
      }
      graph ?aact {
        ?iriact a obo:OBI_0000066 ; dct:isPartOf ?_project_multi_iri .
      }
      optional { graph ?aact { ?iriact rdfs:label ?laact } }
      optional {
        graph ?aact {
          ?iriact a ?subact .
          filter(?subact != obo:OBI_0000066 && strstarts(str(?subact), \"http://purl.obolibrary.org/obo/OBI_\"))
        }
        graph ?piact { ?subact rdfs:label ?sublact }
      }
      bind(coalesce(?laact, replace(str(?iriact), \"^.*[/#]\", \"\")) as ?labelact)
      bind(coalesce(replace(?sublact, \" .*\", \"\"), \"study\") as ?typeact)
      bind(\"��\" as ?iconact)
          filter(contains(?memberPubkeys, ?pkact))
          optional {
      graph npa:graph {
        ?onpact np:hasAssertion ?oaact ;
          np:hasPublicationInfo ?opiact ;
          npa:hasValidSignatureForPublicKeyHash ?opkact .
        filter not exists { ?oixact npx:invalidates ?onpact ; npa:hasValidSignatureForPublicKeyHash ?opkact . }
        filter not exists { ?osxact npx:supersedes ?onpact . }
      }
      graph ?oaact {
        ?oact a obo:OBI_0000066 ; dct:isPartOf ?_project_multi_iri .
      }
            filter(str(?oact) < str(?iriact) && contains(?memberPubkeys, ?opkact))
          }
        } group by ?iriact
      }
      bind((?iyact - floor(?iyact / 1) * 1) * 212 as ?bxact)
      bind(floor(?iyact / 1) * 28 as ?byact)
      bind(if(strlen(?lblact) > 30, concat(substr(?lblact, 1, 29), \"…\"), ?lblact) as ?tact)
      bind(replace(replace(replace(?tact, \"&\", \"&amp;\"), \"<\", \"&lt;\"), \">\", \"&gt;\") as ?escact)
      bind(replace(replace(replace(?lblact, \"&\", \"&amp;\"), \"<\", \"&lt;\"), \">\", \"&gt;\") as ?fullact)
      bind(concat('<a href=\"/part?id=', encode_for_uri(str(?iriact)), '\">',
        '<title>', ?fullact, '</title>',
        '<text x=\"', str(?bxact + 98), '\" y=\"', str(?byact + 12), '\" text-anchor=\"middle\" font-size=\"10\" ',
        'fill=\"#111\">', ?icoact, '  ', ?escact, '</text>',
        '<text x=\"', str(?bxact + 98), '\" y=\"', str(?byact + 22), '\" text-anchor=\"middle\" font-size=\"8\" ',
        'fill=\"#777\">', ?typact, '</text>',
        '</a>') as ?boxact)
    }
  }
  {
    select (group_concat(distinct ?boxout; separator=\"\") as ?boxesout) (count(*) as ?nout) where {
      {
        select ?iriout (min(?labelout) as ?lblout) (min(?iconout) as ?icoout)
            (group_concat(distinct ?typeout; separator=\" / \") as ?typout)
            (count(distinct ?oout) as ?iyout) where {
          values ?_project_multi_iri {}
      service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
        select (group_concat(?mpk; separator=\" \") as ?memberPubkeys) where {
          graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . }
          values ?_project_multi_iri {}
          graph ?stateG {
            ?_project_multi_iri npa:isMaintainedBy? ?space .
            ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; 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 .
          }
        }
      }
      graph npa:graph {
        ?npout np:hasAssertion ?aout ;
          np:hasPublicationInfo ?piout ;
          npa:hasValidSignatureForPublicKeyHash ?pkout .
        filter not exists { ?ixout npx:invalidates ?npout ; npa:hasValidSignatureForPublicKeyHash ?pkout . }
        filter not exists { ?sxout npx:supersedes ?npout . }
      }
      graph ?aout {
        ?_project_multi_iri ?relout ?iriout .
        values ?relout { ff:has-article ff:has-dataset ff:has-software ff:has-method ff:has-dmp ff:has-presentation ff:has-blog-post ff:has-media-coverage ff:has-social-post ff:has-podcast ff:has-discussion }
      }
      optional { graph ?aout { ?iriout rdfs:label ?laout } }
      optional { graph ?piout { ?iriout foaf:name ?lfout } }
      optional { graph ?piout { ?iriout rdfs:label ?lqout } }
      bind(coalesce(?laout, ?lfout, ?lqout, replace(str(?iriout), \"^.*[/#]\", \"\")) as ?labelout)
      bind(strafter(str(?relout), \"https://w3id.org/fair/ff/terms/has-\") as ?raw)
      bind(replace(?raw, \"-\", \" \") as ?typeout)
      bind(if(?raw = \"article\", \"��\", if(?raw = \"software\", \"��\", if(?raw = \"dataset\", \"��\", if(?raw = \"presentation\", \"��\", if(?raw = \"blog-post\", \"��\", if(?raw = \"podcast\", \"��\", if(?raw = \"media-coverage\", \"��\", if(?raw = \"social-post\", \"��\", if(?raw = \"discussion\", \"��\", if(?raw = \"method\", \"��\", if(?raw = \"dmp\", \"��\", \"��\"))))))))))) as ?iconout)
          filter(contains(?memberPubkeys, ?pkout))
          optional {
      graph npa:graph {
        ?onpout np:hasAssertion ?oaout ;
          np:hasPublicationInfo ?opiout ;
          npa:hasValidSignatureForPublicKeyHash ?opkout .
        filter not exists { ?oixout npx:invalidates ?onpout ; npa:hasValidSignatureForPublicKeyHash ?opkout . }
        filter not exists { ?osxout npx:supersedes ?onpout . }
      }
      graph ?oaout {
        ?_project_multi_iri ?orelout ?oout .
        values ?orelout { ff:has-article ff:has-dataset ff:has-software ff:has-method ff:has-dmp ff:has-presentation ff:has-blog-post ff:has-media-coverage ff:has-social-post ff:has-podcast ff:has-discussion }
      }
            filter(str(?oout) < str(?iriout) && contains(?memberPubkeys, ?opkout))
          }
        } group by ?iriout
      }
      bind((?iyout - floor(?iyout / 1) * 1) * 212 as ?bxout)
      bind(floor(?iyout / 1) * 28 as ?byout)
      bind(if(strlen(?lblout) > 30, concat(substr(?lblout, 1, 29), \"…\"), ?lblout) as ?tout)
      bind(replace(replace(replace(?tout, \"&\", \"&amp;\"), \"<\", \"&lt;\"), \">\", \"&gt;\") as ?escout)
      bind(replace(replace(replace(?lblout, \"&\", \"&amp;\"), \"<\", \"&lt;\"), \">\", \"&gt;\") as ?fullout)
      bind(concat('<a href=\"/part?id=', encode_for_uri(str(?iriout)), '\">',
        '<title>', ?fullout, '</title>',
        '<text x=\"', str(?bxout + 98), '\" y=\"', str(?byout + 12), '\" text-anchor=\"middle\" font-size=\"10\" ',
        'fill=\"#111\">', ?icoout, '  ', ?escout, '</text>',
        '<text x=\"', str(?bxout + 98), '\" y=\"', str(?byout + 22), '\" text-anchor=\"middle\" font-size=\"8\" ',
        'fill=\"#777\">', ?typout, '</text>',
        '</a>') as ?boxout)
    }
  }
  {
    select (group_concat(distinct ?boxppl; separator=\"\") as ?boxesppl) (count(*) as ?nppl) where {
      {
        select ?irippl (min(?labelppl) as ?lblppl) (min(?iconppl) as ?icoppl)
            (group_concat(distinct ?typeppl; separator=\" / \") as ?typppl)
            (count(distinct ?oppl) as ?iyppl) where {
          values ?_project_multi_iri {}
      service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
        select (group_concat(?mpk; separator=\" \") as ?memberPubkeys) where {
          graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . }
          values ?_project_multi_iri {}
          graph ?stateG {
            ?_project_multi_iri npa:isMaintainedBy? ?space .
            ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; 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 .
          }
        }
      }
      graph npa:graph {
        ?npppl np:hasAssertion ?appl ;
          np:hasPublicationInfo ?pippl ;
          npa:hasValidSignatureForPublicKeyHash ?pkppl .
        filter not exists { ?ixppl npx:invalidates ?npppl ; npa:hasValidSignatureForPublicKeyHash ?pkppl . }
        filter not exists { ?sxppl npx:supersedes ?npppl . }
      }
      graph ?appl {
        ?_project_multi_iri ?relppl ?irippl .
        values ?relppl { ff:has-principal-investigator ff:has-participant ff:has-data-steward gen:hasProjectLead }
      }
      optional { graph ?appl { ?irippl rdfs:label ?lappl } }
      optional { graph ?pippl { ?irippl foaf:name ?lfppl } }
      optional { graph ?pippl { ?irippl rdfs:label ?lqppl } }
      bind(coalesce(?lappl, ?lfppl, ?lqppl, replace(str(?irippl), \"^.*[/#]\", \"\")) as ?labelppl)
      bind(if(?relppl = ff:has-principal-investigator, \"PI\", if(?relppl = gen:hasProjectLead, \"project lead\", if(?relppl = ff:has-data-steward, \"data steward\", \"participant\"))) as ?typeppl)
      bind(\"��\" as ?iconppl)
          filter(contains(?memberPubkeys, ?pkppl))
          optional {
      graph npa:graph {
        ?onpppl np:hasAssertion ?oappl ;
          np:hasPublicationInfo ?opippl ;
          npa:hasValidSignatureForPublicKeyHash ?opkppl .
        filter not exists { ?oixppl npx:invalidates ?onpppl ; npa:hasValidSignatureForPublicKeyHash ?opkppl . }
        filter not exists { ?osxppl npx:supersedes ?onpppl . }
      }
      graph ?oappl {
        ?_project_multi_iri ?orelppl ?oppl .
        values ?orelppl { ff:has-principal-investigator ff:has-participant ff:has-data-steward gen:hasProjectLead }
      }
            filter(str(?oppl) < str(?irippl) && contains(?memberPubkeys, ?opkppl))
          }
        } group by ?irippl
      }
      bind((?iyppl - floor(?iyppl / 3) * 3) * 216 as ?bxppl)
      bind(floor(?iyppl / 3) * 28 as ?byppl)
      bind(if(strlen(?lblppl) > 31, concat(substr(?lblppl, 1, 30), \"…\"), ?lblppl) as ?tppl)
      bind(replace(replace(replace(?tppl, \"&\", \"&amp;\"), \"<\", \"&lt;\"), \">\", \"&gt;\") as ?escppl)
      bind(replace(replace(replace(?lblppl, \"&\", \"&amp;\"), \"<\", \"&lt;\"), \">\", \"&gt;\") as ?fullppl)
      bind(concat('<a href=\"/part?id=', encode_for_uri(str(?irippl)), '\">',
        '<title>', ?fullppl, '</title>',
        '<text x=\"', str(?bxppl + 100), '\" y=\"', str(?byppl + 12), '\" text-anchor=\"middle\" font-size=\"10\" ',
        'fill=\"#111\">', ?icoppl, '  ', ?escppl, '</text>',
        '<text x=\"', str(?bxppl + 100), '\" y=\"', str(?byppl + 22), '\" text-anchor=\"middle\" font-size=\"8\" ',
        'fill=\"#777\">', ?typppl, '</text>',
        '</a>') as ?boxppl)
    }
  }
  {
    select (group_concat(distinct ?boxinst; separator=\"\") as ?boxesinst) (count(*) as ?ninst) where {
      {
        select ?iriinst (min(?labelinst) as ?lblinst) (min(?iconinst) as ?icoinst)
            (group_concat(distinct ?typeinst; separator=\" / \") as ?typinst)
            (count(distinct ?oinst) as ?iyinst) where {
          values ?_project_multi_iri {}
      service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
        select (group_concat(?mpk; separator=\" \") as ?memberPubkeys) where {
          graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . }
          values ?_project_multi_iri {}
          graph ?stateG {
            ?_project_multi_iri npa:isMaintainedBy? ?space .
            ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; 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 .
          }
        }
      }
      graph npa:graph {
        ?npinst np:hasAssertion ?ainst ;
          np:hasPublicationInfo ?piinst ;
          npa:hasValidSignatureForPublicKeyHash ?pkinst .
        filter not exists { ?ixinst npx:invalidates ?npinst ; npa:hasValidSignatureForPublicKeyHash ?pkinst . }
        filter not exists { ?sxinst npx:supersedes ?npinst . }
      }
      graph ?ainst {
        ?_project_multi_iri ?relinst ?iriinst .
        values ?relinst { ff:has-lead-institution ff:has-partner-institution ff:has-funder }
      }
      optional { graph ?ainst { ?iriinst rdfs:label ?lainst } }
      optional { graph ?piinst { ?iriinst foaf:name ?lfinst } }
      optional { graph ?piinst { ?iriinst rdfs:label ?lqinst } }
      bind(coalesce(?lainst, ?lfinst, ?lqinst, replace(str(?iriinst), \"^.*[/#]\", \"\")) as ?labelinst)
      bind(if(?relinst = ff:has-lead-institution, \"lead institution\", if(?relinst = ff:has-partner-institution, \"partner\", \"funder\")) as ?typeinst)
      bind(\"��\" as ?iconinst)
          filter(contains(?memberPubkeys, ?pkinst))
          optional {
      graph npa:graph {
        ?onpinst np:hasAssertion ?oainst ;
          np:hasPublicationInfo ?opiinst ;
          npa:hasValidSignatureForPublicKeyHash ?opkinst .
        filter not exists { ?oixinst npx:invalidates ?onpinst ; npa:hasValidSignatureForPublicKeyHash ?opkinst . }
        filter not exists { ?osxinst npx:supersedes ?onpinst . }
      }
      graph ?oainst {
        ?_project_multi_iri ?orelinst ?oinst .
        values ?orelinst { ff:has-lead-institution ff:has-partner-institution ff:has-funder }
      }
            filter(str(?oinst) < str(?iriinst) && contains(?memberPubkeys, ?opkinst))
          }
        } group by ?iriinst
      }
      bind((?iyinst - floor(?iyinst / 3) * 3) * 216 as ?bxinst)
      bind(floor(?iyinst / 3) * 28 as ?byinst)
      bind(if(strlen(?lblinst) > 31, concat(substr(?lblinst, 1, 30), \"…\"), ?lblinst) as ?tinst)
      bind(replace(replace(replace(?tinst, \"&\", \"&amp;\"), \"<\", \"&lt;\"), \">\", \"&gt;\") as ?escinst)
      bind(replace(replace(replace(?lblinst, \"&\", \"&amp;\"), \"<\", \"&lt;\"), \">\", \"&gt;\") as ?fullinst)
      bind(concat('<a href=\"/part?id=', encode_for_uri(str(?iriinst)), '\">',
        '<title>', ?fullinst, '</title>',
        '<text x=\"', str(?bxinst + 100), '\" y=\"', str(?byinst + 12), '\" text-anchor=\"middle\" font-size=\"10\" ',
        'fill=\"#111\">', ?icoinst, '  ', ?escinst, '</text>',
        '<text x=\"', str(?bxinst + 100), '\" y=\"', str(?byinst + 22), '\" text-anchor=\"middle\" font-size=\"8\" ',
        'fill=\"#777\">', ?typinst, '</text>',
        '</a>') as ?boxinst)
    }
  }
}""" .
}

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-08-14T10:20:00Z"^^xsd:dateTime;
    dct:creator orcid:0000-0002-1267-0234;
    dct:license <https://creativecommons.org/licenses/by/4.0/>;
    npx:embeds sub:get-project-summary-svg;
    npx:supersedes <https://w3id.org/np/RAXpmwP_IYPG8sh_U2WLHc3en2ojjegN2QRAwgNXjh4TU>;
    rdfs:label "Get project summary diagram as SVG";
    nt:wasCreatedFromProvenanceTemplate <http://purl.org/np/RAcm8OurwUk15WOgBM9wySo-T3a5h6as4K8YR5MBrrxUc>;
    nt:wasCreatedFromPubinfoTemplate <https://w3id.org/np/RACJ58Gvyn91LqCKIO9zu1eijDQIeEff28iyDrJgjSJF8>,
      <https://w3id.org/np/RARW4MsFkHuwjycNElvEVtuMjpf4yWDL10-0C5l2MqqRQ>, <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 "U1PxoPumbjHUcHcFav4itOBbRzpvK3Swnc+0rvLwsxa0e/c+FSsPMu8ELx9R6VCsT7OwqyO0a3bZ0HbjYy9uQ3JxahKA/aB68X5mqLDotzVBEou8eQLEEjcXq1U0Kwmq4mOSCj/Mpodz8ykcCLtS30DUXMsESoY342KfvOgUMkE=";
    npx:hasSignatureTarget this:;
    npx:signedBy orcid:0000-0002-1267-0234 .
}