<docbook><section><title>VirtSparqlCxmlDETs</title><title>Pivot Collections (Part 7)</title>Pivot Collections (Part 7)
<bridgehead class="http://www.w3.org/1999/xhtml:h2">Contents</bridgehead>
<para>Part 1: <ulink url="VirtSparqlCxml">Introduction</ulink></para>
<para>Part 2: <ulink url="VirtSparqlCxml">SparqlCxml</ulink></para>
<para>Part 3: <ulink url="VirtSparqlCxmlDzcs">SparqlCxml Deep Zoom Collections</ulink></para>
<para>Part 4: <ulink url="VirtSparqlCxmlPivotViewer">PivotViewer</ulink></para>
<para>Part 5: <ulink url="VirtSparqlCxmlImport">Importing CXML</ulink></para>
<para>Part 6: <ulink url="VirtSparqlCxmlFacetPivotBridge">Facet Pivot Bridge</ulink></para>
<para>Part 7: DETs : Persisting SPARQL Query Results to DAV</para>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="#AncSparqlCxmlDETs">DETs : Persisting SPARQL Query Results to DAV</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="#AncSparqlCxmlDETsOverview">Overview</ulink> </listitem>
<listitem><ulink url="#AncSparqlDETSupport">SPARQL Endpoint Support for DETs</ulink> </listitem>
<listitem><ulink url="#AncEnablingSparqlDETs">Enabling /sparql DETs</ulink></listitem>
</itemizedlist></listitem>
</itemizedlist><para>Part 8: <ulink url="VirtSparqlCxmlFAQs">Frequently Asked Questions (FAQs)</ulink></para>
<para>Part 9: <ulink url="VirtSparqlCxmlGlossary">Glossary</ulink></para>
<para> <ulink url="">
 </ulink></para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2">DETs : Persisting SPARQL Query Results to DAV</bridgehead>
<ulink url="">
<para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3">Overview</bridgehead>
<para>Virtuoso&#39;s Dynamic Extension Types (DETs) provide a powerful mechanism for generating dynamic hypermedia resources that are akin to materialized views from database queries.
 DETs are useful in cases where clients do not support the requisite access mechanism for a specific data source but, because most modern operating systems are WebDAV compliant, are able to load a file from WebDAV.
 In situations like this, Virtuoso allows you to create an HTTP accessible resource from a query that&#39;s then exposed as a file in a WebDAV folder.
 WebDAV clients, for instance Windows Web Client, can connect to WebDAV storage and access this resource as if it was a plain local file.
 These resources may be temporary or long lived.</para>
<ulink url="">
<para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3">SPARQL Endpoint Support for DETs</bridgehead>
<para>By default, Virtuoso&#39;s /sparql endpoint can only send query results back to the client.
 This can be inconvenient if the result needs to be accessible to programs like file managers and archivers.
 The solution is to let the endpoint create &quot;dynamic&quot; resources in DAV storage.
 To this end, Conductor&#39;s /sparql UI exposes Virtuoso&#39;s DET capability through options which allow you to save SPARQL query results to WebDAV and serve the results without needing to re-execute the query.
 Any of the supported SPARQL result set serialization formats can be used to write the results to file.</para>
<ulink url="">
<para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3">Enabling /sparql DETs</bridgehead>
<para>The easiest way to enable this feature is through Conductor:</para>
<para>Go to the &#39;System Admin&#39; &gt; &#39;User Accounts&#39; tab and choose the &#39;Edit&#39; option for Login name &#39;SPARQL&#39; </para>
<itemizedlist mark="bullet" spacing="compact"><listitem>Set the &#39;DAV Home Path&#39; to /DAV/home/SPARQL/ (include the leading and trailing slashes) and click the &#39;create&#39; checkbox </listitem>
<listitem>Set the &#39;Default Permissions&#39; on this folder to allow the required access, e.g.
 set +r for public or a specific group </listitem>
<listitem>Change the &#39;User type&#39; to &#39;SQL/ODBC and WebDAV&#39;</listitem>
</itemizedlist><para>Open the newly created DAV/home/SPARQL folder using Conductor&#39;s WebDAV browser </para>
<itemizedlist mark="bullet" spacing="compact"><listitem>Create a new folder named &#39;saved-sparql-results&#39;.
 (Use the folder icon at the top of the dialog).
</listitem>
<listitem>Set the &#39;Owner&#39; to &#39;dav&#39; </listitem>
<listitem>Set the &#39;Folder type&#39; to &#39;Dynamic Resources&#39; </listitem>
<listitem>Set the folder permissions to allow public or group access</listitem>
</itemizedlist><programlisting>The net effect of the above steps is:
   1. The &quot;SPARQL&quot; account under which the /sparql service runs is granted access to DAV (by setting U_DAV_ENABLE=1 in table DB.DBA.SYS_USERS)
   2. A DAV home directory /DAV/home/SPARQL/ is created for the SPARQL account and the path saved in the U_HOME field of table DB.DBA.SYS_USERS
   3. A subdirectory named &quot;saved-sparql-results&quot; is created with DAV Extension Type &quot;DynaRes&quot;
</programlisting><para> Once enabled, the /sparql UI will show additional options for saving query results, as depicted below:</para>
<para> <figure><graphic fileref="VirtSparqlCxmlDETs/sparql_save_as_det.jpg" /></figure> </para><para>When a SPARQL result has been successfully saved to DAV, Conductor displays a confirmation dialog:</para>
<para> <figure><graphic fileref="VirtSparqlCxmlDETs/det_create_success.jpg" /></figure> </para><para>and the generated dynamic resource can be seen in WebDAV:</para>
<para> <figure><graphic fileref="VirtSparqlCxmlDETs/sparql_det_webdav_view.jpg" /></figure> </para> </ulink></ulink></ulink></section></docbook>