[ { "@id": "https://w3id.org/np/RA0Khk-E65uHKSNabAidWgZHHLlAlJMpGZjNkGs6u9IlI/assertion", "@graph": [ { "@id": "https://w3id.org/np/RA0Khk-E65uHKSNabAidWgZHHLlAlJMpGZjNkGs6u9IlI/get-nanosuggestions-for-assignee", "http://purl.org/dc/terms/description": [ { "@value": "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. Also returns that winning assignment nanopublication, so an assign action can seed its form from it. 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." } ], "http://purl.org/dc/terms/license": [ { "@id": "http://www.apache.org/licenses/LICENSE-2.0" } ], "@type": [ "https://w3id.org/kpxl/grlc/grlc-query" ], "http://www.w3.org/2000/01/rdf-schema#label": [ { "@value": "Get the nanosuggestions assigned to an agent" } ], "https://w3id.org/kpxl/grlc/endpoint": [ { "@id": "https://w3id.org/np/l/nanopub-query-1.1/repo/type/29e2f808e4864fca4930806dee70c4a32df54a63ee90156244910a47d3443736" } ], "https://w3id.org/kpxl/grlc/sparql": [ { "@value": "\nprefix rdf: \nprefix rdfs: \nprefix dct: \nprefix foaf: \nprefix np: \nprefix npa: \nprefix npx: \nprefix schema: \nprefix gen: \nprefix nsug: \n\nselect distinct ?item_multi_iri ?item_label_multi ?kind ?status ?spaces_multi_iri ?spaces_label_multi\n ?assigned_by ?assigned_by_label ?date ?suggestion ?np ?fill_source\nwhere {\n # grlc fills this block with the page's agent IRI. A multi-valued (_multi_iri)\n # parameter REQUIRES the empty values block: used bare the variable simply stays\n # unbound, and the assignee pattern then matches every agent.\n values ?_resource_multi_iri {}\n # the most recent assignment nanopub for each nanosuggestion\n { select ?suggestion (max(concat(?ad, ' ', str(?anp))) as ?apick) where {\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 bind(str(?adate) as ?ad)\n } group by ?suggestion }\n bind(iri(strafter(?apick, ' ')) as ?assignNp)\n # ...and it must name this agent, so a later reassignment removes the entry\n graph npa:graph { ?assignNp np:hasAssertion ?assignA ; dct:created ?date .\n optional { ?assignNp dct:creator ?assigned_by } }\n graph ?assignA { ?suggestion schema:agent ?_resource_multi_iri . }\n # the declaring nanopub carries the title and kind\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey ; np:hasAssertion ?a .\n filter not exists { ?npi npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\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 # current status: no space to anchor to on a user page, so the most recent one overall\n optional {\n { select ?suggestion (max(concat(?sd, ' ', str(?s))) as ?pick) where {\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 } group by ?suggestion }\n }\n bind(coalesce(iri(strafter(?pick, ' ')), schema:PotentialActionStatus) as ?st)\n bind(if(?st = schema:CompletedActionStatus, 'done',\n if(?st = schema:FailedActionStatus, 'rejected',\n if(?st = schema:ActiveActionStatus, 'in progress', 'open'))) as ?status)\n # which spaces the nanosuggestion is relevant for\n optional {\n { select ?suggestion (group_concat(distinct str(?sp); separator=' ') as ?spaces_multi_iri)\n (group_concat(distinct ?splabel; separator='\\n') as ?spaces_label_multi) where {\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 { ?suggestion gen:isRelevantFor ?sp . }\n optional { ?sp rdfs:label ?spl . filter(lang(?spl) = '') }\n bind(coalesce(?spl, replace(str(?sp), '^.*/', '')) as ?splabel)\n } group by ?suggestion }\n }\n optional { ?assigned_by foaf:name ?assigned_by_label }\n # see the list query: lets \"assign...\" seed its form from the winning assignment nanopub\n bind(coalesce(?assignNp, ?np) as ?fill_source)\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" } ] } ] }, { "@id": "https://w3id.org/np/RA0Khk-E65uHKSNabAidWgZHHLlAlJMpGZjNkGs6u9IlI/Head", "@graph": [ { "@id": "https://w3id.org/np/RA0Khk-E65uHKSNabAidWgZHHLlAlJMpGZjNkGs6u9IlI", "http://www.nanopub.org/nschema#hasAssertion": [ { "@id": "https://w3id.org/np/RA0Khk-E65uHKSNabAidWgZHHLlAlJMpGZjNkGs6u9IlI/assertion" } ], "http://www.nanopub.org/nschema#hasProvenance": [ { "@id": "https://w3id.org/np/RA0Khk-E65uHKSNabAidWgZHHLlAlJMpGZjNkGs6u9IlI/provenance" } ], "http://www.nanopub.org/nschema#hasPublicationInfo": [ { "@id": "https://w3id.org/np/RA0Khk-E65uHKSNabAidWgZHHLlAlJMpGZjNkGs6u9IlI/pubinfo" } ], "@type": [ "http://www.nanopub.org/nschema#Nanopublication" ] } ] }, { "@id": "https://w3id.org/np/RA0Khk-E65uHKSNabAidWgZHHLlAlJMpGZjNkGs6u9IlI/provenance", "@graph": [ { "@id": "https://w3id.org/np/RA0Khk-E65uHKSNabAidWgZHHLlAlJMpGZjNkGs6u9IlI/assertion", "http://www.w3.org/ns/prov#wasAttributedTo": [ { "@id": "https://orcid.org/0000-0002-1267-0234" } ] } ] }, { "@id": "https://w3id.org/np/RA0Khk-E65uHKSNabAidWgZHHLlAlJMpGZjNkGs6u9IlI/pubinfo", "@graph": [ { "@id": "https://orcid.org/0000-0002-1267-0234", "http://xmlns.com/foaf/0.1/name": [ { "@value": "Tobias Kuhn" } ] }, { "@id": "https://w3id.org/np/RA0Khk-E65uHKSNabAidWgZHHLlAlJMpGZjNkGs6u9IlI", "http://purl.org/dc/terms/created": [ { "@value": "2026-08-27T07:37:23Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } ], "http://purl.org/dc/terms/creator": [ { "@id": "https://orcid.org/0000-0002-1267-0234" } ], "http://purl.org/dc/terms/license": [ { "@id": "https://creativecommons.org/licenses/by/4.0/" } ], "http://purl.org/nanopub/x/embeds": [ { "@id": "https://w3id.org/np/RA0Khk-E65uHKSNabAidWgZHHLlAlJMpGZjNkGs6u9IlI/get-nanosuggestions-for-assignee" } ], "http://purl.org/nanopub/x/supersedes": [ { "@id": "https://w3id.org/np/RAuFJKlgbZ0GMUMIh9nFPyRdmX5cf48n6oW3kWgBvwhdc" } ], "http://www.w3.org/2000/01/rdf-schema#label": [ { "@value": "Get the nanosuggestions assigned to an agent" } ], "https://w3id.org/np/o/ntemplate/wasCreatedFromProvenanceTemplate": [ { "@id": "https://w3id.org/np/RA7lSq6MuK_TIC6JMSHvLtee3lpLoZDOqLJCLXevnrPoU" } ], "https://w3id.org/np/o/ntemplate/wasCreatedFromPubinfoTemplate": [ { "@id": "https://w3id.org/np/RA0J4vUn_dekg-U1kK3AOEt02p9mT2WO03uGxLDec1jLw" }, { "@id": "https://w3id.org/np/RAoTD7udB2KtUuOuAe74tJi1t3VzK0DyWS7rYVAq1GRvw" }, { "@id": "https://w3id.org/np/RAukAcWHRDlkqxk7H2XNSegc1WnHI569INvNr-xdptDGI" } ], "https://w3id.org/np/o/ntemplate/wasCreatedFromTemplate": [ { "@id": "https://w3id.org/np/RAEFAt-QcFK0ZhqfvlsmS10BnzGJA0xwOICZXkO-ai87k" } ] }, { "@id": "https://w3id.org/np/RA0Khk-E65uHKSNabAidWgZHHLlAlJMpGZjNkGs6u9IlI/sig", "http://purl.org/nanopub/x/hasAlgorithm": [ { "@value": "RSA" } ], "http://purl.org/nanopub/x/hasPublicKey": [ { "@value": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB" } ], "http://purl.org/nanopub/x/hasSignature": [ { "@value": "noJRdrJaO3AKZL4HtmqtPQYavDEJY0rt0BAnvIsARLKxxOtJ4RH/F7CfZHRASZwIJexEK82/qNNDAQoovIT8CZigw/ICMicE4KOGvkZQ7G5ArAcBJtbQhIM5tf7doIcWtztDo96/IBM0rvCvhEeQXqaoNcwOia4gMQM3Os8c5R4=" } ], "http://purl.org/nanopub/x/hasSignatureTarget": [ { "@id": "https://w3id.org/np/RA0Khk-E65uHKSNabAidWgZHHLlAlJMpGZjNkGs6u9IlI" } ], "http://purl.org/nanopub/x/signedBy": [ { "@id": "https://orcid.org/0000-0002-1267-0234" } ] } ] } ]