https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/Head
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
http://www.nanopub.org/nschema#hasAssertion
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/assertion
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
http://www.nanopub.org/nschema#hasProvenance
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/provenance
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
http://www.nanopub.org/nschema#hasPublicationInfo
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/pubinfo
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://www.nanopub.org/nschema#Nanopublication
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/assertion
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/get-latest-governed-version
http://purl.org/dc/terms/description
Resolves which version a reference to a space-governed definition should use: a resource view, an assertion/provenance/pubinfo template, or any other definition whose versions follow the embeds/isVersionOf/governedBy convention (docs/views-and-presets-as-maintained-resources.md and docs/template-identity-and-governance.md in the nanodash repo). Takes the definition's kind (its dct:isVersionOf target; kind), the space named by the pinned version's gen:governedBy (space), and the nanopublication URI of the pinned version (pin). If the kind is registered as a maintained resource of the space (npa:isMaintainedBy in the current space state), the result is the newest version of the (kind, space) pair: a nanopublication that npx:embeds the version, which declares dct:isVersionOf <kind> and gen:governedBy <space>, is signed by a current member+ (admin/maintainer/member, not observer) of the space's governing ref, and is not invalidated by its own key (mode 'governed'). Without such a version the result is empty and the caller keeps its pin, which is not re-validated here. If the kind is not registered for the space, gen:governedBy has no effect and the pin resolves like an ungoverned version (mode 'supersedes'): the single current head of its npx:supersedes chain, signed with the pin's own key and not invalidated by it. This is the same rule as get-latest-version-of-np, so a chain that has forked into several heads yields no row. Returns at most one row: version (the embedded definition IRI, or the nanopublication URI if it embeds none), date, np and mode. Hosted on the spaces repo; the version lookups federate to the full repo with kind, space and pin as text-substituted constants. For a registered kind, the member keys are gathered into a single row and the full-repo lookup starts from the kind and shares no variables with them, so it runs once and only touches the kind's own versions. Supersedes RA833rrc, which answered the same but looked up the versions once per member of the space, starting from every nanopublication signed by a member key: several seconds, up to a minute, for spaces whose members have signed many nanopublications.
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/get-latest-governed-version
http://purl.org/dc/terms/license
http://www.apache.org/licenses/LICENSE-2.0
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/get-latest-governed-version
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
https://w3id.org/kpxl/grlc/grlc-query
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/get-latest-governed-version
http://www.w3.org/2000/01/rdf-schema#label
Get latest governed version
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/get-latest-governed-version
https://w3id.org/kpxl/grlc/endpoint
https://w3id.org/np/l/nanopub-query-1.1/repo/spaces
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/get-latest-governed-version
https://w3id.org/kpxl/grlc/sparql
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix dct: <http://purl.org/dc/terms/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select distinct ?version ?date ?np ('^' as ?np_label) ?mode where {
{
# Kind registered for the space: newest version of the (kind, space) pair signed by a current member+.
# The member keys are gathered into one row, and the version lookup starts from the kind and shares
# no variables with it, so the federated call runs once instead of once per member row.
{
select (group_concat(distinct ?pubkey; separator=' ') as ?memberKeys) where {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }
graph ?stateG {
?_kind_iri npa:isMaintainedBy ?_space_iri ; npa:hasGoverningSpaceRef ?ref .
?ri a gen:RoleInstantiation ; npa:forSpace ?_space_iri ; npa:forSpaceRef ?ref ;
npa:hasRoleType ?tier ; npa:forAgent ?agent .
filter(?tier = gen:AdminRole || ?tier = gen:MaintainerRole || ?tier = gen:MemberRole)
?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?pubkey .
}
}
}
{
select ?np ?date ?version ?versionKey where {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> {
graph ?a {
?version dct:isVersionOf ?_kind_iri ;
gen:governedBy ?_space_iri .
}
graph npa:graph {
?np np:hasAssertion ?a ;
npx:embeds ?version ;
dct:created ?date ;
npa:hasValidSignatureForPublicKeyHash ?versionKey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?versionKey . }
}
}
}
}
filter(contains(?memberKeys, ?versionKey))
bind('governed' as ?mode)
} union {
# Kind not registered for the space: governedBy has no effect; follow the pin's same-key supersedes chain.
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateU . }
filter not exists { graph ?stateU { ?_kind_iri npa:isMaintainedBy ?_space_iri . } }
service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> {
{
select (count(distinct ?h) as ?heads) (sample(?h) as ?np) where {
graph npa:networkGraph { ?h (npx:supersedes)* ?_pin_iri . }
graph npa:graph {
?_pin_iri npa:hasValidSignatureForPublicKeyHash ?pinKey .
?h npa:hasValidSignatureForPublicKeyHash ?pinKey .
filter not exists { ?hx npx:invalidates ?h ; npa:hasValidSignatureForPublicKeyHash ?pinKey . }
}
}
}
filter(?heads = 1)
graph npa:graph {
?np dct:created ?date .
optional { ?np npx:embeds ?embedded . }
}
bind(coalesce(?embedded, ?np) as ?version)
}
bind('supersedes' as ?mode)
}
}
order by desc(?date) desc(?np) limit 1
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/provenance
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/assertion
http://www.w3.org/ns/prov#wasAttributedTo
https://orcid.org/0000-0002-1267-0234
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/pubinfo
https://orcid.org/0000-0002-1267-0234
http://xmlns.com/foaf/0.1/name
Tobias Kuhn
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
http://purl.org/dc/terms/created
2026-09-24T11:01:39Z
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
http://purl.org/dc/terms/creator
https://orcid.org/0000-0002-1267-0234
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
http://purl.org/dc/terms/license
https://creativecommons.org/licenses/by/4.0/
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
http://purl.org/nanopub/x/embeds
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/get-latest-governed-version
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
http://purl.org/nanopub/x/supersedes
https://w3id.org/np/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
http://www.w3.org/2000/01/rdf-schema#label
Get latest governed version
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
https://w3id.org/np/o/ntemplate/wasCreatedFromProvenanceTemplate
https://w3id.org/np/RA7lSq6MuK_TIC6JMSHvLtee3lpLoZDOqLJCLXevnrPoU
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
https://w3id.org/np/o/ntemplate/wasCreatedFromPubinfoTemplate
https://w3id.org/np/RA0J4vUn_dekg-U1kK3AOEt02p9mT2WO03uGxLDec1jLw
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
https://w3id.org/np/o/ntemplate/wasCreatedFromPubinfoTemplate
https://w3id.org/np/RAoTD7udB2KtUuOuAe74tJi1t3VzK0DyWS7rYVAq1GRvw
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
https://w3id.org/np/o/ntemplate/wasCreatedFromPubinfoTemplate
https://w3id.org/np/RAukAcWHRDlkqxk7H2XNSegc1WnHI569INvNr-xdptDGI
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
https://w3id.org/np/o/ntemplate/wasCreatedFromTemplate
https://w3id.org/np/RAEFAt-QcFK0ZhqfvlsmS10BnzGJA0xwOICZXkO-ai87k
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/sig
http://purl.org/nanopub/x/hasAlgorithm
RSA
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/sig
http://purl.org/nanopub/x/hasPublicKey
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/sig
http://purl.org/nanopub/x/hasSignature
G9is+frXx6SNzcR/FCCPXrBCfbTwgfUHkuHdiezJwcJRjQELrFXS+ZTb1HlDKooUeh13XpmRVy6kAleIgnXxHWFofGzNcmEqF9tBkzBKr1I3jBqM0h9A5tJmWG4zwBf/+fFKclmfEhNW0ZwW+0oa2/f6kZNb0lT8bZVa3t7aBcI=
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/sig
http://purl.org/nanopub/x/hasSignatureTarget
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q
https://w3id.org/np/RAyB49tPLdgMjwmG9alOjtK2wSvxLGPunfncFk57elB-Q/sig
http://purl.org/nanopub/x/signedBy
https://orcid.org/0000-0002-1267-0234