|
Franz Inc, AllegroGraph | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openrdf.repository.base.RepositoryConnectionBase
com.franz.agraph.repository.AGRepositoryConnection
public class AGRepositoryConnection
Implements the Sesame
RepositoryConnection interface for AllegroGraph.
By default, a connection is autoCommit=true.
For ACID transactions, a session must be created.
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 in order to perform their duties.
Adds and deletes during a session must be committed
or rolled back.
A session expires when its idle lifetime
is exceeded, freeing up server resources.
A session lifetime may be extended by calling ping.
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)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:
clearMappings()getDatatypeMappings()registerDatatypeMapping(URI, URI)deleteDatatypeMapping(URI)getPredicateMappings()registerPredicateMapping(URI, URI)deletePredicateMapping(URI)
| Constructor Summary | |
|---|---|
AGRepositoryConnection(AGRepository repository,
com.franz.agraph.http.AGHttpRepoClient client)
|
|
AGRepositoryConnection(AGVirtualRepository repository,
com.franz.agraph.http.AGHttpRepoClient client)
|
|
| Method Summary | ||
|---|---|---|
void |
add(Iterable<? extends Statement> statements,
Resource... contexts)
|
|
|
add(info.aduna.iteration.Iteration<? extends Statement,E> statementIter,
Resource... 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. |
|
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 |
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,
URI[] predicates)
Deprecated. |
|
|
createRepositoryResult(Iterable<? extends E> elements)
Creates a RepositoryResult for the supplied element set. |
|
void |
deleteDatatypeMapping(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. |
|
void |
deletePredicateMapping(URI predicate)
Deletes any predicate mapping associated with the given predicate. |
|
void |
deleteSpinFunction(String uri)
|
|
void |
deleteSpinMagicProperty(String uri)
|
|
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(RDFHandler handler,
String... ids)
|
|
void |
exportStatements(Resource subj,
URI pred,
Value obj,
boolean includeInferred,
RDFHandler handler,
Resource... contexts)
|
|
RepositoryResult<Resource> |
getContextIDs()
|
|
String[] |
getDatatypeMappings()
Gets the datatype mappings defined for this connection. |
|
AGFreetextIndexConfig |
getFreetextIndexConfig(String indexName)
Gets the configuration of the specified free text index. |
|
String[] |
getFreetextIndices()
Deprecated. |
|
String[] |
getFreetextPredicates(String index)
Deprecated. |
|
RepositoryResult<Statement> |
getGeoHaversine(URI type,
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/Storage layer for this connection. |
|
String |
getNamespace(String prefix)
|
|
RepositoryResult<Namespace> |
getNamespaces()
|
|
String[] |
getPredicateMappings()
Gets the predicate mappings defined for this connection. |
|
AGAbstractRepository |
getRepository()
|
|
int |
getSessionLifetime()
Returns the lifetime for a dedicated session spawned by this connection. |
|
String |
getSpinFunction(String uri)
|
|
String |
getSpinMagicProperty(String uri)
|
|
RepositoryResult<Statement> |
getStatements(Resource subj,
URI pred,
Value obj,
boolean includeInferred,
Resource... contexts)
|
|
RepositoryResult<Statement> |
getStatements(String... ids)
Returns statements having the specified ids. |
|
RepositoryResult<Statement> |
getStatementsInBox(URI type,
URI predicate,
float xmin,
float xmax,
float ymin,
float ymax,
int limit,
boolean infer)
|
|
RepositoryResult<Statement> |
getStatementsInCircle(URI type,
URI predicate,
float x,
float y,
float radius,
int limit,
boolean infer)
|
|
RepositoryResult<Statement> |
getStatementsInPolygon(URI type,
URI predicate,
URI polygon,
int limit,
boolean infer)
|
|
long |
getTripleCacheSize()
Returns the size of the spogi cache. |
|
int |
getUploadCommitPeriod()
Gets the commit period used within large add/load operations. |
|
AGValueFactory |
getValueFactory()
|
|
boolean |
isAutoCommit()
|
|
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,
RDFFormat dataFormat,
Resource... contexts)
Instructs the server to load data from the specified server-side path. |
|
void |
load(URI source,
String baseURI,
RDFFormat dataFormat,
Resource... contexts)
Instructs the server to fetch and load data from the specified URI. |
|
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(QueryLanguage ql,
String queryString)
|
|
AGBooleanQuery |
prepareBooleanQuery(QueryLanguage ql,
String queryString,
String baseURI)
|
|
AGGraphQuery |
prepareGraphQuery(QueryLanguage ql,
String queryString)
|
|
AGGraphQuery |
prepareGraphQuery(QueryLanguage ql,
String queryString,
String baseURI)
|
|
AGQuery |
prepareQuery(QueryLanguage ql,
String queryString,
String baseURI)
Unsupported method, throws an UnsupportedOperationException. |
|
AGTupleQuery |
prepareTupleQuery(QueryLanguage ql,
String queryString)
|
|
AGTupleQuery |
prepareTupleQuery(QueryLanguage ql,
String queryString,
String baseURI)
|
|
Update |
prepareUpdate(QueryLanguage ql,
String queryString)
|
|
Update |
prepareUpdate(QueryLanguage ql,
String queryString,
String baseURI)
|
|
void |
putSpinFunction(AGSpinFunction fn)
|
|
void |
putSpinMagicProperty(AGSpinMagicProperty fn)
|
|
URI |
registerCartesianType(float stripWidth,
float xmin,
float xmax,
float ymin,
float ymax)
Registers a cartesian type. |
|
void |
registerDatatypeMapping(URI datatype,
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(URI polygon,
List<Literal> points)
Registers a polygon. |
|
void |
registerPredicateMapping(URI predicate,
URI primtype)
Registers a predicate mapping from the predicate to a primitive datatype. |
|
void |
registerSNAGenerator(String generator,
List<URI> objectOfs,
List<URI> subjectOfs,
List<URI> undirecteds,
String query)
See Social network analysis Lisp documentation and SNA generator registration. |
|
void |
registerSNANeighborMatrix(String matrix,
String generator,
List<URI> group,
int depth)
|
|
URI |
registerSphericalType(float stripWidth,
String unit)
|
|
URI |
registerSphericalType(float stripWidth,
String unit,
float latmin,
float lonmin,
float latmax,
float lonmax)
Registers a spherical type. |
|
void |
remove(Iterable<? extends Statement> statements,
Resource... contexts)
|
|
|
remove(info.aduna.iteration.Iteration<? extends Statement,E> statements,
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 |
setAutoCommit(boolean autoCommit)
Setting autoCommit to false creates a dedicated server session which supports ACID transactions. |
|
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 |
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. |
|
long |
size(Resource... contexts)
|
|
String |
toString()
|
|
void |
unregisterEncodableNamespace(String namespace)
Unregisters the specified encodable namespace. |
|
| Methods inherited from class org.openrdf.repository.base.RepositoryConnectionBase |
|---|
add, add, add, add, add, add, clear, export, getParserConfig, hasStatement, hasStatement, isEmpty, isOpen, prepareQuery, remove, remove, setParserConfig |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.openrdf.repository.RepositoryConnection |
|---|
add, add, add, add, add, add, clear, export, getParserConfig, hasStatement, hasStatement, isEmpty, isOpen, prepareQuery, remove, remove, setParserConfig |
| Constructor Detail |
|---|
public AGRepositoryConnection(AGRepository repository,
com.franz.agraph.http.AGHttpRepoClient client)
AGRepository.getConnection(),
AGVirtualRepository.getConnection()
public AGRepositoryConnection(AGVirtualRepository repository,
com.franz.agraph.http.AGHttpRepoClient client)
| Method Detail |
|---|
public String toString()
toString in class Objectpublic AGAbstractRepository getRepository()
getRepository in interface RepositoryConnectiongetRepository in class RepositoryConnectionBasepublic com.franz.agraph.http.AGHttpRepoClient getHttpRepoClient()
public AGValueFactory getValueFactory()
getValueFactory in interface RepositoryConnectiongetValueFactory in class RepositoryConnectionBase
public void add(Iterable<? extends Statement> statements,
Resource... contexts)
throws RepositoryException
add in interface RepositoryConnectionadd in class RepositoryConnectionBaseRepositoryException
public <E extends Exception> void add(info.aduna.iteration.Iteration<? extends Statement,E> statementIter,
Resource... contexts)
throws RepositoryException,
E extends Exception
add in interface RepositoryConnectionadd in class RepositoryConnectionBaseRepositoryException
E extends Exception
public void remove(Iterable<? extends Statement> statements,
Resource... contexts)
throws RepositoryException
remove in interface RepositoryConnectionremove in class RepositoryConnectionBaseRepositoryException
public <E extends Exception> void remove(info.aduna.iteration.Iteration<? extends Statement,E> statements,
Resource... contexts)
throws RepositoryException,
E extends Exception
remove in interface RepositoryConnectionremove in class RepositoryConnectionBaseRepositoryException
E extends Exception
public void setAutoCommit(boolean autoCommit)
throws 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 RepositoryConnectionsetAutoCommit in class RepositoryConnectionBaseRepositoryException
public boolean isAutoCommit()
throws RepositoryException
isAutoCommit in interface RepositoryConnectionisAutoCommit in class RepositoryConnectionBaseRepositoryExceptionsetAutoCommit(boolean)
public void commit()
throws RepositoryException
commit in interface RepositoryConnectionRepositoryException
public void rollback()
throws RepositoryException
rollback in interface RepositoryConnectionRepositoryExceptionpublic void setStreamResults(boolean streamResults)
AGStreamTupleQuery
for prepareTupleQuery(QueryLanguage, String, String).
isStreamResults()public boolean isStreamResults()
AGStreamTupleQuery.
Default is false.
setStreamResults(boolean)
public void clearNamespaces()
throws RepositoryException
clearNamespaces in interface RepositoryConnectionRepositoryException
public void close()
throws RepositoryException
close in interface Closeableclose in interface RepositoryConnectionclose in class RepositoryConnectionBaseRepositoryExceptionCloseable.close()
public void exportStatements(Resource subj,
URI pred,
Value obj,
boolean includeInferred,
RDFHandler handler,
Resource... contexts)
throws RDFHandlerException,
RepositoryException
exportStatements in interface RepositoryConnectionRDFHandlerException
RepositoryException
public void exportStatements(RDFHandler handler,
String... ids)
throws RDFHandlerException,
RepositoryException
RDFHandlerException
RepositoryException
public RepositoryResult<Resource> getContextIDs()
throws RepositoryException
getContextIDs in interface RepositoryConnectionRepositoryExceptionpublic <E> RepositoryResult<E> createRepositoryResult(Iterable<? extends E> elements)
public String getNamespace(String prefix)
throws RepositoryException
getNamespace in interface RepositoryConnectionRepositoryException
public RepositoryResult<Namespace> getNamespaces()
throws RepositoryException
getNamespaces in interface RepositoryConnectionRepositoryException
public RepositoryResult<Statement> getStatements(Resource subj,
URI pred,
Value obj,
boolean includeInferred,
Resource... contexts)
throws RepositoryException
getStatements in interface RepositoryConnectionRepositoryException
public RepositoryResult<Statement> getStatements(String... ids)
throws RepositoryException
ids - Strings representing statement ids.
RepositoryResult object, a lazy Iterator-like object
containing Statements and optionally throwing a
RepositoryException when an error when a problem occurs
during retrieval.
RepositoryException
public AGQuery prepareQuery(QueryLanguage ql,
String queryString,
String baseURI)
UnsupportedOperationException.
prepareQuery in interface RepositoryConnection
public AGTupleQuery prepareTupleQuery(QueryLanguage ql,
String queryString)
prepareTupleQuery in interface RepositoryConnectionprepareTupleQuery in class RepositoryConnectionBase
public AGTupleQuery prepareTupleQuery(QueryLanguage ql,
String queryString,
String baseURI)
prepareTupleQuery in interface RepositoryConnection
public AGGraphQuery prepareGraphQuery(QueryLanguage ql,
String queryString)
prepareGraphQuery in interface RepositoryConnectionprepareGraphQuery in class RepositoryConnectionBase
public AGGraphQuery prepareGraphQuery(QueryLanguage ql,
String queryString,
String baseURI)
prepareGraphQuery in interface RepositoryConnection
public AGBooleanQuery prepareBooleanQuery(QueryLanguage ql,
String queryString)
prepareBooleanQuery in interface RepositoryConnectionprepareBooleanQuery in class RepositoryConnectionBase
public AGBooleanQuery prepareBooleanQuery(QueryLanguage ql,
String queryString,
String baseURI)
prepareBooleanQuery in interface RepositoryConnection
public Update prepareUpdate(QueryLanguage ql,
String queryString,
String baseURI)
prepareUpdate in interface RepositoryConnection
public Update prepareUpdate(QueryLanguage ql,
String queryString)
prepareUpdate in interface RepositoryConnectionprepareUpdate in class RepositoryConnectionBase
public void removeNamespace(String prefix)
throws RepositoryException
removeNamespace in interface RepositoryConnectionRepositoryException
public void setNamespace(String prefix,
String name)
throws RepositoryException
setNamespace in interface RepositoryConnectionRepositoryException
public long size(Resource... contexts)
throws RepositoryException
size in interface RepositoryConnectionRepositoryException
public void createFreetextIndex(String indexName,
AGFreetextIndexConfig config)
throws RepositoryException
See documentation for freetext index parameters.
indexName - the index name to createconfig - the index configuration
RepositoryExceptionAGFreetextIndexConfig.newInstance()
public void deleteFreetextIndex(String indexName)
throws RepositoryException
RepositoryExceptioncreateFreetextIndex(String, AGFreetextIndexConfig)
public void createFreetextIndex(String name,
URI[] predicates)
throws RepositoryException
RepositoryExceptioncreateFreetextIndex(String, AGFreetextIndexConfig)
public String[] getFreetextPredicates(String index)
throws RepositoryException
RepositoryExceptiongetFreetextIndexConfig(String)
public AGFreetextIndexConfig getFreetextIndexConfig(String indexName)
throws RepositoryException
RepositoryException
public String[] getFreetextIndices()
throws RepositoryException
RepositoryExceptionlistFreetextIndices()
public List<String> listFreetextIndices()
throws RepositoryException
RepositoryException
public void registerPredicateMapping(URI predicate,
URI primtype)
throws 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 URI
RepositoryExceptiongetPredicateMappings()
public void deletePredicateMapping(URI predicate)
throws RepositoryException
See mapping overview and DELETE predicate mapping.
predicate - the predicate
RepositoryExceptiongetPredicateMappings()
public String[] getPredicateMappings()
throws RepositoryException
See mapping overview and GET predicate mapping and the Lisp reference for the predicate-mapping function.
RepositoryExceptionregisterPredicateMapping(URI, URI),
deletePredicateMapping(URI),
getDatatypeMappings()
public void registerDatatypeMapping(URI datatype,
URI primtype)
throws 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 type
RepositoryExceptiongetDatatypeMappings()
public void deleteDatatypeMapping(URI datatype)
throws RepositoryException
See mapping overview and DELETE type mapping.
datatype - the user datatype
RepositoryExceptiongetDatatypeMappings(),
clearMappings()
public String[] getDatatypeMappings()
throws RepositoryException
See mapping overview and GET type mapping and the Lisp reference for the datatype-mapping function.
RepositoryExceptiondeleteDatatypeMapping(URI),
clearMappings(),
registerDatatypeMapping(URI, URI),
getPredicateMappings()
public void clearMappings()
throws RepositoryException
See mapping overview and DELETE all mapping for more details.
RepositoryExceptiongetDatatypeMappings(),
getPredicateMappings()
public void clearMappings(boolean includeAutoEncodedPrimitiveTypes)
throws 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.
RepositoryExceptiongetDatatypeMappings(),
getPredicateMappings()
public void addRules(String rules)
throws 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 text
RepositoryExceptionaddRules(InputStream)
public void addRules(InputStream rulestream)
throws 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 text
RepositoryExceptionaddRules(String)
public String evalInServer(String lispForm)
throws RepositoryException
lispForm - the Lisp form to evaluate
RepositoryExceptionevalInServer(String)
public String evalInServer(InputStream stream)
throws RepositoryException
stream - the Lisp form to evaluate
RepositoryExceptionevalInServer(String)
public void load(URI source,
String baseURI,
RDFFormat dataFormat,
Resource... contexts)
throws 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.
RepositoryException
public void load(String absoluteServerPath,
String baseURI,
RDFFormat dataFormat,
Resource... contexts)
throws 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.
RepositoryException
public void ping()
throws RepositoryException
See session overview and GET ping for more details.
RepositoryExceptionsetSessionLifetime(int)
public String[] getGeoTypes()
throws RepositoryException
RepositoryException
public URI registerCartesianType(float stripWidth,
float xmin,
float xmax,
float ymin,
float ymax)
throws RepositoryException
RepositoryException
public URI registerSphericalType(float stripWidth,
String unit,
float latmin,
float lonmin,
float latmax,
float lonmax)
throws RepositoryException
RepositoryException
public URI registerSphericalType(float stripWidth,
String unit)
throws RepositoryException
RepositoryException
public void registerPolygon(URI polygon,
List<Literal> points)
throws RepositoryException
RepositoryException
public RepositoryResult<Statement> getStatementsInBox(URI type,
URI predicate,
float xmin,
float xmax,
float ymin,
float ymax,
int limit,
boolean infer)
throws RepositoryException
RepositoryException
public RepositoryResult<Statement> getStatementsInCircle(URI type,
URI predicate,
float x,
float y,
float radius,
int limit,
boolean infer)
throws RepositoryException
RepositoryException
public RepositoryResult<Statement> getGeoHaversine(URI type,
URI predicate,
float lat,
float lon,
float radius,
String unit,
int limit,
boolean infer)
throws RepositoryException
RepositoryException
public RepositoryResult<Statement> getStatementsInPolygon(URI type,
URI predicate,
URI polygon,
int limit,
boolean infer)
throws RepositoryException
RepositoryException
public void registerSNAGenerator(String generator,
List<URI> objectOfs,
List<URI> subjectOfs,
List<URI> undirecteds,
String query)
throws 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 - objectOfs - subjectOfs - undirecteds - query -
RepositoryException
public void registerSNANeighborMatrix(String matrix,
String generator,
List<URI> group,
int depth)
throws RepositoryException
RepositoryException
public List<String> listIndices()
throws OpenRDFException
OpenRDFException
public List<String> listValidIndices()
throws OpenRDFException
OpenRDFException
public void addIndex(String type)
throws RepositoryException
type - a valid index type
RepositoryExceptionlistValidIndices()
public void dropIndex(String type)
throws RepositoryException
type - an actively managed index type.
RepositoryExceptionlistValidIndices()
public void sendRDFTransaction(InputStream rdftransaction)
throws RepositoryException,
RDFParseException,
IOException
rdftransaction - a stream in application/x-rdftransaction format
RepositoryException
RDFParseException
IOException
public void registerEncodableNamespace(String namespace,
String format)
throws 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 namespace
RepositoryExceptionregisterEncodableNamespaces(Iterable),
listEncodableNamespaces(),
unregisterEncodableNamespace(String),
AGValueFactory.generateURI(String),
AGValueFactory.generateURIs(String, int)
public void registerEncodableNamespaces(Iterable<? extends AGFormattedNamespace> formattedNamespaces)
throws RepositoryException
RepositoryExceptionregisterEncodableNamespace(String, String)
public List<AGFormattedNamespace> listEncodableNamespaces()
throws OpenRDFException
OpenRDFExceptionregisterEncodableNamespace(String, String)
public void unregisterEncodableNamespace(String namespace)
throws RepositoryException
namespace - the namespace to unregister
RepositoryExceptionregisterEncodableNamespace(String, String)
public Object callStoredProc(String functionName,
String moduleName,
Object... args)
throws 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 proc
com.franz.agraph.http.exception.AGCustomStoredProcException - for errors from stored proc
RepositoryExceptionpublic void setSessionLifetime(int lifetimeInSeconds)
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 RepositoryException
size - the size of the cache, in triples.
RepositoryException
public long getTripleCacheSize()
throws RepositoryException
RepositoryException
public void disableTripleCache()
throws RepositoryException
RepositoryException
public void setUploadCommitPeriod(int period)
throws RepositoryException
period - commit after this many statements
RepositoryExceptionAGHttpRepoClient.setUploadCommitPeriod(int)
public int getUploadCommitPeriod()
throws RepositoryException
RepositoryExceptionAGHttpRepoClient.getUploadCommitPeriod()
public void optimizeIndices(Boolean wait,
int level)
throws 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.
RepositoryException
public void optimizeIndices(Boolean wait)
throws RepositoryException
RepositoryException
public String getSpinFunction(String uri)
throws OpenRDFException
uri - spin function identifier
OpenRDFExceptionputSpinFunction(AGSpinFunction),
deleteSpinFunction(String),
listSpinFunctions(),
getSpinMagicProperty(String)
public List<AGSpinFunction> listSpinFunctions()
throws OpenRDFException
OpenRDFExceptiongetSpinFunction(String),
putSpinFunction(AGSpinFunction),
deleteSpinFunction(String),
listSpinMagicProperties()
public void putSpinFunction(AGSpinFunction fn)
throws OpenRDFException
OpenRDFExceptiongetSpinFunction(String),
deleteSpinFunction(String),
putSpinMagicProperty(AGSpinMagicProperty)
public void deleteSpinFunction(String uri)
throws OpenRDFException
uri - spin function identifier
OpenRDFExceptionputSpinFunction(AGSpinFunction),
getSpinFunction(String)
public String getSpinMagicProperty(String uri)
throws OpenRDFException
uri - spin magic property identifier
OpenRDFExceptionputSpinMagicProperty(AGSpinMagicProperty),
deleteSpinMagicProperty(String)
public List<AGSpinMagicProperty> listSpinMagicProperties()
throws OpenRDFException
OpenRDFExceptiongetSpinMagicProperty(String),
putSpinMagicProperty(AGSpinMagicProperty),
deleteSpinMagicProperty(String),
listSpinFunctions()
public void deleteSpinMagicProperty(String uri)
throws OpenRDFException
uri - spin magic property identifier
OpenRDFExceptionputSpinMagicProperty(AGSpinMagicProperty),
getSpinMagicProperty(String)
public void putSpinMagicProperty(AGSpinMagicProperty fn)
throws OpenRDFException
OpenRDFExceptiongetSpinMagicProperty(String),
deleteSpinMagicProperty(String),
putSpinFunction(AGSpinFunction)
public void deleteDuplicates(String comparisonMode)
throws 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 duplicate
com.franz.agraph.http.exception.AGHttpException
RepositoryException
public void setMasqueradeAsUser(String user)
throws RepositoryException
user - the user for X-Masquerade-As-User requests.
RepositoryException
|
Copyright © 2008-2012 Franz Inc. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||