• Topic
  • Discussion
  • VOS.VirtSparqlCxmlDETs(Last) -- DAVWikiAdmin? , 2017-06-29 07:40:47 Edit WebDAV System Administrator 2017-06-29 07:40:47

    Pivot Collections (Part 7)

    Contents

    Part 1: Introduction

    Part 2: SparqlCxml

    Part 3: SparqlCxml Deep Zoom Collections

    Part 4: PivotViewer

    Part 5: Importing CXML

    Part 6: Facet Pivot Bridge

    Part 7: DETs : Persisting SPARQL Query Results to DAV

    Part 8: Frequently Asked Questions (FAQs)

    Part 9: Glossary


    DETs : Persisting SPARQL Query Results to DAV

    Overview

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

    SPARQL Endpoint Support for DETs

    By default, Virtuoso'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 "dynamic" resources in DAV storage. To this end, Conductor's /sparql UI exposes Virtuoso'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.

    Enabling /sparql DETs

    The easiest way to enable this feature is through Conductor:

    Go to the 'System Admin' > 'User Accounts' tab and choose the 'Edit' option for Login name 'SPARQL'

    • Set the 'DAV Home Path' to /DAV/home/SPARQL/ (include the leading and trailing slashes) and click the 'create' checkbox
    • Set the 'Default Permissions' on this folder to allow the required access, e.g. set +r for public or a specific group
    • Change the 'User type' to 'SQL/ODBC and WebDAV'

    Open the newly created DAV/home/SPARQL folder using Conductor's WebDAV browser

    • Create a new folder named 'saved-sparql-results'. (Use the folder icon at the top of the dialog).
    • Set the 'Owner' to 'dav'
    • Set the 'Folder type' to 'Dynamic Resources'
    • Set the folder permissions to allow public or group access

    The net effect of the above steps is:
       1. The "SPARQL" 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 "saved-sparql-results" is created with DAV Extension Type "DynaRes"
    

    Once enabled, the /sparql UI will show additional options for saving query results, as depicted below:

    When a SPARQL result has been successfully saved to DAV, Conductor displays a confirmation dialog:

    and the generated dynamic resource can be seen in WebDAV: