Stardog
Stardog the RDF database from Clark & Parsia can be connected to via the Stardog
The StardogConnector
assumes the latest version of Stardog is being used, currently these are the 3.x releases. A Stardog
In terms of backwards compatibility the newer connectors may be able to talk to an older server but we can't guarantee this will work correctly, also newer connectors have support for newer Stardog features which will not work if used against an older server.
Supported Capabilities
- Load, Save, Delete, Update and List Graphs
- SPARQL Query
- Configurable query reasoning levels (for Stardog 1.x and 2.x)
- SPARQL Update for Stardog 2.x and 3.x connections
- Transactions
Creating a Connection
Connecting to a Stardog database requires knowing the Base URI for the server, a database ID and user credentials if security is enabled e.g.
StardogConnector stardog = new StardogConnector("http://localhost:5820", "example", "username", "password");
Configurable Query Reasoning
Stardog 1.x and 2.x supports configurable reasoning levels on a per-query basis. The current reasoning level is controlled by the Reasoning
property and takes a value from the Stardog
Note that from Stardog 3.x the reasoning level is controlled at the database level and cannot be changed at the connection level.
This may be changed any time you like and affects any subsequent queries made via the Query()
method.
Transactions
Stardog is one of the few stores currently supported that support transactions, see the Transactions API page for an overview of those APIs. If the Transaction APIs are not explicitly used each operation occurs in its own transaction which is auto-committed at the end of its operation.
Managing a Server
We support managing a server via the Stardog
The StardogServer
assumes the latest version of Stardog is being used, currently these are the 3.x releases. A Stardog
A StardogConnector
provides access to its associated server via the ParentServer
or AsyncParentServer
property.
Connecting to a Server
You can also connect directly to a server by creating an instance of the Stardog
StardogServer server = new StardogServer("http://localhost:5822", "username", "password");
Creating Stores
When creating a store the StardogServer
will provide templates from the following selection:
Template | Description |
---|---|
Stardog |
Used to create a Stardog disk store |
Stardog |
Used to create a Stardog memory store |
Both of these derive from the Base