1.5.13.How Can I define graph with virt:rdf_sponger option set to "on"?

Suppose we have the following scenario:

  1. Create Virtuoso user using Conductor for ex. with name "john" and pwd 1.

  2. 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.

  3. 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/
    
  4. Add another property virt:rdf_sponger with value "on".

    Figure1.2.


  5. Upload RDF files to the RDF Sink folder "MySinkFolder", for ex. upload file with name "data.rdf":

    Figure1.3.


  6. 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
    
    1. Go to http://host:port/sparql ;

    2. Execute simple query to view the graph triples:

      SELECT  *
      FROM <http://local.virt/DAV/home/john/MySinkFolder/data.rdf>
      WHERE
        {
          ?s ?p ?o
        }
      

      Figure1.4.


      Figure1.5.


  7. 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>.

  8. 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