This section is for users and system administrators that are unfamiliar with the GraphDB-Lite semantic repository software. The information contained in the following pages should be enough to get started with GraphDB-Lite, i.e. to install and configure the software, so that repository instances can be created and used.
GraphDB-Lite is packaged as a Storage and Inference Layer (SAIL) for the Sesame RDF framework. GraphDB-Lite can be used in two different ways:
Library: One approach is to integrate GraphDB-Lite in an application using it as a library. An example of doing this is given in the 'getting-started' folder of the GraphDB-Lite distribution zip file. Users intending to use GraphDB-Lite in this way do not need to install the Sesame Web applications (Server and Workbench) and need only to set a few environment variables as detailed in the configuration section of the GraphDB-Lite user guide.
Server: Those users wishing to use GraphDB-Lite via the Sesame Server, with or without the Sesame Workbench, should proceed with one of the two approaches detailed in this section. This will cover installing Sesame and integrating GraphDB-Lite in to the Sesame framework, so that GraphDB-Lite can be used as a plug-in repository type. This approach involves deploying Sesame/GraphDB-Lite via a servlet server, such as Tomcat. The Sesame installation comes with a useful 'workbench' Web application that can be used for many administration tasks.
The rest of this section gives detailed step by step instructions for installing and configuring Sesame and GraphDB-Lite, leading up to the creation of a GraphDB-Lite repository using the Sesame console (a command line script). For more information please check the "doc" folder of the GraphDB-Lite distribution zip file.
Easy install
GraphDB will normally be built against the latest version of the Aduna OpenRDF Sesame framework. If using GraphDB with this version then the easiest way to deploy a GraphDB server instance is to copy the re-packaged Sesame Web applications (.war files) in to the Tomcat webapps directory. These can be found in the sesame_owlim directory in the GraphDB distribution ZIP file. These Web applications have been modified as follows:
openrdf-sesame.war: The Sesame server application. All GraphDB-Lite and 3rd party jar files have been added to this package, so that it can be used immediately after deployment.
openrdf-workbench.war: The GraphDB-Lite jar, XSLT configuration code and a GraphDB-Lite Turtle configuration file have been added, so that new GraphDB-Lite instances can be created using the Workbench without the need to run the command line console application.
After deployment, a GraphDB-Lite instance can be created using the workbench application as follows:
Start a browser and go to the Workbench Web application using a URL of this form: http://localhost:8080/openrdf-workbench/ - substituting localhost and the 8080 port number as appropriate.
Click 'change server' if necessary to select a Sesame server instance if it is running on a different machine. The server URL will be of this form: http://localhost:8080/openrdf-sesame
After selecting a server, click 'New repository'
Select 'GraphDB-Lite' from the drop-down and enter the repository ID and description. Then click 'next'.
Fill in the fields as required and click 'create'.
A message should be displayed that gives details of the new repository and this should also appear in the repository list (click 'repositories' to see this).
All configuration parameters that accept file/path names must use forward slashes ('/') even on Windows systems.
Longer install
This longer install process should be used when a different or modified version of Sesame is being used. In this case, all the GraphDB-Lite files needs to be installed alongside Sesame in a step-by-step process as follows.
Preparation
A suitable application server must be installed. The examples in this guide assume Apache Tomcat version 6.x is used. Importantly, the user must have sufficient privileges to write to the Tomcat webapps directory and to stop and start the Tomcat daemon.
An GraphDB-Lite distribution is required. This is published as a zip file. The examples in this guide use version 6.
The Aduna OpenRDF Sesame framework version 2.7 is required for the longer installation. The examples in this guide use version 2.7.2.
Another application server can be used instead of Tomcat. However, the rest of this guide describes the installation of GraphDB-Lite with this software.
No part of this guide is intended to supersede the documentation published with these 3rd party software components and the reader is strongly advised to familiarise himself/herself with these.
Installation
Assuming that an instance of Tomcat is available, the installation proceeds as follows:
Install and deploy Sesame;
Install GraphDB-Lite and deploy the GraphDB-Lite jar file;
Add the GraphDB-Lite repository template file to the Sesame console configuration;
Use the Sesame console to create a new repository.
Step by step (vanilla)
Locate the Tomcat webapps directory, hereafter called [WEBAPPS].
Unzip the Sesame 2 distribution zip file. The Sesame 'root' directory will be called [SESAME].
Unzip the GraphDB-Lite distribution. The top level unzipped directory will be called [GraphDBLITE].
Deploy the Sesame Web applications by copying the war files in [SESAME]/war to [WEBAPPS].
Alternatively, use the Tomcat manager interface at http://localhost:8080/manager/html to deploy the Web applications. If this approach is used then ensure that a manager user account exists. The following lines should be added to: [tomcat-directory]/conf/tomcat-users.xml substituting your own password:
Restart Tomcat
Run the Sesame console once to create its configuration directory by executing [SESAME]/bin/console.sh (.bat) and then type quit. at the command prompt. Locate the data directory here:
Create the 'templates' folder here and copy the GraphDB-Lite repository template to it. This file is found here: [GraphDBLITE]/templates/owlim-lite.ttl
Copy the GraphDB-Lite jar file to Sesame console and Sesame server, i.e. from [GraphDBLITE]/lib to [SESAME]/lib and [WEBAPPS]/openrdf-sesame/WEB-INF/lib
Restart Tomcat
Run the Sesame console [SESAME]/bin/console.sh (.bat)
Run the Sesame console to create a new repository:
openrdf-sesame-2.*/bin/console.sh
Connect to the Sesame server:
connect http://localhost:8080/openrdf-sesame .
Create a new repository:
create owlim-lite .
At this point values for a number of parameters are asked for, but all the defaults can be accepted pressing <return> for each question. When finished, the message 'Repository created' should be displayed.
Exit the console:
quit .
The status of the new repository can be checked using the Sesame workbench. Type the following URL in to a browser:
http://localhost:8080/openrdf-workbench
Alternatively, execute a test query against the Sesame Server's SPARQL endpoint:
Restart Tomcat using the Tomcat monitor icon in the system try or from the Start menu
Run the Sesame console to create a new repository:
openrdf-sesame-2.7.2\bin\console.bat
Connect to the Sesame server:
connect http://localhost:8080/openrdf-sesame .
Create a new repository:
create owlim-lite .
At this point values for a number of parameters are asked for, but all the defaults can be accepted pressing <return> for each question. When finished, the message 'Repository created' should be displayed, so exit the console:
quit .
The status of the new repository can be checked using the Sesame workbench. Type the following URL in to a browser:
http://localhost:8080/openrdf-workbench
Useful information
Tomcat
When running on Fedora linux, Tomcat uses the following directories:
Contents
Directory
Log files
/var/log/tomcat6/
Web applications
/var/lib/tomcat6/webapps
Sesame configuration, repository data files and logs
/usr/share/tomcat6/.aduna
On a machine running Windows, Tomcat uses the following directories:
Sesame configuration, repository data files and logs
C:\Users\<username>\AppData\Roaming\Aduna
Sesame
The Sesame framework is published as a zip file that is installed simply by unzipping it in to the target directory. This directory is called [SESAME_INSTALL] in this guide.
When running, Sesame stores configuration and repository data in the following directory:
$HOME/.aduna/
On linux/unix operating systems.
%APPDATA%\Aduna
On Windows machines. Note that if Sesame is running as a service then the full path will be: C:\Documents and Settings\LocalService\Application Data\Aduna
This directory is called [ADUNA_DATA] elsewhere in this guide. It can be overridden by setting a Java system property. When using Tomcat, this can be achieved by setting the JAVA_OPTS environment variable, for example (linux and Windows respectively):
export JAVA_OPTS='-Dinfo.aduna.platform.appdata.basedir=/other/dir/'
set JAVA_OPTS=-Dinfo.aduna.platform.appdata.basedir=\other\dir\
Note that setting this environment variable must be done by the same user that runs the Tomcat server. This may not be the case when using 'sudo' to set up/start Tomcat, for instance when using port numbers below 1024, when it is necessary to run Tomcat with root privileges.
The Sesame 2 framework uses a special SYSTEM repository to store its configuration data. Do not store anything else in this repository.
The workbench Web application can be used for many administrative tasks, but it is still experimental. The easiest method to create new repositories is to use the Sesame Console script, which can be found in the bin directory: [SESAME_INSTALL]/bin/console.bat (.sh for linux/unix)
All commands entered using the console must end in a dot '.', e.g. 'help.'
Logging
The Sesame server and workbench use SLF4J for logging, although they each map to different underlying logging implementations. The Sesame server has bindings to logback whereas the Sesame workbench has bindings to the Java Runtime logging framework. By default, the Sesame server logs to:
[ADUNA_DATA]/openrdf-sesame/logs/main.log
The default log level is INFO, but this can be adjusted after the first run by editing:
[ADUNA_DATA]/openrdf-sesame/conf/logback.xml
GraphDB also uses SLF4J for logging and the distribution includes the SLF4J-to-Java-logging mapping jar file. The repackaged openrdf-sesame war file that comes with GraphDB does not have this mapping, so in this case GraphDB logs as Sesame does to the logback framework.
Tomcat uses log4j and the logging details can set up by editing this file (on Linux):
Can not copy GraphDB-Lite jar file to the Sesame WEB-INF/lib directory.
This directory will not exist until the Sesame war files have been deployed to the [WEBAPPS] directory AND Tomcat is running. If the war files have been deployed, but the directory does not exist, try restarting Tomcat.
Make sure that the Sesame war files have been deployed and that Tomcat is running. Restart Tomcat if necessary.
Can not create a GraphDB-Lite repository using the Sesame console
Make sure that the repository template file [GraphDBLITE]/templates/swiftowlim.ttl has been copied to the 'templates' sub-directory of the Sesame console's data directory.
Can not create a GraphDB-Lite repository, the Sesame console says unknown Sail type – owlim:Sail
The Sesame console can not find the GraphDB-Lite jar file. Make sure it was copied from [GraphDBLITE]/lib to the Sesame installation folder here: [SESAME]/lib
Cannot use my custom rule file (pie file), an exception occurred
Custom rule files require the use of a Java Development Kit (JDK) version 1.6 or higher, due to the mechanism used to locate the Java compiler. Furthermore, the application (application server) must be started with the Java Virtual Machine (JVM) that comes with this JDK.
A repository can be created using the openrdf console, but any operation using this repository results in a long error message
Make sure that the GraphDB jar file has been copied to the Sesame Web application's WEB-INF/lib directory.
Sesame Workbench starts, but gives memory error on the 'explore' and 'query' menus
The maximum heap space must be increased, i.e. Tomcat's Java virtual machine must be allowed to allocate more memory. This can be done by setting the environment variable 'CATALINA_OPTS' to include the desired value, e.g. -Xmx1024m.