Nanopublication

< Home

ID

https://w3id.org/np/RAylw5GVAohwMiDZty7dtWtZu94TbrFcfLLtgzJ1wbHX0

Formats

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

Content

@prefix this: <https://w3id.org/np/RAylw5GVAohwMiDZty7dtWtZu94TbrFcfLLtgzJ1wbHX0> .
@prefix sub: <https://w3id.org/np/RAylw5GVAohwMiDZty7dtWtZu94TbrFcfLLtgzJ1wbHX0/> .
@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 980 ', str(((((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) + 48) + (?nppl * 21 + 12) + 34) + (?ninst * 21 + 12) + 20)),
      '\" width=\"980\" height=\"', str(((((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) + 48) + (?nppl * 21 + 12) + 34) + (?ninst * 21 + 12) + 20)), '\" font-family=\"sans-serif\">',
    '<text x=\"490\" y=\"', str(44 - 12), '\" text-anchor=\"middle\" font-size=\"15\" font-weight=\"bold\" fill=\"#333\">Knowledge</text>',
    '<rect x=\"20\" y=\"', str(44), '\" width=\"940\" height=\"', str((?nkno * 21 + 12)),
      '\" rx=\"4\" fill=\"#f0f0f0\" stroke=\"#ccc\"></rect>',
    '<text x=\"34\" y=\"', str(44), '\" font-size=\"14\" fill=\"#111\">', ?lineskno, '</text>',
    '<text x=\"180\" y=\"', str((44 + (?nkno * 21 + 12) + 48) - 12), '\" text-anchor=\"middle\" font-size=\"15\" font-weight=\"bold\" fill=\"#333\">Inputs</text>',
    '<rect x=\"20\" y=\"', str((44 + (?nkno * 21 + 12) + 48)), '\" width=\"320\" height=\"', str(((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12)),
      '\" rx=\"4\" fill=\"#f0f0f0\" stroke=\"#ccc\"></rect>',
    '<text x=\"34\" y=\"', str((44 + (?nkno * 21 + 12) + 48)), '\" font-size=\"14\" fill=\"#111\">', ?linesin, '</text>',
    '<text x=\"505\" y=\"', str((44 + (?nkno * 21 + 12) + 48) - 12), '\" text-anchor=\"middle\" font-size=\"15\" font-weight=\"bold\" fill=\"#333\">Activities</text>',
    '<rect x=\"345\" y=\"', str((44 + (?nkno * 21 + 12) + 48)), '\" width=\"320\" height=\"', str(((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12)),
      '\" rx=\"4\" fill=\"#f0f0f0\" stroke=\"#ccc\"></rect>',
    '<text x=\"359\" y=\"', str((44 + (?nkno * 21 + 12) + 48)), '\" font-size=\"14\" fill=\"#111\">', ?linesact, '</text>',
    '<text x=\"830\" y=\"', str((44 + (?nkno * 21 + 12) + 48) - 12), '\" text-anchor=\"middle\" font-size=\"15\" font-weight=\"bold\" fill=\"#333\">Outputs</text>',
    '<rect x=\"670\" y=\"', str((44 + (?nkno * 21 + 12) + 48)), '\" width=\"290\" height=\"', str(((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12)),
      '\" rx=\"4\" fill=\"#f0f0f0\" stroke=\"#ccc\"></rect>',
    '<text x=\"684\" y=\"', str((44 + (?nkno * 21 + 12) + 48)), '\" font-size=\"14\" fill=\"#111\">', ?linesout, '</text>',
    '<text x=\"490\" y=\"', str(((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) + 48) - 12), '\" text-anchor=\"middle\" font-size=\"15\" font-weight=\"bold\" fill=\"#333\">People</text>',
    '<rect x=\"20\" y=\"', str(((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) + 48)), '\" width=\"940\" height=\"', str((?nppl * 21 + 12)),
      '\" rx=\"4\" fill=\"#f0f0f0\" stroke=\"#ccc\"></rect>',
    '<text x=\"34\" y=\"', str(((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) + 48)), '\" font-size=\"14\" fill=\"#111\">', ?linesppl, '</text>',
    '<text x=\"490\" y=\"', str((((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) + 48) + (?nppl * 21 + 12) + 34) - 12), '\" text-anchor=\"middle\" font-size=\"15\" font-weight=\"bold\" fill=\"#333\">Institutions</text>',
    '<rect x=\"20\" y=\"', str((((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) + 48) + (?nppl * 21 + 12) + 34)), '\" width=\"940\" height=\"', str((?ninst * 21 + 12)),
      '\" rx=\"4\" fill=\"#f0f0f0\" stroke=\"#ccc\"></rect>',
    '<text x=\"34\" y=\"', str((((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) + 48) + (?nppl * 21 + 12) + 34)), '\" font-size=\"14\" fill=\"#111\">', ?linesinst, '</text>',
    '<path d=\"M 345 ', str(((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) / 2)), ' L 329 ', str(((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) / 2) - 7), ' L 329 ', str(((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) / 2) + 7), ' Z\" fill=\"#999\"></path>',
    '<path d=\"M 670 ', str(((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) / 2)), ' L 654 ', str(((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) / 2) - 7), ' L 654 ', str(((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) / 2) + 7), ' Z\" fill=\"#999\"></path>',
    '<path d=\"M 505 ', str((44 + (?nkno * 21 + 12) + 48) - 34), ' L 498 ', str((44 + (?nkno * 21 + 12) + 48) - 20), ' L 512 ', str((44 + (?nkno * 21 + 12) + 48) - 20), ' Z\" fill=\"#999\"></path>',
    '<line x1=\"505\" y1=\"', str((44 + (?nkno * 21 + 12) + 48) - 20), '\" x2=\"505\" y2=\"', str(44 + (?nkno * 21 + 12)), '\" stroke=\"#999\" stroke-width=\"2\"></line>',
    '<line x1=\"505\" y1=\"', str(((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) + 48) - 32), '\" x2=\"505\" y2=\"', str((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12)), '\" stroke=\"#bbb\" stroke-width=\"2\" stroke-dasharray=\"4 3\"></line>',
    '<line x1=\"505\" y1=\"', str((((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) + 48) + (?nppl * 21 + 12) + 34) - 32), '\" x2=\"505\" y2=\"', str(((44 + (?nkno * 21 + 12) + 48) + ((if(?nin > ?nact, if(?nin > ?nout, ?nin, ?nout), if(?nact > ?nout, ?nact, ?nout))) * 21 + 12) + 48) + (?nppl * 21 + 12)), '\" stroke=\"#bbb\" stroke-width=\"2\" stroke-dasharray=\"4 3\"></line>',
    '</svg>') as ?svg) (\"FAIR project summary\" as ?title)
where {
  {
    select (group_concat(distinct ?linekno; separator=\"\") as ?lineskno) (count(*) as ?nkno) where {
      {
        select ?irikno (min(?labelkno) as ?lblkno) (min(?icon0kno) as ?icokno)
            (group_concat(distinct ?typekno; separator=\"/\") as ?typkno) 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 {
        ?nps npa:hasValidSignatureForPublicKeyHash ?pks ;
          np:hasAssertion ?as ;
          np:hasPublicationInfo ?pis .
        filter not exists { ?ixs npx:invalidates ?nps ; npa:hasValidSignatureForPublicKeyHash ?pks . }
        filter not exists { ?sxs npx:supersedes ?nps . }
      }
      filter(contains(?memberPubkeys, ?pks))
      graph ?as {
        ?study a obo:OBI_0000066 ; dct:isPartOf ?_project_multi_iri .
      }
      graph npa:graph {
        ?npkno npa:hasValidSignatureForPublicKeyHash ?pkkno ;
          np:hasAssertion ?akno ;
          np:hasPublicationInfo ?pikno .
        filter not exists { ?ixkno npx:invalidates ?npkno ; npa:hasValidSignatureForPublicKeyHash ?pkkno . }
        filter not exists { ?sxkno npx:supersedes ?npkno . }
      }
      filter(contains(?memberPubkeys, ?pkkno))
      graph ?akno {
        ?irikno a hycl:AIDA-Sentence ; cito:obtainsSupportFrom ?study .
      }
      optional { graph ?pikno { ?npkno rdfs:label ?lpkno } }
      bind(coalesce(?lpkno, \"(finding)\") as ?labelkno)
      bind(\"finding\" as ?typekno)
          bind(\"��\" as ?icon0kno)
        } group by ?irikno
      }
      bind(if(strlen(?lblkno) > 96, concat(substr(?lblkno, 1, 95), \"…\"), ?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>',
        '<tspan x=\"34\" dy=\"21\">', ?icokno, '  ', ?esckno, '</tspan>',
        '<tspan fill=\"#777\"> · ', ?typkno, '</tspan></a>') as ?linekno)
    }
  }
  {
    select (group_concat(distinct ?linein; separator=\"\") as ?linesin) (count(*) as ?nin) where {
      {
        select ?iriin (min(?labelin) as ?lblin) (min(?icon0in) as ?icoin)
            (group_concat(distinct ?typein; separator=\"/\") as ?typin) 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 npa:hasValidSignatureForPublicKeyHash ?pkin ;
          np:hasAssertion ?ain ;
          np:hasPublicationInfo ?piin .
        filter not exists { ?ixin npx:invalidates ?npin ; npa:hasValidSignatureForPublicKeyHash ?pkin . }
        filter not exists { ?sxin npx:supersedes ?npin . }
      }
      filter(contains(?memberPubkeys, ?pkin))
      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(\"dataset\" as ?typein)
          bind(\"��\" as ?icon0in)
        } group by ?iriin
      }
      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>',
        '<tspan x=\"34\" dy=\"21\">', ?icoin, '  ', ?escin, '</tspan>',
        '<tspan fill=\"#777\"> · ', ?typin, '</tspan></a>') as ?linein)
    }
  }
  {
    select (group_concat(distinct ?lineact; separator=\"\") as ?linesact) (count(*) as ?nact) where {
      {
        select ?iriact (min(?labelact) as ?lblact) (min(?icon0act) as ?icoact)
            (group_concat(distinct ?typeact; separator=\"/\") as ?typact) 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 npa:hasValidSignatureForPublicKeyHash ?pkact ;
          np:hasAssertion ?aact ;
          np:hasPublicationInfo ?piact .
        filter not exists { ?ixact npx:invalidates ?npact ; npa:hasValidSignatureForPublicKeyHash ?pkact . }
        filter not exists { ?sxact npx:supersedes ?npact . }
      }
      filter(contains(?memberPubkeys, ?pkact))
      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 ?icon0act)
        } group by ?iriact
      }
      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>',
        '<tspan x=\"359\" dy=\"21\">', ?icoact, '  ', ?escact, '</tspan>',
        '<tspan fill=\"#777\"> · ', ?typact, '</tspan></a>') as ?lineact)
    }
  }
  {
    select (group_concat(distinct ?lineout; separator=\"\") as ?linesout) (count(*) as ?nout) where {
      {
        select ?iriout (min(?labelout) as ?lblout) (min(?icon0out) as ?icoout)
            (group_concat(distinct ?typeout; separator=\"/\") as ?typout) 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 npa:hasValidSignatureForPublicKeyHash ?pkout ;
          np:hasAssertion ?aout ;
          np:hasPublicationInfo ?piout .
        filter not exists { ?ixout npx:invalidates ?npout ; npa:hasValidSignatureForPublicKeyHash ?pkout . }
        filter not exists { ?sxout npx:supersedes ?npout . }
      }
      filter(contains(?memberPubkeys, ?pkout))
      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)
          bind(?iconout as ?icon0out)
        } group by ?iriout
      }
      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>',
        '<tspan x=\"684\" dy=\"21\">', ?icoout, '  ', ?escout, '</tspan>',
        '<tspan fill=\"#777\"> · ', ?typout, '</tspan></a>') as ?lineout)
    }
  }
  {
    select (group_concat(distinct ?lineppl; separator=\"\") as ?linesppl) (count(*) as ?nppl) where {
      {
        select ?irippl (min(?labelppl) as ?lblppl) (min(?icon0ppl) as ?icoppl)
            (group_concat(distinct ?typeppl; separator=\"/\") as ?typppl) 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 npa:hasValidSignatureForPublicKeyHash ?pkppl ;
          np:hasAssertion ?appl ;
          np:hasPublicationInfo ?pippl .
        filter not exists { ?ixppl npx:invalidates ?npppl ; npa:hasValidSignatureForPublicKeyHash ?pkppl . }
        filter not exists { ?sxppl npx:supersedes ?npppl . }
      }
      filter(contains(?memberPubkeys, ?pkppl))
      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, \"lead\", if(?relppl = ff:has-data-steward, \"steward\", \"participant\"))) as ?typeppl)
          bind(\"��\" as ?icon0ppl)
        } group by ?irippl
      }
      bind(if(strlen(?lblppl) > 42, concat(substr(?lblppl, 1, 41), \"…\"), ?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>',
        '<tspan x=\"34\" dy=\"21\">', ?icoppl, '  ', ?escppl, '</tspan>',
        '<tspan fill=\"#777\"> · ', ?typppl, '</tspan></a>') as ?lineppl)
    }
  }
  {
    select (group_concat(distinct ?lineinst; separator=\"\") as ?linesinst) (count(*) as ?ninst) where {
      {
        select ?iriinst (min(?labelinst) as ?lblinst) (min(?icon0inst) as ?icoinst)
            (group_concat(distinct ?typeinst; separator=\"/\") as ?typinst) 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 npa:hasValidSignatureForPublicKeyHash ?pkinst ;
          np:hasAssertion ?ainst ;
          np:hasPublicationInfo ?piinst .
        filter not exists { ?ixinst npx:invalidates ?npinst ; npa:hasValidSignatureForPublicKeyHash ?pkinst . }
        filter not exists { ?sxinst npx:supersedes ?npinst . }
      }
      filter(contains(?memberPubkeys, ?pkinst))
      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\", if(?relinst = ff:has-partner-institution, \"partner\", \"funder\")) as ?typeinst)
          bind(\"��\" as ?icon0inst)
        } group by ?iriinst
      }
      bind(if(strlen(?lblinst) > 52, concat(substr(?lblinst, 1, 51), \"…\"), ?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>',
        '<tspan x=\"34\" dy=\"21\">', ?icoinst, '  ', ?escinst, '</tspan>',
        '<tspan fill=\"#777\"> · ', ?typinst, '</tspan></a>') as ?lineinst)
    }
  }
}""" .
}

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-14T09:30: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/RAB0A48STv6efzv1khghLrvl-hMh88-1hBl6vOMJvzM2I>;
    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 "AfbsHXrIhouiy+S8HS9v0g2k/1UrJcQrgTR/l70niqFWsxVTpgLYmvqdHt1C986mWdxHzaUQSvLv4sEX7PrYZAxtsOfDPoBKAmPdpdE6nG+qSLuu7fMl9xqpQ9KBUGciqYbaAUSKrQYJ+W/4mNWw0QTKEuL1BxV1i9ffE7rPc4I=";
    npx:hasSignatureTarget this:;
    npx:signedBy orcid:0000-0002-1267-0234 .
}