. . . . "Returns the nanosuggestions (issues, bug reports, feature requests and tasks) linked to a given space or maintained resource via gen:isRelevantFor, with kind, current status, current assignees, comment count, reporter and date. Anybody may link a nanosuggestion to a resource, but status and assignment are resolved per space: the most recent assertion by a current member (admin, maintainer or member, not observer) of that space wins; if no member has ever set a status, the most recent one from outside is shown and marked as such; with no status at all the nanosuggestion counts as open. A single assignment may name several people, and all of them are returned. Also returns the winning assignment nanopublication if there is one, so that a reassign action can seed its form from it, and an assign target that is empty in that case so that assign and reassign are offered exclusively." . . . "Get nanosuggestions for a resource" . . "\nprefix rdf: \nprefix rdfs: \nprefix dct: \nprefix foaf: \nprefix np: \nprefix npa: \nprefix npx: \nprefix schema: \nprefix as: \nprefix gen: \nprefix nsug: \n\nselect ?item_multi_iri ?item_label_multi ?kind ?status ?assignee_multi_iri ?assignee_label_multi\n ?comments_multi_iri ?comments_label_multi ?reporter ?reporter_label ?date\n ?suggestion ?np ?fill_source ?assign_target\nwhere {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npi npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np dct:created ?date .\n ?np np:hasAssertion ?a .\n optional { ?np dct:creator ?reporter }\n }\n graph ?a {\n ?suggestion a nsug:Nanosuggestion ; rdfs:label ?title .\n optional { ?suggestion a ?k . filter(?k != nsug:Nanosuggestion && ?k != schema:Statement) }\n }\n filter exists {\n graph npa:graph {\n ?lnp npa:hasValidSignatureForPublicKeyHash ?lpk ; np:hasAssertion ?la .\n filter not exists { ?lnpi npx:invalidates ?lnp ; npa:hasValidSignatureForPublicKeyHash ?lpk . }\n }\n graph ?la {\n values ?_resource_multi_iri {}\n ?suggestion gen:isRelevantFor ?_resource_multi_iri .\n }\n }\n optional {\n { select ?suggestion (max(concat(if(?fm,'1','0'), ?sd, ' ', str(?s))) as ?pick) where {\n service {\n select (group_concat(?mpk; separator=' ') as ?memberPubkeys) where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }\n values ?_resource_multi_iri {}\n graph ?stateG {\n ?_resource_multi_iri npa:isMaintainedBy? ?space .\n ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt .\n filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole))\n ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk .\n }\n }\n }\n graph npa:graph {\n ?snp npa:hasValidSignatureForPublicKeyHash ?spk ; np:hasAssertion ?sa ; dct:created ?sdate .\n filter not exists { ?snpi npx:invalidates ?snp ; npa:hasValidSignatureForPublicKeyHash ?spk . }\n }\n graph ?sa { ?suggestion schema:actionStatus ?s . }\n bind(str(?sdate) as ?sd)\n bind(contains(?memberPubkeys, ?spk) as ?fm)\n } group by ?suggestion }\n }\n bind(coalesce(iri(strafter(?pick, ' ')), schema:PotentialActionStatus) as ?st)\n bind(coalesce(substr(?pick, 1, 1) = '0', false) as ?outside)\n bind(if(?st = schema:CompletedActionStatus, 'done',\n if(?st = schema:FailedActionStatus, 'rejected',\n if(?st = schema:ActiveActionStatus, 'in progress', 'open'))) as ?st_label)\n bind(if(?outside, concat(?st_label, ' (set outside this space)'), ?st_label) as ?status)\n # Current assignee(s). Two-level aggregation: the inner sub-select collects every\n # agent named by each candidate nanopub, the outer argmax then picks the winning\n # nanopub and carries its agents along as a payload. Kept in one scope on purpose:\n # aggregating separately and joining on the winning nanopub across scopes does not\n # restrict, and multiplies the rows instead. The IRI list and the label list are\n # group_concats over the same group, so they stay aligned even though group_concat\n # order is not otherwise guaranteed.\n optional {\n { select ?suggestion (max(concat(if(?afm,'1','0'), ?ad, ' ', ?agIris, '|', ?agLabels)) as ?apick) where {\n { select ?suggestion ?anp ?afm ?ad\n (group_concat(distinct str(?ag); separator=' ') as ?agIris)\n (group_concat(distinct ?agLbl; separator='\\n') as ?agLabels) where {\n service {\n select (group_concat(?mpk; separator=' ') as ?memberPubkeys) where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }\n values ?_resource_multi_iri {}\n graph ?stateG {\n ?_resource_multi_iri npa:isMaintainedBy? ?space .\n ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt .\n filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole))\n ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk .\n }\n }\n }\n graph npa:graph {\n ?anp npa:hasValidSignatureForPublicKeyHash ?apk ; np:hasAssertion ?aa ; dct:created ?adate .\n filter not exists { ?anpi npx:invalidates ?anp ; npa:hasValidSignatureForPublicKeyHash ?apk . }\n }\n graph ?aa { ?suggestion schema:agent ?ag . }\n optional { ?ag foaf:name ?agName }\n bind(coalesce(?agName, replace(str(?ag), '^.*/', '')) as ?agLbl)\n bind(str(?adate) as ?ad)\n bind(contains(?memberPubkeys, ?apk) as ?afm)\n } group by ?suggestion ?anp ?afm ?ad }\n } group by ?suggestion }\n bind(strafter(?apick, ' ') as ?agPayload)\n bind(strbefore(?agPayload, '|') as ?assignee_multi_iri)\n bind(strafter(?agPayload, '|') as ?assignee_label_multi)\n }\n # The assignment nanopub that currently wins, so \"assign...\" can seed its form from it.\n # \"use\" fill mode: the form then arrives pre-filled with ALL current assignees,\n # whatever their number. Falls back to the declaring nanopub, because a raw-key\n # (@) mapping with an empty value hides the button entirely.\n optional {\n { select ?suggestion (max(concat(if(?nfm,'1','0'), ?nd, ' ', str(?anp2))) as ?npick) where {\n service {\n select (group_concat(?mpk; separator=' ') as ?memberPubkeys) where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }\n values ?_resource_multi_iri {}\n graph ?stateG {\n ?_resource_multi_iri npa:isMaintainedBy? ?space .\n ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt .\n filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole))\n ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk .\n }\n }\n }\n graph npa:graph {\n ?anp2 npa:hasValidSignatureForPublicKeyHash ?npk ; np:hasAssertion ?aa2 ; dct:created ?ndate .\n filter not exists { ?anp2i npx:invalidates ?anp2 ; npa:hasValidSignatureForPublicKeyHash ?npk . }\n }\n graph ?aa2 { ?suggestion schema:agent ?ag2 . }\n # Only a *reporting* nanopub asserts the issue's title, so this keeps the\n # candidates to genuine assignment nanopubs. Seeding the assign form from a\n # report would leave its title/description/status/space unmatched, which is\n # what produces the \"could not be filled in\" warning.\n filter not exists { graph ?aa2 { ?suggestion rdfs:label ?titleHere . } }\n bind(str(?ndate) as ?nd)\n bind(contains(?memberPubkeys, ?npk) as ?nfm)\n } group by ?suggestion }\n bind(iri(strafter(?npick, ' ')) as ?assignNp)\n }\n # deliberately no fallback: an empty raw-key (@) mapping hides its button, which\n # is how \"reassign...\" stays hidden until a real assignment nanopub exists\n bind(?assignNp as ?fill_source)\n # \"assign...\" is offered only while there is no assignment nanopub yet; once there\n # is one, \"reassign...\" takes over (it seeds the form from it). An empty string is\n # the off-switch: applyEntryMappings hides a button whose mapped value is blank.\n # Written with an empty string rather than an unbound value because RDF4J evaluates\n # both if() branches eagerly, so an erroring branch would blank the column always.\n bind(if(bound(?fill_source), '', str(?suggestion)) as ?assign_target)\n\n optional {\n { select ?suggestion (count(distinct ?cnp) as ?ccount) where {\n graph npa:graph {\n ?cnp npa:hasValidSignatureForPublicKeyHash ?cpk ; np:hasAssertion ?ca .\n filter not exists { ?cnpi npx:invalidates ?cnp ; npa:hasValidSignatureForPublicKeyHash ?cpk . }\n }\n graph ?ca { ?c a schema:Statement ; rdf:value ?ctext . }\n ?c as:inReplyTo+ ?suggestion .\n } group by ?suggestion }\n filter(?ccount > 0)\n bind(?suggestion as ?comments_multi_iri)\n bind(concat(str(?ccount), if(?ccount = 1, ' comment', ' comments')) as ?comments_label_multi)\n }\n optional { { select ?reporter (min(?rn) as ?reporter_label) where { ?reporter foaf:name ?rn } group by ?reporter } }\n bind(?suggestion as ?item_multi_iri)\n bind(?title as ?item_label_multi)\n bind(coalesce(lcase(strafter(str(?k), 'RA5BAdUvlxLWMWFQN3UVKoIQEB_MYTiAoLH1klXJ7z-XI/')), '') as ?kind)\n bind(if(?st in (schema:CompletedActionStatus, schema:FailedActionStatus), '2', '1') as ?openRank)\n}\norder by ?openRank desc(?date)\n" . . "Tobias Kuhn" . "2026-08-27T08:50:06Z"^^ . . . . . "Get nanosuggestions for a resource" . . . . . . "RSA" . "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB" . "mxNFTRYjRGY9eLAYKHurqzwxQyoFcBoGfoiLubwAL9xlaXKRpZQri1+MmCuGeQQIlyKXbb3M8fr8LX+wkDh+CIRpInreL5hKzOGCDSlwE7gr5tKq/LDSzYwVmp6dVY0PuA5FkQZRU6yOkisH+mjAZxn4JFVMbC6wFP4EnpM2dAg=" . . .