public final class KernelDatabaseConnection extends com.complexible.stardog.api.impl.AbstractConnection implements Connection
A wrapper around the Kernel via DatabaseConnection to provide an adapter for Connection so that it can be used in an "embedded" mode where you're
interacting with the kernel directly without a server involved.
| Modifier and Type | Method and Description |
|---|---|
protected BooleanQueryResult |
_ask(BooleanQuery theQuery) |
protected UUID |
_begin() |
protected void |
_close() |
protected CommitResult |
_commit() |
protected GraphQueryResult |
_graph(GraphQuery theQuery) |
protected PathQueryResult |
_paths(PathQuery theQuery) |
protected void |
_rollback() |
protected SelectQueryResult |
_select(SelectQuery theQuery) |
protected void |
_update(UpdateQuery theQuery) |
AdminConnection |
admin()
Returns an instance of the
AdminConnection class that can be used to perform administrative functions. |
protected CommitResult |
applyChanges(ChangeList<com.complexible.stardog.api.impl.ConnectionChangeType,Object> theChanges,
boolean andCommit) |
BooleanQuery |
ask(String theQuery,
String theBase)
Create a SPARQL ask query against the database
|
<T> T |
call(com.google.common.base.Supplier<T> theSupplier) |
void |
cleanupTx(boolean theClose) |
com.complexible.stardog.db.DatabaseConnection |
connection(boolean theReasoning,
boolean theRW) |
Map<String,Object> |
currentStatus()
Return the current status of the database
|
protected String |
explain(Query theQuery) |
Exporter |
export()
Create an
Exporter to export RDF from the database |
String |
getName() |
GraphQuery |
graph(String theQuery,
String theBase)
Create a SPARQL graph query against the database
|
boolean |
isOpen()
Return whether or not this connection is open.
|
boolean |
isReasoningEnabled()
Return whether reasoning is enabled for this connection.
|
boolean |
isStrictParsing()
In embedded mode this function returns the value of `strict.parsing` database option since there is no client/server separation.
|
NamespacesInfo |
namespaces() |
Options |
options() |
PathQuery |
paths(String theQuery,
String theBase)
Create a path query against the database
|
void |
run(Runnable theAction) |
SelectQuery |
select(String theQuery,
String theBase)
Create a SPARQL select query against the database
|
long |
size()
Return the size of the database.
|
com.complexible.common.rdf.impl.StreamStatementSources.StatementSourceCreator |
statementSourceCreator() |
static com.complexible.stardog.query.UpdateQuery |
toUpdateQuery(com.complexible.stardog.db.DatabaseConnection theConnection,
UpdateQuery theQuery) |
Collection<TxInfo> |
transactions()
Returns an immutable collection of info objects for the open transactions in this database on the server-side.
|
UpdateQuery |
update(String theQuery,
String theBase)
Create a SPARQL update query against the database
|
add, as, ask, assertInTransaction, assertNotInTransaction, assertOpen, begin, cleanupPendingChanges, close, close, commit, executeAsk, executeGraph, executeSelect, executeUpdate, get, getDefaultParserConfig, graph, isInTransaction, name, paths, pushOutstanding, pushOutstandingAndCommit, remove, rollback, select, updatepublic com.complexible.common.rdf.impl.StreamStatementSources.StatementSourceCreator statementSourceCreator()
statementSourceCreator in class com.complexible.stardog.api.impl.AbstractConnectionpublic com.complexible.stardog.db.DatabaseConnection connection(boolean theReasoning,
boolean theRW)
public String getName()
public Options options()
public <T> T call(com.google.common.base.Supplier<T> theSupplier)
public void run(Runnable theAction)
public Map<String,Object> currentStatus() throws StardogException
currentStatus in interface ConnectionStardogException - if the status information could not be retrievedpublic boolean isOpen()
throws IllegalStateException
isOpen in interface ConnectionisOpen in class com.complexible.stardog.api.impl.AbstractConnectionIllegalStateException - if there was an error with the connectionprotected UUID _begin() throws StardogException
_begin in class com.complexible.stardog.api.impl.AbstractConnectionStardogExceptionpublic NamespacesInfo namespaces() throws StardogException
namespaces in interface ConnectionStardogException - if there was an error with the connectionpublic Collection<TxInfo> transactions() throws StardogException
ConnectionReturns an immutable collection of info objects for the open transactions in this database on the server-side. The transactions open on the client-side but not yet sent to the server will not be included in the results even if the transaction is started by this connection.
The logged in user can see only the transactions he/she started. The superusers can see all open transactions.
transactions in interface ConnectionStardogException - if there was an error with the connectionpublic boolean isStrictParsing()
isStrictParsing in class com.complexible.stardog.api.impl.AbstractConnectionprotected CommitResult _commit() throws StardogException
_commit in class com.complexible.stardog.api.impl.AbstractConnectionStardogExceptionpublic void cleanupTx(boolean theClose)
cleanupTx in class com.complexible.stardog.api.impl.AbstractConnectionprotected void _rollback()
throws StardogException
_rollback in class com.complexible.stardog.api.impl.AbstractConnectionStardogExceptionprotected void _close()
throws StardogException
_close in class com.complexible.stardog.api.impl.AbstractConnectionStardogExceptionprotected CommitResult applyChanges(ChangeList<com.complexible.stardog.api.impl.ConnectionChangeType,Object> theChanges, boolean andCommit) throws StardogException
applyChanges in class com.complexible.stardog.api.impl.AbstractConnectionStardogExceptionprotected SelectQueryResult _select(SelectQuery theQuery)
_select in class com.complexible.stardog.api.impl.AbstractConnectionprotected BooleanQueryResult _ask(BooleanQuery theQuery)
_ask in class com.complexible.stardog.api.impl.AbstractConnectionprotected GraphQueryResult _graph(GraphQuery theQuery)
_graph in class com.complexible.stardog.api.impl.AbstractConnectionprotected PathQueryResult _paths(PathQuery theQuery)
_paths in class com.complexible.stardog.api.impl.AbstractConnectionprotected void _update(UpdateQuery theQuery)
_update in class com.complexible.stardog.api.impl.AbstractConnectionpublic static com.complexible.stardog.query.UpdateQuery toUpdateQuery(com.complexible.stardog.db.DatabaseConnection theConnection,
UpdateQuery theQuery)
protected String explain(Query theQuery)
explain in class com.complexible.stardog.api.impl.AbstractConnectionpublic SelectQuery select(String theQuery, String theBase) throws StardogException
select in interface ConnectiontheQuery - the query stringtheBase - the base URI to use when parsing the queryStardogException - if there was an error while creating the querypublic GraphQuery graph(String theQuery, String theBase) throws StardogException
graph in interface ConnectiontheQuery - the query stringtheBase - the base URI to use when parsing the queryStardogException - if there was an error while creating the querypublic PathQuery paths(String theQuery, String theBase) throws StardogException
paths in interface ConnectiontheQuery - the query stringtheBase - the base URI to use when parsing the queryStardogException - if there was an error while creating the querypublic BooleanQuery ask(String theQuery, String theBase) throws StardogException
ask in interface ConnectiontheQuery - the query stringtheBase - the base URI to use when parsing the queryStardogException - if there was an error while creating the querypublic UpdateQuery update(String theQuery, String theBase) throws StardogException
update in interface ConnectiontheQuery - the query stringtheBase - the base URI to use when parsing the queryStardogException - if there was an error while creating the querypublic AdminConnection admin() throws StardogException
AdminConnection class that can be used to perform administrative functions. The
server URL and the credentials used for the current connection will be used to login to the server. The
AdminConnection will be active unless the user AdminConnection.close() logs out} explicitly or
closes this connection. The same AdminConnection will be returned by this function as long as it stays
active.admin in interface ConnectionStardogException - if there was an error creating the AdminConnection instancepublic long size()
throws StardogException
size in interface ConnectionStardogException - if there is an error returning the size of the db.public Exporter export() throws StardogException
Exporter to export RDF from the databaseexport in interface ConnectionExporterStardogException - if the Exporter could not be created.public boolean isReasoningEnabled()
throws StardogException
isReasoningEnabled in interface ConnectionStardogException - if the reasoning flag could not be obtainedCopyright © 2010-2016 Stardog Union. All Rights Reserved.