Virtuoso Open-Source Wiki
Virtuoso Open-Source, OpenLink Data Spaces, and OpenLink Ajax Toolkit
Advanced Search
Location: / Dashboard / Main / VOSIndex / VOSRDF / VOSSPARQLDemo


Virtuoso comes with a demonstration of its SPARQL abilities, built on the W3C DAWG SPARQL test cases. This is the quickest way to get a feel for Virtuoso's SPARQL support.

If you have built the source distribution, the demo database is included. This database contains the SPARQL demo loaded into its WebDAV repository, accessible at http://localhost:8890/sparql_demo/ .

This demo provides a set of canned queries illustrating execution both directly or over SOAP, and how SPARQL translates to SQL, the types of query results and the expected results.

Modifying the Demo

The source code of the demo is located in binsrc/samples/sparql_demo in the source tree. The commands for loading the prepackaged sample data are found in the binsrc/samples/demo/ script.

To start using the demo on an empty database:

Connect to the server using isql:

$ isql 1111 dba dba

SQL> load binsrc/tests/rdf/rdf-exp.sql;   

-- This defines an executable virtual directory for the web interface of the demo.

SQL> ...

This defines the end point for the SPARQL protocol.

Having these in place, you can now edit the .vsp files of the demo as you wish. The files will be automatically reloaded by the server when first used after change.

Using SPARQL from SQL

A SPARQL query is a valid top-level SQL statement as well as a valid SQL subquery or derived table. Thus, assuming you have the test data loaded, as is the case with the demo database or if you have followed the instructions above, you can type for example:

SQL> sparql.....

The RDF top-level chapter in the on-line documentation contains additional information on Virtuoso's SPARQL support and how it works. If you are running the demo database, you will find the documentation located at http://localhost:8890/doc/html .

Powered By Virtuoso