<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>

<title>Simple Virtuoso Installation &amp; Utilization Guide for SPARQL Users (Update 5)</title><link>http://www.openlinksw.com/blog/kidehen@openlinksw.com/blog/?id=1647</link><description>What is SPARQL?
A declarative query language from the W3C for querying structured propositional data (in the form of 3-tuple [triples] or 4-tuple [quads] records) stored in a deductive database (colloquially referred to as triple or quad stores in Semantic Web and Linked Data parlance).
SPARQL is inherently platform independent. Like SQL, the query language and the backend database engine are distinct. Database clients capture SPARQL queries which are then passed on to compliant backend databases.
Why is it important?
Like SQL for relational databases, it provides a powerful mechanism for accessing and joining data across one or more data partitions (named graphs identified by IRIs). The aforementioned capability also enables the construction of sophisticated Views, Reports (HTML or those produced in native form by desktop productivity tools), and data streams for other services.
Unlike SQL, SPARQL includes result serialization formats and an HTTP based wire protocol. Thus, the ubiquity and sophistication of HTTP is integral to SPARQL i.e., client side applications (user agents) only need to be able to perform an HTTP GET against a URL en route to exploiting the power of SPARQL.
How do I use it, generally?

Locate a SPARQL endpoint (DBpedia, LOD Cloud Cache, Data.Gov, URIBurner, others),  or;
Install a SPARQL compliant database server (quad or triple store) on your desktop, workgroup server, data center, or cloud (e.g., Amazon EC2 AMI)
Start the database server
Execute SPARQL Queries via the SPARQL endpoint.


How do I use SPARQL with Virtuoso?
What follows is a very simple guide for using SPARQL against your own instance of Virtuoso:

Software Download and Installation
Data Loading from Data Sources exposed at Network Addresses (e.g. HTTP URLs) using very simple methods
Actual SPARQL query execution via SPARQL endpoint.

Installation Steps


Download Virtuoso Open Source or Virtuoso Commercial Editions


Run installer (if using Commercial edition of Windows Open Source Edition, otherwise follow build guide) 


Follow post-installation guide and verify installation by typing in the command: virtuoso -? (if this fails check you&#39;ve followed installation and setup steps, then verify environment variables have been set)


Start the Virtuoso server using the command: virtuoso-start.sh

 
Verify you have a connection to the Virtuoso Server via the command: isql localhost (assuming you&#39;re using default DB settings) or the command: isql localhost:1112 (assuming demo database) or goto your browser and type in: http://&amp;lt;virtuoso-server-host-name&amp;gt;:[port]/conductor (e.g. http://localhost:8889/conductor for default DB or http://localhost:8890/conductor if using Demo DB)


Go to SPARQL endpoint which is typically -- http://&amp;lt;virtuoso-server-host-name&amp;gt;:[port]/sparql


Run a quick sample query (since the database always has system data in place): select distinct * where {?s ?p ?o} limit 50 .

Troubleshooting

Ensure environment settings are set and functional -- if using Mac OS X or Windows, so you don&#39;t have to worry about this, just start and stop your Virtuoso server using native OS services applets
If using the Open Source Edition, follow the getting started guide -- it covers PATH and startup directory location re. starting and stopping Virtuoso servers.
Sponging (HTTP GETs against external Data Sources) within SPARQL queries is disabled by default. You can enable this feature by assigning &amp;quot;SPARQL_SPONGE&amp;quot; privileges to user &amp;quot;SPARQL&amp;quot;. Note, more sophisticated security exists via WebID based ACLs.



Data Loading Steps


Identify an RDF based structured data source of interest -- a file that contains 3-tuple / triples available at an address on a public or private HTTP based network

Determine the Address (URL) of the RDF data source
Go to your Virtuoso SPARQL endpoint and type in the following SPARQL query: DEFINE GET:SOFT &amp;quot;replace&amp;quot; SELECT DISTINCT * FROM &amp;lt;RDFDataSourceURL&amp;gt; WHERE {?s ?p ?o}


All the triples in the RDF resource (data source accessed via URL) will be loaded into the Virtuoso Quad Store (using RDF Data Source URL as the internal quad store Named Graph IRI) as part of the SPARQL query processing pipeline.



Note: the data source URL doesn&#39;t even have to be RDF based -- which is where the Virtuoso Sponger Middleware comes into play (download and install the VAD installer package first) since it delivers the following features to Virtuoso&#39;s SPARQL engine:



Transformation of data from non RDF data sources (file content, hypermedia resources, web services output etc..) into RDF based 3-tuples (triples)

Cache Invalidation Scheme Construction -- thus, subsequent queries (without the define get:soft &amp;quot;replace&amp;quot; pragma will not be required bar when you forcefully want to override cache).

If you have very large data sources like DBpedia etc. from CKAN, simply use our bulk loader .


SPARQL Endpoint Discovery
Public SPARQL endpoints are emerging at an ever increasing rate. Thus, we&#39;ve setup up a DNS lookup service that provides access to a large number of SPARQL endpoints. Of course, this doesn&#39;t cover all existing endpoints, so if our endpoint is missing please ping me.
Here are a collection of commands for using DNS-SD to discover SPARQL endpoints:

dns-sd -B _sparql._tcp sparql.openlinksw.com -- browse for services instances
dns-sd -Z _sparql._tcp sparql.openlinksw.com -- output results in Zone File format



Related


  Using HTTP from Ruby -- you can just make SPARQL Protocol URLs re. SPARQL

  Using SPARQL Endpoints via Ruby -- Ruby example using DBpedia endpoint

  Interactive SPARQL Query By Example (QBE) tool -- provides a graphical user interface (as is common in SQL realm re. query building against RDBMS engines) that works with any SPARQL endpoint


Other methods of loading RDF data into Virtuoso


Virtuoso Sponger -- architecture and how it turns a wide variety of non RDF data sources into SPARQL accessible data


Using OpenLink Data Explorer (ODE) to populate Virtuoso -- locate a resource of interest; click on a bookmarklet or use context menus (if using ODE extensions for Firefox, Safari, or Chrome); and you&#39;ll have SPARQL accessible data automatically inserted into your Virtuoso instance.


  W3C&#39;s SPARQLing Data Access Ingenuity -- an older generic SPARQL introduction post


Collection of SPARQL Query Examples -- GoodRelations (Product Offers), FOAF (Profiles), SIOC (Data Spaces -- Blogs, Wikis, Bookmarks, Feed Collections, Photo Galleries, Briefcase/DropBox, AddressBook, Calendars, Discussion Forums)


Collection of Live SPARQL Queries against LOD Cloud Cache -- simple and advanced queries.

</description><pubDate>Sun, 16 Jan 2011 07:06:21 GMT</pubDate><generator>Virtuoso Universal Server 08.03.3334</generator><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kingsley Uyi Idehen</dc:creator><image><title>Simple Virtuoso Installation &amp; Utilization Guide for SPARQL Users (Update 5)</title><url>http://www.openlinksw.com/weblog/public/images/vbloglogo.gif</url><link>http://www.openlinksw.com/blog/kidehen@openlinksw.com/blog/?id=1647</link><description>I have seen the future and it&#39;s full of Linked Data! :-)</description><width>88</width><height>31</height></image>
<item><title>Kingsley Uyi Idehen</title><guid>http://www.openlinksw.com/blog/kidehen@openlinksw.com/blog/?id=1647#4841</guid><link>http://www.openlinksw.com/blog/kidehen@openlinksw.com/blog/?id=1647#4841</link><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">kidehen@openlinksw.com</dc:creator><pubDate>Mon, 17 Jan 2011 18:36:57 GMT</pubDate><description>&lt;p&gt;&lt;br /&gt;
	&lt;embed height=&quot;0&quot; type=&quot;application/iodbc&quot; width=&quot;0&quot;&gt;Dan,&lt;/embed&gt;&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
	If using the commercial edition for Mac OS X, you simply use the applets we provide to start and stop the server. There&amp;#39;s no need to enter the shell.&amp;nbsp;&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
	When using the Open Source edition, you need to have the ~virtuoso-installer dir bin in PATH, then situate yourself in a directory with a database config file (INI).&amp;nbsp;&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
	Will get the steps above added to the VOS&amp;nbsp;guide as this will make life simpler.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
	Thanks!&lt;/p&gt;</description></item><item><title>Dan Brickley</title><guid>http://www.openlinksw.com/blog/kidehen@openlinksw.com/blog/?id=1647#4840</guid><link>http://www.openlinksw.com/blog/kidehen@openlinksw.com/blog/?id=1647#4840</link><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">danbri@danbri.org</dc:creator><pubDate>Sun, 16 Jan 2011 14:03:22 GMT</pubDate><description>&lt;p&gt;&lt;br /&gt;
	Thanks for posting this :)&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
	I was already at the stage where I&amp;#39;d configured, made and &amp;#39;make install&amp;#39;d on OSX, and was wondering what to do next.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
	&amp;quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 11px; &quot;&gt;Follow post-installation guide and verify installation by typing in the command: virtuoso -? (if this fails check you&amp;#39;ve followed installation and setup steps, then verify environment variables have been set)&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
	This didn&amp;#39;t work, so I&amp;#39;m a bit stuck. How do I check the right env vars are set? I tried just opening a fresh terminal, but same result - n sign of &amp;#39;virtuoso&amp;#39; command line. I took a look around the installed files, found &amp;nbsp;/usr/local/virtuoso-opensource/bin/ contains a &amp;#39;virtuoso-t&amp;#39; but that didn&amp;#39;t do anything when I ran it...&lt;/p&gt;
</description></item>
</channel>
</rss>
