Attributes | Values |
---|
type
| |
Date Created
| |
Date Modified
| |
label
| - VirtTipsAndTricksGuideQuadStorageInternally
|
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]]
|
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
| |
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 | |