Last active
November 13, 2020 08:27
-
-
Save namedgraph/be9f144086c0cf7b48171f82d6d0e0ac to your computer and use it in GitHub Desktop.
Splits the default RDF graph into named graph per subject URI (does not change the default graph)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT { | |
GRAPH ?graph { | |
?s ?p ?o . | |
} | |
} | |
WHERE | |
{ { SELECT DISTINCT ?s | |
WHERE | |
{ ?s ?p ?o } | |
} | |
BIND(SHA1(str(?s)) AS ?sha1) | |
BIND(uri(concat(str(<graphs/>), ?sha1, "/")) AS ?graph) | |
?s ?p ?o | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment