rows { options { physical_type: PHYSICAL_STREAM_TYPE_QUADS max_name_table_size: 128 max_prefix_table_size: 16 max_datatype_table_size: 16 logical_type: LOGICAL_STREAM_TYPE_DATASETS version: 2 } } rows { prefix { value: "https://w3id.org/np/" } } rows { name { value: "RAn6xOVHbJF96HHRnccpC5YGilfSVYtxv9zNkuoNlTuuQ" } } rows { namespace { name: "this" value { prefix_id: 1 } } } rows { prefix { value: "https://w3id.org/np/RAn6xOVHbJF96HHRnccpC5YGilfSVYtxv9zNkuoNlTuuQ/" } } rows { name { } } rows { namespace { name: "sub" value { prefix_id: 2 } } } rows { prefix { value: "http://www.nanopub.org/nschema#" } } rows { namespace { name: "np" value { prefix_id: 3 name_id: 2 } } } rows { prefix { value: "https://w3id.org/kpxl/grlc/" } } rows { namespace { name: "grlc" value { prefix_id: 4 name_id: 2 } } } rows { prefix { value: "http://purl.org/dc/terms/" } } rows { namespace { name: "dct" value { prefix_id: 5 name_id: 2 } } } rows { prefix { value: "https://w3id.org/np/o/ntemplate/" } } rows { namespace { name: "nt" value { prefix_id: 6 name_id: 2 } } } rows { prefix { value: "http://purl.org/nanopub/x/" } } rows { namespace { name: "npx" value { prefix_id: 7 name_id: 2 } } } rows { prefix { value: "http://www.w3.org/2001/XMLSchema#" } } rows { namespace { name: "xsd" value { prefix_id: 8 name_id: 2 } } } rows { prefix { value: "http://www.w3.org/2000/01/rdf-schema#" } } rows { namespace { name: "rdfs" value { prefix_id: 9 name_id: 2 } } } rows { prefix { value: "https://orcid.org/" } } rows { namespace { name: "orcid" value { prefix_id: 10 name_id: 2 } } } rows { prefix { value: "http://www.w3.org/ns/prov#" } } rows { namespace { name: "prov" value { prefix_id: 11 name_id: 2 } } } rows { prefix { value: "http://xmlns.com/foaf/0.1/" } } rows { namespace { name: "foaf" value { prefix_id: 12 name_id: 2 } } } rows { name { value: "hasAssertion" } } rows { name { value: "assertion" } } rows { name { value: "Head" } } rows { quad { s_iri { prefix_id: 1 name_id: 1 } p_iri { prefix_id: 3 name_id: 3 } o_iri { prefix_id: 2 } g_iri { } } } rows { name { value: "hasProvenance" } } rows { name { value: "provenance" } } rows { quad { p_iri { prefix_id: 3 } o_iri { prefix_id: 2 } } } rows { name { value: "hasPublicationInfo" } } rows { name { value: "pubinfo" } } rows { quad { p_iri { prefix_id: 3 } o_iri { prefix_id: 2 } } } rows { prefix { value: "http://www.w3.org/1999/02/22-rdf-syntax-ns#" } } rows { name { value: "type" } } rows { name { value: "Nanopublication" } } rows { quad { p_iri { prefix_id: 13 } o_iri { prefix_id: 3 } } } rows { name { value: "get-thread-of-contribution" } } rows { name { value: "description" } } rows { quad { s_iri { prefix_id: 2 } p_iri { prefix_id: 5 } o_literal { lex: "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." } g_iri { prefix_id: 2 name_id: 4 } } } rows { name { value: "license" } } rows { prefix { value: "http://www.apache.org/licenses/" } } rows { name { value: "LICENSE-2.0" } } rows { quad { p_iri { prefix_id: 5 name_id: 14 } o_iri { prefix_id: 14 } } } rows { name { value: "grlc-query" } } rows { quad { p_iri { prefix_id: 13 name_id: 10 } o_iri { prefix_id: 4 name_id: 16 } } } rows { name { value: "label" } } rows { quad { p_iri { prefix_id: 9 } o_literal { lex: "Get the discussion thread of a contribution" } } } rows { name { value: "endpoint" } } rows { prefix { value: "https://w3id.org/np/l/nanopub-query-1.1/repo/" } } rows { name { value: "full" } } rows { quad { p_iri { prefix_id: 4 } o_iri { prefix_id: 15 } } } rows { name { value: "sparql" } } rows { quad { p_iri { prefix_id: 4 } o_literal { lex: "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" } } } rows { name { value: "wasAttributedTo" } } rows { name { value: "0000-0002-1267-0234" } } rows { quad { s_iri { prefix_id: 2 name_id: 4 } p_iri { prefix_id: 11 name_id: 21 } o_iri { prefix_id: 10 } g_iri { prefix_id: 2 name_id: 7 } } } rows { name { value: "name" } } rows { quad { s_iri { prefix_id: 10 name_id: 22 } p_iri { prefix_id: 12 } o_literal { lex: "Tobias Kuhn" } g_iri { prefix_id: 2 name_id: 9 } } } rows { name { value: "created" } } rows { datatype { value: "http://www.w3.org/2001/XMLSchema#dateTime" } } rows { quad { s_iri { prefix_id: 1 name_id: 1 } p_iri { prefix_id: 5 name_id: 24 } o_literal { lex: "2026-11-23T14:14:46.022+01:00" datatype: 1 } } } rows { name { value: "creator" } } rows { quad { p_iri { } o_iri { prefix_id: 10 name_id: 22 } } } rows { prefix { value: "https://creativecommons.org/licenses/by/4.0/" } } rows { quad { p_iri { prefix_id: 5 name_id: 14 } o_iri { prefix_id: 16 name_id: 2 } } } rows { name { value: "embeds" } } rows { quad { p_iri { prefix_id: 7 name_id: 26 } o_iri { prefix_id: 2 name_id: 12 } } } rows { name { value: "supersedes" } } rows { name { value: "RAFwMxXlqnv0enr10THFc5O399xjQuH9BEJzaCQo9susQ" } } rows { quad { p_iri { prefix_id: 7 name_id: 27 } o_iri { prefix_id: 1 } } } rows { quad { p_iri { prefix_id: 9 name_id: 17 } o_literal { lex: "Get the discussion thread of a contribution" } } } rows { name { value: "wasCreatedFromProvenanceTemplate" } } rows { name { value: "RA7lSq6MuK_TIC6JMSHvLtee3lpLoZDOqLJCLXevnrPoU" } } rows { quad { p_iri { prefix_id: 6 name_id: 29 } o_iri { prefix_id: 1 } } } rows { name { value: "wasCreatedFromPubinfoTemplate" } } rows { name { value: "RACJ58Gvyn91LqCKIO9zu1eijDQIeEff28iyDrJgjSJF8" } } rows { quad { p_iri { prefix_id: 6 } o_iri { prefix_id: 1 } } } rows { name { value: "RAoTD7udB2KtUuOuAe74tJi1t3VzK0DyWS7rYVAq1GRvw" } } rows { quad { o_iri { } } } rows { name { value: "RAukAcWHRDlkqxk7H2XNSegc1WnHI569INvNr-xdptDGI" } } rows { quad { o_iri { } } } rows { name { value: "wasCreatedFromTemplate" } } rows { name { value: "RAEFAt-QcFK0ZhqfvlsmS10BnzGJA0xwOICZXkO-ai87k" } } rows { quad { p_iri { prefix_id: 6 } o_iri { prefix_id: 1 } } } rows { name { value: "sig" } } rows { name { value: "hasAlgorithm" } } rows { quad { s_iri { prefix_id: 2 } p_iri { prefix_id: 7 } o_literal { lex: "RSA" } } } rows { name { value: "hasPublicKey" } } rows { quad { p_iri { } o_literal { lex: "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB" } } } rows { name { value: "hasSignature" } } rows { quad { p_iri { } o_literal { lex: "eMY8uSeIKURhD/fCmhVe/IV5cyf5pczIjr/mOcPADKBslPOWscbVevVFd8CImoXOiTlqy3Ac/EDZ/ivfID5fytth+OTto1F/7R8DNpnW68m1GcQ0RN8tWSkN6YeJ4jDESEO7/uveKSupEnlke13ZYaGxJIhvuz6NYMwANX8chvY=" } } } rows { name { value: "hasSignatureTarget" } } rows { quad { p_iri { } o_iri { prefix_id: 1 name_id: 1 } } } rows { name { value: "signedBy" } } rows { quad { p_iri { prefix_id: 7 name_id: 42 } o_iri { prefix_id: 10 name_id: 22 } } }