| Modifier and Type | Field and Description |
|---|---|
ConcurrentLinkedQueue<String> |
savedQueryDeleteQueue |
| Constructor and Description |
|---|
AGHttpRepoClient(AGAbstractRepository repo,
AGHTTPClient client,
String repoRoot,
String sessionRoot) |
AGHttpRepoClient(AGAbstractRepository repo,
AGHTTPClient client,
String repoRoot,
String sessionRoot,
ScheduledExecutorService executor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttributeDefinition(String name,
List<String> allowedValues,
boolean ordered,
long minimum,
long maximum)
HTTP client layer function for requesting that AG define a new attribute.
|
void |
addIndex(String index)
Adds the given index to the list of actively managed indices.
|
void |
addRules(InputStream rulestream) |
void |
addRules(String rules) |
void |
addSessionLoadScript(String scriptName)
Adds a 'script' for a dedicated session spawned by this instance.
|
void |
addStatements(Resource subj,
URI pred,
Value obj,
Resource... contexts) |
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.
|
String |
callStoredProcEncoded(String functionName,
String moduleName,
String argsEncoded)
Deprecated.
The stored proc feature and API are experimental, and subject to change in a future release.
|
void |
clearMappings() |
void |
clearMappings(boolean includeAutoEncodedPrimitiveTypes) |
void |
clearNamespaces() |
void |
close()
Releases system resources associated with the object.
|
void |
commit() |
void |
createFreetextIndex(String name,
List<String> predicates,
boolean indexLiterals,
List<String> indexLiteralTypes,
String indexResources,
List<String> indexFields,
int minimumWordSize,
List<String> stopWords,
List<String> wordFilters,
List<String> innerChars,
List<String> borderChars,
String tokenizer)
Creates a new freetext index with the given parameters.
|
void |
deleteAttributeDefinition(String name)
HTTP client layer function for requesting that AG deletes an existing attribute.
|
void |
deleteDatatypeMapping(URI datatype) |
void |
deleteDuplicates(String comparisonMode)
Deletes all duplicates from the store.
|
void |
deleteFreetextIndex(String index)
Delete the freetext index of the given name.
|
void |
deleteHardSpinFunction(String uri) |
void |
deleteHardSpinMagicProperty(String uri) |
void |
deleteJSON(org.json.JSONArray rows,
Resource... contexts) |
long |
deleteMaterialized()
Deletes materialized statements.
|
void |
deletePredicateMapping(URI predicate) |
void |
deleteSavedQuery(String queryName) |
void |
deleteSpinFunction(String uri) |
void |
deleteSpinMagicProperty(String uri) |
void |
deleteStatements(Resource subj,
URI pred,
Value obj,
Resource... contexts) |
void |
deleteStaticAttributeFilter() |
void |
disableTripleCache()
Disables the spogi triple cache.
|
void |
dropIndex(String index)
Drops the given index from the list of actively managed indices.
|
void |
enableTripleCache(long size)
Enables the spogi cache in this repository.
|
void |
evalFreetextQuery(String pattern,
String expression,
String index,
boolean sorted,
int limit,
int offset,
AGResponseHandler handler) |
String |
evalInServer(InputStream stream) |
String |
evalInServer(String lispForm) |
boolean |
getAllowExternalBlankNodeIds() |
static Resource |
getApplicationResource(Resource stored,
AGValueFactory vf)
Returns the application Resource for a given stored resource.
|
static Value |
getApplicationValue(Value stored,
AGValueFactory vf)
Returns the application Value for a given stored value.
|
org.json.JSONArray |
getAttributeDefinition()
Fetch all attribute definitions.
|
org.json.JSONArray |
getAttributeDefinition(String name)
Fetch the attribute definition named by NAME.
|
String[] |
getBlankNodes(int blankNodeAmount) |
TupleQueryResult |
getContextIDs() |
void |
getContextIDs(TupleQueryResultHandler handler) |
String[] |
getDatatypeMappings() |
RDFFormat |
getDefaultRDFFormat()
Gets the default RDFFormat to use in making requests that
return RDF statements; the format should support contexts.
|
static long |
getDefaultSessionLifetime()
Gets the default lifetime of sessions spawned by any instance
unless otherwise specified by
setSessionLifetime(int) |
void |
getDuplicateStatements(String comparisonMode,
RDFHandler handler) |
TupleQueryResult |
getEncodableNamespaces() |
org.json.JSONObject |
getFreetextIndexConfiguration(String index)
Gets the configuration of the given index.
|
String[] |
getFreetextIndices()
Deprecated.
|
String[] |
getFreetextPredicates(String index) |
void |
getGeoBox(String type_uri,
String predicate_uri,
float xmin,
float xmax,
float ymin,
float ymax,
int limit,
boolean infer,
AGResponseHandler handler) |
void |
getGeoCircle(String type_uri,
String predicate_uri,
float x,
float y,
float radius,
int limit,
boolean infer,
AGResponseHandler handler) |
void |
getGeoHaversine(String type_uri,
String predicate_uri,
float lat,
float lon,
float radius,
String unit,
int limit,
boolean infer,
AGResponseHandler handler) |
void |
getGeoPolygon(String type_uri,
String predicate_uri,
String polygon,
int limit,
boolean infer,
AGResponseHandler handler) |
String[] |
getGeoTypes() |
AGHTTPClient |
getHTTPClient() |
String |
getNamespace(String prefix) |
TupleQueryResult |
getNamespaces() |
void |
getNamespaces(TupleQueryResultHandler handler) |
String[] |
getPredicateMappings() |
BooleanQueryResultFormat |
getPreferredBQRFormat() |
RDFFormat |
getPreferredRDFFormat()
Gets the RDFFormat to use in making requests that return
RDF statements.
|
TupleQueryResultFormat |
getPreferredTQRFormat() |
String |
getRoot() |
String |
getServerURL() |
int |
getSessionLifetime()
Returns the 'lifetime' for a dedicated session spawned by this instance.
|
boolean |
getSessionLoadInitFile()
Returns the 'loadInitFile' for a dedicated session spawned by this instance.
|
String |
getSpinFunction(String uri) |
String |
getSpinMagicProperty(String uri) |
void |
getStatements(RDFHandler handler,
String... ids) |
void |
getStatements(Resource subj,
URI pred,
Value obj,
String includeInferred,
RDFHandler handler,
Resource... contexts) |
String |
getStaticAttributeFilter() |
Resource |
getStorableResource(Resource r,
AGValueFactory vf)
Returns a storable Resource for the given Resource.
|
Value |
getStorableValue(Value v,
AGValueFactory vf)
Returns a storable Value for the given Value.
|
long |
getTripleCacheSize()
Returns the size of the spogi cache.
|
int |
getUploadCommitPeriod()
Gets the commit period used when uploading statements.
|
String |
getUserAttributes()
Return the current userAttributes setting for this connection.
|
AGValueFactory |
getValueFactory() |
boolean |
isAutoCommit() |
List<String> |
listFreetextIndices()
Lists the free text indices defined on the repository.
|
List<String> |
listIndices(boolean listValid)
Returns a list of indices for this repository.
|
TupleQueryResult |
listSpinFunctions() |
TupleQueryResult |
listSpinMagicProperties() |
void |
load(String serverAbsolutePath,
String baseURI,
RDFFormat dataFormat,
org.json.JSONObject attributes,
Resource... contexts) |
void |
load(String serverAbsolutePath,
String baseURI,
RDFFormat dataFormat,
Resource... contexts) |
void |
load(URI source,
String baseURI,
RDFFormat dataFormat,
org.json.JSONObject attributes,
Resource... contexts) |
void |
load(URI source,
String baseURI,
RDFFormat dataFormat,
Resource... contexts) |
long |
materialize(AGMaterializer materializer)
Materializes inferred statements (generates and adds them to the store).
|
void |
optimizeIndices(Boolean wait) |
void |
optimizeIndices(Boolean wait,
int level) |
void |
ping() |
void |
putSpinFunction(AGSpinFunction fn) |
void |
putSpinMagicProperty(AGSpinMagicProperty fn) |
void |
query(AGQuery q,
boolean analyzeOnly,
AGResponseHandler handler) |
String |
registerCartesianType(float stripWidth,
float xmin,
float xmax,
float ymin,
float ymax) |
void |
registerDatatypeMapping(URI datatype,
URI primitiveType) |
void |
registerEncodableNamespace(String namespace,
String format) |
void |
registerEncodableNamespaces(org.json.JSONArray formattedNamespaces) |
void |
registerPolygon(String polygon,
List<String> points) |
void |
registerPredicateMapping(URI predicate,
URI primitiveType) |
void |
registerSNAGenerator(String generator,
List<String> objectOfs,
List<String> subjectOfs,
List<String> undirecteds,
String query) |
void |
registerSNANeighborMatrix(String matrix,
String generator,
List<String> group,
int depth) |
String |
registerSphericalType(float stripWidth,
String unit,
float latmin,
float longmin,
float latmax,
float longmax) |
void |
removeNamespacePrefix(String prefix) |
void |
rollback() |
void |
sendRDFTransaction(InputStream rdftransaction) |
void |
sendRDFTransaction(InputStream rdftransaction,
org.json.JSONObject attributes) |
void |
setAllowExternalBlankNodeIds(boolean allow)
Enables/Disables an option to support external blank nodes (experimental).
|
void |
setAutoCommit(boolean autoCommit) |
static void |
setDefaultSessionLifetime(int lifetimeInSeconds)
Sets the default lifetime of sessions spawned by any instance
when none is specified by
setSessionLifetime(int)
Defaults to 3600 seconds (1 hour). |
void |
setMasqueradeAsUser(String user)
Sets the AG user for X-Masquerade-As-User requests.
|
void |
setNamespacePrefix(String prefix,
String name) |
void |
setPreferredBQRFormat(BooleanQueryResultFormat preferredBQRFormat) |
void |
setPreferredRDFFormat(RDFFormat preferredRDFFormat)
Sets the RDFFormat to use in making requests that return
RDF statements; the format should support contexts.
|
void |
setPreferredTQRFormat(TupleQueryResultFormat preferredTQRFormat) |
void |
setSessionLifetime(int lifetimeInSeconds)
Sets the 'lifetime' for a dedicated session spawned by this instance.
|
void |
setSessionLoadInitFile(boolean loadInitFile)
Sets the 'loadInitFile' for a dedicated session spawned by this instance.
|
void |
setStaticAttributeFilter(String filter) |
void |
setUploadCommitPeriod(int period)
Sets the commit period to use when uploading statements.
|
void |
setUserAttributes(String value)
Set the user attributes for this connection.
|
long |
size(Resource... contexts) |
String |
toString() |
void |
unregisterEncodableNamespace(String namespace) |
void |
upload(InputStream contents,
String baseURI,
RDFFormat dataFormat,
boolean overwrite,
org.json.JSONObject attributes,
Resource... contexts) |
void |
upload(InputStream contents,
String baseURI,
RDFFormat dataFormat,
boolean overwrite,
long size,
String contentEncoding,
org.json.JSONObject attributes,
Resource... contexts) |
void |
upload(Reader contents,
String baseURI,
RDFFormat dataFormat,
boolean overwrite,
org.json.JSONObject attributes,
Resource... contexts) |
void |
upload(org.apache.commons.httpclient.methods.RequestEntity reqEntity,
String baseURI,
boolean overwrite,
String serverSideFile,
URI serverSideURL,
RDFFormat dataFormat,
org.json.JSONObject attributes,
Resource... contexts) |
void |
upload(org.apache.commons.httpclient.methods.RequestEntity reqEntity,
String baseURI,
boolean overwrite,
String serverSideFile,
URI serverSideURL,
RDFFormat dataFormat,
org.json.JSONObject attributes,
String contentEncoding,
Resource... contexts) |
void |
upload(String url,
org.apache.commons.httpclient.methods.RequestEntity reqEntity,
String baseURI,
boolean overwrite,
String serverSideFile,
URI serverSideURL,
RDFFormat dataFormat,
org.json.JSONObject attributes,
Resource... contexts) |
void |
upload(String url,
org.apache.commons.httpclient.methods.RequestEntity reqEntity,
String baseURI,
boolean overwrite,
String serverSideFile,
URI serverSideURL,
RDFFormat dataFormat,
org.json.JSONObject attributes,
String contentEncoding,
Resource... contexts) |
void |
upload(String url,
org.apache.commons.httpclient.methods.RequestEntity reqEntity,
String baseURI,
boolean overwrite,
String serverSideFile,
URI serverSideURL,
RDFFormat dataFormat,
Resource... contexts) |
void |
uploadJSON(org.json.JSONArray rows,
Resource... contexts) |
void |
uploadJSON(String url,
org.json.JSONArray rows,
Resource... contexts) |
boolean |
usingMainPortForSessions()
Returns true if using the main server port for sessions.
|
public ConcurrentLinkedQueue<String> savedQueryDeleteQueue
public AGHttpRepoClient(AGAbstractRepository repo, AGHTTPClient client, String repoRoot, String sessionRoot, ScheduledExecutorService executor)
public AGHttpRepoClient(AGAbstractRepository repo, AGHTTPClient client, String repoRoot, String sessionRoot)
public static long getDefaultSessionLifetime()
setSessionLifetime(int)public static void setDefaultSessionLifetime(int lifetimeInSeconds)
setSessionLifetime(int)
Defaults to 3600 seconds (1 hour).lifetimeInSeconds - Number of seconds before the session times out.public String getRoot() throws AGHttpException
AGHttpExceptionpublic boolean usingMainPortForSessions()
public AGValueFactory getValueFactory()
public void setSessionLifetime(int lifetimeInSeconds)
lifetimeInSeconds - an integer number of secondspublic int getSessionLifetime()
public void setSessionLoadInitFile(boolean loadInitFile)
public boolean getSessionLoadInitFile()
public void addSessionLoadScript(String scriptName)
public TupleQueryResultFormat getPreferredTQRFormat()
public void setPreferredTQRFormat(TupleQueryResultFormat preferredTQRFormat)
public BooleanQueryResultFormat getPreferredBQRFormat()
public void setPreferredBQRFormat(BooleanQueryResultFormat preferredBQRFormat)
public RDFFormat getDefaultRDFFormat()
public RDFFormat getPreferredRDFFormat()
getDefaultRDFFormat()public void setPreferredRDFFormat(RDFFormat preferredRDFFormat)
getDefaultRDFFormat()public String getServerURL()
public AGHTTPClient getHTTPClient()
public void getStatements(Resource subj, URI pred, Value obj, String includeInferred, RDFHandler handler, Resource... contexts) throws RDFHandlerException, AGHttpException
RDFHandlerExceptionAGHttpExceptionpublic void getStatements(RDFHandler handler, String... ids) throws RDFHandlerException, AGHttpException
RDFHandlerExceptionAGHttpExceptionpublic void addStatements(Resource subj, URI pred, Value obj, Resource... contexts) throws AGHttpException
AGHttpExceptionpublic void deleteStatements(Resource subj, URI pred, Value obj, Resource... contexts) throws AGHttpException
AGHttpExceptionpublic void setAutoCommit(boolean autoCommit)
throws AGHttpException
AGHttpExceptionpublic boolean isAutoCommit()
throws AGHttpException
AGHttpExceptionpublic void setUploadCommitPeriod(int period)
upload(String, RequestEntity, String, boolean, String, URI, RDFFormat, Resource...)
Defaults to period=0, meaning that no commits are done in an upload.
Setting period > 0 can be used to work around the fact that
uploading a huge amount of statements in a single transaction
will require excessive amounts of memory.period - A non-negative integer.getUploadCommitPeriod()public int getUploadCommitPeriod()
setUploadCommitPeriod(int)public void commit()
throws AGHttpException
AGHttpExceptionpublic void rollback()
throws AGHttpException
AGHttpExceptionpublic void clearNamespaces()
throws AGHttpException
AGHttpExceptionpublic void upload(Reader contents, String baseURI, RDFFormat dataFormat, boolean overwrite, org.json.JSONObject attributes, Resource... contexts) throws RDFParseException, AGHttpException
RDFParseExceptionAGHttpExceptionpublic void upload(InputStream contents, String baseURI, RDFFormat dataFormat, boolean overwrite, org.json.JSONObject attributes, Resource... contexts) throws RDFParseException, AGHttpException
RDFParseExceptionAGHttpExceptionpublic void upload(InputStream contents, String baseURI, RDFFormat dataFormat, boolean overwrite, long size, String contentEncoding, org.json.JSONObject attributes, Resource... contexts) throws RDFParseException, AGHttpException
RDFParseExceptionAGHttpExceptionpublic void sendRDFTransaction(InputStream rdftransaction) throws AGHttpException
AGHttpExceptionpublic void sendRDFTransaction(InputStream rdftransaction, org.json.JSONObject attributes) throws AGHttpException
AGHttpExceptionpublic void uploadJSON(org.json.JSONArray rows,
Resource... contexts)
throws AGHttpException
AGHttpExceptionpublic void uploadJSON(String url, org.json.JSONArray rows, Resource... contexts) throws AGHttpException
AGHttpExceptionpublic void deleteJSON(org.json.JSONArray rows,
Resource... contexts)
throws AGHttpException
AGHttpExceptionpublic void load(URI source, String baseURI, RDFFormat dataFormat, Resource... contexts) throws AGHttpException
AGHttpExceptionpublic void load(URI source, String baseURI, RDFFormat dataFormat, org.json.JSONObject attributes, Resource... contexts) throws AGHttpException
AGHttpExceptionpublic void load(String serverAbsolutePath, String baseURI, RDFFormat dataFormat, Resource... contexts) throws AGHttpException
AGHttpExceptionpublic void load(String serverAbsolutePath, String baseURI, RDFFormat dataFormat, org.json.JSONObject attributes, Resource... contexts) throws AGHttpException
AGHttpExceptionpublic void upload(org.apache.commons.httpclient.methods.RequestEntity reqEntity,
String baseURI,
boolean overwrite,
String serverSideFile,
URI serverSideURL,
RDFFormat dataFormat,
org.json.JSONObject attributes,
Resource... contexts)
throws AGHttpException
AGHttpExceptionpublic void upload(org.apache.commons.httpclient.methods.RequestEntity reqEntity,
String baseURI,
boolean overwrite,
String serverSideFile,
URI serverSideURL,
RDFFormat dataFormat,
org.json.JSONObject attributes,
String contentEncoding,
Resource... contexts)
throws AGHttpException
AGHttpExceptionpublic void upload(String url, org.apache.commons.httpclient.methods.RequestEntity reqEntity, String baseURI, boolean overwrite, String serverSideFile, URI serverSideURL, RDFFormat dataFormat, Resource... contexts) throws AGHttpException
AGHttpExceptionpublic void upload(String url, org.apache.commons.httpclient.methods.RequestEntity reqEntity, String baseURI, boolean overwrite, String serverSideFile, URI serverSideURL, RDFFormat dataFormat, org.json.JSONObject attributes, Resource... contexts) throws AGHttpException
AGHttpExceptionpublic void upload(String url, org.apache.commons.httpclient.methods.RequestEntity reqEntity, String baseURI, boolean overwrite, String serverSideFile, URI serverSideURL, RDFFormat dataFormat, org.json.JSONObject attributes, String contentEncoding, Resource... contexts) throws AGHttpException
AGHttpExceptionpublic TupleQueryResult getContextIDs() throws AGHttpException
AGHttpExceptionpublic void getContextIDs(TupleQueryResultHandler handler) throws TupleQueryResultHandlerException, AGHttpException
public long size(Resource... contexts) throws AGHttpException
AGHttpExceptionpublic TupleQueryResult getNamespaces() throws AGHttpException
AGHttpExceptionpublic void getNamespaces(TupleQueryResultHandler handler) throws TupleQueryResultHandlerException, AGHttpException
public String getNamespace(String prefix) throws AGHttpException
AGHttpExceptionpublic void setNamespacePrefix(String prefix, String name) throws AGHttpException
AGHttpExceptionpublic void removeNamespacePrefix(String prefix) throws AGHttpException
AGHttpExceptionpublic void query(AGQuery q, boolean analyzeOnly, AGResponseHandler handler) throws AGHttpException
AGHttpExceptionpublic void deleteSavedQuery(String queryName) throws AGHttpException
AGHttpExceptionpublic void close()
throws AGHttpException
Closeableclose in interface CloseableAGHttpExceptionCloseable.close()public void createFreetextIndex(String name, List<String> predicates, boolean indexLiterals, List<String> indexLiteralTypes, String indexResources, List<String> indexFields, int minimumWordSize, List<String> stopWords, List<String> wordFilters, List<String> innerChars, List<String> borderChars, String tokenizer) throws AGHttpException
AGHttpExceptionpublic void deleteFreetextIndex(String index) throws AGHttpException
index - the name of the indexAGHttpExceptionpublic List<String> listFreetextIndices() throws AGHttpException
AGHttpExceptionpublic String[] getFreetextIndices() throws AGHttpException
AGHttpExceptionlistFreetextIndices()public org.json.JSONObject getFreetextIndexConfiguration(String index) throws AGHttpException, org.json.JSONException
AGHttpExceptionorg.json.JSONExceptionpublic String[] getFreetextPredicates(String index) throws AGHttpException
AGHttpExceptionpublic void evalFreetextQuery(String pattern, String expression, String index, boolean sorted, int limit, int offset, AGResponseHandler handler) throws AGHttpException
AGHttpExceptionpublic void registerPredicateMapping(URI predicate, URI primitiveType) throws AGHttpException
AGHttpExceptionpublic void deletePredicateMapping(URI predicate) throws AGHttpException
AGHttpExceptionpublic String[] getPredicateMappings() throws AGHttpException
AGHttpExceptionpublic void registerDatatypeMapping(URI datatype, URI primitiveType) throws AGHttpException
AGHttpExceptionpublic void deleteDatatypeMapping(URI datatype) throws AGHttpException
AGHttpExceptionpublic String[] getDatatypeMappings() throws AGHttpException
AGHttpExceptionpublic void clearMappings()
throws AGHttpException
AGHttpExceptionpublic void clearMappings(boolean includeAutoEncodedPrimitiveTypes)
throws AGHttpException
AGHttpExceptionpublic void addRules(String rules) throws AGHttpException
AGHttpExceptionpublic void addRules(InputStream rulestream) throws AGHttpException
AGHttpExceptionpublic String evalInServer(String lispForm) throws AGHttpException
AGHttpExceptionpublic String evalInServer(InputStream stream) throws AGHttpException
AGHttpExceptionpublic void ping()
throws AGHttpException
AGHttpExceptionpublic String[] getGeoTypes() throws AGHttpException
AGHttpExceptionpublic String registerCartesianType(float stripWidth, float xmin, float xmax, float ymin, float ymax) throws AGHttpException
AGHttpExceptionpublic String registerSphericalType(float stripWidth, String unit, float latmin, float longmin, float latmax, float longmax) throws AGHttpException
AGHttpExceptionpublic void registerPolygon(String polygon, List<String> points) throws AGHttpException
AGHttpExceptionpublic void getGeoBox(String type_uri, String predicate_uri, float xmin, float xmax, float ymin, float ymax, int limit, boolean infer, AGResponseHandler handler) throws AGHttpException
AGHttpExceptionpublic void getGeoCircle(String type_uri, String predicate_uri, float x, float y, float radius, int limit, boolean infer, AGResponseHandler handler) throws AGHttpException
AGHttpExceptionpublic void getGeoHaversine(String type_uri, String predicate_uri, float lat, float lon, float radius, String unit, int limit, boolean infer, AGResponseHandler handler) throws AGHttpException
AGHttpExceptionpublic void getGeoPolygon(String type_uri, String predicate_uri, String polygon, int limit, boolean infer, AGResponseHandler handler) throws AGHttpException
AGHttpExceptionpublic void registerSNAGenerator(String generator, List<String> objectOfs, List<String> subjectOfs, List<String> undirecteds, String query) throws AGHttpException
AGHttpExceptionpublic void registerSNANeighborMatrix(String matrix, String generator, List<String> group, int depth) throws AGHttpException
AGHttpExceptionpublic List<String> listIndices(boolean listValid) throws AGHttpException
listValid - true yields all valid types, false yields active types.AGHttpExceptionpublic void addIndex(String index) throws AGHttpException
index - a valid index typeAGHttpExceptionlistIndices(boolean)public void dropIndex(String index) throws AGHttpException
index - a valid index typeAGHttpExceptionlistIndices(boolean)public void registerEncodableNamespace(String namespace, String format) throws AGHttpException
AGHttpExceptionpublic void unregisterEncodableNamespace(String namespace) throws AGHttpException
AGHttpExceptionpublic void enableTripleCache(long size)
throws AGHttpException
size - the size of the cache, in triples.AGHttpExceptionpublic void registerEncodableNamespaces(org.json.JSONArray formattedNamespaces)
throws AGHttpException
AGHttpExceptionpublic TupleQueryResult getEncodableNamespaces() throws AGHttpException
AGHttpExceptionpublic String callStoredProcEncoded(String functionName, String moduleName, String argsEncoded) throws AGHttpException
Low-level access to the data sent to the server can be done with:
{@link AGDeserializer#decodeAndDeserialize(String) AGDeserializer.decodeAndDeserialize}(
callStoredProcEncoded(functionName, moduleName,
{@link AGSerializer#serializeAndEncode(Object[]) AGSerializer.serializeAndEncode}(args)));
If an error occurs in the stored procedure then result will be a two element vector with the first element being the string "_fail_" and the second element being the error message (also a string).
callStoredProc(String, String, Object...)
does this encoding, decoding, and throws exceptions for error result.
functionName - stored proc lisp function, for example "addTwo"moduleName - lisp FASL file name, for example "example.fasl"argsEncoded - byte-encoded arguments to the stored procAGHttpExceptioncallStoredProc(String, String, Object...)public Object callStoredProc(String functionName, String moduleName, Object... args) throws AGHttpException
The input arguments and the return value can be:
String, Integer, null, byte[],
or Object[] or List of these (can be nested).
functionName - stored proc lisp function, for example "addTwo"moduleName - lisp FASL file name, for example "example.fasl"args - arguments to the stored procAGCustomStoredProcException - for errors from stored proc.AGHttpExceptionAGSerializer.serializeAndEncode(Object[]),
AGDeserializer.decodeAndDeserialize(String)public long getTripleCacheSize()
throws AGHttpException
AGHttpExceptionpublic void disableTripleCache()
throws AGHttpException
AGHttpExceptionpublic String[] getBlankNodes(int blankNodeAmount) throws AGHttpException
AGHttpExceptionpublic void deleteDuplicates(String comparisonMode) throws AGHttpException
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 duplicateAGHttpExceptionpublic void getDuplicateStatements(String comparisonMode, RDFHandler handler) throws AGHttpException, RDFHandlerException
AGHttpExceptionRDFHandlerExceptionpublic long materialize(AGMaterializer materializer) throws AGHttpException
The materializer's configuration determines how statements are materialized.
materializer - the materializer to use.AGHttpExceptionAGMaterializer.newInstance()public long deleteMaterialized()
throws RepositoryException
AGHttpException - returns the number of statements deleted.RepositoryExceptionmaterialize(AGMaterializer)public void optimizeIndices(Boolean wait, int level) throws AGHttpException
AGHttpExceptionpublic void optimizeIndices(Boolean wait) throws AGHttpException
AGHttpExceptionpublic String getSpinFunction(String uri) throws AGHttpException
AGHttpExceptionpublic TupleQueryResult listSpinFunctions() throws AGHttpException
AGHttpExceptionpublic void putSpinFunction(AGSpinFunction fn) throws AGHttpException
AGHttpExceptionpublic void deleteSpinFunction(String uri) throws AGHttpException
AGHttpExceptionpublic void deleteHardSpinFunction(String uri) throws AGHttpException
AGHttpExceptionpublic String getSpinMagicProperty(String uri) throws AGHttpException
AGHttpExceptionpublic TupleQueryResult listSpinMagicProperties() throws AGHttpException
AGHttpExceptionpublic void putSpinMagicProperty(AGSpinMagicProperty fn) throws AGHttpException
AGHttpExceptionpublic void deleteSpinMagicProperty(String uri) throws AGHttpException
AGHttpExceptionpublic void deleteHardSpinMagicProperty(String uri) throws AGHttpException
AGHttpExceptionpublic void setAllowExternalBlankNodeIds(boolean allow)
Disabled by default. Enable it from an AGRepositoryConnection using:
conn.getHttpRepoClient().setAllowExternalBlankNodeIds(true);
An external blank node is a blank node whose id is not generated by AllegroGraph. Applications should normally request new blank nodes from AllegroGraph [via the AGValueFactory#createBNode() method in the Sesame api, or via the AGModel#createResource() method in the Jena adapter]; this helps to avoid unintended blank node id collisions (particularly in a multi-user setting) and enables blank nodes to be stored more efficiently, etc.
Previously, for applications that did use an external blank node id [such as via AGValueFactory#createBNode("ex") in Sesame, or in Jena via AGModel#createResource(AnonId.create("ex"))] or an external blank node factory [such as ValueFactoryImpl#createBNode() in Sesame or ResourceFactory#createResource() in Jena], there were some issues that arose. When the application tried to add a statement such as [_:ex p a] over HTTP, the AllegroGraph server allocates a new blank node id to use in place of the external blank node id _:ex, so that the actual statement stored is something like [_:bF010696Fx1 p a].
There are 2 issues with this:
1) adding a second statement such as [_:ex q b] in a subsequent request will result in another new bnode id being allocated, so that the statement stored might be [_:bF010696Fx2 q b], and the link between the two statements (that exists client side via blank node _:ex) is now lost.
2) trying to get the statement [_:ex p a] will fail, because the actual statement stored is [_:bF010696Fx1 p a].
Note that these issues arise with external blank node ids because the server does not know their scope, and by default assumes that the scope is limited to the HTTP request in order to avoid blank node conflicts. When AG-allocated blank node ids are used instead, the two issues above do not arise (they are stored as is, and they will be found as expected with a get). In short, AG-allocated blank nodes round-trip, external blank nodes do not.
One workaround for this is to have applications declare that they want external blank nodes to round-trip. An external blank node can exist for the life of an application, and that life can exceed the life of an AllegroGraph server instance, so adding a statement with an external blank node will need to persist the external blank node's id somehow. AllegroGraph doesn't currently allow storing blank nodes with an arbitrary external id, so this workaround converts them to URI's (of the form "urn:x-bnode:id" by default) for storage, and recovers the blank nodes with correct ids when the values are retrieved in queries, so that applications continue to transparently deal with BNodes and see the expected behavior w.r.t. issues 1) and 2) above.
When enabling the workaround described here, the application must take responsibility for using an external blank node factory that avoids blank node conflicts, and must also be willing to incur the additional costs of storing external blank nodes as URIs. When the workaround is disabled (allow=false, the default), the application must avoid using external blank nodes with AG (using AG-allocated blank nodes instead); using external blank node ids when they are not allowed will result in an explanatory exception (as opposed to quietly exhibiting the two problems described above).
This method and approach are experimental and subject to change.
allow - true enables a workaround to support external bnodesgetAllowExternalBlankNodeIds(),
AGValueFactory.isAGBlankNodeId(String)public boolean getAllowExternalBlankNodeIds()
setAllowExternalBlankNodeIds(boolean),
AGValueFactory.isAGBlankNodeId(String)public Resource getStorableResource(Resource r, AGValueFactory vf)
r - a resourcegetApplicationResource(Resource, AGValueFactory),
setAllowExternalBlankNodeIds(boolean)public Value getStorableValue(Value v, AGValueFactory vf)
v - a valuegetApplicationValue(Value, AGValueFactory),
setAllowExternalBlankNodeIds(boolean)public static Resource getApplicationResource(Resource stored, AGValueFactory vf)
stored - a stored resourcegetStorableResource(Resource, AGValueFactory)public static Value getApplicationValue(Value stored, AGValueFactory vf)
stored - a stored valuegetStorableValue(Value, AGValueFactory)public void setMasqueradeAsUser(String user) throws RepositoryException
user - the user for X-Masquerade-As-User requests.RepositoryExceptionpublic void addAttributeDefinition(String name, List<String> allowedValues, boolean ordered, long minimum, long maximum) throws AGHttpException
name - allowedValues - ordered - minimum - maximum - AGHttpExceptionpublic void deleteAttributeDefinition(String name) throws AGHttpException
name - AGHttpExceptionpublic org.json.JSONArray getAttributeDefinition()
throws AGHttpException,
org.json.JSONException
AGHttpExceptionorg.json.JSONExceptionpublic org.json.JSONArray getAttributeDefinition(String name) throws AGHttpException, org.json.JSONException
name - of the attributeAGHttpExceptionorg.json.JSONExceptionpublic void setStaticAttributeFilter(String filter) throws AGHttpException
AGHttpExceptionpublic String getStaticAttributeFilter() throws AGHttpException
AGHttpExceptionpublic void deleteStaticAttributeFilter()
throws AGHttpException
AGHttpExceptionpublic String getUserAttributes()
public void setUserAttributes(String value)
value, - a String containing a serialized JSON object of the attributes.Copyright © 2017 Franz Inc.. All rights reserved.