public interface ModelConnection
Model.
It permits the addition and removal of data to and from the model,
handling of transactions,
access to the total order of Ripple values in the model,
and mapping of values into and out of Ripple space.| Modifier and Type | Method and Description |
|---|---|
void |
add(RippleValue subj,
RippleValue pred,
RippleValue obj,
RippleValue... contexts)
Adds one or more RDF statements to the model.
|
RDFValue |
booleanValue(boolean b)
Constructs a boolean value.
|
RippleValue |
canonicalValue(RDFValue v)
Finds the "canonical" value, in Ripple space, for a given RDF value.
|
void |
close()
Closes this connection, releasing its resources and rolling back any uncommitted changes.
|
void |
commit()
Commits the current transaction.
|
info.aduna.iteration.CloseableIteration<? extends org.openrdf.query.BindingSet,org.openrdf.query.QueryEvaluationException> |
evaluate(String query)
Evaluates a SPARQL query against the model.
|
void |
finish()
Complete any still-executing tasks.
|
Comparator<RippleValue> |
getComparator() |
Source<RippleValue> |
getContexts() |
Model |
getModel() |
Source<org.openrdf.model.Namespace> |
getNamespaces()
Retrieves all namespaces defined in this model.
|
void |
getStatements(RDFValue subj,
RDFValue pred,
RDFValue obj,
Sink<org.openrdf.model.Statement> sink)
Retrieves all statements in the model matching a given triple pattern.
|
boolean |
internalize(RippleList list)
Adds an RDF description of the given list to the model.
|
RDFValue |
languageTaggedValue(String s,
String language)
Constructs a language-tagged literal value in Ripple space.
|
RippleList |
list() |
NumericValue |
numericValue(BigDecimal bd)
Constructs a big-decimal-typed numeric value.
|
NumericValue |
numericValue(double d)
Constructs a double-precision numeric value.
|
NumericValue |
numericValue(int i)
Constructs an integer-typed numeric value.
|
NumericValue |
numericValue(long l)
Constructs a long-integer-typed numeric value.
|
RDFValue |
plainValue(String label)
Constructs a plain literal value in Ripple space.
|
void |
query(StatementPatternQuery query,
Sink<RippleValue> sink,
boolean asynchronous)
Issues a triple pattern query over the model.
|
void |
remove(RippleValue subj,
RippleValue pred,
RippleValue obj,
RippleValue... contexts)
Removes matching RDF statements from the model.
|
void |
reset(boolean rollback)
Returns the ModelConnection to a normal state after an Exception has
been thrown.
|
void |
setNamespace(String prefix,
String ns,
boolean override)
Define a namespace prefix.
|
boolean |
toBoolean(RippleValue v)
Attempts to convert a Ripple value to a boolean value.
|
Date |
toDateValue(RippleValue v)
Attempts to convert a Ripple value to a date value.
|
void |
toList(RippleValue v,
Sink<RippleList> sink)
Attempts to convert a Ripple value to a Ripple List.
|
NumericValue |
toNumericValue(RippleValue v)
Attempts to convert a Ripple value to a numeric value.
|
String |
toString(RippleValue v)
Attempts to convert a Ripple value to a string value.
|
RDFValue |
typedValue(String label,
org.openrdf.model.URI datatype)
Constructs a typed RDF literal value.
|
RDFValue |
uriValue(String uri)
Construct an RDF URI reference.
|
Model getModel()
Model of this connectionvoid close()
throws RippleException
RippleException - if anything goes wrongvoid reset(boolean rollback)
throws RippleException
rollback - whether to roll back the current transactionRippleException - if anything goes wrongvoid commit()
throws RippleException
RippleException - if the transaction cannot be committedboolean toBoolean(RippleValue v) throws RippleException
v - the value to convert. It must be of a type which is convertible to boolean.RippleException - if the value cannot be convertedNumericValue toNumericValue(RippleValue v) throws RippleException
v - the value to convert. It must be of a type which is convertible to a number.RippleException - if the value cannot be convertedDate toDateValue(RippleValue v) throws RippleException
v - the value to convert. It must be of a type which is convertible to a date.RippleException - if the value cannot be convertedString toString(RippleValue v) throws RippleException
v - the value to convert.RippleException - if conversion failsvoid toList(RippleValue v, Sink<RippleList> sink) throws RippleException
v - the value to convert. It must be of a type which is convertible to a list,
or be the head of an RDF list in the model's RDF knowledge base.sink - a handler for successfully converted listsRippleException - if conversion failsRDFValue uriValue(String uri) throws RippleException
uri - the URI to convertRippleException - if the argument is not a valid URIRDFValue plainValue(String label) throws RippleException
label - the lexical form of the stringRippleException - if the literal cannot be constructedRDFValue languageTaggedValue(String s, String language) throws RippleException
s - the label of the literallanguage - the language tag of the literal (e.g. "en" or "de")RippleException - if the literal cannot be constructedRDFValue typedValue(String label, org.openrdf.model.URI datatype) throws RippleException
label - the label of the literaldatatype - the data type of the valueRippleException - if the arguments do not define a valid literalRDFValue booleanValue(boolean b) throws RippleException
b - the primitive value to wrapRippleException - if the value cannot be constructedNumericValue numericValue(int i) throws RippleException
i - the primitive value to wrapRippleException - if the value cannot be constructedNumericValue numericValue(long l) throws RippleException
l - the primitive value to wrapRippleException - if the value cannot be constructedNumericValue numericValue(double d) throws RippleException
d - the primitive value to wrapRippleException - if the value cannot be constructedNumericValue numericValue(BigDecimal bd) throws RippleException
bd - the primitive value to wrapRippleException - if the value cannot be constructedRippleValue canonicalValue(RDFValue v)
SpecialValueMap.v - the RDF value to look upRippleList list()
Comparator<RippleValue> getComparator()
void setNamespace(String prefix, String ns, boolean override) throws RippleException
prefix - the namespace prefixns - the namespace URI, or null to undefine a prefixoverride - whether to override an existing namespace with this prefix, if there is oneRippleException - if the namespace cannot be setvoid query(StatementPatternQuery query, Sink<RippleValue> sink, boolean asynchronous) throws RippleException
query - the query to evaluatesink - a handler for query resultsasynchronous - whether the query should be evaluated in an asynchronous fashion,
allowing new threads to be spawned in order to compute results in parallelRippleException - if the query cannot be evaluatedSource<org.openrdf.model.Namespace> getNamespaces() throws RippleException
RippleException - if namespaces cannot be retrievedvoid getStatements(RDFValue subj, RDFValue pred, RDFValue obj, Sink<org.openrdf.model.Statement> sink) throws RippleException
subj - the subject of matching statementspred - the predicate of matching statementsobj - the object of matching statementssink - a handler for matched statementsRippleException - if statements cannot be retrievedinfo.aduna.iteration.CloseableIteration<? extends org.openrdf.query.BindingSet,org.openrdf.query.QueryEvaluationException> evaluate(String query) throws RippleException
query - the query to evaluateRippleException - if query evaluation failsSource<RippleValue> getContexts() throws RippleException
RippleException - if contexts cannot be retrievedvoid add(RippleValue subj, RippleValue pred, RippleValue obj, RippleValue... contexts) throws RippleException
subj - the subject of each statementpred - the predicate of each statementobj - the object of each statementcontexts - the graph contexts of the statements, if any.
For each non-null context supplied, a statement will be created and placed in the corresponding graph.
If a null context is supplied, a statement will be added to the default graph.
If no contexts are supplied, a single statement will be added to the default graph.RippleException - if the statement(s) cannot be addedvoid remove(RippleValue subj, RippleValue pred, RippleValue obj, RippleValue... contexts) throws RippleException
subj - the subject of each matching statement, or null as a wildcardpred - the predicate of each matching statement, or null as a wildcardobj - the object of each matching statement, or null as a wildcardcontexts - zero or more graph contexts for matching statements.
For each non-null context supplied, matching statements from the corresponding graph will be removed.
If a null context is supplied, matching statements from the default context will be removed.
If no contexts are supplied, matching statements from all contexts will be removed.RippleException - if matching statements cannot be removedboolean internalize(RippleList list) throws RippleException
rdf:type, rdf:first, and rdf:rest
statements for the list itself,
as well as those of any lists it contains, recursively.list - the list to internalizeRippleException - if internalization failsvoid finish()
throws RippleException
RippleExceptionCopyright © 2007-2012 fortytwo.net. All Rights Reserved.