https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/Head
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8
http://www.nanopub.org/nschema#hasAssertion
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/assertion
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8
http://www.nanopub.org/nschema#hasProvenance
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/provenance
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8
http://www.nanopub.org/nschema#hasPublicationInfo
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/pubinfo
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://www.nanopub.org/nschema#Nanopublication
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/assertion
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/list-preset-assignments
http://purl.org/dc/terms/description
Lists the presets assigned in a given space ref (space IRI + root definition). Pass the ref's root nanopub (root_np); the query resolves the ref via npa:rootNanopub and reads the server-materialised npa:PresetAssignment rows scoped by npa:forSpaceRef from the trust-validated current space-state graph (only admin-authored assignments are materialised, so this is authorisation-scoped). An assignment is identified by the assigned preset's stable KIND (dct:isVersionOf) and the resource, mirroring view displays, which the client dedups by view kind (nanodash issue #607): among the assignments of one preset kind for one resource only the latest by dct:created counts, so assigning another version of the same preset replaces the earlier assignment instead of adding a second, competing row; a version declaring no kind keys on itself, and the preset listed is the version that assignment pinned. The preset is listed only when that latest row is still activated (npa:isActivated true) -- a deactivation is a newer admin-authored row with npa:isActivated false. The version column reports whether the assigned version is still current: version_label is what the cell shows (latest, or an up-arrow plus update available) and version carries the dates behind it as the hover tooltip -- that way round because the renderer displays a literal column's _label companion and puts the principal value in the tooltip. updatePreset holds the version the update action pre-fills. All three are derived from the newest non-invalidated version of the same kind, restricted to versions published by the same agent as the assigned version, so an unrelated agent cannot advertise a version of someone else's preset here. Presets never auto-update -- adopting the newer version stays an explicit, admin-signed act. Columns match the IRI-keyed list-preset-assignments (preset, preset_label, deactivatePreset, added_by, date_added, update_noheader, update_label, updatePreset, np, np_label) so it drives the existing Preset assignments view unchanged. Ref-scoped variant: shows only that one ref's assignments rather than merging all refs claiming the IRI.
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/list-preset-assignments
http://purl.org/dc/terms/license
http://www.apache.org/licenses/LICENSE-2.0
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/list-preset-assignments
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
https://w3id.org/kpxl/grlc/grlc-query
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/list-preset-assignments
http://www.w3.org/2000/01/rdf-schema#label
List preset assignments (ref-scoped)
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/list-preset-assignments
https://w3id.org/kpxl/grlc/endpoint
https://w3id.org/np/l/nanopub-query-1.1/repo/spaces
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/list-preset-assignments
https://w3id.org/kpxl/grlc/sparql
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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 gen: <https://w3id.org/kpxl/gen/terms/>
select ?preset (sample(?lbl) as ?preset_label)
(sample(?detail) as ?version) (sample(?verdict) as ?version_label)
(str(?preset) as ?deactivatePreset)
(sample(?user) as ?added_by) (?date as ?date_added)
(sample(?updateTarget) as ?updatePreset)
?np ("^" as ?np_label)
where {
values ?_root_np_multi_iri {}
graph npa:spacesGraph { ?ref npa:rootNanopub ?_root_np_multi_iri . }
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }
graph ?g {
?paRef a npa:PresetAssignment ; npa:forSpaceRef ?ref ; npa:ofPreset ?preset ; npa:forResource ?resource ;
npa:isActivated ?activated ; npa:viaNanopub ?np ; dct:created ?date .
}
# The assigned preset version: its label, its stable kind, its author and its date.
optional {
?pnp npx:embeds ?preset ; np:hasAssertion ?pa .
optional { graph npa:graph { ?pnp npx:signedBy ?presetSigner } }
optional { graph npa:graph { ?pnp dct:created ?presetDate } }
graph ?pa {
optional { ?preset rdfs:label ?lbl }
optional { ?preset dct:isVersionOf ?presetKindOptional }
}
}
# Assignment identity is (preset KIND, resource) -- as for view displays, where the
# client dedups by view kind -- so assigning another version of the same preset
# replaces the earlier assignment instead of adding a second, competing one. A
# version that declares no kind keys on itself.
bind(coalesce(?presetKindOptional, ?preset) as ?presetKey)
filter(?activated = true)
filter not exists {
graph ?g { ?pa2 a npa:PresetAssignment ; npa:forSpaceRef ?ref ; npa:ofPreset ?preset2 ;
npa:forResource ?resource ; npa:viaNanopub ?np2 ; dct:created ?date2 . }
optional {
?pnp2 npx:embeds ?preset2 ; np:hasAssertion ?pa2Assertion .
graph ?pa2Assertion { ?preset2 dct:isVersionOf ?presetKind2 }
}
filter(coalesce(?presetKind2, ?preset2) = ?presetKey)
filter(?date2 > ?date || (?date2 = ?date && str(?np2) > str(?np)))
}
# Newest version of the assigned preset's kind, restricted to versions published by
# the same agent as the assigned version, so an unrelated agent cannot advertise a
# version of someone else's preset here (issue #607). Presets never auto-update:
# this only surfaces the newer version and pre-fills the update action with it.
optional {
{ select (?versionKind as ?presetKey) (?versionSigner as ?presetSigner)
(iri(strafter(max(concat(str(?vDate), ">", str(?vPreset))), ">")) as ?latestVersion)
(max(?vDate) as ?latestDate) where {
graph npa:graph {
?vNp npx:hasNanopubType gen:Preset ;
npa:hasValidSignatureForPublicKeyHash ?vPubkey ;
dct:created ?vDate ;
npx:signedBy ?versionSigner ;
npx:embeds ?vPreset ;
np:hasAssertion ?vA .
filter not exists { ?vInv npx:invalidates ?vNp ; npa:hasValidSignatureForPublicKeyHash ?vPubkey . }
}
graph ?vA { ?vPreset a gen:Preset ; dct:isVersionOf ?versionKind . }
} group by ?versionKind ?versionSigner }
}
bind(bound(?latestVersion) && ?latestVersion != ?preset && ?latestDate > ?presetDate as ?hasUpdate)
# See the IRI-keyed twin: for a literal column with an "x_label" companion the LABEL
# is displayed and the principal value becomes the hover tooltip, so the short verdict
# is the label and the dates are the principal.
bind(if(?hasUpdate, "⬆️ update available", "latest") as ?rawVerdict)
bind(if(?hasUpdate,
concat("Assigned version of ", substr(str(?presetDate), 1, 10),
"; version of ", substr(str(?latestDate), 1, 10), " is newer"),
concat("Assigned version of ", substr(str(?presetDate), 1, 10))) as ?rawDetail)
bind(if(bound(?presetDate), ?rawVerdict, "") as ?verdict)
bind(if(bound(?presetDate), ?rawDetail, "") as ?detail)
bind(if(?hasUpdate, str(?latestVersion), "") as ?updateTarget)
optional { graph npa:graph { ?np npx:signedBy ?user } }
}
group by ?preset ?date ?np
order by desc(?date)
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/provenance
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/assertion
http://www.w3.org/ns/prov#wasAttributedTo
https://orcid.org/0000-0002-1267-0234
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/pubinfo
https://orcid.org/0000-0002-1267-0234
http://xmlns.com/foaf/0.1/name
Tobias Kuhn
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8
http://purl.org/dc/terms/created
2026-09-09T08:02:41Z
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8
http://purl.org/dc/terms/creator
https://orcid.org/0000-0002-1267-0234
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8
http://purl.org/dc/terms/license
https://creativecommons.org/licenses/by/4.0/
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8
http://purl.org/nanopub/x/embeds
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/list-preset-assignments
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8
http://purl.org/nanopub/x/supersedes
https://w3id.org/np/RArC6iR-Bwm8e1RP9PPClwJuzVEKJYX0agMZaQIc9Ln0s
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8
https://w3id.org/np/o/ntemplate/wasCreatedFromProvenanceTemplate
https://w3id.org/np/RA7lSq6MuK_TIC6JMSHvLtee3lpLoZDOqLJCLXevnrPoU
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8
https://w3id.org/np/o/ntemplate/wasCreatedFromPubinfoTemplate
https://w3id.org/np/RA0J4vUn_dekg-U1kK3AOEt02p9mT2WO03uGxLDec1jLw
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8
https://w3id.org/np/o/ntemplate/wasCreatedFromTemplate
https://w3id.org/np/RAEFAt-QcFK0ZhqfvlsmS10BnzGJA0xwOICZXkO-ai87k
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/sig
http://purl.org/nanopub/x/hasAlgorithm
RSA
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/sig
http://purl.org/nanopub/x/hasPublicKey
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/sig
http://purl.org/nanopub/x/hasSignature
MenzIwJebvOw7XcISSI2Zxf0H8xibQPoVb+YFca4UhMvLOcqPJJ96H5HadDSzdxUlBGLA9e0pqvCpkZdU+J5F9dKUReqWwn0uh9ih71V+zTIxLH5zwCAweJ9w8pLbQZ5n+legzAb4FjbxxKAwTADlxQyMj6x8Z2crlgk2wnciLA=
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/sig
http://purl.org/nanopub/x/hasSignatureTarget
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8
https://w3id.org/np/RArXnUQf2dQguqlteWMwKVWxIpnk5xzF4ppAokGkpuOn8/sig
http://purl.org/nanopub/x/signedBy
https://orcid.org/0000-0002-1267-0234