. . . . "Returns the whole discussion thread that the given contribution belongs to: its first contribution and all responses at any depth, whichever contribution of the thread is given. A contribution is a schema:Statement or schema:Question with its text in rdf:value, following the Nanoarguments model. It responds to another contribution through as:inReplyTo or a rhetorical CiTO stance (supports, disputes, qualifies, agreesWith, and so on) or na:tests, pointing at the contribution itself or at the nanopublication holding it; citation relations such as cito:citesAsEvidence do not make it a response. One row per contribution, in the columns a thread view reads (reply, relation, in_reply_to, by, date). The relation is the CiTO stance where there is one, else asks for a question, answers for a statement responding to a question, and replies otherwise. A contribution republished under the same IRI shows its latest version by its author: one signed with the key of the nanopublication that minted the IRI, where that nanopublication holds the contribution itself. A nanopublication by anyone else that keeps the IRI, such as an override, is not taken as a new version of it. Retracted and superseded nanopublications and example nanopublications are left out." . . . "Get the discussion thread of a contribution" . . "prefix rdf: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix prov: \nprefix foaf: \nprefix schema: \nprefix schemah: \nprefix as: \nprefix cito: \nprefix na: \n\nselect ?reply ?reply_label ?relation ?in_reply_to ?by ?by_label ?date ?support_stance ?dispute_stance ?np ?np_label\nwhere {\n {\n select ?reply ?np ?a ?prov ?pi ?date\n (max(if(?ctype = schema:Question, 1, 0)) as ?isQuestion)\n (min(str(?p)) as ?parentStr)\n (min(if(?rel = as:inReplyTo, \"~\", str(?rel))) as ?stanceStr)\n (max(if(bound(?pqa), 1, 0)) as ?toQuestion)\n where {\n {\n # the latest valid, non-example version of each contribution\n select ?reply ?onp (max(?created) as ?date) where {\n {\n # the contributions of the thread that the given contribution belongs to\n select distinct ?reply where {\n {\n select distinct ?root where {\n values ?atype { schema:Statement schema:Question }\n graph ?aa { ?_resource_iri a ?atype ; rdf:value ?av . }\n graph npa:graph {\n ?anp np:hasAssertion ?aa ; npa:hasValidSignatureForPublicKeyHash ?apk .\n filter not exists { ?ax npx:invalidates ?anp ; npa:hasValidSignatureForPublicKeyHash ?apk . }\n }\n ?_resource_iri (as:inReplyTo|na:tests|cito:agreesWith|cito:confirms|cito:corrects|cito:critiques|cito:derides|cito:disagreesWith|cito:discusses|cito:disputes|cito:extends|cito:parodies|cito:qualifies|cito:refutes|cito:repliesTo|cito:retracts|cito:reviews|cito:ridicules|cito:speculatesOn|cito:supports|cito:updates|npx:introduces)* ?root .\n filter not exists {\n values ?rrel {\n as:inReplyTo na:tests cito:agreesWith cito:confirms cito:corrects\n cito:critiques cito:derides cito:disagreesWith cito:discusses cito:disputes\n cito:extends cito:parodies cito:qualifies cito:refutes cito:repliesTo\n cito:retracts cito:reviews cito:ridicules cito:speculatesOn cito:supports\n cito:updates\n }\n graph ?ra { ?root ?rrel ?rt . }\n values ?rtt { schema:Statement schema:Question }\n graph ?rta { ?rt a ?rtt ; rdf:value ?rtv . }\n filter(?rt != ?root)\n }\n }\n }\n ?reply (as:inReplyTo|na:tests|cito:agreesWith|cito:confirms|cito:corrects|cito:critiques|cito:derides|cito:disagreesWith|cito:discusses|cito:disputes|cito:extends|cito:parodies|cito:qualifies|cito:refutes|cito:repliesTo|cito:retracts|cito:reviews|cito:ridicules|cito:speculatesOn|cito:supports|cito:updates|npx:introduces)* ?root .\n }\n }\n values ?type { schema:Statement schema:Question }\n graph ?va { ?reply a ?type ; rdf:value ?vv . }\n graph npa:graph {\n ?vnp np:hasAssertion ?va ; np:hasPublicationInfo ?vpi ;\n npa:hasValidSignatureForPublicKeyHash ?vpk ; dct:created ?created .\n filter not exists { ?vx npx:invalidates ?vnp ; npa:hasValidSignatureForPublicKeyHash ?vpk . }\n }\n filter not exists { graph ?vpi { ?vnp npx:hasNanopubType npx:ExampleNanopub . } }\n # only its author's versions count: those signed with the key of the nanopublication\n # whose namespace the contribution's IRI was minted in, if that nanopublication holds\n # the contribution itself. Someone else's nanopublication keeping the IRI (an\n # override) is not a new version of it. Where the minting nanopublication does not\n # hold the contribution (an IRI taken over from a template, say), any version counts.\n bind(iri(replace(str(?reply), \"^(.*RA[A-Za-z0-9_-]{43}).*$\", \"$1\")) as ?onp)\n filter not exists {\n graph npa:graph { ?onp np:hasAssertion ?oa ; npa:hasValidSignatureForPublicKeyHash ?opk . }\n filter(?opk != ?vpk)\n graph ?oa { ?reply a ?otype ; rdf:value ?ov . }\n filter(?otype in (schema:Statement, schema:Question))\n }\n } group by ?reply ?onp\n }\n graph npa:graph {\n ?np dct:created ?date ; np:hasAssertion ?a ; np:hasProvenance ?prov ; np:hasPublicationInfo ?pi ;\n npa:hasValidSignatureForPublicKeyHash ?npk .\n }\n values ?ctype { schema:Statement schema:Question }\n graph ?a { ?reply a ?ctype ; rdf:value ?cv . }\n # the same rule for the version of that date, which someone else's could share\n filter not exists {\n graph npa:graph { ?onp np:hasAssertion ?oa ; npa:hasValidSignatureForPublicKeyHash ?opk . }\n filter(?opk != ?npk)\n graph ?oa { ?reply a ?otype ; rdf:value ?ov . }\n filter(?otype in (schema:Statement, schema:Question))\n }\n # what it responds to: a reply or a CiTO stance toward another contribution\n # (directly, or via the nanopublication that holds it)\n optional {\n values ?rel {\n as:inReplyTo na:tests cito:agreesWith cito:confirms cito:corrects cito:critiques\n cito:derides cito:disagreesWith cito:discusses cito:disputes cito:extends cito:parodies\n cito:qualifies cito:refutes cito:repliesTo cito:retracts cito:reviews cito:ridicules\n cito:speculatesOn cito:supports cito:updates\n }\n graph ?a { ?reply ?rel ?t . }\n optional {\n graph npa:graph { ?t np:hasAssertion ?ta . }\n graph ?ta { ?tn a ?tnt . }\n filter(?tnt in (schema:Statement, schema:Question))\n }\n bind(coalesce(?tn, ?t) as ?p)\n filter(?p != ?reply)\n filter exists {\n values ?ptype { schema:Statement schema:Question }\n graph ?pa { ?p a ?ptype ; rdf:value ?pv . }\n graph npa:graph {\n ?pnp np:hasAssertion ?pa ; npa:hasValidSignatureForPublicKeyHash ?ppk .\n filter not exists { ?px npx:invalidates ?pnp ; npa:hasValidSignatureForPublicKeyHash ?ppk . }\n }\n }\n optional { graph ?pqa { ?p a schema:Question . } }\n }\n } group by ?reply ?np ?a ?prov ?pi ?date\n }\n bind(iri(?parentStr) as ?in_reply_to)\n bind(if(coalesce(?stanceStr, \"~\") != \"~\", ?stanceStr,\n if(?isQuestion = 1, \"asks\",\n if(!bound(?in_reply_to), \"\",\n if(?toQuestion = 1, \"answers\", \"replies\")))) as ?relation)\n optional { graph ?a { ?reply rdf:value ?reply_label . } }\n optional { graph ?prov { ?a prov:wasAttributedTo ?attr . } }\n optional { graph ?pi { ?np dct:creator ?creator . } }\n bind(coalesce(?attr, ?creator) as ?by)\n optional { graph ?pi { ?by foaf:name ?by_label . } }\n bind(cito:supports as ?support_stance)\n bind(cito:disputes as ?dispute_stance)\n bind(\"^\" as ?np_label)\n}\norder by ?date\n" . . "Tobias Kuhn" . "2026-11-23T14:14:46.022+01:00"^^ . . . . . "Get the discussion thread of a contribution" . . . . . . "RSA" . "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB" . "eMY8uSeIKURhD/fCmhVe/IV5cyf5pczIjr/mOcPADKBslPOWscbVevVFd8CImoXOiTlqy3Ac/EDZ/ivfID5fytth+OTto1F/7R8DNpnW68m1GcQ0RN8tWSkN6YeJ4jDESEO7/uveKSupEnlke13ZYaGxJIhvuz6NYMwANX8chvY=" . . .