@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-question-info a grlc:grlc-query; dct:description "This query returns the basic information about a single question as a key-value table: the question text, who asked it, when it was asked, the resource the question is anchored to, and the nanopublication the question comes from. Questions are schema:Question nodes carrying their text in rdf:value and their anchor in schema:about, following the Nanoarguments discourse model. The question is described by the most recent non-invalidated nanopublication that types it as a question and gives it a text, so that an overridden question shows its current wording. Rows without a value are left out. Meant for the part page of a question, with the question IRI passed as the 'question' parameter."; dct:license ; rdfs:label "Get the basic information about a question"; grlc:endpoint ; grlc:sparql """prefix rdf: prefix dct: prefix np: prefix npa: prefix npx: prefix prov: prefix foaf: prefix schema: select ?Property_noheader ?Value_noheader ?Value_label where { { select ?np (min(?dateV) as ?date) (min(?textV) as ?text) (min(?askedByV) as ?askedBy) (min(?nameV) as ?askedByName) (min(?aboutV) as ?about) where { values ?_question_multi_iri {} graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pk ; np:hasAssertion ?a ; np:hasProvenance ?prov ; np:hasPublicationInfo ?pi ; dct:created ?dateV . filter not exists { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pk . } } graph ?a { ?_question_multi_iri a schema:Question ; rdf:value ?textV . } # Latest wins: a newer still-valid nanopublication restating the question # (an override of its wording) replaces this one. filter not exists { graph npa:graph { ?np2 npa:hasValidSignatureForPublicKeyHash ?pk2 ; np:hasAssertion ?a2 ; dct:created ?date2 . filter not exists { ?inv2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pk2 . } } graph ?a2 { ?_question_multi_iri a schema:Question ; rdf:value ?text2 . } filter(?date2 > ?dateV) } optional { graph ?a { ?_question_multi_iri schema:about ?aboutV } } optional { graph ?prov { ?a prov:wasAttributedTo ?askedByV } } optional { graph ?pi { ?askedByV foaf:name ?nameV } } } group by ?np } # Every row's value is produced as a string first: RDF4J evaluates both branches of # if(), so an unbound optional reaching str() would leave the whole expression -- and # with it every row -- unbound. bind(coalesce(str(?askedBy), \"\") as ?askedByS) bind(coalesce(str(?about), \"\") as ?aboutS) values (?k ?Property_noheader ?ord) { (\"text\" \"Question:\" 1) (\"by\" \"Asked by:\" 2) (\"date\" \"Asked on:\" 3) (\"about\" \"About:\" 4) (\"np\" \"Nanopublication:\" 5) } bind(if(?k = \"text\", ?text, if(?k = \"by\", ?askedByS, if(?k = \"date\", str(?date), if(?k = \"about\", ?aboutS, str(?np))))) as ?Value_noheader) filter(?Value_noheader != \"\") # An empty label is no label: the agent, the anchor resource and the nanopublication # are then named by Nanodash itself from its own registries. bind(if(?k = \"by\", coalesce(?askedByName, \"\"), if(?k = \"np\", substr(replace(str(?np), \"^.*/np/\", \"\"), 1, 10), \"\")) as ?Value_label) } order by ?ord""" . } 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-10-13T05:24:08Z"^^xsd:dateTime; dct:creator orcid:0000-0002-1267-0234; dct:license ; npx:embeds sub:get-question-info; rdfs:label "Get the basic information about a question"; nt:wasCreatedFromProvenanceTemplate ; nt:wasCreatedFromPubinfoTemplate , ; nt:wasCreatedFromTemplate . sub:sig npx:hasAlgorithm "RSA"; npx:hasPublicKey "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB"; npx:hasSignature "IVyQtc2kH3xA/NFaWH3IdyzzRSOuWqz0kCmqVIYwnNiiBpIHu+ouGBoa4EdX4uisR65BftUMAh5PY7xGvxr7IP25gOz4MMHL44Dm9VnD35Z01yLql47gfZGTDDb7kj8cMgd9QCYvIH9wKwAykaS7OscY24NTE5fGbcPpquRQYLc="; npx:hasSignatureTarget this:; npx:signedBy orcid:0000-0002-1267-0234 . }