@prefix this: . @prefix sub: . @prefix np: . @prefix grlc: . @prefix dct: . @prefix nt: . @prefix npx: . @prefix xsd: . @prefix rdfs: . @prefix 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 each related paragraph with its current title as label, the chapter it belongs to with the title declared for this documentation, and the linking nanopublication as source and edit target."; dct:license ; rdfs:label "Get the paragraphs related to a documentation paragraph"; grlc:endpoint ; grlc:sparql """prefix rdf: prefix rdfs: prefix dct: prefix np: prefix npa: prefix npx: prefix schema: prefix schemas: prefix gen: # Paragraphs related to ONE documentation paragraph, in either direction of rdfs:seeAlso, # where the link was published by a member of the maintaining space. ?related is the related # paragraph with its current title as label, ?chapter the chapter it belongs to with the title # declared for this documentation, ?np the linking nanopublication (also the edit target). select ?related ?related_label ?chapter ?chapter_label ?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 ?chapterStr) where { service { 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)) } # the chapter's title as declared for THIS documentation, not any label the anchor IRI has elsewhere values ?__context_multi_iri {} optional { graph ?tg { ?topic rdfs:label ?topicLabel ; gen:isRelevantFor ?__context_multi_iri . } } } group by ?paragraph ?np ?date } bind(?paragraph as ?related) bind(?title as ?related_label) bind(iri(?chapterStr) as ?chapter) bind(coalesce(?chapterLabel, ?chapterStr) as ?chapter_label) } order by ?related_label""" . } sub:provenance { sub:assertion prov:wasAttributedTo . } sub:pubinfo { this: dct:created "2026-09-15T09:48:09Z"^^xsd:dateTime; dct:creator ; dct:license ; npx:embeds sub:get-docs-paragraph-related; npx:supersedes ; nt:wasCreatedFromProvenanceTemplate ; nt:wasCreatedFromPubinfoTemplate , , ; nt:wasCreatedFromTemplate . sub:sig npx:hasAlgorithm "RSA"; npx:hasPublicKey "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl8cMusqtNyKA6UIsi3f7BAcZmHQXWxU0qk0PLsboMWQxYrGBfGgHTgRHJrBRxL+Zn9kJHKVmz2smDcjCBptXi/OwWy80gjsx+Pbe6IWz3zFPWF1UoFIKfPnC0slV67CQgdM853zW7Bmk9/uflCtK4EtZKmPdRGtUHVC7DTVvDBMDzLRGdE2KCBVN29EbM5GGVNvijYbaZQ9OFQPBkQshayqSIyGRr6rreJdkrRVLIzu3uuAjKYydaeXZWSN2JLnVBwrClKUxaEdCwhb5nXpMtKOMD+R+LgaXLeJUWM8BdRSYnta9ZqI5pHY4y3v+eW7J+HHeTvRbHvlik+Z4hFUXmQIDAQAB"; npx:hasSignature "c4HVXdQiejqrsb4SCvfTChO3A/TpMI6M+PDvjYqdlNQesf6g+1uwfC3DfNWW5xnhRPiYDm4G9pGhhbrcH4t4qx/NQSxyh90H9IgYWNvSxLr2H5Jk4oWZDw1+n6V80+vWpa5WX4N+jIuK1VKlK2xCX4OqK8ivs5auFmaJN2v6fBNvJDmyjeRcDr0H7Tjf/3HZNwrfQHUf6wzBMfFvvjcsHBv7nLgC1Dh2CcL+dN/2NIITRJ0MpY/+OrHZ6Nlo5y58RS8ALIidEsjqLAXVXG8X1ysIg2Wev1OgAvrLfoOLv46Pu6i2QTg063I9Ul0gWZupxhuNiUZXKC094WrLTFtZbw=="; npx:hasSignatureTarget this:; npx:signedBy . }