public class AGRepositoryConnection extends org.openrdf.repository.base.RepositoryConnectionBase implements org.openrdf.repository.RepositoryConnection, Closeable
RepositoryConnection
interface for AllegroGraph.
By default, a connection is in autoCommit
mode. Connections in this mode are said to be
shared. Multiple shared connections may be serviced by the
same server back-end process and they have no associated state,
thus they do not support some functionality such as multi-step
transactions and datatype mappings.
Full functionality is offered by dedicated sessions at the cost of higher server resource requirements.
Note that concurrent access to the same connection object of
either kind is explicitly forbidden. The client must perform its
own synchronization to ensure non-concurrent access. This is
typically achieved by employing connection pooling (see AGConnPool
) and having exactly one thread
that uses each connection.
Sessions with AllegroGraph server are used for ACID transactions and also for server code in InitFile and Scripts. See more documentation for Sessions in the AllegroGraph HTTP Protocol and ACID transactions in the AllegroGraph Server documentation.
Operations such as
setAutoCommit
,
addRules
, and
registerSNAGenerator
will spawn a dedicated session (simply session, from now on) in
order to perform their duties. Adds and deletes during a session
must be committed
or rolled
back
.
To conserve resources, the server will drop a session when
its idle lifetime
is exceeded.
To avoid this, the client periodically sends a ping
message to the server. This automated behavior can be controlled
by changing the executor used to schedule maintenance tasks.
This can be done either in the
AGServer.setExecutor(ScheduledExecutorService)
server}
object or when creating a new connection with
AGRepository.getConnection(ScheduledExecutorService)
.
A session should be closed
when finished.
InitFiles
and Scripts
are loaded into the server only for sessions. See
Scripting in HTTP Protocol and
search for "InitFile" in WebView for how to create initFiles.
Starting a session causes http requests to use a new port, which may cause an exception if the client can not access it. See Session Port Setup.
Methods that start a session if not already started:
setAutoCommit(boolean)
addRules(String)
addRules(InputStream)
registerSNAGenerator(String, List, List, List, String)
Methods that affect a session in use:
Methods to configure a session before it is started:
setSessionLifetime(int)
and getSessionLifetime()
setSessionLoadInitFile(boolean)
addSessionLoadScript(String)
For more details, see the HTTP Protocol docs for Type Mappings and the Lisp reference for Data-type and Predicate Mapping.
Methods for type mappings:
Modifier and Type | Class and Description |
---|---|
class |
AGRepositoryConnection.AttributeDefinition
Builder class for defining a new attribute definition.
|
Constructor and Description |
---|
AGRepositoryConnection(AGRepository repository,
com.franz.agraph.http.AGHttpRepoClient client) |
AGRepositoryConnection(AGVirtualRepository repository,
com.franz.agraph.http.AGHttpRepoClient client) |
Modifier and Type | Method and Description |
---|---|
void |
add(File file,
String baseURI,
org.openrdf.rio.RDFFormat dataFormat,
org.json.JSONObject attributes,
org.openrdf.model.Resource... contexts)
Adds RDF data from the specified file to a specific contexts in the
repository.
|
void |
add(File file,
String baseURI,
org.openrdf.rio.RDFFormat dataFormat,
org.openrdf.model.Resource... contexts)
Adds RDF data from the specified file to a specific contexts in the
repository.
|
void |
add(InputStream in,
String baseURI,
org.openrdf.rio.RDFFormat dataFormat,
org.json.JSONObject attributes,
org.openrdf.model.Resource... contexts)
Adds RDF data from an InputStream to the repository, optionally to one or
more named contexts.
|
void |
add(InputStream in,
String baseURI,
org.openrdf.rio.RDFFormat dataFormat,
org.openrdf.model.Resource... contexts)
Adds RDF data from an InputStream to the repository, optionally to one or
more named contexts.
|
void |
add(Iterable<? extends org.openrdf.model.Statement> statements,
org.json.JSONObject attributes,
org.openrdf.model.Resource... contexts) |
void |
add(Iterable<? extends org.openrdf.model.Statement> statements,
org.openrdf.model.Resource... contexts) |
<E extends Exception> |
add(info.aduna.iteration.Iteration<? extends org.openrdf.model.Statement,E> statementIter,
org.json.JSONObject attributes,
org.openrdf.model.Resource... contexts) |
<E extends Exception> |
add(info.aduna.iteration.Iteration<? extends org.openrdf.model.Statement,E> statementIter,
org.openrdf.model.Resource... contexts) |
void |
add(Reader reader,
String baseURI,
org.openrdf.rio.RDFFormat dataFormat,
org.json.JSONObject attributes,
org.openrdf.model.Resource... contexts)
Adds RDF data from a Reader to the repository, optionally to one or more
named contexts.
|
void |
add(Reader reader,
String baseURI,
org.openrdf.rio.RDFFormat dataFormat,
org.openrdf.model.Resource... contexts)
Adds RDF data from a Reader to the repository, optionally to one or more
named contexts.
|
void |
add(org.openrdf.model.Resource subject,
org.openrdf.model.URI predicate,
org.openrdf.model.Value object,
org.json.JSONObject attributes,
org.openrdf.model.Resource... contexts) |
void |
add(org.openrdf.model.Resource subject,
org.openrdf.model.URI predicate,
org.openrdf.model.Value object,
org.openrdf.model.Resource... contexts)
Adds a statement with the specified subject, predicate and object to this
repository, optionally to one or more named contexts.
|
void |
add(org.openrdf.model.Statement st,
org.json.JSONObject attributes,
org.openrdf.model.Resource... contexts) |
void |
add(org.openrdf.model.Statement st,
org.openrdf.model.Resource... contexts) |
void |
add(URL url,
String baseURI,
org.openrdf.rio.RDFFormat dataFormat,
org.json.JSONObject attributes,
org.openrdf.model.Resource... contexts)
Adds the RDF data that can be found at the specified URL to the
repository, optionally to one or more named contexts.
|
void |
add(URL url,
String baseURI,
org.openrdf.rio.RDFFormat dataFormat,
org.openrdf.model.Resource... contexts)
Adds the RDF data that can be found at the specified URL to the
repository, optionally to one or more named contexts.
|
void |
addIndex(String type)
Adds the given index to the list of actively managed indices.
|
void |
addRules(InputStream rulestream)
Adds Prolog rules to be used on this connection.
|
void |
addRules(String rules)
Adds Prolog rules to be used on this connection.
|
void |
addSessionLoadScript(String scriptName)
Adds a 'script' for a dedicated session spawned by this connection.
|
void |
begin()
Begins a transaction requiring
commit() or rollback() to
be called to end the transaction. |
Object |
callStoredProc(String functionName,
String moduleName,
Object... args)
Deprecated.
The stored proc feature and API are experimental, and subject to change in a future release.
|
void |
clear(org.openrdf.model.Resource... contexts)
Removes all statement(s) within the specified contexts.
|
void |
clearMappings()
Deletes all user-defined predicate and datatype mappings for this connection,
and reestablishes the automatic mappings for primitive datatypes.
|
void |
clearMappings(boolean includeAutoEncodedPrimitiveTypes)
Deletes all predicate and user-defined datatype mappings for this connection.
|
void |
clearNamespaces() |
void |
close()
Closes the session if there is one started.
|
void |
commit()
Commit the current transaction.
|
void |
createFreetextIndex(String indexName,
AGFreetextIndexConfig config)
Creates a freetext index with the given name and configuration.
|
void |
createFreetextIndex(String name,
org.openrdf.model.URI[] predicates)
Deprecated.
|
<E> org.openrdf.repository.RepositoryResult<E> |
createRepositoryResult(Iterable<? extends E> elements)
Creates a RepositoryResult for the supplied element set.
|
void |
deleteAttributeDefinition(String name)
Delete an existing triple attribute definition.
|
void |
deleteDatatypeMapping(org.openrdf.model.URI datatype)
Deletes any datatype mapping associated with the given datatype.
|
void |
deleteDuplicates(String comparisonMode)
Deletes all duplicates from the store.
|
void |
deleteFreetextIndex(String indexName)
Deletes the freetext index of the specified name.
|
long |
deleteMaterialized()
Deletes materialized statements.
|
void |
deletePredicateMapping(org.openrdf.model.URI predicate)
Deletes any predicate mapping associated with the given predicate.
|
void |
deleteSpinFunction(String uri) |
void |
deleteSpinMagicProperty(String uri) |
void |
deleteStaticAttributeFilter()
Delete the static attribute filter defined on this repository.
|
void |
disableTripleCache()
Disables the spogi triple cache.
|
void |
dropIndex(String type)
Drops the given index from the list of actively managed indices.
|
void |
enableTripleCache(long size)
Enables the spogi cache in this repository.
|
String |
evalInServer(InputStream stream)
Evaluates a Lisp form on the server, and returns the result as a String.
|
String |
evalInServer(String lispForm)
Evaluates a Lisp form on the server, and returns the result as a String.
|
void |
exportStatements(org.openrdf.rio.RDFHandler handler,
String... ids) |
void |
exportStatements(org.openrdf.model.Resource subj,
org.openrdf.model.URI pred,
org.openrdf.model.Value obj,
boolean includeInferred,
org.openrdf.rio.RDFHandler handler,
org.openrdf.model.Resource... contexts) |
org.json.JSONArray |
getAttributeDefinition(String name)
Return the definition of the attribute named by NAME.
|
org.json.JSONArray |
getAttributeDefinitions()
Return a list of all attributes defined for the current connection.
|
org.openrdf.repository.RepositoryResult<org.openrdf.model.Resource> |
getContextIDs() |
String[] |
getDatatypeMappings()
Gets the datatype mappings defined for this connection.
|
org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> |
getDuplicateStatements(String comparisonMode)
Returns all duplicates from the store.
|
AGFreetextIndexConfig |
getFreetextIndexConfig(String indexName)
Gets the configuration of the specified free text index.
|
String[] |
getFreetextIndices()
Deprecated.
|
String[] |
getFreetextPredicates(String index)
Deprecated.
|
org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> |
getGeoHaversine(org.openrdf.model.URI type,
org.openrdf.model.URI predicate,
float lat,
float lon,
float radius,
String unit,
int limit,
boolean infer) |
String[] |
getGeoTypes()
Gets the Geospatial types that have been registered.
|
com.franz.agraph.http.AGHttpRepoClient |
getHttpRepoClient()
Returns the lower level HTTP layer for this connection.
|
String |
getNamespace(String prefix) |
org.openrdf.repository.RepositoryResult<org.openrdf.model.Namespace> |
getNamespaces() |
String[] |
getPredicateMappings()
Gets the predicate mappings defined for this connection.
|
AGAbstractRepository |
getRepository() |
AGServer |
getServer()
Returns the AGServer object associated with this connection.
|
int |
getSessionLifetime()
Returns the lifetime for a dedicated session spawned by this connection.
|
String |
getSpinFunction(String uri) |
String |
getSpinMagicProperty(String uri) |
org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> |
getStatements(org.openrdf.model.Resource subj,
org.openrdf.model.URI pred,
org.openrdf.model.Value obj,
boolean includeInferred,
org.openrdf.model.Resource... contexts) |
org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> |
getStatements(String... ids)
Returns statements having the specified ids.
|
org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> |
getStatementsInBox(org.openrdf.model.URI type,
org.openrdf.model.URI predicate,
float xmin,
float xmax,
float ymin,
float ymax,
int limit,
boolean infer) |
org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> |
getStatementsInCircle(org.openrdf.model.URI type,
org.openrdf.model.URI predicate,
float x,
float y,
float radius,
int limit,
boolean infer) |
org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> |
getStatementsInPolygon(org.openrdf.model.URI type,
org.openrdf.model.URI predicate,
org.openrdf.model.URI polygon,
int limit,
boolean infer) |
String |
getStaticAttributeFilter()
Fetch the string representation of the static attribute filter defined on this
repository
|
long |
getTripleCacheSize()
Returns the size of the spogi cache.
|
int |
getUploadCommitPeriod()
Gets the commit period used within large add/load operations.
|
String |
getUserAttributes() |
AGValueFactory |
getValueFactory() |
boolean |
isActive()
Indicates if a transaction is currently active on the connection.
|
boolean |
isAutoCommit()
Deprecated.
since release 2.7.0. Use isActive() instead.
|
boolean |
isStreamResults()
If true, automatically use
AGStreamTupleQuery . |
List<AGFormattedNamespace> |
listEncodableNamespaces()
Returns a list of the registered encodable namespaces.
|
List<String> |
listFreetextIndices()
Lists the freetext indices that have been defined for this repository.
|
List<String> |
listIndices()
Returns a list of actively managed indices for this repository.
|
List<AGSpinFunction> |
listSpinFunctions() |
List<AGSpinMagicProperty> |
listSpinMagicProperties() |
List<String> |
listValidIndices()
Returns a list of all possible index types for this repository.
|
void |
load(String absoluteServerPath,
String baseURI,
org.openrdf.rio.RDFFormat dataFormat,
org.json.JSONObject attributes,
org.openrdf.model.Resource... contexts)
Instructs the server to load data from the specified server-side path.
|
void |
load(String absoluteServerPath,
String baseURI,
org.openrdf.rio.RDFFormat dataFormat,
org.openrdf.model.Resource... contexts)
Instructs the server to load data from the specified server-side path.
|
void |
load(org.openrdf.model.URI source,
String baseURI,
org.openrdf.rio.RDFFormat dataFormat,
org.json.JSONObject attributes,
org.openrdf.model.Resource... contexts)
Instructs the server to fetch and load data from the specified URI.
|
void |
load(org.openrdf.model.URI source,
String baseURI,
org.openrdf.rio.RDFFormat dataFormat,
org.openrdf.model.Resource... contexts)
Instructs the server to fetch and load data from the specified URI.
|
long |
materialize(AGMaterializer materializer)
Materializes inferred statements (generates and adds them to the store).
|
void |
optimizeIndices(Boolean wait) |
void |
optimizeIndices(Boolean wait,
int level)
tells the server to try and optimize the indices for this
store.
|
void |
ping()
Instructs the server to extend the life of this connection's dedicated
session, if it is using one.
|
AGBooleanQuery |
prepareBooleanQuery(org.openrdf.query.QueryLanguage ql,
String queryString) |
AGBooleanQuery |
prepareBooleanQuery(org.openrdf.query.QueryLanguage ql,
String queryString,
String baseURI) |
AGGraphQuery |
prepareGraphQuery(org.openrdf.query.QueryLanguage ql,
String queryString) |
AGGraphQuery |
prepareGraphQuery(org.openrdf.query.QueryLanguage ql,
String queryString,
String baseURI) |
AGQuery |
prepareQuery(org.openrdf.query.QueryLanguage ql,
String queryString,
String baseURI)
Prepares a
AGQuery for evaluation on this repository. |
AGTupleQuery |
prepareTupleQuery(org.openrdf.query.QueryLanguage ql,
String queryString) |
AGTupleQuery |
prepareTupleQuery(org.openrdf.query.QueryLanguage ql,
String queryString,
String baseURI) |
AGUpdate |
prepareUpdate(org.openrdf.query.QueryLanguage ql,
String queryString) |
AGUpdate |
prepareUpdate(org.openrdf.query.QueryLanguage ql,
String queryString,
String baseURI) |
void |
putSpinFunction(AGSpinFunction fn) |
void |
putSpinMagicProperty(AGSpinMagicProperty fn) |
org.openrdf.model.URI |
registerCartesianType(float stripWidth,
float xmin,
float xmax,
float ymin,
float ymax)
Registers a cartesian type.
|
void |
registerDatatypeMapping(org.openrdf.model.URI datatype,
org.openrdf.model.URI primtype)
Registers a datatype mapping from the datatype to a primitive datatype.
|
void |
registerEncodableNamespace(String namespace,
String format)
Registers an encodable namespace having the specified format.
|
void |
registerEncodableNamespaces(Iterable<? extends AGFormattedNamespace> formattedNamespaces)
Registers multiple formatted namespaces in a single request.
|
void |
registerPolygon(org.openrdf.model.URI polygon,
List<org.openrdf.model.Literal> points)
Registers a polygon.
|
void |
registerPredicateMapping(org.openrdf.model.URI predicate,
org.openrdf.model.URI primtype)
Registers a predicate mapping from the predicate to a primitive datatype.
|
void |
registerSNAGenerator(String generator,
List<org.openrdf.model.URI> objectOfs,
List<org.openrdf.model.URI> subjectOfs,
List<org.openrdf.model.URI> undirecteds,
String query)
|
void |
registerSNANeighborMatrix(String matrix,
String generator,
List<org.openrdf.model.URI> group,
int depth) |
org.openrdf.model.URI |
registerSphericalType(float stripWidth,
String unit) |
org.openrdf.model.URI |
registerSphericalType(float stripWidth,
String unit,
float latmin,
float lonmin,
float latmax,
float lonmax)
Registers a spherical type.
|
void |
remove(Iterable<? extends org.openrdf.model.Statement> statements,
org.openrdf.model.Resource... contexts) |
<E extends Exception> |
remove(info.aduna.iteration.Iteration<? extends org.openrdf.model.Statement,E> statements,
org.openrdf.model.Resource... contexts) |
void |
remove(org.openrdf.model.Resource subject,
org.openrdf.model.URI predicate,
org.openrdf.model.Value object,
org.openrdf.model.Resource... contexts)
Removes the statement(s) with the specified subject, predicate and object
from the repository, optionally restricted to the specified contexts.
|
void |
remove(org.openrdf.model.Statement st,
org.openrdf.model.Resource... contexts) |
void |
removeNamespace(String prefix) |
void |
rollback()
Roll back the current transaction (discard all changes made since last commit).
|
void |
sendRDFTransaction(InputStream rdftransaction)
Executes an application/x-rdftransaction.
|
void |
sendRDFTransaction(InputStream rdftransaction,
org.json.JSONObject attributes)
send an RDFTransaction, including attributes.
|
void |
setAutoCommit(boolean autoCommit)
Deprecated.
As of release 2.7.0, use begin() instead.
|
void |
setMasqueradeAsUser(String user)
Sets the AG user for X-Masquerade-As-User requests.
|
void |
setNamespace(String prefix,
String name) |
void |
setSessionLifetime(int lifetimeInSeconds)
Sets the 'lifetime' for a dedicated session spawned by this connection.
|
void |
setSessionLoadInitFile(boolean loadInitFile)
Sets the 'loadInitFile' for a dedicated session spawned by this connection.
|
void |
setStaticAttributeFilter(String filter)
Establish a static attribute filter on the current repository.
|
void |
setStreamResults(boolean streamResults)
Set to true to automatically use
AGStreamTupleQuery
for prepareTupleQuery(QueryLanguage, String, String) . |
void |
setUploadCommitPeriod(int period)
Sets the commit period to use within large add/load operations.
|
void |
setUserAttributes(org.json.JSONObject value) |
void |
setUserAttributes(String value) |
long |
size(org.openrdf.model.Resource... contexts) |
String |
toString() |
void |
unregisterEncodableNamespace(String namespace)
Unregisters the specified encodable namespace.
|
export, getParserConfig, hasStatement, hasStatement, isEmpty, isOpen, prepareQuery, setParserConfig
public AGRepositoryConnection(AGRepository repository, com.franz.agraph.http.AGHttpRepoClient client)
public AGRepositoryConnection(AGVirtualRepository repository, com.franz.agraph.http.AGHttpRepoClient client)
public AGAbstractRepository getRepository()
getRepository
in interface org.openrdf.repository.RepositoryConnection
getRepository
in class org.openrdf.repository.base.RepositoryConnectionBase
public AGServer getServer()
public com.franz.agraph.http.AGHttpRepoClient getHttpRepoClient()
public AGValueFactory getValueFactory()
getValueFactory
in interface org.openrdf.repository.RepositoryConnection
getValueFactory
in class org.openrdf.repository.base.RepositoryConnectionBase
public void add(Iterable<? extends org.openrdf.model.Statement> statements, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
add
in interface org.openrdf.repository.RepositoryConnection
add
in class org.openrdf.repository.base.RepositoryConnectionBase
org.openrdf.repository.RepositoryException
public void add(Iterable<? extends org.openrdf.model.Statement> statements, org.json.JSONObject attributes, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public <E extends Exception> void add(info.aduna.iteration.Iteration<? extends org.openrdf.model.Statement,E> statementIter, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException, E extends Exception
add
in interface org.openrdf.repository.RepositoryConnection
add
in class org.openrdf.repository.base.RepositoryConnectionBase
org.openrdf.repository.RepositoryException
E extends Exception
public <E extends Exception> void add(info.aduna.iteration.Iteration<? extends org.openrdf.model.Statement,E> statementIter, org.json.JSONObject attributes, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException, E extends Exception
org.openrdf.repository.RepositoryException
E extends Exception
public void add(File file, String baseURI, org.openrdf.rio.RDFFormat dataFormat, org.openrdf.model.Resource... contexts) throws IOException, org.openrdf.rio.RDFParseException, org.openrdf.repository.RepositoryException
add
in interface org.openrdf.repository.RepositoryConnection
add
in class org.openrdf.repository.base.RepositoryConnectionBase
file
- A file containing RDF data.baseURI
- The base URI against which any relative URIs in the data are
resolved. This defaults to the value of
file.toURI()
if the value is set to
null.dataFormat
- The serialization format of the data.contexts
- The contexts to add the data to. Note that this parameter is a
vararg and as such is optional. If no contexts are specified, the
data is added to any context specified in the actual data file, or
if the data contains no context, it is added to the default context.
If one or more contexts are specified the data is added to these
contexts, ignoring any context information in the data itself.IOException
- If an I/O error occurred while reading from the file.org.openrdf.rio.UnsupportedRDFormatException
- If no parser is available for the specified RDF format.org.openrdf.rio.RDFParseException
- If an error occurred while parsing the RDF data.org.openrdf.repository.RepositoryException
- If the data could not be added to the repository, for example
because the repository is not writable.public void add(File file, String baseURI, org.openrdf.rio.RDFFormat dataFormat, org.json.JSONObject attributes, org.openrdf.model.Resource... contexts) throws IOException, org.openrdf.rio.RDFParseException, org.openrdf.repository.RepositoryException
file
- A file containing RDF data.baseURI
- The base URI against which any relative URIs in the data are
resolved. This defaults to the value of
file.toURI()
if the value is set to
null.dataFormat
- The serialization format of the data.attributes
- A JSONObject of attribute bindings that will be added to each statement
imported from `file'. For RDFFormats that support the specification of
attributes (like NQX) these attributes will be applied to statements
that do not already specify attributes.contexts
- The contexts to add the data to. Note that this parameter is a
vararg and as such is optional. If no contexts are specified, the
data is added to any context specified in the actual data file, or
if the data contains no context, it is added to the default context.
If one or more contexts are specified the data is added to these
contexts, ignoring any context information in the data itself.IOException
- If an I/O error occurred while reading from the file.org.openrdf.rio.UnsupportedRDFormatException
- If no parser is available for the specified RDF format.org.openrdf.rio.RDFParseException
- If an error occurred while parsing the RDF data.org.openrdf.repository.RepositoryException
- If the data could not be added to the repository, for example
because the repository is not writable.public void add(URL url, String baseURI, org.openrdf.rio.RDFFormat dataFormat, org.openrdf.model.Resource... contexts) throws IOException, org.openrdf.rio.RDFParseException, org.openrdf.repository.RepositoryException
add
in interface org.openrdf.repository.RepositoryConnection
add
in class org.openrdf.repository.base.RepositoryConnectionBase
url
- The URL of the RDF data.baseURI
- The base URI against which any relative URIs in the data are
resolved. This defaults to the value of url.toExternalForm()
if the value is
set to null.dataFormat
- The serialization format of the data.contexts
- The contexts to add the data to. If one or more contexts are
specified the data is added to these contexts, ignoring any context
information in the data itself.IOException
- If an I/O error occurred while reading from the URL.org.openrdf.rio.UnsupportedRDFormatException
- If no parser is available for the specified RDF format.org.openrdf.rio.RDFParseException
- If an error occurred while parsing the RDF data.org.openrdf.repository.RepositoryException
- If the data could not be added to the repository, for example
because the repository is not writable.public void add(URL url, String baseURI, org.openrdf.rio.RDFFormat dataFormat, org.json.JSONObject attributes, org.openrdf.model.Resource... contexts) throws IOException, org.openrdf.rio.RDFParseException, org.openrdf.repository.RepositoryException
url
- The URL of the RDF data.baseURI
- The base URI against which any relative URIs in the data are
resolved. This defaults to the value of url.toExternalForm()
if the value is
set to null.dataFormat
- The serialization format of the data.attributes
- A JSONObject of attribute bindings that will be added to each statement
imported from `url'. For RDFFormats that support the specification of
attributes (like NQX) these attributes will be applied to statements
that do not already specify attributes.contexts
- The contexts to add the data to. If one or more contexts are
specified the data is added to these contexts, ignoring any context
information in the data itself.IOException
- If an I/O error occurred while reading from the URL.org.openrdf.rio.UnsupportedRDFormatException
- If no parser is available for the specified RDF format.org.openrdf.rio.RDFParseException
- If an error occurred while parsing the RDF data.org.openrdf.repository.RepositoryException
- If the data could not be added to the repository, for example
because the repository is not writable.public void add(InputStream in, String baseURI, org.openrdf.rio.RDFFormat dataFormat, org.openrdf.model.Resource... contexts) throws IOException, org.openrdf.rio.RDFParseException, org.openrdf.repository.RepositoryException
add
in interface org.openrdf.repository.RepositoryConnection
add
in class org.openrdf.repository.base.RepositoryConnectionBase
in
- An InputStream from which RDF data can be read.baseURI
- The base URI against which any relative URIs in the data are
resolved.dataFormat
- The serialization format of the data.contexts
- The contexts to add the data to. If one or more contexts are
supplied the method ignores contextual information in the actual
data. If no contexts are supplied the contextual information in the
input stream is used, if no context information is available the
data is added without any context.IOException
- If an I/O error occurred while reading from the input stream.org.openrdf.rio.UnsupportedRDFormatException
- If no parser is available for the specified RDF format.org.openrdf.rio.RDFParseException
- If an error occurred while parsing the RDF data.org.openrdf.repository.RepositoryException
- If the data could not be added to the repository, for example
because the repository is not writable.public void add(InputStream in, String baseURI, org.openrdf.rio.RDFFormat dataFormat, org.json.JSONObject attributes, org.openrdf.model.Resource... contexts) throws IOException, org.openrdf.rio.RDFParseException, org.openrdf.repository.RepositoryException
in
- An InputStream from which RDF data can be read.baseURI
- The base URI against which any relative URIs in the data are
resolved.dataFormat
- The serialization format of the data.attributes
- A JSONObject of attribute bindings that will be added to each statement
imported from `in'. For RDFFormats that support the specification of
attributes (like NQX) these attributes will be applied to statements
that do not already specify attributes.contexts
- The contexts to add the data to. If one or more contexts are
supplied the method ignores contextual information in the actual
data. If no contexts are supplied the contextual information in the
input stream is used, if no context information is available the
data is added without any context.IOException
- If an I/O error occurred while reading from the input stream.org.openrdf.rio.UnsupportedRDFormatException
- If no parser is available for the specified RDF format.org.openrdf.rio.RDFParseException
- If an error occurred while parsing the RDF data.org.openrdf.repository.RepositoryException
- If the data could not be added to the repository, for example
because the repository is not writable.public void add(Reader reader, String baseURI, org.openrdf.rio.RDFFormat dataFormat, org.openrdf.model.Resource... contexts) throws IOException, org.openrdf.rio.RDFParseException, org.openrdf.repository.RepositoryException
add
in interface org.openrdf.repository.RepositoryConnection
add
in class org.openrdf.repository.base.RepositoryConnectionBase
reader
- A Reader from which RDF data can be read.baseURI
- The base URI against which any relative URIs in the data are
resolved.dataFormat
- The serialization format of the data.contexts
- The contexts to add the data to. If one or more contexts are
specified the data is added to these contexts, ignoring any context
information in the data itself.IOException
- If an I/O error occurred while reading from the reader.org.openrdf.rio.UnsupportedRDFormatException
- If no parser is available for the specified RDF format.org.openrdf.rio.RDFParseException
- If an error occurred while parsing the RDF data.org.openrdf.repository.RepositoryException
- If the data could not be added to the repository, for example
because the repository is not writable.public void add(Reader reader, String baseURI, org.openrdf.rio.RDFFormat dataFormat, org.json.JSONObject attributes, org.openrdf.model.Resource... contexts) throws IOException, org.openrdf.rio.RDFParseException, org.openrdf.repository.RepositoryException
reader
- A Reader from which RDF data can be read.baseURI
- The base URI against which any relative URIs in the data are
resolved.dataFormat
- The serialization format of the data.attributes
- A JSONObject of attribute bindings that will be added to each statement
imported from `reader'. For RDFFormats that support the specification of
attributes (like NQX) these attributes will be applied to statements
that do not already specify attributes.contexts
- The contexts to add the data to. If one or more contexts are
specified the data is added to these contexts, ignoring any context
information in the data itself.IOException
- If an I/O error occurred while reading from the reader.org.openrdf.rio.UnsupportedRDFormatException
- If no parser is available for the specified RDF format.org.openrdf.rio.RDFParseException
- If an error occurred while parsing the RDF data.org.openrdf.repository.RepositoryException
- If the data could not be added to the repository, for example
because the repository is not writable.public void add(org.openrdf.model.Resource subject, org.openrdf.model.URI predicate, org.openrdf.model.Value object, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
add
in interface org.openrdf.repository.RepositoryConnection
add
in class org.openrdf.repository.base.RepositoryConnectionBase
subject
- The statement's subject.predicate
- The statement's predicate.object
- The statement's object.contexts
- The contexts to add the data to. Note that this parameter is a
vararg and as such is optional. If the data contains no context,
it is added to the default context. If one or more contexts are
specified the data is added to these contexts, ignoring any context
information in the data itself.org.openrdf.repository.RepositoryException
- If the data could not be added to the repository, for example
because the repository is not writable.public void add(org.openrdf.model.Resource subject, org.openrdf.model.URI predicate, org.openrdf.model.Value object, org.json.JSONObject attributes, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void remove(org.openrdf.model.Resource subject, org.openrdf.model.URI predicate, org.openrdf.model.Value object, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
remove
in interface org.openrdf.repository.RepositoryConnection
remove
in class org.openrdf.repository.base.RepositoryConnectionBase
subject
- The statement's subject, or null for a wildcard.predicate
- The statement's predicate, or null for a wildcard.object
- The statement's object, or null for a wildcard.contexts
- The context(s) to remove the data from. Note that this parameter is
a vararg and as such is optional. If no contexts are supplied the
method operates on the entire repository.org.openrdf.repository.RepositoryException
- If the statement(s) could not be removed from the repository, for
example because the repository is not writable.public void remove(org.openrdf.model.Statement st, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
remove
in interface org.openrdf.repository.RepositoryConnection
remove
in class org.openrdf.repository.base.RepositoryConnectionBase
org.openrdf.repository.RepositoryException
public void add(org.openrdf.model.Statement st, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
add
in interface org.openrdf.repository.RepositoryConnection
add
in class org.openrdf.repository.base.RepositoryConnectionBase
org.openrdf.repository.RepositoryException
public void add(org.openrdf.model.Statement st, org.json.JSONObject attributes, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void remove(Iterable<? extends org.openrdf.model.Statement> statements, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
remove
in interface org.openrdf.repository.RepositoryConnection
remove
in class org.openrdf.repository.base.RepositoryConnectionBase
org.openrdf.repository.RepositoryException
public <E extends Exception> void remove(info.aduna.iteration.Iteration<? extends org.openrdf.model.Statement,E> statements, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException, E extends Exception
remove
in interface org.openrdf.repository.RepositoryConnection
remove
in class org.openrdf.repository.base.RepositoryConnectionBase
org.openrdf.repository.RepositoryException
E extends Exception
public void setAutoCommit(boolean autoCommit) throws org.openrdf.repository.RepositoryException
Starting a session causes http requests to use a new port, which may cause an exception if the client can not access it. See Session Port Setup.
setAutoCommit
in interface org.openrdf.repository.RepositoryConnection
setAutoCommit
in class org.openrdf.repository.base.RepositoryConnectionBase
org.openrdf.repository.RepositoryException
public boolean isAutoCommit() throws org.openrdf.repository.RepositoryException
isAutoCommit
in interface org.openrdf.repository.RepositoryConnection
isAutoCommit
in class org.openrdf.repository.base.RepositoryConnectionBase
org.openrdf.repository.RepositoryException
setAutoCommit(boolean)
public void commit() throws org.openrdf.repository.RepositoryException
commit
in interface org.openrdf.repository.RepositoryConnection
org.openrdf.repository.RepositoryException
public void rollback() throws org.openrdf.repository.RepositoryException
rollback
in interface org.openrdf.repository.RepositoryConnection
org.openrdf.repository.RepositoryException
public void setStreamResults(boolean streamResults)
AGStreamTupleQuery
for prepareTupleQuery(QueryLanguage, String, String)
.isStreamResults()
public boolean isStreamResults()
AGStreamTupleQuery
.
Default is false.setStreamResults(boolean)
public void clearNamespaces() throws org.openrdf.repository.RepositoryException
clearNamespaces
in interface org.openrdf.repository.RepositoryConnection
org.openrdf.repository.RepositoryException
public void close() throws org.openrdf.repository.RepositoryException
close
in interface Closeable
close
in interface org.openrdf.repository.RepositoryConnection
close
in class org.openrdf.repository.base.RepositoryConnectionBase
org.openrdf.repository.RepositoryException
Closeable.close()
public void exportStatements(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, boolean includeInferred, org.openrdf.rio.RDFHandler handler, org.openrdf.model.Resource... contexts) throws org.openrdf.rio.RDFHandlerException, org.openrdf.repository.RepositoryException
exportStatements
in interface org.openrdf.repository.RepositoryConnection
org.openrdf.rio.RDFHandlerException
org.openrdf.repository.RepositoryException
public void exportStatements(org.openrdf.rio.RDFHandler handler, String... ids) throws org.openrdf.rio.RDFHandlerException, org.openrdf.repository.RepositoryException
org.openrdf.rio.RDFHandlerException
org.openrdf.repository.RepositoryException
public org.openrdf.repository.RepositoryResult<org.openrdf.model.Resource> getContextIDs() throws org.openrdf.repository.RepositoryException
getContextIDs
in interface org.openrdf.repository.RepositoryConnection
org.openrdf.repository.RepositoryException
public <E> org.openrdf.repository.RepositoryResult<E> createRepositoryResult(Iterable<? extends E> elements)
public String getNamespace(String prefix) throws org.openrdf.repository.RepositoryException
getNamespace
in interface org.openrdf.repository.RepositoryConnection
org.openrdf.repository.RepositoryException
public org.openrdf.repository.RepositoryResult<org.openrdf.model.Namespace> getNamespaces() throws org.openrdf.repository.RepositoryException
getNamespaces
in interface org.openrdf.repository.RepositoryConnection
org.openrdf.repository.RepositoryException
public org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> getStatements(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, boolean includeInferred, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
getStatements
in interface org.openrdf.repository.RepositoryConnection
org.openrdf.repository.RepositoryException
public org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> getStatements(String... ids) throws org.openrdf.repository.RepositoryException
ids
- Strings representing statement ids.RepositoryResult
object, a lazy Iterator-like object
containing Statement
s and optionally throwing a
RepositoryException
when an error when a problem occurs
during retrieval.org.openrdf.repository.RepositoryException
public AGQuery prepareQuery(org.openrdf.query.QueryLanguage ql, String queryString, String baseURI)
AGQuery
for evaluation on this repository. Note
that the preferred way of preparing queries is to use the more specific
prepareTupleQuery(QueryLanguage, String, String)
,
prepareBooleanQuery(QueryLanguage, String, String)
, or
prepareGraphQuery(QueryLanguage, String, String)
methods instead.prepareQuery
in interface org.openrdf.repository.RepositoryConnection
UnsupportedOperationException
- if the method is not supported for the supplied query language.IllegalArgumentException
- if the query type (Tuple, Graph, Boolean) cannot be determined.public AGTupleQuery prepareTupleQuery(org.openrdf.query.QueryLanguage ql, String queryString)
prepareTupleQuery
in interface org.openrdf.repository.RepositoryConnection
prepareTupleQuery
in class org.openrdf.repository.base.RepositoryConnectionBase
public AGTupleQuery prepareTupleQuery(org.openrdf.query.QueryLanguage ql, String queryString, String baseURI)
prepareTupleQuery
in interface org.openrdf.repository.RepositoryConnection
public AGGraphQuery prepareGraphQuery(org.openrdf.query.QueryLanguage ql, String queryString)
prepareGraphQuery
in interface org.openrdf.repository.RepositoryConnection
prepareGraphQuery
in class org.openrdf.repository.base.RepositoryConnectionBase
public AGGraphQuery prepareGraphQuery(org.openrdf.query.QueryLanguage ql, String queryString, String baseURI)
prepareGraphQuery
in interface org.openrdf.repository.RepositoryConnection
public AGBooleanQuery prepareBooleanQuery(org.openrdf.query.QueryLanguage ql, String queryString)
prepareBooleanQuery
in interface org.openrdf.repository.RepositoryConnection
prepareBooleanQuery
in class org.openrdf.repository.base.RepositoryConnectionBase
public AGBooleanQuery prepareBooleanQuery(org.openrdf.query.QueryLanguage ql, String queryString, String baseURI)
prepareBooleanQuery
in interface org.openrdf.repository.RepositoryConnection
public AGUpdate prepareUpdate(org.openrdf.query.QueryLanguage ql, String queryString, String baseURI)
prepareUpdate
in interface org.openrdf.repository.RepositoryConnection
public AGUpdate prepareUpdate(org.openrdf.query.QueryLanguage ql, String queryString)
prepareUpdate
in interface org.openrdf.repository.RepositoryConnection
prepareUpdate
in class org.openrdf.repository.base.RepositoryConnectionBase
public void removeNamespace(String prefix) throws org.openrdf.repository.RepositoryException
removeNamespace
in interface org.openrdf.repository.RepositoryConnection
org.openrdf.repository.RepositoryException
public void setNamespace(String prefix, String name) throws org.openrdf.repository.RepositoryException
setNamespace
in interface org.openrdf.repository.RepositoryConnection
org.openrdf.repository.RepositoryException
public long size(org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
size
in interface org.openrdf.repository.RepositoryConnection
org.openrdf.repository.RepositoryException
public void createFreetextIndex(String indexName, AGFreetextIndexConfig config) throws org.openrdf.repository.RepositoryException
See documentation for freetext index parameters.
indexName
- the index name to createconfig
- the index configurationorg.openrdf.repository.RepositoryException
AGFreetextIndexConfig.newInstance()
public void deleteFreetextIndex(String indexName) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
createFreetextIndex(String, AGFreetextIndexConfig)
public void createFreetextIndex(String name, org.openrdf.model.URI[] predicates) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
createFreetextIndex(String, AGFreetextIndexConfig)
public String[] getFreetextPredicates(String index) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
getFreetextIndexConfig(String)
public AGFreetextIndexConfig getFreetextIndexConfig(String indexName) throws org.openrdf.repository.RepositoryException, org.json.JSONException
org.openrdf.repository.RepositoryException
org.json.JSONException
public String[] getFreetextIndices() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
listFreetextIndices()
public List<String> listFreetextIndices() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void registerPredicateMapping(org.openrdf.model.URI predicate, org.openrdf.model.URI primtype) throws org.openrdf.repository.RepositoryException
Once registered, the objects of any data added via this connection that have this predicate will be mapped to the primitive datatype.
For example, registering that predicate <http://example.org/age>
is mapped to XMLSchema.INT
and adding the triple:
<http://example.org/Fred> <http://example.org/age> "24"
will result in the object being treated as "24"^^xsd:int
.
See mapping overview and POST predicate mapping.
predicate
- the predicate URIprimtype
- datatype URIorg.openrdf.repository.RepositoryException
getPredicateMappings()
public void deletePredicateMapping(org.openrdf.model.URI predicate) throws org.openrdf.repository.RepositoryException
See mapping overview and DELETE predicate mapping.
predicate
- the predicateorg.openrdf.repository.RepositoryException
getPredicateMappings()
public String[] getPredicateMappings() throws org.openrdf.repository.RepositoryException
See mapping overview and GET predicate mapping and the Lisp reference for the predicate-mapping function.
org.openrdf.repository.RepositoryException
registerPredicateMapping(URI, URI)
,
deletePredicateMapping(URI)
,
getDatatypeMappings()
public void registerDatatypeMapping(org.openrdf.model.URI datatype, org.openrdf.model.URI primtype) throws org.openrdf.repository.RepositoryException
Once registered, the objects of any data added via this connection that have this datatype will be mapped to the primitive datatype.
For example, registering that datatype <http://example.org/usertype>
is mapped to XMLSchema.INT
and adding the triple:
<http://example.org/Fred> <http://example.org/age> "24"^^<http://example.org/usertype>
will result in the object being treated as "24"^^xsd:int
.
See mapping overview and POST type mapping.
datatype
- the user datatypeprimtype
- the primitive typeorg.openrdf.repository.RepositoryException
getDatatypeMappings()
public void deleteDatatypeMapping(org.openrdf.model.URI datatype) throws org.openrdf.repository.RepositoryException
See mapping overview and DELETE type mapping.
datatype
- the user datatypeorg.openrdf.repository.RepositoryException
getDatatypeMappings()
,
clearMappings()
public String[] getDatatypeMappings() throws org.openrdf.repository.RepositoryException
See mapping overview and GET type mapping and the Lisp reference for the datatype-mapping function.
org.openrdf.repository.RepositoryException
deleteDatatypeMapping(URI)
,
clearMappings()
,
registerDatatypeMapping(URI, URI)
,
getPredicateMappings()
public void clearMappings() throws org.openrdf.repository.RepositoryException
See mapping overview and DELETE all mapping for more details.
org.openrdf.repository.RepositoryException
getDatatypeMappings()
,
getPredicateMappings()
public void clearMappings(boolean includeAutoEncodedPrimitiveTypes) throws org.openrdf.repository.RepositoryException
When includeAutoEncodedPrimitiveTypes is true, also deletes the automatic mappings for primitive datatypes; this is rarely what you want to do, as it will cause range queries to perform much less efficiently than when encodings are used; this option can be useful for ensuring literal forms are preserved in the store (there can be precision loss when encoding some literals).
See mapping overview and DELETE all mapping for more details.
org.openrdf.repository.RepositoryException
getDatatypeMappings()
,
getPredicateMappings()
public void addRules(String rules) throws org.openrdf.repository.RepositoryException
Starts a session if one is not already started. See session overview for more details. Starting a session causes http requests to use a new port, which may cause an exception if the client can not access it. See Session Port Setup.
rules
- a string of rule textorg.openrdf.repository.RepositoryException
addRules(InputStream)
public void addRules(InputStream rulestream) throws org.openrdf.repository.RepositoryException
Starts a session if one is not already started. See session overview for more details. Starting a session causes http requests to use a new port, which may cause an exception if the client can not access it. See Session Port Setup.
rulestream
- a stream of rule textorg.openrdf.repository.RepositoryException
addRules(String)
public String evalInServer(String lispForm) throws org.openrdf.repository.RepositoryException
lispForm
- the Lisp form to evaluateorg.openrdf.repository.RepositoryException
evalInServer(String)
public String evalInServer(InputStream stream) throws org.openrdf.repository.RepositoryException
stream
- the Lisp form to evaluateorg.openrdf.repository.RepositoryException
evalInServer(String)
public void load(org.openrdf.model.URI source, String baseURI, org.openrdf.rio.RDFFormat dataFormat, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
source
- the URI to fetch and load.baseURI
- the base URI for the source document.dataFormat
- the RDF data format for the source document.contexts
- zero or more contexts into which data will be loaded.org.openrdf.repository.RepositoryException
public void load(org.openrdf.model.URI source, String baseURI, org.openrdf.rio.RDFFormat dataFormat, org.json.JSONObject attributes, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
source
- the URI to fetch and load.baseURI
- the base URI for the source document.dataFormat
- the RDF data format for the source document.attributes
- A JSONObject of attribute bindings that will be added to each statement
imported from `source'. For RDFFormats that support the specification of
attributes (like NQX) these attributes will be applied to statements
that do not already specify attributes.contexts
- zero or more contexts into which data will be loaded.org.openrdf.repository.RepositoryException
public void load(String absoluteServerPath, String baseURI, org.openrdf.rio.RDFFormat dataFormat, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
absoluteServerPath
- the path to the server-side source file.baseURI
- the base URI for the source document.dataFormat
- the RDF data format for the source document.contexts
- zero or more contexts into which data will be loaded.org.openrdf.repository.RepositoryException
public void load(String absoluteServerPath, String baseURI, org.openrdf.rio.RDFFormat dataFormat, org.json.JSONObject attributes, org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
absoluteServerPath
- the path to the server-side source file.baseURI
- the base URI for the source document.dataFormat
- the RDF data format for the source document.attributes
- A JSONObject of attribute bindings that will be added to each statement
imported from `absoluteServerPath'. For RDFFormats that support the
specification of attributes (like NQX) these attributes will be applied
to statements that do not already specify attributes.contexts
- zero or more contexts into which data will be loaded.org.openrdf.repository.RepositoryException
public void ping() throws org.openrdf.repository.RepositoryException
Note that this method is called automatically before the timeout expires.
See session overview and GET ping for more details.
org.openrdf.repository.RepositoryException
setSessionLifetime(int)
public String[] getGeoTypes() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public org.openrdf.model.URI registerCartesianType(float stripWidth, float xmin, float xmax, float ymin, float ymax) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public org.openrdf.model.URI registerSphericalType(float stripWidth, String unit, float latmin, float lonmin, float latmax, float lonmax) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public org.openrdf.model.URI registerSphericalType(float stripWidth, String unit) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void registerPolygon(org.openrdf.model.URI polygon, List<org.openrdf.model.Literal> points) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> getStatementsInBox(org.openrdf.model.URI type, org.openrdf.model.URI predicate, float xmin, float xmax, float ymin, float ymax, int limit, boolean infer) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> getStatementsInCircle(org.openrdf.model.URI type, org.openrdf.model.URI predicate, float x, float y, float radius, int limit, boolean infer) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> getGeoHaversine(org.openrdf.model.URI type, org.openrdf.model.URI predicate, float lat, float lon, float radius, String unit, int limit, boolean infer) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> getStatementsInPolygon(org.openrdf.model.URI type, org.openrdf.model.URI predicate, org.openrdf.model.URI polygon, int limit, boolean infer) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void registerSNAGenerator(String generator, List<org.openrdf.model.URI> objectOfs, List<org.openrdf.model.URI> subjectOfs, List<org.openrdf.model.URI> undirecteds, String query) throws org.openrdf.repository.RepositoryException
Starts a session if one is not already started. See session overview for more details. Starting a session causes http requests to use a new port, which may cause an exception if the client can not access it. See Session Port Setup.
generator
- Generator name.objectOfs
- subjectOfs
- undirecteds
- query
- org.openrdf.repository.RepositoryException
public void registerSNANeighborMatrix(String matrix, String generator, List<org.openrdf.model.URI> group, int depth) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public List<String> listIndices() throws org.openrdf.OpenRDFException
org.openrdf.OpenRDFException
public List<String> listValidIndices() throws org.openrdf.OpenRDFException
org.openrdf.OpenRDFException
public void addIndex(String type) throws org.openrdf.repository.RepositoryException
type
- a valid index typeorg.openrdf.repository.RepositoryException
listValidIndices()
public void dropIndex(String type) throws org.openrdf.repository.RepositoryException
type
- an actively managed index type.org.openrdf.repository.RepositoryException
listValidIndices()
public void sendRDFTransaction(InputStream rdftransaction) throws org.openrdf.repository.RepositoryException, org.openrdf.rio.RDFParseException, IOException
rdftransaction
- a stream in application/x-rdftransaction formatorg.openrdf.repository.RepositoryException
org.openrdf.rio.RDFParseException
IOException
public void sendRDFTransaction(InputStream rdftransaction, org.json.JSONObject attributes) throws org.openrdf.repository.RepositoryException, org.openrdf.rio.RDFParseException, IOException
rdftransaction
- a stream in application/x-rdftransaction formatattributes
- a JSONObject of attribute bindings that will be added
to each triple imported from `rdftransaction'.org.openrdf.repository.RepositoryException
org.openrdf.rio.RDFParseException
IOException
public void registerEncodableNamespace(String namespace, String format) throws org.openrdf.repository.RepositoryException
Registering an encodable namespace enables a more efficient encoding of URIs in a namespace, and generation of unique URIs for that namespace, because its URIs are declared to conform to a specified format; the namespace is thereby bounded in size, and encodable.
The namespace is any valid URIref, e.g.:
http://franz.com/ns0
The format is a string using a simplified regular expression
syntax supporting character ranges and counts specifying the
suffix portion of the URIs in the namespace, e.g:
[a-z][0-9]-[a-f]{3}
Generation of unique URIs AGValueFactory.generateURI(String)
for the above namespace and format might yield an ID such as:
http://franz.com/ns0@@a0-aaa
Note: "@@" is used to concatenate the namespace and id suffix to facilitate efficient recognition/encoding during parsing.
The format can be ambiguous (e.g., "[A-Z]{1,2}[B-C}{0,1}"). We will not check for ambiguity in this first version but can add this checking at a later time.
If the format corresponds to a namespace that is not encodable (it may be malformed, or perhaps it's too large to encode), an exception is thrown.
For more details, see Encoded IDs.
namespace
- a valid namespace, a URI refformat
- a valid format for an encodable namespaceorg.openrdf.repository.RepositoryException
registerEncodableNamespaces(Iterable)
,
listEncodableNamespaces()
,
unregisterEncodableNamespace(String)
,
AGValueFactory.generateURI(String)
,
AGValueFactory.generateURIs(String, int)
public void registerEncodableNamespaces(Iterable<? extends AGFormattedNamespace> formattedNamespaces) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
registerEncodableNamespace(String, String)
public List<AGFormattedNamespace> listEncodableNamespaces() throws org.openrdf.OpenRDFException
org.openrdf.OpenRDFException
registerEncodableNamespace(String, String)
public void unregisterEncodableNamespace(String namespace) throws org.openrdf.repository.RepositoryException
namespace
- the namespace to unregisterorg.openrdf.repository.RepositoryException
registerEncodableNamespace(String, String)
public Object callStoredProc(String functionName, String moduleName, Object... args) throws org.openrdf.repository.RepositoryException
The input arguments and the return value can be:
String
, Integer
, null, byte[],
or Object[] or List
of these (can be nested).
See also
getHttpRepoClient()
.callStoredProc
(functionName, moduleName, args)
functionName
- stored proc lisp function, for example "addTwo"moduleName
- lisp FASL file name, for example "example.fasl"args
- arguments to the stored proccom.franz.agraph.http.exception.AGCustomStoredProcException
- for errors from stored procorg.openrdf.repository.RepositoryException
public void setSessionLifetime(int lifetimeInSeconds)
Also see session overview and POST session for more details.
lifetimeInSeconds
- the session lifetime, in seconds.getSessionLifetime()
,
ping()
public int getSessionLifetime()
See also: Session overview.
setSessionLifetime(int)
,
ping()
public void setSessionLoadInitFile(boolean loadInitFile)
loadInitFile is a boolean, defaulting to false, which determines whether the initfile is loaded into this session.
See also: Session overview.
addSessionLoadScript(String)
public void addSessionLoadScript(String scriptName)
Scripts are server code that may be loaded during a session.
See also: Session overview.
setSessionLoadInitFile(boolean)
public void enableTripleCache(long size) throws org.openrdf.repository.RepositoryException
size
- the size of the cache, in triples.org.openrdf.repository.RepositoryException
public long getTripleCacheSize() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void disableTripleCache() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void setUploadCommitPeriod(int period) throws org.openrdf.repository.RepositoryException
period
- commit after this many statementsorg.openrdf.repository.RepositoryException
AGHttpRepoClient.setUploadCommitPeriod(int)
public int getUploadCommitPeriod() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
AGHttpRepoClient.getUploadCommitPeriod()
public void optimizeIndices(Boolean wait, int level) throws org.openrdf.repository.RepositoryException
wait
- is a boolean, false for request to return immediatelylevel
- determines the work to be done. See the index documentation
for an explanation of the different levels.org.openrdf.repository.RepositoryException
public void optimizeIndices(Boolean wait) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public String getSpinFunction(String uri) throws org.openrdf.OpenRDFException
uri
- spin function identifierorg.openrdf.OpenRDFException
putSpinFunction(AGSpinFunction)
,
deleteSpinFunction(String)
,
listSpinFunctions()
,
getSpinMagicProperty(String)
public List<AGSpinFunction> listSpinFunctions() throws org.openrdf.OpenRDFException
org.openrdf.OpenRDFException
getSpinFunction(String)
,
putSpinFunction(AGSpinFunction)
,
deleteSpinFunction(String)
,
listSpinMagicProperties()
public void putSpinFunction(AGSpinFunction fn) throws org.openrdf.OpenRDFException
org.openrdf.OpenRDFException
getSpinFunction(String)
,
deleteSpinFunction(String)
,
putSpinMagicProperty(AGSpinMagicProperty)
public void deleteSpinFunction(String uri) throws org.openrdf.OpenRDFException
uri
- spin function identifierorg.openrdf.OpenRDFException
putSpinFunction(AGSpinFunction)
,
getSpinFunction(String)
public String getSpinMagicProperty(String uri) throws org.openrdf.OpenRDFException
uri
- spin magic property identifierorg.openrdf.OpenRDFException
putSpinMagicProperty(AGSpinMagicProperty)
,
deleteSpinMagicProperty(String)
public List<AGSpinMagicProperty> listSpinMagicProperties() throws org.openrdf.OpenRDFException
org.openrdf.OpenRDFException
getSpinMagicProperty(String)
,
putSpinMagicProperty(AGSpinMagicProperty)
,
deleteSpinMagicProperty(String)
,
listSpinFunctions()
public void deleteSpinMagicProperty(String uri) throws org.openrdf.OpenRDFException
uri
- spin magic property identifierorg.openrdf.OpenRDFException
putSpinMagicProperty(AGSpinMagicProperty)
,
getSpinMagicProperty(String)
public void putSpinMagicProperty(AGSpinMagicProperty fn) throws org.openrdf.OpenRDFException
org.openrdf.OpenRDFException
getSpinMagicProperty(String)
,
deleteSpinMagicProperty(String)
,
putSpinFunction(AGSpinFunction)
public void deleteDuplicates(String comparisonMode) throws org.openrdf.repository.RepositoryException
The comparisonMode determines what will be deemed a "duplicate".
If comparisonMode is "spog", quad parts (s,p,o,g) will all be compared when looking for duplicates.
If comparisonMode is "spo", only the (s,p,o) parts will be compared; the same triple in different graphs will thus be deemed duplicates.
See also the protocol documentation for deleting duplicates
comparisonMode
- determines what is a duplicatecom.franz.agraph.http.exception.AGHttpException
org.openrdf.repository.RepositoryException
public org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> getDuplicateStatements(String comparisonMode) throws org.openrdf.repository.RepositoryException
The comparisonMode determines what will be deemed a "duplicate".
If comparisonMode is "spog", quad parts (s,p,o,g) will all be compared when looking for duplicates.
If comparisonMode is "spo", only the (s,p,o) parts will be compared; the same triple in different graphs will thus be deemed duplicates.
See also the protocol documentation for deleting duplicates
comparisonMode
- determines what is a duplicatecom.franz.agraph.http.exception.AGHttpException
org.openrdf.repository.RepositoryException
public long materialize(AGMaterializer materializer) throws org.openrdf.repository.RepositoryException
The materializer's configuration determines how statements are materialized.
materializer
- the materializer to use.com.franz.agraph.http.exception.AGHttpException
org.openrdf.repository.RepositoryException
AGMaterializer.newInstance()
public long deleteMaterialized() throws org.openrdf.repository.RepositoryException
com.franz.agraph.http.exception.AGHttpException
org.openrdf.repository.RepositoryException
materialize(AGMaterializer)
public void setMasqueradeAsUser(String user) throws org.openrdf.repository.RepositoryException
user
- the user for X-Masquerade-As-User requests.org.openrdf.repository.RepositoryException
public void begin() throws org.openrdf.repository.RepositoryException
commit()
or rollback()
to
be called to end the transaction.begin
in interface org.openrdf.repository.RepositoryConnection
org.openrdf.repository.RepositoryException
isActive()
,
commit()
,
rollback()
public boolean isActive() throws org.openrdf.repository.UnknownTransactionStateException, org.openrdf.repository.RepositoryException
begin()
has been called, and becomes
inactive after commit()
or rollback()
has been called.isActive
in interface org.openrdf.repository.RepositoryConnection
true
iff a transaction is active, false
iff no transaction is active.org.openrdf.repository.UnknownTransactionStateException
- if the transaction state can not be determined. This can happen
for instance when communication with a repository fails or times
out.org.openrdf.repository.RepositoryException
public void clear(org.openrdf.model.Resource... contexts) throws org.openrdf.repository.RepositoryException
clear
in interface org.openrdf.repository.RepositoryConnection
clear
in class org.openrdf.repository.base.RepositoryConnectionBase
contexts
- The context(s) to remove the data from. Note that this parameter is
a vararg and as such is optional. If no contexts are supplied the
method operates on the entire repository.org.openrdf.repository.RepositoryException
- If the statement(s) could not be removed from the repository, for
example because the repository is not writable.public void deleteAttributeDefinition(String name) throws org.openrdf.repository.RepositoryException
name
- - The name of the defined attribute to delete.org.openrdf.repository.RepositoryException
public org.json.JSONArray getAttributeDefinitions() throws org.openrdf.repository.RepositoryException, org.json.JSONException
org.openrdf.repository.RepositoryException
org.json.JSONException
public org.json.JSONArray getAttributeDefinition(String name) throws org.openrdf.repository.RepositoryException, org.json.JSONException
name
- org.openrdf.repository.RepositoryException
org.json.JSONException
public void setStaticAttributeFilter(String filter) throws org.openrdf.repository.RepositoryException
filter
- a String representing a static attribute filter definition.org.openrdf.repository.RepositoryException
public String getStaticAttributeFilter() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public void deleteStaticAttributeFilter() throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryException
public String getUserAttributes()
public void setUserAttributes(String value)
public void setUserAttributes(org.json.JSONObject value)