@prefix this: . @prefix sub: . @prefix np: . @prefix grlc: . @prefix dct: . @prefix nt: . @prefix npx: . @prefix xsd: . @prefix skos: . @prefix rdfs: . @prefix orcid: . @prefix prov: . @prefix foaf: . sub:Head { this: a np:Nanopublication; np:hasAssertion sub:assertion; np:hasProvenance sub:provenance; np:hasPublicationInfo sub:pubinfo . } sub:assertion { sub:get-pinned-resources a grlc:grlc-query; dct:description "This query returns the pinned resources for a given entity (e.g. a Space), each resource only once (from its latest pin)."; dct:license ; rdfs:label "Get pinned resources"; grlc:endpoint ; grlc:sparql """prefix rdfs: prefix dct: prefix np: prefix npa: prefix npx: prefix gen: select ?resource (min(?label) as ?resource_label) (min(?cmt) as ?comment) ?np (\"^\" as ?np_label) where { values ?_entity_multi_iri {} graph npa:graph { ?np npx:hasNanopubType gen:hasPinnedResource ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } } graph ?a { ?_entity_multi_iri gen:hasPinnedResource ?resource . } # Show each resource once: skip this pin if a newer valid pin of the same resource exists (by anyone). optional { graph ?a2 { ?_entity_multi_iri gen:hasPinnedResource ?resource . } graph npa:graph { ?np2 np:hasAssertion ?a2 ; npx:hasNanopubType gen:hasPinnedResource ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } filter(?date2 > ?date || (?date2 = ?date && str(?np2) > str(?np))) } filter(!bound(?np2)) optional { graph ?a { ?resource rdfs:label ?label . } } optional { graph ?a { ?resource rdfs:comment ?cmt . } } } group by ?resource ?np""" . } sub:provenance { sub:assertion prov:wasAttributedTo orcid:0000-0002-1267-0234 . } sub:pubinfo { orcid:0000-0002-1267-0234 foaf:name "Tobias Kuhn" . this: dct:created "2026-11-11T05:08:08Z"^^xsd:dateTime; dct:creator orcid:0000-0002-1267-0234; dct:license ; npx:embeds sub:get-pinned-resources; npx:supersedes ; skos:changeNote "Each resource is listed only once: when several valid pins of the same resource exist for the entity, only the latest one (by dct:created) is shown."; nt:wasCreatedFromProvenanceTemplate ; nt:wasCreatedFromPubinfoTemplate , , , ; nt:wasCreatedFromTemplate . sub:sig npx:hasAlgorithm "RSA"; npx:hasPublicKey "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB"; npx:hasSignature "U1bhghsj5a6qy48Uoq2Y14aPTauoHlBMxZyvxwvBi7pNjtHiIvqKgVel17vwjQheYm97wSVV9+89915WpArMfS+2bXt5O+gFRNFXmIqoLwh5wfzW+OOi6QF4Ux0WVs+Xgda9erXUuiWn/tO4WyCRu/dve7oi0+ouo1WGrxJqPEo="; npx:hasSignatureTarget this:; npx:signedBy orcid:0000-0002-1267-0234 . }