public class ContextAwareConnection extends RepositoryConnectionWrapper
logger| Constructor and Description |
|---|
ContextAwareConnection(Repository repository) |
ContextAwareConnection(RepositoryConnection connection) |
ContextAwareConnection(Repository repository,
RepositoryConnection connection) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(File file,
RDFFormat dataFormat,
Resource... contexts) |
void |
add(File file,
String baseURI,
RDFFormat dataFormat,
Resource... contexts) |
void |
add(InputStream in,
RDFFormat dataFormat,
Resource... contexts) |
void |
add(InputStream in,
String baseURI,
RDFFormat dataFormat,
Resource... contexts) |
void |
add(Iterable<? extends Statement> statements,
Resource... contexts) |
<E extends Exception> |
add(Iteration<? extends Statement,E> statementIter,
Resource... contexts) |
void |
add(Reader reader,
RDFFormat dataFormat,
Resource... contexts) |
void |
add(Reader reader,
String baseURI,
RDFFormat dataFormat,
Resource... contexts) |
void |
add(Resource subject,
URI predicate,
Value object,
Resource... contexts) |
void |
add(Statement st,
Resource... contexts) |
void |
add(URL url,
RDFFormat dataFormat,
Resource... contexts) |
void |
add(URL url,
String baseURI,
RDFFormat dataFormat,
Resource... contexts) |
void |
clear(Resource... contexts) |
void |
export(RDFHandler handler,
Resource... contexts) |
void |
exportStatements(Resource subj,
URI pred,
Value obj,
boolean includeInferred,
RDFHandler handler,
Resource... contexts) |
void |
exportStatements(Resource subj,
URI pred,
Value obj,
RDFHandler handler,
Resource... contexts)
Exports all statements with a specific subject, predicate and/or object
from the repository, optionally from the specified contexts.
|
URI[] |
getAddContexts()
Deprecated.
|
URI[] |
getArchiveContexts()
Deprecated.
|
String |
getBaseURI() |
URI |
getInsertContext()
The default context to add the statements to.
|
int |
getMaxQueryTime() |
QueryLanguage |
getQueryLanguage() |
URI[] |
getReadContexts()
The default context(s) to get the data from.
|
URI[] |
getRemoveContexts()
The context(s) to remove the data from.
|
RepositoryResult<Statement> |
getStatements(Resource subj,
URI pred,
Value obj,
boolean includeInferred,
Resource... contexts) |
RepositoryResult<Statement> |
getStatements(Resource subj,
URI pred,
Value obj,
Resource... contexts)
Gets all statements with a specific subject, predicate and/or object from
the repository.
|
boolean |
hasStatement(Resource subj,
URI pred,
Value obj,
boolean includeInferred,
Resource... contexts) |
boolean |
hasStatement(Resource subj,
URI pred,
Value obj,
Resource... contexts)
Checks whether the repository contains statements with a specific subject,
predicate and/or object, optionally in the specified contexts.
|
boolean |
hasStatement(Statement st,
boolean includeInferred,
Resource... contexts) |
boolean |
hasStatement(Statement st,
Resource... contexts)
Checks whether the repository contains the specified statement, optionally
in the specified contexts.
|
protected boolean |
isDelegatingRemove() |
boolean |
isIncludeInferred()
if false, no inferred statements are considered; if true, inferred
statements are considered if available
|
BooleanQuery |
prepareBooleanQuery(QueryLanguage ql,
String query) |
BooleanQuery |
prepareBooleanQuery(QueryLanguage ql,
String query,
String baseURI) |
GraphQuery |
prepareGraphQuery(QueryLanguage ql,
String query) |
GraphQuery |
prepareGraphQuery(QueryLanguage ql,
String query,
String baseURI) |
GraphQuery |
prepareGraphQuery(String query) |
Query |
prepareQuery(QueryLanguage ql,
String query) |
Query |
prepareQuery(QueryLanguage ql,
String query,
String baseURI) |
Query |
prepareQuery(String query) |
TupleQuery |
prepareTupleQuery(QueryLanguage ql,
String query) |
TupleQuery |
prepareTupleQuery(QueryLanguage ql,
String query,
String baseURI) |
TupleQuery |
prepareTupleQuery(String query) |
Update |
prepareUpdate(QueryLanguage ql,
String query) |
Update |
prepareUpdate(QueryLanguage ql,
String update,
String baseURI) |
Update |
prepareUpdate(String query) |
void |
remove(Iterable<? extends Statement> statements,
Resource... contexts) |
<E extends Exception> |
remove(Iteration<? extends Statement,E> statementIter,
Resource... contexts)
Removes the supplied statements from a specific context in this
repository, ignoring any context information carried by the statements
themselves.
|
void |
remove(Resource subject,
URI predicate,
Value object,
Resource... contexts)
Removes the statement with the specified subject, predicate and object
from the repository, optionally restricted to the specified contexts.
|
void |
remove(Statement st,
Resource... contexts)
Removes the supplied statement from the specified contexts in the
repository.
|
protected void |
removeWithoutCommit(Resource subject,
URI predicate,
Value object,
Resource... contexts) |
void |
setAddContexts(URI... addContexts)
Deprecated.
|
void |
setArchiveContexts(URI... archiveContexts)
Deprecated.
|
void |
setBaseURI(String baseURI) |
void |
setIncludeInferred(boolean includeInferred)
if false, no inferred statements are considered; if true, inferred
statements are considered if available
|
void |
setInsertContext(URI insertContext)
The default context to add the statements to.
|
void |
setMaxQueryTime(int maxQueryTime) |
void |
setQueryLanguage(QueryLanguage ql) |
void |
setReadContexts(URI... readContexts)
The default context(s) to get the data from.
|
void |
setRemoveContexts(URI... removeContexts)
The context(s) to remove the data from.
|
long |
size(Resource... contexts)
Returns the number of (explicit) statements that are in the specified
contexts in this repository.
|
addWithoutCommit, begin, clearNamespaces, close, commit, exportStatements, getContextIDs, getDelegate, getNamespace, getNamespaces, isActive, isAutoCommit, isDelegatingAdd, isDelegatingRead, isEmpty, isOpen, removeNamespace, rollback, setAutoCommit, setDelegate, setNamespace, setParserConfigaddWithoutCommit, conditionalCommit, conditionalRollback, getParserConfig, getRepository, getValueFactory, removeWithoutCommit, startLocalTransactionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetParserConfig, getRepository, getValueFactorypublic ContextAwareConnection(Repository repository) throws RepositoryException
RepositoryExceptionpublic ContextAwareConnection(RepositoryConnection connection) throws RepositoryException
RepositoryExceptionpublic ContextAwareConnection(Repository repository, RepositoryConnection connection) throws RepositoryException
RepositoryExceptionprotected boolean isDelegatingRemove()
throws RepositoryException
isDelegatingRemove in class RepositoryConnectionWrapperRepositoryExceptionpublic boolean isIncludeInferred()
public void setIncludeInferred(boolean includeInferred)
public int getMaxQueryTime()
public void setMaxQueryTime(int maxQueryTime)
public QueryLanguage getQueryLanguage()
public void setQueryLanguage(QueryLanguage ql)
public String getBaseURI()
public void setBaseURI(String baseURI)
baseURI - The default baseURI to set.public URI[] getReadContexts()
public void setReadContexts(URI... readContexts)
@Deprecated public URI[] getAddContexts()
@Deprecated public void setAddContexts(URI... addContexts)
public URI[] getRemoveContexts()
public void setRemoveContexts(URI... removeContexts)
@Deprecated public URI[] getArchiveContexts()
@Deprecated public void setArchiveContexts(URI... archiveContexts)
public URI getInsertContext()
public void setInsertContext(URI insertContext)
public void add(File file, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException
public void add(File file, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException
add in interface RepositoryConnectionadd in class RepositoryConnectionWrapperIOExceptionRDFParseExceptionRepositoryExceptionpublic void add(InputStream in, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException
public void add(InputStream in, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException
add in interface RepositoryConnectionadd in class RepositoryConnectionWrapperIOExceptionRDFParseExceptionRepositoryExceptionpublic void add(Iterable<? extends Statement> statements, Resource... contexts) throws RepositoryException
add in interface RepositoryConnectionadd in class RepositoryConnectionWrapperRepositoryExceptionpublic <E extends Exception> void add(Iteration<? extends Statement,E> statementIter, Resource... contexts) throws RepositoryException, E extends Exception
add in interface RepositoryConnectionadd in class RepositoryConnectionWrapperRepositoryExceptionE extends Exceptionpublic void add(Reader reader, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException
public void add(Reader reader, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException
add in interface RepositoryConnectionadd in class RepositoryConnectionWrapperIOExceptionRDFParseExceptionRepositoryExceptionpublic void add(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException
add in interface RepositoryConnectionadd in class RepositoryConnectionWrapperRepositoryExceptionpublic void add(Statement st, Resource... contexts) throws RepositoryException
add in interface RepositoryConnectionadd in class RepositoryConnectionWrapperRepositoryExceptionpublic void add(URL url, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException
public void add(URL url, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException
add in interface RepositoryConnectionadd in class RepositoryConnectionWrapperIOExceptionRDFParseExceptionRepositoryExceptionpublic void clear(Resource... contexts) throws RepositoryException
clear in interface RepositoryConnectionclear in class RepositoryConnectionWrapperRepositoryExceptionpublic void export(RDFHandler handler, Resource... contexts) throws RepositoryException, RDFHandlerException
export in interface RepositoryConnectionexport in class RepositoryConnectionBaseRepositoryExceptionRDFHandlerExceptionpublic void exportStatements(Resource subj, URI pred, Value obj, RDFHandler handler, Resource... contexts) throws RepositoryException, RDFHandlerException
subj - The subject, or null if the subject doesn't matter.pred - The predicate, or null if the predicate doesn't matter.obj - The object, or null if the object doesn't matter.handler - The handler that will handle the RDF data.RDFHandlerException - If the handler encounters an unrecoverable error.RepositoryExceptiongetReadContexts(),
isIncludeInferred()public void exportStatements(Resource subj, URI pred, Value obj, boolean includeInferred, RDFHandler handler, Resource... contexts) throws RepositoryException, RDFHandlerException
exportStatements in interface RepositoryConnectionexportStatements in class RepositoryConnectionWrapperRepositoryExceptionRDFHandlerExceptionpublic RepositoryResult<Statement> getStatements(Resource subj, URI pred, Value obj, Resource... contexts) throws RepositoryException
subj - A Resource specifying the subject, or null for a wildcard.pred - A URI specifying the predicate, or null for a wildcard.obj - A Value specifying the object, or null for a wildcard.RepositoryResult object, a lazy Iterator-like object
containing Statements and optionally throwing a
RepositoryException when an error when a problem occurs
during retrieval.RepositoryExceptiongetReadContexts(),
isIncludeInferred()public RepositoryResult<Statement> getStatements(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException
getStatements in interface RepositoryConnectiongetStatements in class RepositoryConnectionWrapperRepositoryExceptionpublic boolean hasStatement(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException
hasStatement in interface RepositoryConnectionhasStatement in class RepositoryConnectionWrapperRepositoryExceptionpublic boolean hasStatement(Statement st, boolean includeInferred, Resource... contexts) throws RepositoryException
hasStatement in interface RepositoryConnectionhasStatement in class RepositoryConnectionWrapperRepositoryExceptionpublic boolean hasStatement(Resource subj, URI pred, Value obj, Resource... contexts) throws RepositoryException
subj - A Resource specifying the subject, or null for a wildcard.pred - A URI specifying the predicate, or null for a wildcard.obj - A Value specifying the object, or null for a wildcard.RepositoryExceptiongetReadContexts(),
isIncludeInferred()public boolean hasStatement(Statement st, Resource... contexts) throws RepositoryException
st - The statement to look for. Context information in the statement is
ignored.RepositoryExceptiongetReadContexts(),
isIncludeInferred()public GraphQuery prepareGraphQuery(String query) throws MalformedQueryException, RepositoryException
public Query prepareQuery(String query) throws MalformedQueryException, RepositoryException
public TupleQuery prepareTupleQuery(String query) throws MalformedQueryException, RepositoryException
public Update prepareUpdate(String query) throws MalformedQueryException, RepositoryException
public GraphQuery prepareGraphQuery(QueryLanguage ql, String query) throws MalformedQueryException, RepositoryException
prepareGraphQuery in interface RepositoryConnectionprepareGraphQuery in class RepositoryConnectionBaseMalformedQueryExceptionRepositoryExceptionpublic Query prepareQuery(QueryLanguage ql, String query) throws MalformedQueryException, RepositoryException
prepareQuery in interface RepositoryConnectionprepareQuery in class RepositoryConnectionBaseMalformedQueryExceptionRepositoryExceptionpublic TupleQuery prepareTupleQuery(QueryLanguage ql, String query) throws MalformedQueryException, RepositoryException
prepareTupleQuery in interface RepositoryConnectionprepareTupleQuery in class RepositoryConnectionBaseMalformedQueryExceptionRepositoryExceptionpublic BooleanQuery prepareBooleanQuery(QueryLanguage ql, String query) throws MalformedQueryException, RepositoryException
prepareBooleanQuery in interface RepositoryConnectionprepareBooleanQuery in class RepositoryConnectionBaseMalformedQueryExceptionRepositoryExceptionpublic Update prepareUpdate(QueryLanguage ql, String query) throws MalformedQueryException, RepositoryException
prepareUpdate in interface RepositoryConnectionprepareUpdate in class RepositoryConnectionBaseMalformedQueryExceptionRepositoryExceptionpublic GraphQuery prepareGraphQuery(QueryLanguage ql, String query, String baseURI) throws MalformedQueryException, RepositoryException
prepareGraphQuery in interface RepositoryConnectionprepareGraphQuery in class RepositoryConnectionWrapperMalformedQueryExceptionRepositoryExceptionpublic Query prepareQuery(QueryLanguage ql, String query, String baseURI) throws MalformedQueryException, RepositoryException
prepareQuery in interface RepositoryConnectionprepareQuery in class RepositoryConnectionWrapperMalformedQueryExceptionRepositoryExceptionpublic TupleQuery prepareTupleQuery(QueryLanguage ql, String query, String baseURI) throws MalformedQueryException, RepositoryException
prepareTupleQuery in interface RepositoryConnectionprepareTupleQuery in class RepositoryConnectionWrapperMalformedQueryExceptionRepositoryExceptionpublic BooleanQuery prepareBooleanQuery(QueryLanguage ql, String query, String baseURI) throws MalformedQueryException, RepositoryException
prepareBooleanQuery in interface RepositoryConnectionprepareBooleanQuery in class RepositoryConnectionWrapperMalformedQueryExceptionRepositoryExceptionpublic Update prepareUpdate(QueryLanguage ql, String update, String baseURI) throws MalformedQueryException, RepositoryException
prepareUpdate in interface RepositoryConnectionprepareUpdate in class RepositoryConnectionWrapperMalformedQueryExceptionRepositoryExceptionpublic void remove(Iterable<? extends Statement> statements, Resource... contexts) throws RepositoryException
remove in interface RepositoryConnectionremove in class RepositoryConnectionWrapperRepositoryExceptionpublic <E extends Exception> void remove(Iteration<? extends Statement,E> statementIter, Resource... contexts) throws RepositoryException, E extends Exception
remove in interface RepositoryConnectionremove in class RepositoryConnectionWrapperstatementIter - The statements to remove. In case the iterator is a
CloseableIteration, it will be closed before this method
returns.RepositoryException - If the statements could not be removed from the repository, for
example because the repository is not writable.E extends ExceptiongetRemoveContexts()public void remove(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException
remove in interface RepositoryConnectionremove in class RepositoryConnectionWrappersubject - The statement's subject.predicate - The statement's predicate.object - The statement's object.RepositoryException - If the statement could not be removed from the repository, for
example because the repository is not writable.getRemoveContexts()public void remove(Statement st, Resource... contexts) throws RepositoryException
remove in interface RepositoryConnectionremove in class RepositoryConnectionWrapperst - The statement to remove.RepositoryException - If the statement could not be removed from the repository, for
example because the repository is not writable.getRemoveContexts()public long size(Resource... contexts) throws RepositoryException
size in interface RepositoryConnectionsize in class RepositoryConnectionWrapperRepositoryExceptiongetReadContexts()protected void removeWithoutCommit(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException
removeWithoutCommit in class RepositoryConnectionWrapperRepositoryExceptionCopyright © 2001-2014 Aduna. All Rights Reserved.