Attributes | Values |
---|
type
| |
Date Created
| |
Date Modified
| |
label
| - VirtTipsAndTricksGuideQuadStorageInternally
|
seeAlso
| |
maker
| |
Title
| - VirtTipsAndTricksGuideQuadStorageInternally
|
isDescribedUsing
| |
has creator
| |
content
| - %META:TOPICPARENT{name="VirtTipsAndTricksGuide"}%
---++How can I see which quad storages exist and in which quad storage a graph resides?
Let's take for example a [[http://virtuoso.openlinksw.com/whitepapers/relational%20rdf%20views%20mapping.html][created RDF view from relational data in Virtuoso]]. The RDF output therefor should have two graphs which reside in a quad storage named for ex.:
<verbatim>
http://localhost:8890/rdfv_demo/quad_storage/default
</verbatim>
Also the RDF is accessible over the SPARQL endpoint with the following query:
<verbatim>
define input:storage <http://localhost:8890/rdfv_demo/quad_storage/default>
SELECT *
WHERE
{
?s ?p ?o
}
</verbatim>
Now one could ask is there a way to define internally (once) that the quad storage should be included in queries to the SPARQL endpoint? So that the user does not have to define the <b>input:storage</b> explicitly in each query, like this:
<verbatim>
http://localhost:8890/sparql?query=select * where { ?s ?p ?o }&default-graph-uri=NULL&named-graph-uri=NULL
</verbatim>
All metadata about all RDF storages are kept in "system" graph <http://www.openlinksw.com/schemas/virtrdf#> ( namespace prefix
<b>virtrdf:</b> ). Subjects of type <b>virtrdf:QuadStorage</b> are RDF storages. There are three of them by default:
<verbatim>
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.
</verbatim>
1 <b>virtrdf:DefaultQuadStorage</b> is what's in use if no input:storage specified.
1 <b>virtrdf:DefaultServiceStorage</b> will be used for SPARQL federation.
1 <b>virtrdf:SyncToQuads</b> is to keep the list of Linked Data Views that are translated into RDB2RDF triggers.
There are two ways of using the Linked Data View from above in SPARQL endpoint without <b>define input:storage</b>:
1. Create Linked Data View right in <b>virtrdf:DefaultQuadStorage</b> or add the view in other storage and then copy it from there to <b>virtrdf:DefaultQuadStorage</b>.
* In any of these two variants, use:
<verbatim>
SPARQL ALTER QUAD STORAGE virtrdf:DefaultQuadStorage . . .
</verbatim>
1. Use <b><nowiki>SYS_SPARQL_HOST</b></nowiki> table as described [[http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfdefaultgraph][here]] and set <b><nowiki>SH_DEFINES</b></nowiki> so it contains your favorite define input:storage
---+++Related
* [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]]
* [[http://docs.openlinksw.com/virtuoso/rdfsparql.html][SPARQL]]
- %META:TOPICPARENT{name="VirtTipsAndTricksGuide"}%
---+ How can I see which quad storages exist and in which quad storage a graph resides?
Let's take for example a
[[http://virtuoso.openlinksw.com/whitepapers/relational%20rdf%20views%20mapping.html][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 --
<verbatim>
http://localhost:8890/rdfv_demo/quad_storage/default
</verbatim>
The RDF is also accessible through the SPARQL endpoint with a query like --
<verbatim>
DEFINE input:storage <http://localhost:8890/rdfv_demo/quad_storage/default>
SELECT *
WHERE
{
?s ?p ?o
}
</verbatim>
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 <b>input:storage</b> explicitly in each query?
<verbatim>
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
</verbatim>
All metadata about all RDF storages are kept in "system" graph <code><nowiki><http://www.openlinksw.com/schemas/virtrdf#></nowiki></code>
(with built-in, predefined namespace prefix, <b><code>virtrdf:</code></b>). Subjects of type <b><code><nowiki>virtrdf:QuadStorage</nowiki></code></b>
are RDF storages. There are three of them by default:
<verbatim>
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.
</verbatim>
* <b><code><nowiki>virtrdf:DefaultQuadStorage</nowiki></code></b> is used if no <code>input:storage</code> is specified.
* <b><code><nowiki>virtrdf:DefaultServiceStorage</nowiki></code></b> is used for SPARQL Federation.
* <b><code><nowiki>virtrdf:SyncToQuads</nowiki></code></b> 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 <code>define input:storage</code> declaration.
* Create a Linked Data View right in <b><code><nowiki>virtrdf:DefaultQuadStorage</nowiki></code></b>; or add the view in other storage, and then
copy it from there to <b><code><nowiki>virtrdf:DefaultQuadStorage</nowiki></code></b>. In either case, use:
<verbatim>
SPARQL ALTER QUAD STORAGE virtrdf:DefaultQuadStorage . . .
</verbatim>
* Use <b><code><nowiki>SYS_SPARQL_HOST</nowiki></code></b> table as [[http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfdefaultgraph][described here]], and set <b><code><nowiki>SH_DEFINES</nowiki></code></b> so it contains your favorite <code>define input:storage</code>.
---++ Related
* [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]]
* [[http://docs.openlinksw.com/virtuoso/rdfsparql.html][SPARQL]]
|
id
| - 21f4d615f871ee317ae5515f553d247d
|
link
| |
has container
| |
http://rdfs.org/si...ices#has_services
| |
atom:title
| - VirtTipsAndTricksGuideQuadStorageInternally
|
links to
| |
atom:source
| |
atom:author
| |
atom:published
| |
atom:updated
| - 2017-06-13T05:36:47Z
- 2018-04-23T11:40:44Z
|
topic
| |
is made
of | |
is container of
of | |
is link
of | |
is http://rdfs.org/si...vices#services_of
of | |
is links to
of | |
is creator of
of | |
is atom:entry
of | |
is atom:contains
of | |