Get the nanosuggestions assigned to an agent
created: 2026-08-26T14:55:57Z
creator: Tobias Kuhn
license: https://creativecommons.org/licenses/by/4.0/
embeds: Get the nanosuggestions assigned to an agent
type: Nanopublication
has assertion: assertion
has provenance: provenance
has publication info: pubinfo

sig
has algorithm: RSA
signed by: Tobias Kuhn

Get the nanosuggestions assigned to an agent
type: grlc-query
description: Returns the nanosuggestions currently assigned to a given agent, for that agent's user page: title, kind, current status, the spaces the nanosuggestion is relevant for, who assigned it and when. Only the most recent assignment of each nanosuggestion counts, so a reassignment moves the entry to the new assignee instead of leaving it with both. Unlike the space-page listing, this query is not gated on space membership: a user page has no space to resolve membership against, so every assignment naming the agent is shown.
license: LICENSE-2.0
sparql: prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix schema: <https://schema.org/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix nsug: <https://w3id.org/np/RA5BAdUvlxLWMWFQN3UVKoIQEB_MYTiAoLH1klXJ7z-XI/> select distinct ?item_multi_iri ?item_label_multi ?kind ?status ?spaces_multi_iri ?spaces_label_multi ?assigned_by ?assigned_by_label ?date ?suggestion ?np ?status_active ?status_done ?status_rejected where { # the most recent assignment nanopub for each nanosuggestion { select ?suggestion (max(concat(?ad, ' ', str(?anp))) as ?apick) where { graph npa:graph { ?anp npa:hasValidSignatureForPublicKeyHash ?apk ; np:hasAssertion ?aa ; dct:created ?adate . filter not exists { ?anpi npx:invalidates ?anp ; npa:hasValidSignatureForPublicKeyHash ?apk . } } graph ?aa { ?suggestion schema:agent ?ag . } bind(str(?adate) as ?ad) } group by ?suggestion } bind(iri(strafter(?apick, ' ')) as ?assignNp) # ...and it must name this agent, so a later reassignment removes the entry graph npa:graph { ?assignNp np:hasAssertion ?assignA ; dct:created ?date . optional { ?assignNp dct:creator ?assigned_by } } graph ?assignA { ?suggestion schema:agent ?_resource_multi_iri . } # the declaring nanopub carries the title and kind graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkey ; np:hasAssertion ?a . filter not exists { ?npi npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } } graph ?a { ?suggestion a nsug:Nanosuggestion ; rdfs:label ?title . optional { ?suggestion a ?k . filter(?k != nsug:Nanosuggestion && ?k != schema:Statement) } } # current status: no space to anchor to on a user page, so the most recent one overall optional { { select ?suggestion (max(concat(?sd, ' ', str(?…