This section gives an overview of configuring a GraphDB-Lite repository. Also covered are the contents of the GraphDB-Lite distribution and a description of the 'getting-started' application that is included. This sample application serves as an example for integrating GraphDB-Lite in to other systems. For a detailed step-by-step guide for installing and setting-up GraphDB-Lite, see the installation section.
The GraphDB-Lite distribution zip file includes the following folders:
The distribution contains the following files in the root directory of the zip file:
The GraphDB distribution comes with a sample application that can be used as a template for building applications that interact with a GraphDB repository. The source code of this application performs a sequence of typical operations: initialisation of the repository, uploading statements, executing queries and obtaining results, deleting statements, etc. This application template comes with:
An easy way to set up an application to use GraphDB is to copy the getting-started folder and modify the contents as necessary.
To run the program, use the example.cmd / example.sh script. This script requires the JAVA_HOME environment variable to be set. Alternatively, it can be set directly by editing the setvars.cmd / setvars.sh script in the root folder of the GraphDB software distribution. If the program is modified to use a custom rule set, then JAVA_HOME must point to the Java Runtime Environment (JRE) of a Java Development Kit (JDK) version 1.6 or later, in order the new mechanism for locating the Java compiler to be used.
The queries are always evaluated, but the results are output only if the showresults parameter is set to true.
The application can also be run against a remote repository exposed using the Sesame HTTP server. In this case, the url parameter is used to specify the sesame endpoint and the repository parameter is used to specify the repository to use on this server. The use of url and repository overrides the config parameter.
Due to its range of functions, the getting started application makes a useful bulk-loading tool. It can load a single file or traverse through a whole directory structure loading any RDF file it can find. If the files are very large, it will automatically insert commit operations at suitable moments, so it is not necessary to convert and split large files in to smaller ones. For example:
Will load all RDF files located in /home/me/wordnet/ and its sub-directories in to the repository called my_repo at the Sesame endpoint http://192.168.1.31:8080/openrdf-sesame secured using HTTP authentication with the above credentials. If an error occurs, it will output a message and continue on to the next RDF file.
The export features of getting-started allow a reasonable back-up of a GraphDB database to be made.
In this example the TriG file format is used, because it preserves named-graph names (it is a quad format).
Wordnet, is the most popular lexical knowledge base, developed at the University of Princeton. It encodes the meanings of about 150,000 English words. The meanings of the words are defined by word-senses, which relate a word to a lexical concept. Lexical concepts are called synsets, i.e. synonym sets – about 115,000 of those appear in Wordnet v.2.0. Numerous lexical semantic relations are formally modelled, e.g.
A standard RDF/OWL representation of Wordnet is available at http://www.w3.org/TR/wordnet-rdf/. It contains about 1.9 million explicit statements (the Full variant), expressed in a fragment of OWL-Lite that further entails 6.3 million implicit statements.
Sesame 2.0 keeps repository configurations in a SYSTEM repository – in RDF. A new repository can be configured simply by inserting an appropriate graph in to the SYSTEM repository. The getting started application uses the Turtle format for convenience and also because the Sesame console application uses the Turtle format for template files when creating repositories.
Often it is desirable to ensure that a repository starts with a predefined set of RDF statements, usually one or more schema graphs. This is possible by using the owlim:imports property. After start up, these files are parsed and their contents are permanently added to the repository. The complete set of configuration parameters, their descriptions and their default and allowed values are listed below. What follows is a short description of those properties specific to GraphDB-Lite that are used to setup the repository. For more information about Sesame 2 configuration schema refer to the Sesame documentation . In short, the configuration is an RDF graph, the root node is of rdf:type rep:Repository, it must be connected through rep:RepositoryID property to a Literal that contains the human readable name of the repository. The root node must be connected via the rep:repositoryImpl property to a node that describes the configuration. The type of the repository is defined via rep:repositoryType property and its value must be openrdf:SailRepository to allow for custom sail implementations (such as GraphDB-Lite) to be used in Sesame 2.0. Then a node that specifies the Sail implementation to be instantiated must be connected with sr:sailImpl property. To instantiate GraphDB-Lite, this last node must have a property sail:sailType with the value swiftowlim:Sail – the Sesame framework will locate the correct SailFactory within the application classpath that will be used to instantiate the Java implementation class.
All properties used to specify GraphDB-Lite's configuration parameters use the owlim: prefix and the local names match up with the parameters listed below, e.g. the value of the ruleset parameter can be specified using the http://www.ontotext.com/trree/owlim#ruleset property.
There follows an example configuration (in Turtle RDF format) of a Sesame 2 repository that uses a GraphDB-Lite sail implementation:
Almost all GraphDB parameters can be set both in the TTL configuration file and from the command line using the Java -D_<_param.name>=<value> command line option to set system properties. When a parameter is set simultaneously using both methods, the system property overrides the value in the configuration file. Some GraphDB parameters can only be set using system properties.
Skip to end of metadata Go to start of metadata