1.5.13. How Can I define graph with virt:rdf_sponger option set to "on"?
Suppose we have the following scenario:
-
Create Virtuoso user using Conductor for ex. with name "john" and pwd 1.
-
Create for the user a RDF Sink folder for ex. with name "MySinkFolder" from type "RDF Upload Folder" or use the
rdf_sink
folder created automatically for your user.
-
In the properties page of the RDF sink folder add in the WebDAV section this property
virt:rdf_graph
with value:
http://host:port/DAV/home/<user-name>/<rdf-sink-folder>/ -- So in our example it should be: http://example.com/DAV/home/john/MySinkFolder/
-
Add another property virt:rdf_sponger with value "on".
Figure 1.2.
-
Upload RDF files to the RDF Sink folder "MySinkFolder", for ex. upload file with name "data.rdf":
Figure 1.3.
-
As result the RDF data should be stored in graph depending on your folder name etc.:
http:///local.virt/DAV/home/<user-name>/<rdf-sink-folder>/<resource> -- So in our example it will be: http:///local.virt/DAV/home/john/MySinkFolder/data.rdf
-
Go to http://host:port/sparql ;
-
Execute simple query to view the graph triples:
SELECT * FROM <http://local.virt/DAV/home/john/MySinkFolder/data.rdf> WHERE { ?s ?p ?o }
Figure 1.4.
Figure 1.5.
-
-
In order to define any graph you want with the options from above, you should execute:
SQL> DAV_PROP_SET ('/DAV/home/<user-name>/<rdf-sink-folder>/', 'virt:rdf_graph', iri, <user-name>, <password>); -- So in our example it should be: SQL> DAV_PROP_SET ('/DAV/home/john/MySinkFolder/', 'virt:rdf_graph', 'http://mydata.com', 'john', '1');
-
Note: calling this function uses the given IRI as the graph IRI when sponging stuff put in <your-rdf-sink-folder>.
-
-
Finally you should execute the following command to get the RDF data from the new graph:
SQL> SELECT DAV_PROP_GET ('/DAV/home/<user-name>/<your-rdf-sink-folder>/', 'virt:rdf_graph',<user-name>, <password>); -- So in our example it should be: SQL> SELECT DAV_PROP_GET ('/DAV/home/john/MySinkFolder/', 'virt:rdf_graph','john', '1'); Query result: DAV_PROP_GET http://example.com/DAV/home/john/MySinkFolder/ No. of rows in result: 1