Skip to content

Instantly share code, notes, and snippets.

@egonw
Created April 8, 2024 05:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egonw/d98c5ddf9f803a44a47addfa74ad3fca to your computer and use it in GitHub Desktop.
Save egonw/d98c5ddf9f803a44a47addfa74ad3fca to your computer and use it in GitHub Desktop.
CiTO nanopublications
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix dct: <http://purl.org/dc/terms/>
select ?np ?label ?subj ?citationrel ?obj ?date where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
?np dct:created ?date .
?np np:hasAssertion ?assertion .
optional { ?np rdfs:label ?label . }
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }
}
graph ?assertion {
?subj ?citationrel ?obj .
filter(regex(str(?citationrel), "^http://purl.org/spar/cito/.*$"))
filter(regex(str(?subj), "doi.org/10"))
filter(regex(str(?obj), "doi.org/10"))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment