VirtuosoRDFSinkFolder How to use Virtuoso's RDF Sink Folder How to use Virtuoso's RDF Sink Folder What is the RDF Sink Folder? WebDAV supports a special folder type for RDF uploads, called rdf_sink. This folder can be used to uploads RDF files from any WebDAV client. When a new user is created, a new WebDAV folder with name rdf_sink is automatically created in the user's home directory. The rdf_sink folder has two special properties - virt:rdf_graph and virt:rdf_sponger. WebDAV property names are prefixed with virt:, and these are not shown as resource/collection properties in the ODS Briefcase; they can only be seen in the Conductor. The properties of other DET folders are prefixed in the same way. The property virt:rdf_graph contains the name of the graph into which triples parsed from the uploaded files will be loaded. The property virt:rdf_sponger holds the upload method. <tgroup><thead /><tbody> <row /> <row><entry> on </entry><entry> The content of <emphasis>every file uploaded to that folder</emphasis> will be added to the RDF store using the Sponger method. </entry></row> <row><entry> off </entry><entry> The content of <emphasis>only files with special MIME types</emphasis> will be added to RDF store. </entry></row> </tbody></tgroup></table> </listitem> </itemizedlist><para>After the first upload into the folder, a new file is created with a name based on the RDF graph name. This file is dynamic, and contains all uploaded triples.</para> <para>Resources stored to the rdf_sink folder don't have any special properties.</para> <para>A user may see the properties of this folder through the Conductor UI, using the <emphasis>Properties</emphasis> button found to the right of the folder name. That page will include two <ulink url="WebDAV">WebDAV</ulink> properties, for instance --</para> <itemizedlist mark="bullet" spacing="compact"><listitem><emphasis>virt:rdf_graph</emphasis>: http://demo.openlinksw.com/DAV/home/demo/rdf_sink </listitem> <listitem><emphasis>virt:rdf_sponger</emphasis>: on</listitem> </itemizedlist><para>Users may change these values as other <ulink url="WebDAV">WebDAV</ulink> properties.</para> <bridgehead class="http://www.w3.org/1999/xhtml:h3"> Notes for Virtuoso upgraders</bridgehead> <para>When a Virtuoso DB is upgraded from a version which lacked the RDF Sink feature, to a version which includes it -- </para> <orderedlist spacing="compact"><listitem>A procedure is added to automatically create the rdf_sink folder in the home directory of existing users. </listitem> <listitem>The <emphasis>Add Users</emphasis> page of the Conductor is changed so that when any new user created with a <ulink url="WebDAV">WebDAV</ulink> home directory, then the rdf_sink folder is created too.</listitem> </orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> HTTP Content Negotiation</bridgehead> <para>How does it work?</para> <orderedlist spacing="compact"><listitem>When a file is uploaded to the rdf_sink folder, it is parsed for RDF data, which is then stored in 2 graphs: <itemizedlist mark="bullet" spacing="compact"><listitem>In the Public Graph specified as parameter for the rdf_sink folder, containing RDF data from all files stored there; </listitem> <listitem>In a Private Graph, containing only RDF data from this file; </listitem> </itemizedlist></listitem> <listitem>A rewrite rule is added for the virtual path "/DAV" especially for the rdf_sink folder. </listitem> <listitem>When the file is dereferenced and the user agent specifies one of the following content types in its Accept: header, then the parsed content of the file is returned from the private graph in accepted type. <itemizedlist mark="bullet" spacing="compact"><listitem>application/rdf+xml </listitem> <listitem>application/foaf+xml </listitem> <listitem>text/rdf+n3 </listitem> <listitem>text/rdf+ttl </listitem> <listitem>application/rdf+n3 </listitem> <listitem>application/rdf+turtle </listitem> <listitem>application/turtle </listitem> <listitem>application/x-turtle</listitem> </itemizedlist></listitem> </orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Examples</bridgehead> <bridgehead class="http://www.w3.org/1999/xhtml:h3"> Example 1</bridgehead> <para>User demo uploads an RDF file to the rdf_sink folder at <ulink url="http://demo.openlinksw.com/ods">http://demo.openlinksw.com/ods</ulink>: </para> <orderedlist spacing="compact"><listitem>Go to demo user's Briefcase instance home page. </listitem> <listitem>Upload the RDF file (e.g., "TimBLcard.rdf") to the rdf_sink folder. </listitem> <listitem>After upload, "http___demo.openlinksw.com_DAV_home_demo_rdf_sink_.RDF" DET file is created. </listitem> <listitem>The RDF data will then be loaded into the graph name specified in the virt:rdf_graph property for the rdf_sink folder, i.e., http://demo.openlinksw.com/DAV/home/demo/rdf_sink.</listitem> </orderedlist><para> </para> <bridgehead class="http://www.w3.org/1999/xhtml:h3"> Example 2</bridgehead> <para>Suppose there is myfoaf.rdf file with the following content:</para> <programlisting><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> </programlisting><para> Now let's upload the myfoaf.rdf file to destination server demo.openlinksw.com, for user demo:</para> <programlisting>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> </programlisting><para> </para> <bridgehead class="http://www.w3.org/1999/xhtml:h2"> See Also</bridgehead> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://ods.openlinksw.com/dataspace/dav/wiki/ODS/ODSRDFSinkFolder">ODS RDF Sink Folder</ulink></listitem> </itemizedlist><para><ulink url="CategoryVirtuoso">CategoryVirtuoso</ulink> <ulink url="CategoryDAV">CategoryDAV</ulink> <ulink url="CategorySpec">CategorySpec</ulink></para> </section></docbook>