Goal of this page

To operate SymbolicData on a local site requires access to the data via a web server at localhost and a Sparql endpoint.

On this page we describe how to set up your own Sparql endpoint at http://localhost:8890/sparql based on Apache running under a recent Linux Debian Ubuntu distribution.

Preliminary Remarks

There are plenty of RDF stores based on MySQL databases. Much of them are well suited for serving SymbolicData Data, too (we successfully used an arc2 based store).

Here we describe how to install an RDF infrastructure based on the more powerful RDF Engine Virtuoso and (optional) the RDF Editor Tool Ontowiki.

It may be necessary to adjust the apache settings in etc/php5/apache2/php.ini to be able to upload large knowledge bases:

   post_max_size = 128M
   short_open_tag = off
   memory_limit = 1280M
   upload_max_filesize = 128M

Caveat: In any case it is a good advice to upload larger RDF graphs via the Virtuoso console (as described below).

Moreover, mod_rewrite has to be activated since OntoWiki heavily uses URI Rewriting to comply with the Linked Open Data Standards.

Install the Virtuoso engine

The virtuoso engine can easily be installed with the single command

  sudo aptitude install virtuoso-opensource

For security reasons during installation you will be asked for a password for the db users ‘dba’ and ‘dav’ (default: dba). The password should match the regex [a-zA-Z0-9]+, i.e., have only letters and ciphers.

For details see http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VOSUbuntuNotes

The executables provided (in the virtuoso-opensource-6.1-bin package) are:

At server start time a Virtuoso database is started with configuration read from /etc/virtuoso-opensource-6.1/virtuoso.ini. The default settings point to

  isql-vt 1111 dba YourDBPassword

if the daemon is running.

(Optional) Create a new Virtuoso Database and start operation

Copy /etc/virtuoso-opensource-6.1/virtuoso.ini to a fresh directory /myPATH/myNewVDir, change all file names to local ones

  DatabaseFile                   = virtuoso.db
  ErrorLogFile                   = virtuoso.log
  LockFile                       = virtuoso.lck 
  TransactionFile                = virtuoso.trx
  xa_persistent_file             = virtuoso.pxa
  DatabaseFile                   = virtuoso-temp.db
  TransactionFile                = virtuoso-temp.trx

change the ports 1111 (new, e.g. 1112) and 8890 (new, e.g. 8891) to different ones and start a new daemon with

  cd /myPATH/myNewVDir; virtuoso-t +configfile virtuoso.ini 

This will generate all additional files in that directory and start the daemon. Access the database via console

  isql-vt 1112 dba dba

and first change the default password ‘dba’

  SQL> set password dba YourVerySecretPassword ;

The web front end to the new database will be available at http://localhost:8891.

Shut down the service from the console with

  isql-vt 1112 dba YourVerySecretPassword
  SQL> shutdown() ;

(Optional) Install Ontowiki

Ontowiki is a pure PHP application, that runs completely within the apache web server and can be configured by various plugins.

Ontowiki requires apache with php5 support. To operate with Virtuoso the php5-odbc extension has to be installed.

  sudo apt-get install php5-odbc php5 libapache2-mod-php5

hgg, 2014-01-09: We get reported for ubuntu 13.10, that ‘php-json’ is put (by legal restrictions) into a separate package and is required to be installed additionally.

The database service has to be be registered with ODBC. Add a section

   # SymbolicData OntoWiki dsn start
   [SDOW]
   Description=SymbolicData OntoWiki Virtuoso DSN
   Driver=/usr/lib/odbc/virtodbc.so
   Address=localhost:1111
   # SymbolicData OntoWiki dsn end

with a unique section name [SDOW] and the DBPort to the /etc/odbc.ini file.

hgg, 2013-07-22: I had a problem if the the port is not 1111, OntoWiki was installed under the default port instead of the port given here.

To run Ontowiki requires Apache with php5 and mod_rewrite enabled. A typical configuration in apache2/sites-enabled looks as follows:

   DocumentRoot /home/web/public_html
   <Directory /home/web/public_html/>
     Options Indexes FollowSymLinks MultiViews
     AllowOverride All 
     Order allow,deny
     Allow from all
   </Directory>

We recommend to deploy one Ontowiki instance per application.

We describe the main steps to deploy Ontowiki. See https://github.com/AKSW/OntoWiki/wiki/GetOntowikiUsers for details.

   git clone https://github.com/AKSW/OntoWiki.git
   make deploy

Security warning: In the current default installation (as of 2013-11-09, present also in 2014-03-01) the preconfigured Admin account has no password set and the Anonymous account has write access to all ontologies. This should be changed for an non local OntoWiki installation.

Data Management

To load SD data from the files supplied with the git repo directly into the Virtuoso engine the following steps are required:

1) Check out the repo to /YourPathTo/symbolicdata, add the path /YourPathTo/symbolicdata to the data part of the distribution to the DirsAllowed

  DirsAllowed =., /usr/share/virtuoso-opensource-6.1/vad, /YourPathTo/symbolicdata

and restart the daemon.

2) Load all turtle graphs into the Virtuoso Engine. The perl script at src/vsql/loaddata.pl writes the required output to stdout, that contains a number of records like

   sparql create silent graph <http://symbolicdata.org/Data/People/> ; 
   DB.DBA.TTLP_MT (file_to_string_output('/YourPathTo/symbolicdata/data/RDFData/People.ttl'),'[http://symbolicdata.org/Data/People/](http://symbolicdata.org/Data/People/)'); 

Read that into Virtuoso using the command line tool isql-vt:

   perl loaddata.pl | isql-vt 1111 dba YourVerySecretPassword

3) Check success from within the console

   isql-vt 1111 dba YourVerySecretPassword
   SQL> sparql select distinct ?s from <http://symbolicdata.org/Data/People/> where {?s ?p ?o};

and similar for the other graphs ‘Bibliography’, ‘PolynomialSystems’, ‘Systems’ etc. The command will list you the URIs of all instances in the given graph. Try the same at the Sparql endpoint http://localhost:8890/sparql with

   select distinct ?s from <http://symbolicdata.org/Data/People/> where {?s ?p ?o}

It should list the URIs of all people stored in the SD People knowledge base. Compare your output with that from http://symbolicdata.org:8890/sparql

Additional remarks about Virtuoso

More on config.ini

Adapt at least the items ServerPort in the Parameters section (default 1111), the ServerPort in the HTTPSection (default 8890) and the DirsAllowed. Different databases have to use different ports.

DirsAllowed contains a comma separated list of all directories where the service is allowed to read files. A file location in any subdirectory of the listed directories will be accepted. It is recommended to use absolute path names without file symlinks.

Change the Password

Open the console

  isql-v <DBServerPort> dba <passwd>

and change the password (standard user = dba, passwd = dba)

  SQL>  set password <old password> <new password>;

For curious people: Direct your Browser to http://localhost:8890. It will show you the Virtuoso VSP pages with a “phpmyadmin” like administration web frontend at http://localhost:8890/conductor. Not required for beginners.

Some useful commands

Shutdown the service from the console with

   SQL> shutdown() ;

Clear Data from a given graph:

   SQL> sparql clear graph <http://symbolicdata.org/Data/Annotations/> ; 

Graphs are not created automatically. If you have problems to display content in Ontowiki, a command as the following may help to resolve the trouble

   SQL> sparql create silent graph <http://symbolicdata.org/Data/Bibliography/> ;