[ { "@id": "https://w3id.org/np/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A/assertion", "@graph": [ { "@id": "https://w3id.org/np/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A/get-latest-governed-version", "http://purl.org/dc/terms/description": [ { "@value": "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 and gen:governedBy , 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. Supersedes the two-parameter version, which returned nothing for an unregistered kind and so kept every reference to such a version on exactly that version, ignoring even same-key supersedes." } ], "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 latest governed version" } ], "https://w3id.org/kpxl/grlc/endpoint": [ { "@id": "https://w3id.org/np/l/nanopub-query-1.1/repo/spaces" } ], "https://w3id.org/kpxl/grlc/sparql": [ { "@value": "prefix np: \nprefix npa: \nprefix npx: \nprefix dct: \nprefix gen: \n\nselect distinct ?version ?date ?np ('^' as ?np_label) ?mode where {\n {\n # Kind registered for the space: newest version of the (kind, space) pair signed by a current member+.\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }\n graph ?stateG {\n ?_kind_iri npa:isMaintainedBy ?_space_iri ; npa:hasGoverningSpaceRef ?ref .\n ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_iri ; npa:forSpaceRef ?ref ;\n npa:hasRoleType ?tier ; npa:forAgent ?agent .\n filter(?tier = gen:AdminRole || ?tier = gen:MaintainerRole || ?tier = gen:MemberRole)\n ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?pubkey .\n }\n service {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey ;\n dct:created ?date ;\n npx:embeds ?version ;\n np:hasAssertion ?a .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n }\n graph ?a {\n ?version dct:isVersionOf ?_kind_iri ;\n gen:governedBy ?_space_iri .\n }\n }\n bind('governed' as ?mode)\n } union {\n # Kind not registered for the space: governedBy has no effect; follow the pin's same-key supersedes chain.\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateU . }\n filter not exists { graph ?stateU { ?_kind_iri npa:isMaintainedBy ?_space_iri . } }\n service {\n {\n select (count(distinct ?h) as ?heads) (sample(?h) as ?np) where {\n graph npa:networkGraph { ?h (npx:supersedes)* ?_pin_iri . }\n graph npa:graph {\n ?_pin_iri npa:hasValidSignatureForPublicKeyHash ?pinKey .\n ?h npa:hasValidSignatureForPublicKeyHash ?pinKey .\n filter not exists { ?hx npx:invalidates ?h ; npa:hasValidSignatureForPublicKeyHash ?pinKey . }\n }\n }\n }\n filter(?heads = 1)\n graph npa:graph {\n ?np dct:created ?date .\n optional { ?np npx:embeds ?embedded . }\n }\n bind(coalesce(?embedded, ?np) as ?version)\n }\n bind('supersedes' as ?mode)\n }\n}\norder by desc(?date) desc(?np) limit 1" } ] } ] }, { "@id": "https://w3id.org/np/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A/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/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A", "http://purl.org/dc/terms/created": [ { "@value": "2026-09-24T09:55:19Z", "@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/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A/get-latest-governed-version" } ], "http://purl.org/nanopub/x/supersedes": [ { "@id": "https://w3id.org/np/RAPSWgzHef9bIJyCoLodFH-BWtlESf1jIstEb0kn4B5Cw" } ], "http://www.w3.org/2000/01/rdf-schema#label": [ { "@value": "Get latest governed version" } ], "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/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A/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": "Ufy0BH9NkWP2ScK/FeCgqXThcDtSwz/7vu5e+S37SfMRSehpWmfk2wRTVi/uxHTDt3aqQNw8CtkGvylOlSVU92W7ooh3w+IrsgJ6BoSlC+BAWZXVdsJAYVVkiYQ3jOxWeEJwvu4dnh+V1z7SyHvoe7dCOGgJ94O8bu1oKHDpkwU=" } ], "http://purl.org/nanopub/x/hasSignatureTarget": [ { "@id": "https://w3id.org/np/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A" } ], "http://purl.org/nanopub/x/signedBy": [ { "@id": "https://orcid.org/0000-0002-1267-0234" } ] } ] }, { "@id": "https://w3id.org/np/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A/provenance", "@graph": [ { "@id": "https://w3id.org/np/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A/assertion", "http://www.w3.org/ns/prov#wasAttributedTo": [ { "@id": "https://orcid.org/0000-0002-1267-0234" } ] } ] }, { "@id": "https://w3id.org/np/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A/Head", "@graph": [ { "@id": "https://w3id.org/np/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A", "http://www.nanopub.org/nschema#hasAssertion": [ { "@id": "https://w3id.org/np/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A/assertion" } ], "http://www.nanopub.org/nschema#hasProvenance": [ { "@id": "https://w3id.org/np/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A/provenance" } ], "http://www.nanopub.org/nschema#hasPublicationInfo": [ { "@id": "https://w3id.org/np/RA833rrcvetgt-JpGur9yiM03UNBZXIbRBrS-ozxqr9_A/pubinfo" } ], "@type": [ "http://www.nanopub.org/nschema#Nanopublication" ] } ] } ]