OWLIM is packaged as a Storage and Inference Layer (SAIL) for Sesame version 2.x and makes extensive use of the features and infrastructure of Sesame, especially the RDF model, RDF parsers and query engines. Explicit and inferred statements are stored in highly-optimized data structures. The inferred closure is updated through inference at the end of each transaction that modifies the repository.
This section will describe using the Sesame API to create and access OWLIM-Lite repositories, both on the local file-system and remotely via the Sesame HTTP server. Furthermore, a brief introduction will be given to the Sesame workbench Web application that provides many repository management functions through a convenient user interface.
Programmatically, OWLIM is used via the Sesame Java framework of classes and interfaces. Documentation for these interfaces (including Javadoc) can be found at http://www.openrdf.org. Code snippets in the following sections are taken from (or are variations of) the GettingStarted example program that comes with the OWLIM-Lite distribution.
With Sesame 2, repository configurations are represented as RDF graphs. A particular repository configuration is described as a resource, possibly a blank node, of type:
Note that the code to parse this file and find the 'root' node for the configuration can be found in the getting-started program.
The procedure is as follows: instantiate a local repository manager with the data directory to use for the repository storage files (repositories will store their data in their own sub-directory from here), add a repository configuration for the desired repository type to the manager, 'get' the repository and open a connection to it. From then on, most activities will use the connection object to interact with the repository, e.g. executing queries, adding statements, committing transactions, counting statements, etc. See the getting-started application for examples.
The Sesame Server is a Web application that allows interaction with repositories using the HTTP protocol. It runs in a JEE compliant servlet container, e.g. Tomcat, and allows client applications to interact with repositories located on remote machines. All that is required to connect to and use a remote repository instead of a local one is to replace the local repository manager for a remote one. The URL of the Sesame Server must be provided, but no repository configuration is needed if the repository already exists on the server. The following lines can be added to the getting-started example program, although a correct URL must be specified:
The installation section explains how to set up a OWLIM-Lite repository that is exposed via the Sesame HTTP Server. In summary, the Sesame Server and Workbench applications are deployed to a Tomcat instance and the necessary library files are copied to the correct locations. After this, the Sesame console application is used with the owlim-lite.ttl repository template file to connect to the Sesame server and create a repository instance.
The server has a simple user interface that shows status, logging and configuration information.
The workbench lists repositories and their namespaces, allows for the addition and deletion of statements, and provides a query interface for SPARQL and SeRQL query languages. However, the list of repository types is currently hard-coded in the workbench, so an OWLIM repository must still be created using the Sesame console application, as described in the installation section.
Skip to end of metadata Go to start of metadata