Nanopublication

< Home

ID

https://w3id.org/np/RAUm6gSQ7nTb6STnIfIHZa6WcMG0AEdyKv7BfhzaZZFlM

Formats

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

Content

@prefix this: <https://w3id.org/np/RAUm6gSQ7nTb6STnIfIHZa6WcMG0AEdyKv7BfhzaZZFlM> .
@prefix sub: <https://w3id.org/np/RAUm6gSQ7nTb6STnIfIHZa6WcMG0AEdyKv7BfhzaZZFlM/> .
@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-paragraphs a grlc:grlc-query;
    dct:description "The paragraphs about one documentation topic, published by members of the space maintaining the documentation resource (the page's context), newest version of each paragraph only. A paragraph whose newest version marks it as removed (gen:DeactivatedParagraph) is not shown. Shaped for a plain paragraph view with per-paragraph edit and remove actions.";
    dct:license <http://www.apache.org/licenses/LICENSE-2.0>;
    rdfs:label "Get the documentation paragraphs of a topic";
    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/>

# The paragraphs of one documentation topic, gated to the members of the space that
# maintains the documentation resource, with only the newest version of each paragraph.
#
# ?_resource_multi_iri is the topic (the part page's own IRI), filled by the view's
# gen:hasViewQueryTargetField. ?__context_multi_iri is the maintained resource the part
# page belongs to; Nanodash fills a placeholder named 'context' automatically with the
# page's context resource, so the space to gate against never has to be hardcoded.
#
# ?paragraph is the paragraph's own IRI: the paragraph view links each heading to its
# part page under the documentation resource (nanodash issue #701).
select ?paragraph ?title ?content ?date (str(?np) as ?override_target) ?np (\"^\" as ?np_label) where {
  # One row holding every member pubkey hash of the maintaining space, space-separated.
  # A sub-select sharing no variables with the outer query, so it is evaluated once
  # rather than per result row.
  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 .
      }
      # Observers are excluded: that tier can be self-attested and so is no gate at all.
      filter(?roleType in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole))
    }
  }
  graph npa:graph {
    ?np npa:hasValidSignatureForPublicKeyHash ?npPubkey ;
        dct:created ?date ;
        np:hasAssertion ?a .
    filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?npPubkey . }
  }
  # Must sit outside the graph block: ?memberPubkeys is bound by the service above.
  filter(contains(?memberPubkeys, ?npPubkey))
  values ?_resource_multi_iri {}
  graph ?a {
    ?paragraph rdf:type gen:Paragraph ;
      schema:title|schemas:title ?title ;
      gen:hasContent ?content ;
      schema:isPartOf|schemas:isPartOf|schema:about|schemas:about ?_resource_multi_iri .
    optional { ?paragraph gen:hasPositionString ?position }
  }
  # Latest-wins per paragraph: an edit republished by another member keeps the paragraph
  # IRI (override fill mode) and only its newest member-signed version is shown. A removal
  # is a newer version typed gen:DeactivatedParagraph (no title or content), so a removed
  # paragraph has no winning row and disappears; restoring it is just another newer version.
  filter not exists {
    graph npa:graph {
      ?np2 npa:hasValidSignatureForPublicKeyHash ?np2Pubkey ;
           dct:created ?date2 ;
           np:hasAssertion ?a2 .
      filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?np2Pubkey . }
    }
    graph ?a2 { ?paragraph rdf:type ?type2 . }
    values ?type2 { gen:Paragraph gen:DeactivatedParagraph }
    filter(?date2 > ?date)
    filter(contains(?memberPubkeys, ?np2Pubkey))
  }
}
order by ?position ?title""" .
}

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

sub:pubinfo {
  this: dct:created "2026-09-16T15:13:47Z"^^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-paragraphs;
    npx:supersedes <https://w3id.org/np/RAbOBFWFpJ0K7ShUeAW7gfhAJiIC1CHBGdSPkL5T-3mko>;
    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 "YjQblEMQ1nREFqYcZ2rzwB+Ttz9hvWWkfHlcpS1mZlPuwuAVZumsMlGdcTr7eVyLXTcU/Hwn/yl+9ed6b2bH6xsc40IoDTjoGLn8XHfKLMhDFZ7dNyu0M6Q6NEoFf69NKu0awqQzoF53fI90f9S6zcA6a8S2kxgdTiU9IiN51E8zeOFR17NHoiRGOcpqN+nKrgT/+eh9ewZt+gbJaOSAjGOevppkrI4IKNS/9Oi+/EdNKciusBIcQqUWZ3t7MyBdN+j+h6i/r2giZdd/QpFzJq84Iio+ynCq8WEvzlZdr8DKQi/ZIqzPh8EaDC+NOTiVgLqtMVrPIYyBSboXJ3m5CA==";
    npx:hasSignatureTarget this:;
    npx:signedBy <https://w3id.org/np/RAFJKwxgChOLOQ2UduMAT1bYf1VNaWIZYIPmTT3YvJ8y0/docs-bot> .
}