@prefix this: . @prefix sub: . @prefix np: . @prefix grlc: . @prefix dct: . @prefix nt: . @prefix npx: . @prefix xsd: . @prefix rdfs: . @prefix orcid: . @prefix prov: . @prefix foaf: . sub:Head { this: a np:Nanopublication; np:hasAssertion sub:assertion; np:hasProvenance sub:provenance; np:hasPublicationInfo sub:pubinfo . } sub:assertion { sub:get-thread a grlc:grlc-query; dct:description "Lists the whole thread under a discourse contribution: the replies to it, the replies to those, and so on. as:inReplyTo is followed both to the contribution node and to a whole nanopublication, as both are in use. Reply texts are indented by nesting level, and rows are ordered by thread. Retracted nanopublications are skipped."; dct:license ; rdfs:label "Get the thread under a contribution"; grlc:endpoint ; grlc:sparql """prefix rdf: prefix rdfs: prefix dct: prefix np: prefix npa: prefix npx: prefix prov: prefix foaf: prefix as: select ?level ?reply ?reply_label ?relation ?in_reply_to ?in_reply_to_label ?by ?by_label ?date ?reply_target ?np ?np_label where { { select ?reply ?in_reply_to ?by ?created ?np (count(distinct ?up) as ?level) (min(?upcreated) as ?start) (coalesce(min(?value), min(?label), str(?reply)) as ?text) (coalesce(min(?ptext), str(?in_reply_to)) as ?parenttext) (min(?cito) as ?relation) (coalesce(min(?name), str(?by)) as ?by_label) where { values ?_resource_multi_iri {} graph npa:graph { ?np np:hasAssertion ?a ; np:hasProvenance ?prov ; np:hasPublicationInfo ?pi ; npa:hasValidSignatureForPublicKeyHash ?key ; dct:created ?created . filter not exists { ?x npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?key } } graph ?a { ?reply as:inReplyTo ?target } ?reply (as:inReplyTo|np:hasAssertion|npx:introduces)+ ?_resource_multi_iri . optional { graph npa:graph { ?target np:hasAssertion ?targetassertion } } bind(coalesce(?targetassertion, ?target) as ?in_reply_to) optional { graph ?a { ?reply rdf:value ?value } } optional { graph ?a { ?reply rdfs:label ?label } } optional { graph ?a { ?reply ?citoprop ?target } filter(strstarts(str(?citoprop), \"http://purl.org/spar/cito/\")) bind(strafter(str(?citoprop), \"cito/\") as ?cito) } optional { graph ?prov { ?a prov:wasAttributedTo ?by } } optional { graph ?pi { ?by foaf:name ?name } } optional { graph npa:graph { ?pnp np:hasAssertion ?pa ; npa:hasValidSignatureForPublicKeyHash ?pkey . filter not exists { ?y npx:invalidates ?pnp ; npa:hasValidSignatureForPublicKeyHash ?pkey } } graph ?pa { ?in_reply_to ?ptextprop ?ptext } filter(?ptextprop in (rdf:value, rdfs:label)) } ?reply (as:inReplyTo|np:hasAssertion)* ?up . ?up (as:inReplyTo|np:hasAssertion|npx:introduces)+ ?_resource_multi_iri . graph npa:graph { ?upnp np:hasAssertion ?upa ; dct:created ?upcreated } graph ?upa { ?up as:inReplyTo ?upparent } } group by ?reply ?in_reply_to ?by ?created ?np } bind(concat(substr(\"· · · · · · · \", 1, 2 * (?level - 1)), ?text) as ?reply_label) bind(if(strlen(?parenttext) > 60, concat(substr(?parenttext, 1, 60), \"...\"), ?parenttext) as ?in_reply_to_label) bind(substr(str(?created), 1, 10) as ?date) bind(str(?reply) as ?reply_target) bind(\"^\" as ?np_label) } order by ?start ?created""" . } 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-09-01T12:31:41Z"^^xsd:dateTime; dct:creator orcid:0000-0002-1267-0234; dct:license ; npx:embeds sub:get-thread; rdfs:label "Get the thread under a contribution"; nt:wasCreatedFromProvenanceTemplate ; nt:wasCreatedFromPubinfoTemplate , , ; nt:wasCreatedFromTemplate . sub:sig npx:hasAlgorithm "RSA"; npx:hasPublicKey "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB"; npx:hasSignature "KsxJEqhR30NXrdRRAu4OumpyNSB55abcmuyCRuU2A0Ua6WA8r9nvEQj6YXNlTt9lVs1hxRhJcficHaD7G7KKC6Q4rC1qDKFB+wDer0XNiA51BuF3OUwWL8Q4jW3faZ62Misq33P9vrb+2NgAquQBDfe5YJJ2Us/5I/nTpbRy6Ws="; npx:hasSignatureTarget this:; npx:signedBy orcid:0000-0002-1267-0234 . }