Get questions and answers about a resource
type: Nanopublication
has assertion: assertion
has provenance: provenance
has publication info: pubinfo
created: 2026-08-17T13:46:50Z
creator: https://orcid.org/0000-0002-1267-0234
license: https://creativecommons.org/licenses/by/4.0/
embeds: Get questions and answers about a resource

Get questions and answers about a resource
type: grlc-query
description: This query returns the questions asked about a resource (a space, a maintained resource, or any other entity, including part-level resources), together with who asked them and when, and their answers and other follow-up contributions. Questions are schema:Question nodes anchored to the resource via schema:about, following the Nanoarguments discourse model; answers are discourse contributions (schema:Statement) targeting the question via as:inReplyTo. Each answer is identified by its own nanopublication rather than by its statement node, so that several answers remain distinct even when the template they were created from reuses one statement IRI. Answers published by an admin, maintainer, or member of the space that maintains the resource are marked with a check mark; the maintaining space and its validated member public-key hashes are resolved server-side from the spaces repo (/repo/spaces). Retracted nanopublications and example nanopublications are excluded.
license: LICENSE-2.0
sparql: prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix prov: <http://www.w3.org/ns/prov#> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix schema: <https://schema.org/> prefix as: <https://www.w3.org/ns/activitystreams#> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?question ?question_label ?asked_by (min(?asked_byName) as ?asked_by_label) ?date (group_concat(distinct ?anp; separator=" ") as ?answers_multi_iri) (group_concat(?ansLabel; separator="\n") as ?answers_label_multi) (str(?question) as ?reply_target) ?np ?np_label where { graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npi npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np np:hasAssertion ?qa ; np:hasProvenance ?qprov ; np:hasPublicationInfo ?qpi ; dct:created ?date . } graph ?qa { ?question a schema:Question ; rdf:value ?question_label . values ?_resource_multi_iri {} ?question schema:about ?_resource_multi_iri . } filter not exists { graph ?qpi { ?np npx:hasNanopubType npx:ExampleNanopub } } optional { graph ?qprov { ?qa prov:wasAttributedTo ?asked_by } } optional { graph ?qpi { ?asked_by foaf:name ?asked_byName } } optional { select ?question ?anp (min(?lbl) as ?ansLabel) where { service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select (group_concat(?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } values ?_resource_multi_iri {} graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?magent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?magent ; npa:pubkey ?mpk . } } } graph ?qa2 { ?question a schema:Question . values…

sig
has algorithm: RSA
signed by: https://orcid.org/0000-0002-1267-0234