Status: 
| part | subject | predicate | object | published by | date | |
|---|---|---|---|---|---|---|
|
Assertion
|
|
|||||
|
Assertion
|
List preset assignments
|
|
||||
|
Assertion
|
|
|||||
|
Assertion
|
Lists the currently active presets assigned to a resource, for the About page, filtered to assignments signed by an admin or maintainer of the owning space, or by the affected user themselves; deactivated assignments (and assignments with a newer deactivation for the same pair) are excluded. Shows each assigned preset, who added it, the date, and the source nanopub. The deactivatePreset column feeds the per-row deactivate action.
|
|
||||
|
Assertion
|
|
|||||
|
Assertion
|
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 ?preset_label
(str(?preset) as ?deactivatePreset)
(?user as ?added_by) (?date as ?date_added)
?np ("^" as ?np_label) where {
values ?_resource_multi_iri {}
service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }
{
graph ?stateG {
?_resource_multi_iri npa:isMaintainedBy? ?space .
?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ;
(npa:inverseProperty|npa:regularProperty) ?roleProp .
?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey .
}
optional {
graph npa:spacesGraph {
?rd a npa:RoleDeclaration ; npa:forSpace ?space ;
npa:hasRoleType gen:MaintainerRole ;
(npa:inverseProperty|npa:regularProperty) ?roleProp .
bind(true as ?isMaintainer)
}
}
filter(?roleProp = gen:hasAdmin || bound(?isMaintainer))
} union {
graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . }
}
}
graph npa:graph {
?np npx:hasNanopubType gen:PresetAssignment ;
npa:hasValidSignatureForPublicKeyHash ?pubkey ;
dct:created ?date ;
npx:embeds ?assignment ;
np:hasAssertion ?a .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
optional { ?np npx:signedBy ?user }
}
graph ?a {
?assignment gen:isAssignmentFor ?_resource_multi_iri ;
gen:isAssignmentOfPreset ?preset .
optional {
values ?mode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment }
?assignment a ?mode .
}
}
filter(!bound(?mode) || !contains(str(?mode), "Deactivated"))
filter not exists {
graph npa:graph {
?np2 npx:hasNanopubType gen:PresetAssignment ;
npa:hasValidSignatureForPublicKeyHash ?pubkey2 ;
dct:created ?date2 ;
npx:embeds ?assignment2 ;
np:hasAssertion ?a2 .
filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }
}
graph ?a2 {
?assignment2 a gen:DeactivatedPresetAssignment ;
gen:isAssignmentFor ?_resource_multi_iri ;
gen:isAssignmentOfPreset ?preset .
}
filter(?date2 > ?date)
}
optional {
graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . }
graph ?pa {
optional { ?preset rdfs:label ?preset_label . }
}
}
}
order by desc(?date)
|
|
||||
|
PublicationInfo
|
|
|||||
|
Assertion
|
|
|||||
|
Assertion
|
|
|||||
|
Assertion
|
|
|||||