Nanopublication

< Home

ID

https://w3id.org/np/RAGbWrOWNAn3DBiyVWswIMrq2G5ZN2U-fRYcVHI8k7GwY

Formats

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

Content

@prefix this: <https://w3id.org/np/RAGbWrOWNAn3DBiyVWswIMrq2G5ZN2U-fRYcVHI8k7GwY> .
@prefix sub: <https://w3id.org/np/RAGbWrOWNAn3DBiyVWswIMrq2G5ZN2U-fRYcVHI8k7GwY/> .
@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 prov: <http://www.w3.org/ns/prov#> .

sub:Head {
  this: a np:Nanopublication;
    np:hasAssertion sub:assertion;
    np:hasProvenance sub:provenance;
    np:hasPublicationInfo sub:pubinfo .
}

sub:assertion {
  sub:get-docs-paragraph-related a grlc:grlc-query;
    dct:description "Paragraphs linked to one documentation paragraph with rdfs:seeAlso, in either direction, by a member of the maintaining space. Returns the related paragraph (as the paragraph column, so a paragraph view links its heading to that paragraph's page), its current title, and its chapter; the linking nanopublication is the row's source and edit target.";
    dct:license <http://www.apache.org/licenses/LICENSE-2.0>;
    rdfs:label "Get the paragraphs related to a documentation paragraph";
    grlc:endpoint <https://w3id.org/np/l/nanopub-query-1.1/repo/full>;
    grlc:sparql """prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
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 schema: <http://schema.org/>
prefix schemas: <https://schema.org/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>

# Paragraphs related to ONE documentation paragraph, in either direction of rdfs:seeAlso,
# where the link was published by a member of the maintaining space. ?paragraph is the
# related paragraph (so the heading links to its page), ?title its current title, ?content
# names its chapter, ?np is the linking nanopublication (also the edit target).
select ?paragraph ?title ?content ?date (str(?np) as ?override_target) ?np (\"^\" as ?np_label) where {
  {
    select ?paragraph ?np ?date (min(?t) as ?title) (min(?topicLabel) as ?chapterLabel) (min(str(?topic)) as ?chapter) where {
      service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
        select (group_concat(?mpk; separator=\" \") as ?memberPubkeys) where {
          graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }
          values ?__context_multi_iri {}
          graph ?stateG {
            ?__context_multi_iri npa:isMaintainedBy? ?space .
            ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?roleType .
            ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk .
          }
          filter(?roleType in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole))
        }
      }
      values ?_resource_multi_iri {}
      graph npa:graph {
        ?np npa:hasValidSignatureForPublicKeyHash ?k ; dct:created ?date ; np:hasAssertion ?la .
        filter not exists { ?x npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?k . }
      }
      filter(contains(?memberPubkeys, ?k))
      graph ?la {
        { ?_resource_multi_iri rdfs:seeAlso ?paragraph . } union { ?paragraph rdfs:seeAlso ?_resource_multi_iri . }
      }
      filter(?paragraph != ?_resource_multi_iri)
      # the related paragraph's current (newest member-signed) title and chapter
      graph npa:graph {
        ?pnp npa:hasValidSignatureForPublicKeyHash ?pk ; dct:created ?pdate ; np:hasAssertion ?pa .
        filter not exists { ?y npx:invalidates ?pnp ; npa:hasValidSignatureForPublicKeyHash ?pk . }
      }
      filter(contains(?memberPubkeys, ?pk))
      graph ?pa { ?paragraph rdf:type gen:Paragraph ; schema:title|schemas:title ?t ; schema:about|schemas:about|schema:isPartOf|schemas:isPartOf ?topic . }
      filter not exists {
        graph npa:graph { ?pnp2 npa:hasValidSignatureForPublicKeyHash ?pk2 ; dct:created ?pdate2 ; np:hasAssertion ?pa2 .
          filter not exists { ?z npx:invalidates ?pnp2 ; npa:hasValidSignatureForPublicKeyHash ?pk2 . } }
        graph ?pa2 { ?paragraph rdf:type gen:Paragraph . }
        filter(?pdate2 > ?pdate) filter(contains(?memberPubkeys, ?pk2))
      }
      optional { graph ?tg { ?topic rdfs:label ?topicLabel . } }
    } group by ?paragraph ?np ?date
  }
  bind(concat(\"<p>In chapter <a href=\\\"/part?id=\", encode_for_uri(?chapter), \"\\\">\", coalesce(?chapterLabel, ?chapter), \"</a></p>\") as ?content)
}
order by ?title""" .
}

sub:provenance {
  sub:assertion prov:wasAttributedTo <https://w3id.org/np/RAFJKwxgChOLOQ2UduMAT1bYf1VNaWIZYIPmTT3YvJ8y0/docs-bot> .
}

sub:pubinfo {
  this: dct:created "2026-09-15T07:22:07Z"^^xsd:dateTime;
    dct:creator <https://w3id.org/np/RAFJKwxgChOLOQ2UduMAT1bYf1VNaWIZYIPmTT3YvJ8y0/docs-bot>;
    dct:license <https://creativecommons.org/licenses/by/4.0/>;
    npx:embeds sub:get-docs-paragraph-related;
    nt:wasCreatedFromProvenanceTemplate <https://w3id.org/np/RA7lSq6MuK_TIC6JMSHvLtee3lpLoZDOqLJCLXevnrPoU>;
    nt:wasCreatedFromPubinfoTemplate <https://w3id.org/np/RA-N4_kFxcruvBTlo1yJv29E4SLOXsx5KO_th69PprMrA>,
      <https://w3id.org/np/RACJ58Gvyn91LqCKIO9zu1eijDQIeEff28iyDrJgjSJF8>;
    nt:wasCreatedFromTemplate <https://w3id.org/np/RAEFAt-QcFK0ZhqfvlsmS10BnzGJA0xwOICZXkO-ai87k> .
  
  sub:sig npx:hasAlgorithm "RSA";
    npx:hasPublicKey "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl8cMusqtNyKA6UIsi3f7BAcZmHQXWxU0qk0PLsboMWQxYrGBfGgHTgRHJrBRxL+Zn9kJHKVmz2smDcjCBptXi/OwWy80gjsx+Pbe6IWz3zFPWF1UoFIKfPnC0slV67CQgdM853zW7Bmk9/uflCtK4EtZKmPdRGtUHVC7DTVvDBMDzLRGdE2KCBVN29EbM5GGVNvijYbaZQ9OFQPBkQshayqSIyGRr6rreJdkrRVLIzu3uuAjKYydaeXZWSN2JLnVBwrClKUxaEdCwhb5nXpMtKOMD+R+LgaXLeJUWM8BdRSYnta9ZqI5pHY4y3v+eW7J+HHeTvRbHvlik+Z4hFUXmQIDAQAB";
    npx:hasSignature "Oob4yBFYf8MWViWkQilfeZHIgG2IwYQAGSaodrHqRs7v9QgnuseKldq7wHVk6MUyTHnacJPusHBu/wHT9Rxfxlf2/LvPZZnT7ihE9DfTuQTXujrRKB26pdaE/04e2U4y0tB2RuI9klom3pRumqvuN6KQ8MxaKqrEfwl15u6bNyi5MNDs9IpdtSga89aCjdMSrQgvwUFJTLwEO6WBOYmk0cwXz/qD1i4c3wGrcDsVxSMGLyMBvM/izE7/403bVl/PIorNL6AkL8BxrWMGwJYiPumFgbfCLGDWpSBqbFvhUw879QWt79zbS1haCqzgQHW237R+GtV3g7U17C9G3shXNw==";
    npx:hasSignatureTarget this:;
    npx:signedBy <https://w3id.org/np/RAFJKwxgChOLOQ2UduMAT1bYf1VNaWIZYIPmTT3YvJ8y0/docs-bot> .
}