|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.franz.ag.AllegroGraph
Each instance of this class implements access to one AllegroGraph triple store.
There is no public constructor. Instances of this class are created by calls to methods in the AllegroGraphConnection class:
Value
interface.
In search operations, if the context is not specifed, then the search examines only the null context. If the context is specifed, then a null value is wild and matches any context, the empty string denotes the null context, any other value must be a valid Value reference.
The other components of triples may be specfied as strings in ntriple notation, Value instances, and UPI instances. In some cases null may be used to denote a wild card.
Nested Class Summary | |
static class |
AllegroGraph.V3_0_0_p1
The name of this class identifies the version of the AllegroGraph Java implementation. |
Constructor Summary | |
AllegroGraph(java.lang.String name)
Create an unconnected AllegroGraph instance. |
Method Summary | |
void |
addDataMapping(java.lang.String[] map)
Add to the table of datatype and property mappings in the triple store. |
void |
addIndexFlavors(java.lang.String[] flavors)
Add some index flavors to the triple store. |
Literal |
addLiteral(boolean value)
Create a typed Literal instance from a Java boolean value and add the Literal to the triple store registry. |
Literal |
addLiteral(byte value)
Create a typed Literal instance from a Java byte value and add the Literal to the triple store registry. |
Literal |
addLiteral(double value)
Create a typed Literal instance from a Java double value and add the Literal to the triple store registry. |
Literal |
addLiteral(float value)
Create a typed Literal instance from a Java float value and add the Literal to the triple store registry. |
Literal |
addLiteral(int value)
Create a typed Literal instance from a Java int value and add the Literal to the triple store registry. |
Literal |
addLiteral(long value)
Create a typed Literal instance from a Java long value and add the Literal to the triple store registry. |
Literal |
addLiteral(short value)
Create a typed Literal instance from a Java short value and add the Literal to the triple store registry. |
Literal |
addLiteral(java.lang.String value)
Create a literal instance and add the Literal to the triple store registry. |
Literal |
addLiteral(java.lang.String value,
java.lang.String language)
Create a literal instance with a language tag and add the Literal to the triple store registry. |
Literal |
addLiteral(java.lang.String value,
URI datatype)
Create a literal instance with a datatype tag and add the Literal to the triple store registry. |
UPI[] |
addLiteralIds(java.lang.String[] values,
java.lang.String[] datatypes,
java.lang.String[] languages)
Add a set of literal instances to the triple store registry. |
Literal[] |
addLiterals(java.lang.String[] values,
java.lang.String[] datatypes,
java.lang.String[] languages)
Create a set of Literal instances and add the literals to the triple store registry. |
ValueNode |
addPart(java.lang.String part)
Add a Literal, Node or BlankNode to the triple store. |
void |
addStatement(java.lang.Object subject,
java.lang.Object predicate,
java.lang.Object object)
Add a Statement in the null context to the triple store. |
void |
addStatement(java.lang.Object subject,
java.lang.Object predicate,
java.lang.Object object,
java.lang.Object context)
Add a Statement to the triple store. |
void |
addStatements(java.lang.Object subject,
java.lang.Object predicate,
java.lang.Object object)
Add several null context Statements to the triple store. |
void |
addStatements(java.lang.Object subject,
java.lang.Object predicate,
java.lang.Object object,
java.lang.Object contexts)
Add several Statements to the triple store. |
Literal |
addTypedLiteral(java.lang.String text,
java.lang.String type)
Create a typed Literal instance from a string and add the Literal to the triple store registry. |
Literal |
addTypedLiteral(java.lang.String text,
UPI type)
Create a typed Literal instance from a string and add the literal to the triple store registry. |
Literal |
addTypedLiteral(java.lang.String text,
URI type)
Create a typed Literal instance from a string and add the literal to the triple store registry. |
Node |
addURI(java.lang.String uri)
Create a resource node with a URI label and add the resource to the triple store registry. |
UPI[] |
addURIIds(java.lang.String[] uri)
Create a set of resource nodes in the triple store registry. |
URI[] |
addURIs(java.lang.String[] uri)
Create a set of resource Node instances and add the resources to the triple store registry. |
void |
clear()
Delete all the statements in the triple store (one-by-one). |
void |
closeDatabase()
Deprecated. Use closeTripleStore() instead. |
boolean |
closeTripleStore()
Close an AllegroGraph instance. |
boolean |
closeTripleStore(boolean doClose)
Close an AllegroGraph instance and optionally close the triple store if this is the only reference. |
BNode |
createBNode()
Create a BlankNode instance. |
BNode |
createBNode(java.lang.String nodeId)
Create a BlankNode instance. |
UPI[] |
createBNodeIds(int n)
Allocate a set of BlankNode ID numbers. |
BlankNode[] |
createBNodes(int n)
Allocate a set of BlankNodes. |
EncodedLiteral |
createEncodedLiteral(double v,
java.lang.String encoding)
Create an AllegroGraph EncodedLiteral instance from a Java double value. |
EncodedLiteral |
createEncodedLiteral(long v,
java.lang.String encoding)
Create an AllegroGraph EncodedLiteral instance from a Java long value. |
EncodedLiteral |
createEncodedLiteral(java.lang.String v,
java.lang.String encoding)
Create an AllegroGraph EncodedLiteral instance from a Java string value. |
Literal |
createLiteral(boolean value)
Create a typed Literal instance from a Java boolean value but do not modify the triple store. |
Literal |
createLiteral(byte value)
Create a typed Literal instance from a Java byte value but do not modify the triple store. |
Literal |
createLiteral(double value)
Create a typed Literal instance from a Java double value but do not modify the triple store. |
Literal |
createLiteral(float value)
Create a typed Literal instance from a Java float value but do not modify the triple store. |
Literal |
createLiteral(int value)
Create a typed Literal instance from a Java int value but do not modify the triple store. |
Literal |
createLiteral(long value)
Create a typed Literal instance from a Java long value but do not modify the triple store. |
Literal |
createLiteral(short value)
Create a typed Literal instance from a Java short value but do not modify the triple store. |
Literal |
createLiteral(java.lang.String value)
Create a literal instance without updating the triple store. |
Literal |
createLiteral(java.lang.String value,
java.lang.String language)
Create a literal instance with a language tag but do not modify the triple store. |
Literal |
createLiteral(java.lang.String value,
URI datatype)
Create a literal instance with a datatype tag but do not modify the triple store. |
Statement |
createStatement(Resource subject,
URI predicate,
Value object)
Create a Null Context Statement instance but do not update the triple store. |
Statement |
createStatement(Resource subject,
URI predicate,
Value object,
Resource context)
Create a Statement instance but do not update the triple store. |
Literal |
createTypedLiteral(java.lang.String text,
java.lang.String type)
Create a typed Literal instance from a string but do not modify the triple store. |
Literal |
createTypedLiteral(java.lang.String text,
UPI type)
Create a typed Literal instance from a string but do not modify the triple store. |
URI |
createURI(java.lang.String uri)
Create a resource node with a URI label but do not modify the triple store. |
URI |
createURI(java.lang.String namespace,
java.lang.String localName)
Create a resource node with a URI label but do not modify the triple store. |
void |
dropIndexFlavors(java.lang.String[] flavors)
Delete some indexing flavors from the triple store. |
java.lang.Object[] |
evalInServer(java.lang.String expression)
Evaluate a Lisp expression in the AllegroGraph server. |
java.lang.String[] |
getDataMapping()
Query the current table of datatype and property mappings in the triple store. |
java.lang.String[] |
getFreetextPredicates()
Retrieve the URI labels of the registered freetext predicates. |
Cursor |
getFreetextStatements(java.lang.String pattern)
Find triples that match a text pattern. |
ValueObject[] |
getFreetextUniqueSubjects(java.lang.String pattern)
Collect the unique subjects from triples that match a text pattern. |
GeoExtension |
getGeoExtension()
Get the GeoExtension instance of this AllegroGraph instance. |
java.lang.String[] |
getIndexFlavors()
Query the range of indexing that is applied to this triple store. |
int |
getLookAhead()
Query the look-ahead value. |
NamespaceRegistry |
getNamespaceRegistry()
Query the namespace definitions specific to this triple store. |
java.lang.String[] |
getNamespaces()
Query the namespace definitions specific to this triple store. |
java.lang.String[] |
getParts(UPI id)
Retrieve the string and type information associated with a triple store part. |
void |
getParts(UPI[] ids,
java.lang.String[] types,
java.lang.String[] vals,
java.lang.String[] mods)
Like getParts(UPI) but operates on an array of UPI instances. |
int |
getSelectLimit()
Get the current value of the select limit parameter. |
SNAExtension |
getSNAExtension()
Get the SNAExtension instance of this AllegroGraph instance. |
Cursor |
getStatements(boolean includeInferred,
java.lang.Object subject,
java.lang.Object predicate,
java.lang.Object object)
Retrieve null context statements from the triple store. |
Cursor |
getStatements(boolean includeInferred,
java.lang.Object subject,
java.lang.Object predicate,
java.lang.Object object,
java.lang.Object context)
Retrieve statements from the triple store. |
Cursor |
getStatements(boolean includeInferred,
java.lang.Object subject,
java.lang.Object predicate,
java.lang.Object object,
java.lang.Object obEnd,
java.lang.Object context,
java.lang.Object contextEnd)
Retrieve statements from the triple store and specify a range of values for the object and/or context components of the triples. |
Cursor |
getStatements(boolean includeInferred,
java.lang.Object subject,
java.lang.Object subEnd,
java.lang.Object predicate,
java.lang.Object predEnd,
java.lang.Object object,
java.lang.Object obEnd,
java.lang.Object context,
java.lang.Object contextEnd)
Retrieve statements from the triple store and specify a range of values for any of the components of the triples. |
Cursor |
getStatements(java.lang.Object subject,
java.lang.Object predicate,
java.lang.Object object)
Retrieve null context statements from the triple store. |
Cursor |
getStatements(java.lang.Object subject,
java.lang.Object predicate,
java.lang.Object object,
java.lang.Object context)
Retrieve statements from the triple store . |
Cursor |
getStatements(java.lang.Object subject,
java.lang.Object predicate,
java.lang.Object object,
java.lang.Object obEnd,
java.lang.Object context,
java.lang.Object contextEnd)
Retrieve statements from the triple store and specify a range of values for the object and/or context components of the triples. |
AllegroGraph[] |
getStores()
Retrieve the components of a federated triple store. |
boolean |
getSyncEveryTime()
Query the synchronization mode for this AllegroGraph instance. |
UPI[] |
getTripleParts(long id)
Return an array of 4 UPI instances for subject, predicate, object, and context. |
int |
getUnindexedThreshold()
Query the threshold for automatic indexing of the triple store. |
int |
getUnindexedTripleCount()
Query the number of unindexed triples in the triple store. |
int |
getUnmergedCount()
Query the number of unmerged index chunks in the triple store. |
int |
getUnmergedThreshold()
Query the threshold for automatic re-indexing of the triple store. |
boolean |
hasStatement(boolean includeInferred,
java.lang.Object subject,
java.lang.Object predicate,
java.lang.Object object)
Find out if null-context statements matching the arguments are in the triple store. |
boolean |
hasStatement(boolean includeInferred,
java.lang.Object subject,
java.lang.Object predicate,
java.lang.Object object,
java.lang.Object context)
Find out if any statements matching the arguments are in the triple store. |
boolean |
hasStatement(java.lang.Object subject,
java.lang.Object predicate,
java.lang.Object object)
Find out if null-context statements matching the arguments are in the triple store. |
boolean |
hasStatement(java.lang.Object subject,
java.lang.Object predicate,
java.lang.Object object,
java.lang.Object context)
Find out if any statements matching the arguments are in the triple store. |
void |
indexAll()
Deprecated. Use indexAllTriples() instead |
void |
indexAllTriples()
Index all the triples in the triple store. |
void |
indexAllTriples(boolean wait)
Index all triples immediately or in the background. |
void |
indexNewTriples()
Index new triples. |
void |
indexNewTriples(boolean wait)
Index new triples immediately or in the background. |
void |
indexTriples()
Deprecated. Use indexNewTriples() instead |
long |
loadNTriples(java.lang.Object names,
java.lang.Object context,
java.lang.Boolean save,
java.lang.String ext,
java.lang.Object[] place)
Load one or more files of triple declarations. |
long |
loadNTriples(java.lang.String name)
Load a file of triple declarations. |
long |
loadNTriples(java.lang.String[] names)
Load several files of triple declarations. |
long |
loadNTriples(java.lang.String[] names,
java.lang.Object context)
Load several files of triple declarations. |
long |
loadNTriples(java.lang.String name,
java.lang.Object context)
Load a file of triple declarations. |
long |
loadRDF(java.lang.String filePath)
Parse an XML file of RDF triple definitions and add the triples to the null context of the triple store. |
long |
loadRDF(java.lang.String[] filePaths)
Parse a set of XML files of RDF triple definitions and add the triples to the null context of the triple store. |
long |
loadRDF(java.lang.String filePath,
java.lang.Object context)
Parse an XML file of RDF triple definitions and add the triples to the specified context of the triple store. |
long |
loadRDF(java.lang.String filePath,
java.lang.Object context,
java.lang.String baseURI)
Parse an XML file of RDF triple definitions and add the triples to the specified context of the triple store. |
static void |
main(java.lang.String[] args)
Print AllegroGraph version information. |
int |
moreValues(java.lang.Object x)
Determine if more results are available for a selectValues(String) result. |
Triple |
newTriple(java.lang.Object s,
java.lang.Object p,
java.lang.Object o)
Add a new triple to the triple store. |
Triple |
newTriple(java.lang.Object s,
java.lang.Object p,
java.lang.Object o,
java.lang.Object c)
Add a new triple to the triple store. |
long |
newTripleId(java.lang.Object s,
java.lang.Object p,
java.lang.Object o)
Add a new triple to the triple store. |
long |
newTripleId(java.lang.Object s,
java.lang.Object p,
java.lang.Object o,
java.lang.Object c)
Add a new triple to the triple store. |
long[] |
newTripleIds(java.lang.Object s,
java.lang.Object p,
java.lang.Object o)
Add new triples to the triple store. |
long[] |
newTripleIds(java.lang.Object s,
java.lang.Object p,
java.lang.Object o,
java.lang.Object c)
Add new triples to the triple store. |
Triple[] |
newTriples(java.lang.Object s,
java.lang.Object p,
java.lang.Object o)
Add new triples to the triple store. |
Triple[] |
newTriples(java.lang.Object s,
java.lang.Object p,
java.lang.Object o,
java.lang.Object c)
Add new triples to the triple store. |
ValueObject |
newValue(UPI id)
Convert a UPI instance into a ValueObject instance. |
long |
numberOfTriples()
Query the number of triples in the triple store. |
long |
parseNTriples(java.lang.String from)
Parse a string and add triples to the null context of triple store. |
long |
parseNTriples(java.lang.String from,
java.lang.Object context)
Parse a string and add triples to the specified context of the triple store. |
long |
parseNTriples(java.lang.String from,
java.lang.Object context,
java.lang.Boolean save,
java.lang.Object[] place)
Parse a string and add triples to the specified context of the triple store. |
void |
registerFreetextPredicate(java.lang.Object predicate)
Register a predicate for freetext indexing. |
void |
registerNamespace(java.lang.String prefix,
java.lang.String full)
Register one namespace definition for this triple store. |
void |
registerNamespaces(java.lang.String[] defs)
Register several namespace definitions for this triple store. |
void |
removeStatement(java.lang.Object s,
java.lang.Object p,
java.lang.Object o)
Remove one null-context statement from the triple store. |
void |
removeStatement(java.lang.Object s,
java.lang.Object p,
java.lang.Object o,
java.lang.Object c)
Remove one statement from the triple store. |
void |
removeStatements(java.lang.Object s,
java.lang.Object p,
java.lang.Object o)
Remove all statement that match a pattern from the triple store. |
void |
removeStatements(java.lang.Object s,
java.lang.Object p,
java.lang.Object o,
java.lang.Object c)
Remove all statement that match a pattern from the triple store. |
Cursor |
select(java.lang.String query)
Deprecated. Use selectStatements(String) instead |
Cursor |
select(java.lang.String query,
java.lang.Object arg)
Deprecated. Use selectStatements(String,Object) instead |
Cursor |
select(java.lang.String query,
java.lang.Object arg,
java.lang.String svar)
Deprecated. Use selectStatements(String,Object,String) instead |
ValueObject[] |
selectMore(ValueObject[] sr)
Get more results from a previous selectSingleValues query. |
ValueObject[][] |
selectMore(ValueObject[][] sr)
Get more results from a previous selectValues query. |
ValueObject[] |
selectSingleValues(boolean includeInferred,
boolean distinct,
java.lang.String query,
java.lang.Object[] invals,
java.lang.String invars)
Evaluate a Prolog query that retrieves a single value in each success. |
ValueObject[] |
selectSingleValues(java.lang.String query,
java.lang.Object[] invals,
java.lang.String invars)
Evaluate a Prolog query that retrieves a single value in each success. |
Cursor |
selectStatements(boolean includeInferred,
boolean distinct,
java.lang.String query,
java.lang.Object arg,
java.lang.String svars)
Search the AllegroGraph triple store with a Prolog query. |
Cursor |
selectStatements(java.lang.String query)
Search the AllegroGraph triple store with a Prolog query. |
Cursor |
selectStatements(java.lang.String query,
java.lang.Object arg)
Search the AllegroGraph triple store with a Prolog query. |
Cursor |
selectStatements(java.lang.String query,
java.lang.Object arg,
java.lang.String svars)
Search the AllegroGraph triple store with a Prolog query. |
ValueObject[][] |
selectValues(boolean includeInferred,
boolean distinct,
java.lang.String query)
Evaluate a Prolog query that retrieves triples, resources, or literals from the triple store. |
ValueObject[][] |
selectValues(boolean includeInferred,
boolean distinct,
java.lang.String query,
java.lang.Object[] invals,
java.lang.String invars)
Evaluate a Prolog query that retrieves triples, resources, or literals from the triple store. |
ValueObject[][] |
selectValues(java.lang.String query)
Evaluate a Prolog query that retrieves triples, resources, or literals from the triple store. |
ValueObject[][] |
selectValues(java.lang.String query,
java.lang.Object[] invals,
java.lang.String invars)
Evaluate a Prolog query that retrieves triples, resources, or literals from the triple store. |
int |
serverTrace(boolean onoff)
Change the trace state in the AllegroGraph server. |
int |
serverTrace(java.lang.String outFile)
Start tracing calls from Java in the AllegroGraph server. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set attributes that affect the creation of new triple stores or the accessing of existing ones. |
void |
setDataMapping(java.lang.String[] map)
Replace the current table of datatype and property mappings in the triple store. |
void |
setIndexFlavors(java.lang.String[] flavors)
Replace the set of indexing flavors in the triple store. |
void |
setLookAhead(int n)
Set the look-ahead value for subsequent Statement search operations. |
void |
setNamespaceRegistry()
Reset the namespace definition in this AllefroGraph instance to the initial default. |
void |
setNamespaceRegistry(NamespaceRegistry ns)
Register several namespace definitions for this triple store. |
void |
setSelectLimit(int v)
Set the value of the select limit parameter. |
void |
setSyncEveryTime(boolean s)
Set the synchronization mode for this AllegroGraph instance. |
void |
setUnindexedThreshold(int val)
Set the threshold for automatic indexing of the triple store. |
void |
setUnmergedThreshold(int val)
Set the threshold for automatic re-indexing of the triple store. |
void |
syncDatabase()
Deprecated. Use syncTripleStore() instead. |
void |
syncTripleStore()
Sync an AllegroGraph triple store. |
java.lang.String |
toString()
Display some details about the AllegroGraph instance. |
boolean |
twinqlAsk(java.lang.String query)
Deprecated. Use the methods in SPARQLQuery instead. |
long |
twinqlCount(java.lang.String query,
java.lang.String vars,
int limit,
int offset)
Deprecated. Use the methods in SPARQLQuery instead. |
Cursor |
twinqlFind(java.lang.String query,
int limit,
int offset)
Deprecated. Use the methods in SPARQLQuery instead. |
java.lang.String |
twinqlQuery(java.lang.String query,
java.lang.String format,
int limit,
int offset)
Deprecated. Use the methods in SPARQLQuery instead. |
ValueObject[][] |
twinqlSelect(boolean includeInferred,
java.lang.String query,
java.lang.String vars,
int limit,
int offset)
Deprecated. Use the methods in SPARQLQuery instead. |
ValueObject[][] |
twinqlSelect(java.lang.String query,
java.lang.String vars,
int limit,
int offset)
Deprecated. Use the methods in SPARQLQuery instead. |
java.lang.String[] |
valueNames(java.lang.Object x)
Get the names of the variables in query. |
int |
valuesLength(ValueObject[][] x)
Return the number of result sets in the array returned by selectValues(String) . |
static java.lang.String |
version()
Query the current AllegroGraph version. |
static java.lang.String[] |
versions()
Query the current AllegroGraph and component versions. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AllegroGraph(java.lang.String name)
name
- the pathname string for the triple store.setAttribute(String, Object)
Method Detail |
public static java.lang.String version()
public static java.lang.String[] versions()
public static void main(java.lang.String[] args)
public void setLookAhead(int n)
n
- an integer look-ahead value - must be positive.
A zero value specifies that the defaultLookAhead value in the
Cursor class should be used.
The look-ahead value determines how many Statements will be pre-loaded into a Cursor instance when it is created or advanced. The pre-loaded Statements in the Cursor are retrieved immediately in Java without a round-trip to the AllegroGraph server.
Cursor.setLookAhead(int)
public int getLookAhead()
setLookAhead(int)
public void setAttribute(java.lang.String name, java.lang.Object value)
name
- The name of the attribute.value
- The value of the attribute.
Attribute names are listed below as well as the required datatype
of the value:
"expected-unique-resouces"
-- Long -- The initial
size of the resource table in a new triple store.
"with-indices"
-- String[] -- The desired indices
for a new triple store.
"include-standard-parts"
-- Boolean -- When true,
create some commonly used RDF and Owl resources in
a new triple store.
"read-only"
-- Boolean -- When true, open an
existing triple store in read-only mode.
"indirect-host"
-- String -- A hostname where the server
will find a remote triple store. When an inirect-host is specified, the name
and directory arguments are relative to the location of the remote host.
"indirect-port"
-- Integer -- The port number where the
indirect-host is listening.
public void syncTripleStore() throws AllegroGraphException
AllegroGraphException
public boolean closeTripleStore() throws AllegroGraphException
AllegroGraphException
public boolean closeTripleStore(boolean doClose) throws AllegroGraphException
doClose
- when true, close the triple-store if this is the
only reference.
AllegroGraphException
public long loadNTriples(java.lang.String name) throws AllegroGraphException
name
- -
a pathname string. The file must be in the ntriples format
expected by the AllegroGraph server.
If a file is very large, the operation may take a long time. During that time, the calling thread, and the AllegroGraphConnection instance are blocked. On Windows, it is possible to see progress messages in the server console window which is normally hidden. On Unix, the server progress messages may be seen if the server is running with a log file; in that case the log file will grow as progress messages are added.
If other AllegroGraph instances of different stores are connected through different AllegroGraphConnection instances, they may continue to make queries or add triples.
AllegroGraphException
public long loadNTriples(java.lang.String name, java.lang.Object context) throws AllegroGraphException
name
- a pathname string pointing to the source file.context
- a triple part reference for the graph component of the new triples.
See the note about progress messages in the description of
AllegroGraphException
loadNTriples(String)
public long loadNTriples(java.lang.String[] names) throws AllegroGraphException
names
- -
an array of pathname string. The files must be in the ntriples
format expected by the AllegroGraph server.
See the note about progress messages in the description of
AllegroGraphException
loadNTriples(String)
public long loadNTriples(java.lang.String[] names, java.lang.Object context) throws AllegroGraphException
names
- -
an array of pathname string. The files must be in the ntriples
format expected by the AllegroGraph server.context
- a triple part reference for the graph component of the new triples.
See the note about progress messages in the description of
AllegroGraphException
loadNTriples(String)
public long loadNTriples(java.lang.Object names, java.lang.Object context, java.lang.Boolean save, java.lang.String ext, java.lang.Object[] place) throws AllegroGraphException
names
- - a string pointing to one file, or
an array of pathname string. The files must be in the ntriples
format expected by the AllegroGraph server.context
- a triple part reference for the graph component of the new triples.save
- This argument controls how encoded literals are stored in the store.
When true, if a triple triggers an ecoding of a literal, two triples are added
to the store, one with the encoded literal and one with the string literal.
When false, only the encoded triple is added.
When null, allow the default behavior (currently to add both).ext
- A string that names the external-format used to translate octets into
characters. The server default is determined by the locale of the server.
Valid values are
"1250" "1251" "1252" "1253" "1254" "1255" "1256" "1257" "1258" "874" "932" "936" "949" "950" "big5" "emacs-mule" "euc" "euc-jp" "fat" "fat-le" "gb2312" "gbk" "iso-2022-jp" "iso8859-1" "iso8859-14" "iso8859-15" "iso8859-2" "iso8859-3" "iso8859-4" "iso8859-5" "iso8859-6" "iso8859-7" "iso8859-8" "iso8859-9" "jis" "jvm-utf8" "koi8-r" "latin-14" "latin-15" "latin-2" "latin-3" "latin-4" "latin-5" "latin-6" "latin-7" "latin-8" "latin-9" "latin1" "latin14" "latin15" "latin2" "latin3" "latin4" "latin5" "latin6" "latin7" "latin8" "latin9" "shiftjis" "ujis" "unicode" "utf8"The numeric strings refer to Windows Code Page encodings.
place
- When non-null, must be an array of at least one Object. The array element
zero is updated with the UPI of the graph component of all the triples added
by the bulk load.
See the note about progress messages in the description of
AllegroGraphException
loadNTriples(String)
public long parseNTriples(java.lang.String from) throws AllegroGraphException
from
- a string in ntriples format
AllegroGraphException
public long parseNTriples(java.lang.String from, java.lang.Object context) throws AllegroGraphException
from
- a string in ntriples formatcontext
- a string, UPI instance, Value instance or null.
AllegroGraphException
public long parseNTriples(java.lang.String from, java.lang.Object context, java.lang.Boolean save, java.lang.Object[] place) throws AllegroGraphException
from
- from a string in ntriples formatcontext
- a string, UPI instance, Value instance or null.save
- if true, save both the string form and the encoded form of encoded literal.
If false, save only the encoded form. Literal that are not subject ot encoding
are not affected.place
- null or an Object array of length at least one.
The array (if present) element zero is updated with the UPI of the actual
context marker used.
AllegroGraphException
public long loadRDF(java.lang.String filePath) throws AllegroGraphException
filePath
- A string that points to the file. The file must be in the RDF
format expected by the AllegroGraph server.
See the note about progress messages in the description
of loadNTriples(String)
.
AllegroGraphException
public long loadRDF(java.lang.String filePath, java.lang.Object context) throws AllegroGraphException
filePath
- A string that points to the file. The file must be in the RDF
format expected by the AllegroGraph server.context
- a String or instance that identifies a triple part to be used
as the context marker for all the triples. If the context is specified
as "source", a URI is constructed from the source file path.
See the note about progress messages in the description
of loadNTriples(String)
.
AllegroGraphException
public long loadRDF(java.lang.String filePath, java.lang.Object context, java.lang.String baseURI) throws AllegroGraphException
filePath
- A string that points to the file. The file must be in the RDF
format expected by the AllegroGraph server.context
- a String or instance that identifies a triple part to be used
as the context marker for all the triples. If the context is specified
as "source", a URI is constructed from the source file path.baseURI
- a string that specifies a base URI for the file.
See the note about progress messages in the description
of loadNTriples(String)
.
AllegroGraphException
public long loadRDF(java.lang.String[] filePaths) throws AllegroGraphException
filePaths
- an array of file pathname strings. The files are loaded in the
order specified.
AllegroGraphException
public long numberOfTriples() throws AllegroGraphException
AllegroGraphException
public void indexNewTriples() throws AllegroGraphException
AllegroGraphException
- if an error occurs during indexing.
If the current indexing chunk size is too small, it can cause too many files to be opened during indexing; in that case the AllegroGraphException exception with the string "too-many-index-chunks-error: will create nnn files" is thrown; nnn is the number of chunks. At this point, the triple store has not been indexed, but the server is in a stable state. The Application can adjust the chunk size with AllegroGraphConnection.setChunkSize() and try the indexing call again.
If the current indexing chunk size is too large, the server may run out of memory during indexing; in that case, the thrown exception will depend on where and when the out-of-memory condition occurred. The triple store may be in a partially indexed state.
public void indexNewTriples(boolean wait) throws AllegroGraphException
wait
- If true, then return only after indexing is completed.
If false, schedule an indexing task to run in the background
and return immediately.
AllegroGraphException
public void indexAllTriples() throws AllegroGraphException
AllegroGraphException
- if an error occurs during indexing.
See the discussion of chunk size at indexNewTriples().
public void indexAllTriples(boolean wait) throws AllegroGraphException
wait
- If true, then return only after indexing is completed.
If false, schedule an indexing task to run in the background
and return immediately.
AllegroGraphException
public ValueObject newValue(UPI id)
id
- A UPI instance that denotes a Resource or Literal object
java.lang.IllegalStateException
- if the object could not be created.public java.lang.String[] getParts(UPI id) throws AllegroGraphException
id
- A UPI instance that identifies a triple store part.
AllegroGraphException
public UPI[] getTripleParts(long id) throws AllegroGraphException
AllegroGraphException
public void getParts(UPI[] ids, java.lang.String[] types, java.lang.String[] vals, java.lang.String[] mods) throws AllegroGraphException
ids
- an array of UPI instancestypes
- a String array of the same length as ids.vals
- a String array of the same length as ids.mods
- a String array of the same length as ids.
The arrays types, vals, mods are modified to hold the string values corresponding to the id number in the ids array.
AllegroGraphException
public int getSelectLimit()
This number determines the number of values transmitted in one set of results from the AllegroGraph server to the Java client. If the number of expected results is very large, but the application is interested in only a few, then a small number may improve performance. If the number is very large, there may be a long delay as the large array of results is prepared and transmitted to the client. The total numer of actual values returned depends on the number of free variables in the query.
The built-in initial value is 1000.
public void setSelectLimit(int v)
v
- A positive integer.getSelectLimit()
public BNode createBNode()
createBNode
in interface ValueFactory
BlankNode
java.lang.IllegalStateException
- if the creation fails.
It does not make sense to create a BNode that is not registered in the triple store because two instances of apparently identical unregistered BNodes would map to distinct BNodes in the triple store.
public BNode createBNode(java.lang.String nodeId)
createBNode
in interface ValueFactory
nodeId
- the bnode identifier
BlankNode
java.lang.IllegalStateException
- if the creation fails.
See note on createBNode().
public BlankNode[] createBNodes(int n) throws AllegroGraphException
n
- the number of nodes to allocate.
AllegroGraphException
- if there is a problem during creation.
See note on createBNode().
public EncodedLiteral createEncodedLiteral(long v, java.lang.String encoding)
v
- The Java long value.encoding
- A string that specifies the AllegroGraph encoding desired.
The available encodings are described in the AllegroGraph Introduction document.
public EncodedLiteral createEncodedLiteral(double v, java.lang.String encoding)
v
- The Java double value.encoding
- A string that specifies the AllegroGraph encoding desired.
The available encodings are described in the AllegroGraph Introduction document.
public EncodedLiteral createEncodedLiteral(java.lang.String v, java.lang.String encoding)
v
- The Java string value.encoding
- A string that specifies the AllegroGraph encoding desired.
The available encodings are described in the AllegroGraph Introduction document.
public Literal createLiteral(java.lang.String value)
createLiteral
in interface ValueFactory
value
- The literal's value.
Literal
The literal instance will have a null UPI.
public Literal addLiteral(java.lang.String value)
java.lang.IllegalStateException
- if the creation fails.public Literal createLiteral(java.lang.String value, java.lang.String language)
createLiteral
in interface ValueFactory
value
- The literal's value.language
- The literal's language attribute, or null if the
literal doesn't have a language.
Literal
The literal instance will have a null UPI.
public Literal addLiteral(java.lang.String value, java.lang.String language)
java.lang.IllegalStateException
- if the creation fails.public Literal createTypedLiteral(java.lang.String text, java.lang.String type)
text
- A string URI.type
- A string URI that denotes the type.
public Literal addTypedLiteral(java.lang.String text, java.lang.String type)
text
- A string URI.type
- A string URI that denotes the type.
java.lang.IllegalStateException
- if the creation fails.public Literal createTypedLiteral(java.lang.String text, UPI type)
text
- A string.type
- A UPI instance that identifie a Node
public Literal addTypedLiteral(java.lang.String text, UPI type)
text
- A string.type
- A UPI instance that identifies the datatype resource.
java.lang.IllegalStateException
- if the creation fails.public Literal addTypedLiteral(java.lang.String text, URI type)
text
- A string.type
- A URI instance that identifies the datatype resource.
java.lang.IllegalStateException
- if the creation fails.public Literal createLiteral(java.lang.String value, URI datatype)
createLiteral
in interface ValueFactory
value
- The literal's value.datatype
- The literal's datatype, or null if the literal
doesn't have a datatype.
Literal
The literal instance will have a null UPI.
public Literal addLiteral(java.lang.String value, URI datatype) throws AllegroGraphException
java.lang.IllegalStateException
- if the creation fails.
AllegroGraphException
public Literal[] addLiterals(java.lang.String[] values, java.lang.String[] datatypes, java.lang.String[] languages) throws AllegroGraphException
values
- An array of string literal values (of length n).datatypes
- null, or an array of datatype URIs. If null, none of
the new Literal instances will have a datatype qualifier. If an array,
the first n elements will be used as datatype labels for the
corresponding Literal. A null element specifies a Literal without
a datatype label. If the length of the array is less than n, the
last element is repeated as often as necessary. If a non-null value
is specified in an array element, the corresponding element in the
languages array is ignored.languages
- null, or an array of language labels. If null, none of
the new Literal instances will have a language qualifier. If an array,
the first n elements will be used as language labels for the
corresponding Literal. A null element specifies a Literal without
a language label. If the length of the array is less than n, the
last element is repeated as often as necessary.
AllegroGraphException
public URI createURI(java.lang.String uri)
createURI
in interface ValueFactory
uri
-
Node
public Node addURI(java.lang.String uri) throws AllegroGraphException
uri
-
AllegroGraphException
- if the creation fails.public UPI[] addURIIds(java.lang.String[] uri) throws AllegroGraphException
uri
- An array of URI strings.
AllegroGraphException
public URI[] addURIs(java.lang.String[] uri) throws AllegroGraphException
uri
- An array of URI strings.
AllegroGraphException
public URI createURI(java.lang.String namespace, java.lang.String localName)
createURI
in interface ValueFactory
namespace
- A namespace.localName
- A legal local name. A legal local name adheres to the
definition of an NCName as specified at
http://www.w3.org/TR/REC-xml-names/#NT-NCName.
Node
java.lang.IllegalStateException
- if the creation fails.public Cursor getStatements(java.lang.Object subject, java.lang.Object predicate, java.lang.Object object) throws AllegroGraphException
AllegroGraphException
- if there is
a problem.public Cursor getStatements(boolean includeInferred, java.lang.Object subject, java.lang.Object predicate, java.lang.Object object) throws AllegroGraphException
includeInferred
- if true, include inferred triples in the result.
If false, return only triples that are actually present in the
triple store.
AllegroGraphException
- if there is
a problem.public Cursor getStatements(java.lang.Object subject, java.lang.Object predicate, java.lang.Object object, java.lang.Object context) throws AllegroGraphException
AllegroGraphException
- if there is
a problem.public Cursor getStatements(boolean includeInferred, java.lang.Object subject, java.lang.Object predicate, java.lang.Object object, java.lang.Object context) throws AllegroGraphException
includeInferred
- if true, include inferred triples in the result.
If false, return only triples that are actually present in the
triple store.context
- Specifies the context or graph of the statements. Null is wild
and matches any context; the empty string denotes the Null Context.
AllegroGraphException
- if there is
a problem.public Cursor getStatements(java.lang.Object subject, java.lang.Object predicate, java.lang.Object object, java.lang.Object obEnd, java.lang.Object context, java.lang.Object contextEnd) throws AllegroGraphException
subject
- predicate
- object
- obEnd
- a non-null value specifies the end of a range of values
for the object component of the triples. A null value specifies
that only the object agument will be used to match triples.context
- a null value is a wild card, the empty string specifies
the null context, any other value must specify a resource that will
match the context component.contextEnd
- a non-null value specifies the end of a range of values
for the context component of the triples. A null value specifies
that only the context agument will be used to match triples.
AllegroGraphException
- if there is
a problem.public Cursor getStatements(boolean includeInferred, java.lang.Object subject, java.lang.Object predicate, java.lang.Object object, java.lang.Object obEnd, java.lang.Object context, java.lang.Object contextEnd) throws AllegroGraphException
includeInferred
- if true, include inferred triples in the result.
If false, return only triples that are actually present in the
triple store.subject
- predicate
- object
- obEnd
- a non-null value specifies the end of a range of values
for the object component of the triples. A null value specifies
that only the object agument will be used to match triples.context
- a null value is a wild card, the empty string specifies
the null context, any other value must specify a resource that will
match the context component.contextEnd
- a non-null value specifies the end of a range of values
for the context component of the triples. A null value specifies
that only the context agument will be used to match triples.
AllegroGraphException
- if there is
a problem.public Cursor getStatements(boolean includeInferred, java.lang.Object subject, java.lang.Object subEnd, java.lang.Object predicate, java.lang.Object predEnd, java.lang.Object object, java.lang.Object obEnd, java.lang.Object context, java.lang.Object contextEnd) throws AllegroGraphException
includeInferred
- subject
- subEnd
- predicate
- predEnd
- object
- obEnd
- context
- contextEnd
-
AllegroGraphException
getStatements(boolean, Object, Object, Object, Object, Object, Object)
public boolean hasStatement(java.lang.Object subject, java.lang.Object predicate, java.lang.Object object) throws AllegroGraphException
AllegroGraphException
public boolean hasStatement(boolean includeInferred, java.lang.Object subject, java.lang.Object predicate, java.lang.Object object) throws AllegroGraphException
includeInferred
- If false, only ground triples (triples directly stored
in the triple store) are included in the search. If true, the search
includes triples derived by reasoning.
AllegroGraphException
public boolean hasStatement(java.lang.Object subject, java.lang.Object predicate, java.lang.Object object, java.lang.Object context) throws AllegroGraphException
AllegroGraphException
public boolean hasStatement(boolean includeInferred, java.lang.Object subject, java.lang.Object predicate, java.lang.Object object, java.lang.Object context) throws AllegroGraphException
includeInferred
- If false, only ground triples (triples directly stored
in the triple store) are included in the search. If true, the search
includes triples derived by reasoning.
AllegroGraphException
public void addStatement(java.lang.Object subject, java.lang.Object predicate, java.lang.Object object) throws AllegroGraphException
AllegroGraphException
public void addStatement(java.lang.Object subject, java.lang.Object predicate, java.lang.Object object, java.lang.Object context) throws AllegroGraphException
AllegroGraphException
public void addStatements(java.lang.Object subject, java.lang.Object predicate, java.lang.Object object) throws AllegroGraphException
subject
- An array of Resource instances.predicate
- An array of URI instances.object
- An array of Value instances.
The number of Statements added is determined by the longest array argument. The last element in short arrays is extended to the required length. A single (not array) argument is treated as an array of one element.
AllegroGraphException
public void addStatements(java.lang.Object subject, java.lang.Object predicate, java.lang.Object object, java.lang.Object contexts) throws AllegroGraphException
subject
- An array of Resource instances.predicate
- An array of URI instances.object
- An array of Value instances.contexts
- An array of URI instances.
The number of Statements added is determined by the longest array argument. The last element in short arrays is extended to the required length. A single (not array) argument is treated as an array of one element.
AllegroGraphException
public void clear() throws AllegroGraphException
AllegroGraphException
public Literal createLiteral(boolean value)
Literal
The literal instance will have a null UPI.
public Literal addLiteral(boolean value) throws AllegroGraphException
AllegroGraphException
public Literal createLiteral(long value)
Literal
The literal instance will have a null UPI.
public Literal addLiteral(long value) throws AllegroGraphException
AllegroGraphException
public Literal createLiteral(int value)
Literal
The literal instance will have a null UPI.
public Literal addLiteral(int value) throws AllegroGraphException
AllegroGraphException
public Literal createLiteral(short value)
Literal
The literal instance will have a null UPI.
public Literal addLiteral(short value) throws AllegroGraphException
AllegroGraphException
public Literal createLiteral(byte value)
Literal
The literal instance will have a null UPI.
public Literal addLiteral(byte value) throws AllegroGraphException
AllegroGraphException
public Literal createLiteral(double value)
Literal
The literal instance will have a null UPI.
public Literal addLiteral(double value) throws AllegroGraphException
AllegroGraphException
public Literal createLiteral(float value)
Literal
The literal instance will have a null UPI.
public Literal addLiteral(float value) throws AllegroGraphException
AllegroGraphException
public Statement createStatement(Resource subject, URI predicate, Value object, Resource context)
public Cursor selectStatements(java.lang.String query) throws AllegroGraphException
selectStatements(boolean, boolean, String, Object, String)
.
query
- An ACL Prolog query of the form
(?x0 ?x1 ... ?xm) (q- ...) ...
AllegroGraphException
getSelectLimit()
public Cursor selectStatements(java.lang.String query, java.lang.Object arg) throws AllegroGraphException
selectStatements(boolean, boolean, String, Object, String)
.
query
- Like selectStatements(String)arg
- A single Value reference or an array.
The AllegroGraph reference to the Value of each element
is substituted for the Prolog variables "?a0", "?a1"... in the query.
In this way, queries can be paramtrized with values from the
Java application.
AllegroGraphException
public Triple newTriple(java.lang.Object s, java.lang.Object p, java.lang.Object o) throws AllegroGraphException
s
- A String, UPI, or Value specifying a subject.p
- A String, UPI, or Value specifying a predicate.o
- A String, UPI, or Value specifying an object.
AllegroGraphException
public long newTripleId(java.lang.Object s, java.lang.Object p, java.lang.Object o) throws AllegroGraphException
s
- A String, UPI, or Value specifying a subject.p
- A String, UPI, or Value specifying a predicate.o
- A String, UPI, or Value specifying an object.
AllegroGraphException
public Triple newTriple(java.lang.Object s, java.lang.Object p, java.lang.Object o, java.lang.Object c) throws AllegroGraphException
s
- A String, UPI, or Value specifying a subject.p
- A String, UPI, or Value specifying a predicate.o
- A String, UPI, or Value specifying an object.c
- A String, UPI, or Value specifying a context.
AllegroGraphException
public long newTripleId(java.lang.Object s, java.lang.Object p, java.lang.Object o, java.lang.Object c) throws AllegroGraphException
s
- A String, UPI, or Value specifying a subject.p
- A String, UPI, or Value specifying a predicate.o
- A String, UPI, or Value specifying an object.c
- A String, UPI, or Value specifying a context.
AllegroGraphException
public Triple[] newTriples(java.lang.Object s, java.lang.Object p, java.lang.Object o) throws AllegroGraphException
s
- An array of Strings UPIs or Value instances specifying subjects.p
- An array of Strings UPIs or Value instances specifying predicates.o
- An array of Strings UPIs or Value instances specifying objects.
The number of triples added is determined by the longest array argument. The last element in short arrays is extended to the required length.
AllegroGraphException
public Triple[] newTriples(java.lang.Object s, java.lang.Object p, java.lang.Object o, java.lang.Object c) throws AllegroGraphException
s
- An array of Strings UPIs or Value instances specifying subjects.p
- An array of Strings UPIs or Value instances specifying predicates.o
- An array of Strings UPIs or Value instances specifying objects.c
- An array of Strings UPIs or Value instances specifying contexts.
The number of triples added is determined by the longest array argument. The last element in short arrays is extended to the required length.
AllegroGraphException
public long[] newTripleIds(java.lang.Object s, java.lang.Object p, java.lang.Object o) throws AllegroGraphException
s
- An array of Strings UPIs or Value instances specifying subjects.p
- An array of Strings UPIs or Value instances specifying predicates.o
- An array of Strings UPIs or Value instances specifying objects.
The number of triples added is determined by the longest array argument. The last element in short arrays is extended to the required length.
AllegroGraphException
public long[] newTripleIds(java.lang.Object s, java.lang.Object p, java.lang.Object o, java.lang.Object c) throws AllegroGraphException
s
- An array of Strings UPIs or Value instances specifying subjects.p
- An array of Strings UPIs or Value instances specifying predicates.o
- An array of Strings UPIs or Value instances specifying objects.c
- An array of Strings UPIs or Value instances specifying contexts.
The number of triples added is determined by the longest array argument. The last element in short arrays is extended to the required length.
AllegroGraphException
public void removeStatements(java.lang.Object s, java.lang.Object p, java.lang.Object o) throws AllegroGraphException
s
- the subject pattern (Value, UPI, string)p
- the predicate pattern (Value, UPI, string)o
- the object pattern (Value, UPI, string)
The s, p, or o, arguments may also be null or an empty string to denote a wild card.
AllegroGraphException
public void removeStatements(java.lang.Object s, java.lang.Object p, java.lang.Object o, java.lang.Object c) throws AllegroGraphException
s
- the subject pattern (Value, UPI, string)p
- the predicate pattern (Value, UPI, string)o
- the object pattern (Value, UPI, string)c
- the context pattern (Value, UPI, string); null denotes all contexts,
the empty string denotes the null context.
The s, p, or o, arguments may also be null or an empty string to denote a wild card.
AllegroGraphException
public Cursor selectStatements(java.lang.String query, java.lang.Object arg, java.lang.String svars) throws AllegroGraphException
selectStatements(boolean, boolean, String, Object, String)
.
query
- like selectStatements(String)
arg
- A Resource or Literal references, or an array of these.
The AllegroGraph Id of the
argument is substituted for the Prolog variable specified in the svar
argument.svars
- A string containing one or more names of Prolog variables
separated by spaces. These variables must not be any of the variables
to be set by the search (because these variables will actually be
constants during the search). If there are fewer variables than values
then additional values will be bound to the Prolog variables ?ai
where i is the index of the value in the array arg.
The name of a Prolog variable in the query.
selectStatements(String)
AllegroGraphException
public Cursor selectStatements(boolean includeInferred, boolean distinct, java.lang.String query, java.lang.Object arg, java.lang.String svars) throws AllegroGraphException
includeInferred
- if true, include values obtained by reasoningdistinct
- if true, return only distinct sets of valuesquery
- like selectStatements(String)
arg
- A Resource or Literal references, or an array of these.
The AllegroGraph Id of the
argument is substituted for the Prolog variable specified in the svar
argument.svars
- A string containing one or more names of Prolog variables
separated by spaces. These variables must not be any of the variables
to be set by the search (because these variables will actually be
constants during the search). If there are fewer variables than values
then additional values will be bound to the Prolog variables ?ai
where i is the index of the value in the array arg.
The name of a Prolog variable in the query.
selectStatements(String)
AllegroGraphException
public UPI[] createBNodeIds(int n) throws AllegroGraphException
n
- the number of nodes to allocate.
AllegroGraphException
- if there is a problem during creation.public void removeStatement(java.lang.Object s, java.lang.Object p, java.lang.Object o) throws AllegroGraphException
s
- A Resource, a string in triples format, or a UPIp
- A Node, a string in triples format, or a UPIo
- A Value, a string in triples format, or a UPI
AllegroGraphException
public void removeStatement(java.lang.Object s, java.lang.Object p, java.lang.Object o, java.lang.Object c) throws AllegroGraphException
s
- the subject of the Statement in questionp
- the predicate of the Statement in questiono
- the object of the Statement in questionc
- the context (or graph) of the Statement in question
Each of the parameters may be a Value instance, or a UPI instance, or a string containing an ntriple format reference.
The context argument may be null to denote the Null Context (Default Graph).
AllegroGraphException
public UPI[] addLiteralIds(java.lang.String[] values, java.lang.String[] datatypes, java.lang.String[] languages) throws AllegroGraphException
values
- an array of string literal values.datatypes
- an array of string URIs for datatypes. If an array element is
null, the corresponding literal does not have a datatype qualifier. If the
array argument is null, then none of the literals have datatype qualifiers.languages
- an array of strings language qualifiers. If an array element is
null, the corresponding literal does not have a language qualifier. If
the array argument is null, then none of the literals have language
qualifiers.
If an element of the datatypes array is not null, the corresponding element in the languages array is ignored.
AllegroGraphException
- The result array is the same length as the values array. The other two argument arrays may be shorter. If shorter, the last element in each array is repeated as often as necessary.
public ValueObject[][] selectValues(java.lang.String query, java.lang.Object[] invals, java.lang.String invars) throws AllegroGraphException
selectValues(boolean, boolean, String, Object[], String)
.
query
- A string containing an AllegroGraph SELECT query.
The query may contain ! notations - these are resolved with
respect to the triple store associated with the calling
AllegroGraph instance.invars
- A string that lists the variables to be preset to values
in the query. For example "?a ?b ?c". By setting these variables
in the query, the query can be paramtrized with values from the
application program.invals
- An array of values for the variables mentioned in invars.
The values must be all of the same type.
The values may be UPI instances that denote AllegroGraph objects,
String instances in ntriples format, or ValueNode instances.
moreValues(Object)
can be used to query if additional results are available.
The number of sets of results returned is the smaller of the limit
value or the actual number found by the query. The limit is determined
by calling setSelectLimit(int)
.
Additional results can be retrieved by calling selectMore(ValueObject[][])
.
AllegroGraphException
-
In the query
selectValues("(?x ?y ?z) (q- ?a my!pred ?x)...", {subj}, "?a")
The Prolog variable ?a is preset to the value of the Java variable
'subj' and therfore behaves like a constant during the query.
The result will be an array of 3-tuples. The first element in each 3-tuple will be the binding of variable ?x, the second ?y, and the third ?z
selectMore(ValueObject[][])
public ValueObject[][] selectValues(boolean includeInferred, boolean distinct, java.lang.String query, java.lang.Object[] invals, java.lang.String invars) throws AllegroGraphException
includeInferred
- if true, include values obtained by reasoningdistinct
- if true, return only distinct sets of valuesquery
- the query as in selectValues(String, Object[], String)
invals
- see selectValues(String, Object[], String)
invars
- see selectValues(String, Object[], String)
selectValues(String, Object[], String)
AllegroGraphException
public ValueObject[] selectSingleValues(java.lang.String query, java.lang.Object[] invals, java.lang.String invars) throws AllegroGraphException
query
- A query similar to the query passed to selectValues(String, Object[], String)
but limited to a single result variable.invals
- null or an array of values as in selectValues(String, Object[], String)
invars
- null or atring of variable names as in selectValues(String, Object[], String)
moreValues(Object)
can be used to query if additional results are available.
AllegroGraphException
selectMore(ValueObject[])
public ValueObject[] selectSingleValues(boolean includeInferred, boolean distinct, java.lang.String query, java.lang.Object[] invals, java.lang.String invars) throws AllegroGraphException
includeInferred
- if true, include values obtained by reasoningdistinct
- if true, return only distinct sets of valuesquery
- A query similar to the query passed to selectValues(String, Object[], String)
but limited to a single result variable.invals
- null or an array of values as in selectValues(String, Object[], String)
invars
- null or atring of variable names as in selectValues(String, Object[], String)
moreValues(Object)
can be used to query if additional results are available.
AllegroGraphException
selectMore(ValueObject[])
public ValueObject[] getFreetextUniqueSubjects(java.lang.String pattern) throws AllegroGraphException
pattern
- A text pattern as described in getFreetextStatements(String)
setSelectLimit(int)
.
AllegroGraphException
selectMore(ValueObject[])
public Cursor getFreetextStatements(java.lang.String pattern) throws AllegroGraphException
pattern
- A text pattern as described below.
AllegroGraphException
- The text pattern is a string containing a well-formed pattern expression defines as follows:
pattern := atomic_pattern | composite_pattern composite_pattern := ( and pattern* ) | ( or pattern* ) atomic_pattern := word_pattern | phrase_pattern word_pattern := 'char*' phrase pattern := [char*] char := /( denotes the character [ char := /) denotes the character ] char := /! denotes the character ' char := // denotes the character / char := /# denotes the character " char := ? denotes a wild card that matches any single character char := * denotes a wild card that matches any sequence of characters char := any any other character denotes itself
public java.lang.String[] getFreetextPredicates() throws AllegroGraphException
AllegroGraphException
public void registerFreetextPredicate(java.lang.Object predicate) throws AllegroGraphException
getFreetextStatements(String)
or with
getFreetextUniqueSubjects(String)
.
Freetext indexing predicates must be reistered before any triples
are added to the triple store.
predicate
- The predicate may be specified as a string in ntriples syntax
or !-notation, a UPI instance, or a URI instance.
AllegroGraphException
public ValueObject[][] selectValues(java.lang.String query) throws AllegroGraphException
selectValues(boolean, boolean, String, Object[], String)
.
query
- A string containing an AllegroGraph SELECT query.
The query may contain ! notations - these are resolved with
respect to the triple store associated with the calling
AllegroGraph instance.
moreValues(Object)
can be used to query if additional results are available.
The number of results returned is the smaller of the limit
value or the actual number in the triple store. The limit is determined
by calling setSelectLimit(int)
.
Additional results can be retrieved by calling selectMore(ValueObject[][])
.
AllegroGraphException
-
In the query
selectValues("(?x ?y ?z) (q- ...)...")
The result will be an array of 3-tuples. The first element in each
3-tuple will be the binding of variable ?x, the second ?y, and the
third ?z
selectMore(ValueObject[][])
public ValueObject[][] selectValues(boolean includeInferred, boolean distinct, java.lang.String query) throws AllegroGraphException
includeInferred
- if true, include values obtained by reasoningdistinct
- if true, return only distinct sets of valuesquery
- the query as in selectValues(String, Object[], String)
selectValues(String, Object[], String)
AllegroGraphException
public int valuesLength(ValueObject[][] x)
selectValues(String)
.
x
- the array of results returned by selectValues(String)
public int moreValues(java.lang.Object x)
selectValues(String)
result.
x
- An array returned by selectValues(String)
public java.lang.String[] valueNames(java.lang.Object x)
x
- An object returned by a call to selectValues(), selectSingleValue(),
or twinqlSelect().
public ValueObject[][] selectMore(ValueObject[][] sr) throws AllegroGraphException
sr
- An array of values previously returned by a call
to selectValues(String)
AllegroGraphException
selectValues(String, Object[], String)
public ValueObject[] selectMore(ValueObject[] sr) throws AllegroGraphException
sr
- An array of values previously returned by a call
to selectSingleValues(String, Object[], String)
AllegroGraphException
selectSingleValues(String, Object[], String)
public boolean twinqlAsk(java.lang.String query) throws AllegroGraphException
SPARQLQuery
instead.
query
- A string containing a well-formed SPARQL ASK query.
If the query string is not an ASK query, the result is undefined.
AllegroGraphException
- See SPARQLQuery
for more SPARQL query options.public ValueObject[][] twinqlSelect(java.lang.String query, java.lang.String vars, int limit, int offset) throws AllegroGraphException
SPARQLQuery
instead.
query
- A string containing a well-formed SPARQL SELECT query.
If the query string is not a SELECT query. the result is undefined.vars
- A String containing the names of the SPARQL variables
separated by spaces, to be returned from the query.
The order of the names in this list is the order of the
corresponding values in the result array.
This argument may be null or "" to use the variables listed
in the query. Note that in the case of a "SELECT *" query, the
application must call valueNames(Object)
to
determine the names of the variables for which the bindings are returned
in each result set.limit
- Overrides a LIMIT specification in the query string.
The LIMIT specification in the SPARQL language places a limit on
the number of results collected by the query. This limit is
separate and distinct from the setSelectLimit() value.
A zero or negative value is interpreted as unlimited.offset
- Overrides an OFFSET specification in the query string.
A zero or negative value is interpreted as unlimited.
AllegroGraphException
- See SPARQLQuery
for more SPARQL query options.public ValueObject[][] twinqlSelect(boolean includeInferred, java.lang.String query, java.lang.String vars, int limit, int offset) throws AllegroGraphException
SPARQLQuery
instead.
includeInferred
- if true, include inferred triples in the result.query
- vars
- limit
- offset
-
AllegroGraphException
- See SPARQLQuery
for more SPARQL query options.public long twinqlCount(java.lang.String query, java.lang.String vars, int limit, int offset) throws AllegroGraphException
SPARQLQuery
instead.
twinqlSelect(String, String, int, int)
.
SPARQLQuery
for more SPARQL query options.
AllegroGraphException
public Cursor twinqlFind(java.lang.String query, int limit, int offset) throws AllegroGraphException
SPARQLQuery
instead.
query
- A string containing a SPARQL DESCRIBE or CONSTRUCT query that
returns a set of triples.limit
- Overrides a LIMIT specification in the query string.
The LIMIT specification in the SPARQL language places a limit on
the number of results collected by the query. This limit is
separate and distinct from the setSelectLimit() value.
A zero or negative value is interpreted as unlimited.offset
- Overrides an OFFSET specification in the query string.
A zero or negative value is interpreted as unlimited.
AllegroGraphException
- See SPARQLQuery
for more SPARQL query options.public java.lang.String twinqlQuery(java.lang.String query, java.lang.String format, int limit, int offset) throws AllegroGraphException
SPARQLQuery
instead.
query
- A SPARQL query string.limit
- Overrides a LIMIT specification in the query string.
The LIMIT specification in the SPARQL language places a limit on
the number of results collected by the query. This limit is
separate and distinct from the setSelectLimit() value.
A zero or negative value is interpreted as unlimited.offset
- Overrides an OFFSET specification in the query string.
A zero or negative value is interpreted as unlimited.format
- A string that specifies the format of the result.
Currently recognized strings are:
AllegroGraphException
- See SPARQLQuery
for more SPARQL query options.public Statement createStatement(Resource subject, URI predicate, Value object)
createStatement
in interface ValueFactory
subject
- The statement's subject.predicate
- The statement's predicate.object
- The statement's object.
public int getUnmergedCount() throws AllegroGraphException
AllegroGraphException
public int getUnindexedTripleCount() throws AllegroGraphException
AllegroGraphException
public int getUnindexedThreshold() throws AllegroGraphException
AllegroGraphException
public void setUnindexedThreshold(int val) throws AllegroGraphException
val
- The new value for this parameter.
AllegroGraphException
public int getUnmergedThreshold() throws AllegroGraphException
AllegroGraphException
public void setUnmergedThreshold(int val) throws AllegroGraphException
val
- The new value for this parameter.
AllegroGraphException
public java.lang.String[] getIndexFlavors() throws AllegroGraphException
AllegroGraphException
public void setIndexFlavors(java.lang.String[] flavors) throws AllegroGraphException
flavors
- An array of strings specifying the desired indexing
flavors. Any existing flavors are discarded.
Each string is a permutation of the letters "spog".
AllegroGraphException
- Multi-user Note: The set of index flavors is a persistent property of the persistent triple store. If several users are accessing the same triple store, any changes to the index flavors are seen by all users.
public void addIndexFlavors(java.lang.String[] flavors) throws AllegroGraphException
flavors
- An array of strings specifying the desired indexing
flavors. These flavors are added to the existing flavors.
Each string is a permutation of the letters "spog".
AllegroGraphException
- Multi-user Note: The set of index flavors is a persistent property of the persistent triple store. If several users are accessing the same triple store, any changes to the index flavors are seen by all users.
public void dropIndexFlavors(java.lang.String[] flavors) throws AllegroGraphException
flavors
- An array of strings specifying the indexing
flavors to delete. These flavors are deleted from the existing flavors.
Each string is a permutation of the letters "spog".
AllegroGraphException
- Multi-user Note: The set of index flavors is a persistent property of the persistent triple store. If several users are accessing the same triple store, any changes to the index flavors are seen by all users.
public void addDataMapping(java.lang.String[] map) throws AllegroGraphException
map
- An array of strings of a length that is a multiple of 3.
Each group of 3 consecutive elements defines one mapping:
the first element is string URI of a datatype or predicate;
the second element is a string naming an internal representation type
of AllegroGraph (the valid types are listed in the AllegroGraph
introduction); the third element is the string "datatype" or
"predicate" to identify the kind of mapping.
The entries in the array are added to the table in the triple store. An existing entry is superseded by the new definition.
When a triple is created with a predicate matching a defined URI, then the object of the triple is parsed and converted to the internal data type.
When a literal is created with a datatype modifier that matches a defined URI, then the content of the literal is parsed and converted to the internal data type.
AllegroGraphException
public void setDataMapping(java.lang.String[] map) throws AllegroGraphException
map
- An array of strings similar to the array returned by getDataMapping().
AllegroGraphException
addDataMapping(String[])
,
getDataMapping()
public java.lang.String[] getDataMapping() throws AllegroGraphException
AllegroGraphException
addDataMapping(String[])
public java.lang.Object[] evalInServer(java.lang.String expression) throws AllegroGraphException
expression
- The expression.
AllegroGraphException
-
The proper usage of this method is fully described in
AllegroGraphConnection.evalInServer(String)
public int serverTrace(boolean onoff)
onoff
- true to turn on tracing.
When tracing is turned on in the AllegroGraph server, every call from Java to the server causes some output on the server console. This output may be useful in diagnosing some problems. Since tracing may produce large quantities of output it should be used with caution and only around critical sections of code.
The trace state applies only to operations on this triple store.
public int serverTrace(java.lang.String outFile)
outFile
- the name and path for a file where the trace output will go.
When tracing is turned on in the AllegroGraph server, every call from Java to the server causes some output on the server console. This output may be useful in diagnosing some problems. Since tracing may produce large quantities of output it should be used with caution and only around critical sections of code.
The trace state applies only to operations on this triple store.
public java.lang.String[] getNamespaces()
public NamespaceRegistry getNamespaceRegistry()
public void registerNamespace(java.lang.String prefix, java.lang.String full) throws AllegroGraphException
prefix
- the prefixfull
- The full namespace text. If the full text is null
or "", then the prefix is removed from the table.
AllegroGraphException
public void registerNamespaces(java.lang.String[] defs) throws AllegroGraphException
defs
- An array of strings. The even numbered elements are prefixes
and the following odd numbered element is the full namespace text.
If the full text is null or "", then the prefix is removed
from the table.
AllegroGraphException
public void setNamespaceRegistry(NamespaceRegistry ns) throws AllegroGraphException
ns
- the new definitions.
AllegroGraphException
public void setNamespaceRegistry() throws AllegroGraphException
AllegroGraphException
public ValueNode addPart(java.lang.String part) throws AllegroGraphException
part
- A string in ntriples syntax or !-notation that denotes
a Literal, a Node, or a blank node.
NOTE: mentioning a blank node twice with the same string will still create two distinct blank node instances.
AllegroGraphException
public AllegroGraph[] getStores() throws AllegroGraphException
AllegroGraphException
public boolean getSyncEveryTime()
public void setSyncEveryTime(boolean s)
s
- if true, the triple store will be synchronized after every
update call from Java. If false, the application must call
#syncTripleStore(AllegroGraph)
every now and then
in order to force a persistent store update.
NOTE: If the synchronization mode is false, and the application
terminates abruptly, any updates since the last synchronization
call will be lost.public java.lang.String toString()
public SNAExtension getSNAExtension()
SNAExtension
instancepublic GeoExtension getGeoExtension()
GeoExtension
instancepublic void syncDatabase() throws AllegroGraphException
syncTripleStore()
instead.
AllegroGraphException
public void closeDatabase() throws AllegroGraphException
closeTripleStore()
instead.
AllegroGraphException
public void indexAll() throws AllegroGraphException
indexAllTriples()
instead
AllegroGraphException
public void indexTriples() throws AllegroGraphException
indexNewTriples()
instead
AllegroGraphException
public Cursor select(java.lang.String query) throws AllegroGraphException
selectStatements(String)
instead
AllegroGraphException
public Cursor select(java.lang.String query, java.lang.Object arg) throws AllegroGraphException
selectStatements(String,Object)
instead
AllegroGraphException
public Cursor select(java.lang.String query, java.lang.Object arg, java.lang.String svar) throws AllegroGraphException
selectStatements(String,Object,String)
instead
AllegroGraphException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |