Virtuoso Open-Source Wiki
Virtuoso Open-Source, OpenLink Data Spaces, and OpenLink Ajax Toolkit
Advanced Search
Help?
Location: / Dashboard / Main / VirtuosoRDFSinkFolder

Virtuoso RDF Sink Folder

WebDAV supports special folder for RDF uploads with name rdf_sink. This folder is used for uploads of the RDF files from any WebDAV client.

  1. When a new user is created, then a new WebDAV folder with name rdf_sink is created in the user's home directory;
  2. The folder has two properties - virt:rdf_graph and virt:rdf_sponger. Names of the WebDAV properties are prefixed with virt:. The properties of the other DET folders are also prefixed in the same way. Properties prefixed with virt: are not shown as resource/collection properties in the ODS Briefcase - they can be seen only in the Conductor. Uploaded resources in the rdf_sink folder don't have any special properties.
    1. The property virt:rdf_graph contains the name of the graph for uploads.
    2. The property virt:rdf_sponger points to the upload method. If it is "on" then the content of every file uploaded to that folder is added to RDF store using the Sponger method. If this value is "off" then only files with special mime types are added to RDF store. After the first upload into the folder a new file is created too with a name based on rdf graph name - this file is dynamic and contains all uploaded triples;
  3. For the existing users is added a procedure for automatic creation of the rdf_sink folder in their home directory;
  4. The Conductor add users page is changed so that when a new user is created with option for creating WebDAV home directory, then the rdf_sink folder is created too;

From the Conductor UI an user may see properties for this folder using properies button at the right of the folder name. The opened page shows two WebDAV properties:

  1. virt:rdf_graph: for ex. http://demo.openlinksw.com/DAV/home/demo/rdf_sink
  2. virt:rdf_sponger: for ex. "on".

User may change these values as other WebDAV properties.

Sample Example

User demo uploads at http://demo.openlinksw.com/ods rdf file in the rdf_sink folder:
  1. Go to demo user's Briefcase instance home page.
  2. Upload the RDF file ("TimBLcard.rdf") in the rdf_sink folder.
  3. After upload "http___demo.openlinksw.com_DAV_home_demo_rdf_sink_.RDF" DET file is created.
  4. The RDF data will then be loaded into the graph name specified in the virt:rdf_graph property for the rdf_sink folder, ex http://demo.openlinksw.com/DAV/home/demo/rdf_sink .

HTTP Content Negotiation

How does it work?

  1. When a file is uploaded in the rdf_sink like folder, then its content as RDF data is stored in 2 graphs:
    1. In the Public Graph specified as parameter for the rdf_sink folder containing RDF data from all files;
    2. In the Private Graph containing only RDF data from this file;
  2. Rewrite rule is added for the virtual path "/DAV" especially for the rdf_sink folder.
  3. When file is accessed with one of the following content types: application/rdf+xml, application/foaf+xml, text/rdf+n3, text/rdf+ttl, application/rdf+n3, application/rdf+turtle, application/turtle, application/x-turtle, then the content of the file is returned from the private graph in accepted type.

Simple Usage Example

Suppose there is myfoaf.rdf file with the following content:
<rdf:RDF xmlns="http://www.example/jose/foaf.rdf#"
    xmlns:foaf="http://xmlns.com/foaf/0.1/"
    xmlns:log="http://www.w3.org/2000/10/swap/log#"
    xmlns:myfoaf="http://www.example/jose/foaf.rdf#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

    <foaf:Person rdf:about="http://www.example/jose/foaf.rdf#jose">
        <foaf:homepage rdf:resource="http://www.example/jose/"/>
        <foaf:knows rdf:resource="http://www.example/jose/foaf.rdf#juan"/>
        <foaf:name>Jose Jimen~ez</foaf:name>
        <foaf:nick>Jo</foaf:nick>
        <foaf:workplaceHomepage rdf:resource="http://www.corp.example/"/>
    </foaf:Person>

    <foaf:Person rdf:about="http://www.example/jose/foaf.rdf#juan">
        <foaf:mbox rdf:resource="mailto:juan@mail.example"/>
    </foaf:Person>

    <foaf:Person rdf:about="http://www.example/jose/foaf.rdf#julia">
        <foaf:mbox rdf:resource="mailto:julia@mail.example"/>
    </foaf:Person>

    <rdf:Description rdf:about="http://www.example/jose/foaf.rdf#kendall">
        <foaf:knows rdf:resource="http://www.example/jose/foaf.rdf#edd"/>
    </rdf:Description>
</rdf:RDF>

Now let's upload the myfoaf.rdf file to destination server demo.openlinksw.com for user demo:

File: myfoaf.rdf
Destination Server: demo.openlinksw.com

curl -T myfoaf.rdf http://demo.openlinksw.com/DAV/home/demo/rdf_sink/myfoaf.rdf -u demo:demo
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
  <TITLE>201 Created</TITLE>
</HEAD>
<BODY>
  <H1>Created</H1>
  Resource /DAV/home/demo/rdf_sink/ myfoaf.rdf has been created.
</BODY>
</HTML>

See Also

Powered By Virtuoso