Last active
November 13, 2019 19:01
-
-
Save white-gecko/7a3a8f3bcac8832752905f9dd1d0f765 to your computer and use it in GitHub Desktop.
If you want to query a complete dataset with a single construct query.
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
PREFIX ex: <http://example.org/> | |
CONSTRUCT { | |
?s ?p ?o . | |
?g a ex:Graph ; | |
ex:hasData ?datalit . | |
} WHERE { | |
{ | |
?s ?p ?o . | |
} UNION { | |
GRAPH ?g { | |
?gs ?gp ?go | |
BIND(CONCAT("<", STR(?gs), "> <", STR(?gp), "> <", STR(?go), "> .") as ?datalit) | |
} | |
} | |
} |
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
PREFIX ex: <http://example.org/> | |
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
CONSTRUCT { | |
?s ?p ?o . | |
?g a ex:Graph ; | |
ex:hasData [ a rdf:Statement ; | |
rdf:subject ?gs ; | |
rdf:predicate ?gp ; | |
rdf:object ?go ] . | |
} WHERE { | |
{ | |
?s ?p ?o . | |
} UNION { | |
GRAPH ?g { | |
?gs ?gp ?go | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment