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

Customizing SPARQL Endpoint Page

The following steps provide a guide how to change the sparql endpoint page. It offers opportunity for creating different variants of the page for different IRIs:

  1. Create a patched version of the procedure named WS.WS."/!sparql/". Its source text resides in libsrc/Wi/sparql_io.sql .
  2. Name the new version of the procedure from above with different name, for ex.: WS.WS."/!sparql_new/"
  3. Load it in ISQL:

    SQL>create procedure WS.WS."/!sparql_new/" (inout path varchar, inout params any, inout lines any) {.. http(' <p>TEST This query page is designed to help you test OpenLink Virtuoso .. } ; Done. -- 60 msec. SQL>

  4. Execute:

    SQL>DB.DBA.VHOST_REMOVE (lpath=>'/sparql');

  5. Execute:

    SQL>DB.DBA.VHOST_DEFINE (lpath=>'/sparql/', ppath => '/your-function-name/', is_dav => 1, vsp_user => 'dba', opts => vector('noinherit', 1)); -- so for ex.: SQL>DB.DBA.VHOST_DEFINE (lpath=>'/sparql/', ppath => '/!sparql_new/', is_dav => 1, vsp_user => 'dba', opts => vector('noinherit', 1));

  6. Execute:

    SQL>grant execute on WS.WS."your-function" to "SPARQL"; -- so for ex.: SQL>grant execute on WS.WS."/!sparql_new/" to "SPARQL";

    • Note: you should use double quotes around name of "SPARQL" user and the upper case, otherwise it will be confused with keyword SPARQL.
  7. Execute:

    SQL>registry_set ('/your-function-name/', 'no_vsp_recompile'); -- so for ex.: SQL>registry_set ('/!sparql_new/', 'no_vsp_recompile');

    • Note: if this step is omitted, the HTTP server will try to find the physical path in DAV storage or a filesystem, to read and compile the content as a procedure.
  8. Access the sparql endpoint page which now as result should contain your changes:

Powered By Virtuoso