Let's take for example a Linked Data (RDF) View created from relational data in Virtuoso. The RDF output should have two graphs which reside in a quad storage named, for example --
http://localhost:8890/rdfv_demo/quad_storage/default
The RDF is also accessible through the SPARQL endpoint with a query like --
DEFINE input:storage <http://localhost:8890/rdfv_demo/quad_storage/default> SELECT * WHERE { ?s ?p ?o }
One might ask, is there a way to tell Virtuoso (once) that the quad storage should always be included in all queries to the SPARQL endpoint, such that the user does not have to define the input:storage explicitly in each query?
http://localhost:8890/sparql?qtxt=SELECT%20*%20WHERE%20%7B%20%3Fs%20%3Fp%20%3Fo%20%7D&default-graph-uri=NULL&named-graph-uri=NULL
All metadata about all RDF storages are kept in "system" graph <http://www.openlinksw.com/schemas/virtrdf#>
(with built-in, predefined namespace prefix, virtrdf:
).
Subjects of type virtrdf:QuadStorage
are RDF storages.
There are three of them by default:
SQL> SPARQL SELECT * FROM virtrdf: WHERE { ?s a virtrdf:QuadStorage }; s VARCHAR _______________________________________________________________________________ http://www.openlinksw.com/schemas/virtrdf#DefaultQuadStorage http://www.openlinksw.com/schemas/virtrdf#DefaultServiceStorage http://www.openlinksw.com/schemas/virtrdf#SyncToQuads 3 Rows. -- 3 msec.
virtrdf:DefaultQuadStorage
is used if no input:storage
is specified.
virtrdf:DefaultServiceStorage
is used for SPARQL Federation.
virtrdf:SyncToQuads
is used to keep the list of Linked Data Views that are translated into RDB2RDF triggers.There are two ways of using one of these Linked Data Views in SPARQL endpoint without making a define input:storage
declaration.
virtrdf:DefaultQuadStorage
; or add the view in other storage, and then copy it from there to virtrdf:DefaultQuadStorage
.
In either case, use:
SPARQL ALTER QUAD STORAGE virtrdf:DefaultQuadStorage . . .
SYS_SPARQL_HOST
table as described here, and set SH_DEFINES
so it contains your favorite define input:storage
.