Skip to content

Instantly share code, notes, and snippets.

@baskaufs
Last active October 16, 2021 15:56
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 baskaufs/379a694e1f4e235e3261972995fdfbf0 to your computer and use it in GitHub Desktop.
Save baskaufs/379a694e1f4e235e3261972995fdfbf0 to your computer and use it in GitHub Desktop.
SPARQL CONSTRUCT query to create a triple for a resource relationship to be run at https://sparql.vanderbilt.edu/
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix dcterms: <http://purl.org/dc/terms/>
construct {?subject ?predicate ?object}
from <https://resourcerelationship>
where {
bind("http://example.org/.well-known/genid/" as ?skolem)
?statement rdf:subject/dcterms:identifier ?subjectID.
?statement rdf:predicate/dcterms:identifier ?predicateID.
?statement rdf:object/dcterms:identifier ?objectID.
bind(iri(concat(?skolem, encode_for_uri(?subjectID))) as ?subject)
bind(iri(concat(?skolem, encode_for_uri(?predicateID))) as ?predicate)
bind(iri(concat(?skolem, encode_for_uri(?objectID))) as ?object)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment