public class SPARQLConnection extends RepositoryConnectionBase implements HttpClientDependent
RepositoryConnection interface to any SPARQL endpoint.logger| Constructor and Description |
|---|
SPARQLConnection(SPARQLRepository repository,
SparqlSession client) |
SPARQLConnection(SPARQLRepository repository,
SparqlSession client,
boolean quadMode) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(File file,
String baseURI,
RDFFormat dataFormat,
Resource... contexts) |
void |
add(InputStream in,
String baseURI,
RDFFormat dataFormat,
Resource... contexts) |
void |
add(Iterable<? extends Statement> statements,
Resource... contexts) |
void |
add(Reader reader,
String baseURI,
RDFFormat dataFormat,
Resource... contexts) |
void |
add(Statement st,
Resource... contexts) |
void |
add(URL url,
String baseURI,
RDFFormat dataFormat,
Resource... contexts) |
protected void |
addWithoutCommit(Resource subject,
URI predicate,
Value object,
Resource... contexts) |
void |
begin() |
void |
clear(Resource... contexts) |
void |
clearNamespaces() |
void |
commit() |
void |
exportStatements(Resource subj,
URI pred,
Value obj,
boolean includeInferred,
RDFHandler handler,
Resource... contexts) |
RepositoryResult<Resource> |
getContextIDs() |
org.apache.http.client.HttpClient |
getHttpClient() |
String |
getNamespace(String prefix) |
RepositoryResult<Namespace> |
getNamespaces() |
SPARQLRepository |
getRepository() |
RepositoryResult<Statement> |
getStatements(Resource subj,
URI pred,
Value obj,
boolean includeInferred,
Resource... contexts) |
boolean |
hasStatement(Resource subj,
URI pred,
Value obj,
boolean includeInferred,
Resource... contexts) |
boolean |
isActive() |
boolean |
isEmpty() |
protected boolean |
isQuadMode()
Shall graph information also be retrieved,
e.g.
|
BooleanQuery |
prepareBooleanQuery(QueryLanguage ql,
String query,
String base) |
GraphQuery |
prepareGraphQuery(QueryLanguage ql,
String query,
String base) |
Query |
prepareQuery(QueryLanguage ql,
String query,
String base) |
TupleQuery |
prepareTupleQuery(QueryLanguage ql,
String query,
String base) |
Update |
prepareUpdate(QueryLanguage ql,
String update,
String baseURI) |
void |
remove(Iterable<? extends Statement> statements,
Resource... contexts) |
void |
remove(Statement st,
Resource... contexts) |
void |
removeNamespace(String prefix) |
protected void |
removeWithoutCommit(Resource subject,
URI predicate,
Value object,
Resource... contexts) |
void |
rollback() |
void |
setHttpClient(org.apache.http.client.HttpClient httpClient) |
void |
setNamespace(String prefix,
String name) |
long |
size(Resource... contexts) |
protected Iteration<Statement,QueryEvaluationException> |
toStatementIteration(TupleQueryResult iter,
Resource subj,
URI pred,
Value obj)
Converts a
TupleQueryResult resulting from the EVERYTHING_WITH_GRAPH
to a statement by using the respective values from the BindingSet or (if
provided) the ones from the arguments. |
String |
toString() |
add, add, addWithoutCommit, begin, close, conditionalCommit, conditionalRollback, export, getIsolationLevel, getParserConfig, getValueFactory, hasStatement, isAutoCommit, isOpen, prepareBooleanQuery, prepareGraphQuery, prepareQuery, prepareTupleQuery, prepareUpdate, remove, remove, removeWithoutCommit, setAutoCommit, setIsolationLevel, setParserConfig, startLocalTransactionpublic SPARQLConnection(SPARQLRepository repository, SparqlSession client)
public SPARQLConnection(SPARQLRepository repository, SparqlSession client, boolean quadMode)
public final org.apache.http.client.HttpClient getHttpClient()
getHttpClient in interface HttpClientDependentpublic void setHttpClient(org.apache.http.client.HttpClient httpClient)
setHttpClient in interface HttpClientDependentpublic void exportStatements(Resource subj, URI pred, Value obj, boolean includeInferred, RDFHandler handler, Resource... contexts) throws RepositoryException, RDFHandlerException
exportStatements in interface RepositoryConnectionRepositoryExceptionRDFHandlerExceptionpublic RepositoryResult<Resource> getContextIDs() throws RepositoryException
getContextIDs in interface RepositoryConnectionRepositoryExceptionpublic String getNamespace(String prefix) throws RepositoryException
getNamespace in interface RepositoryConnectionRepositoryExceptionpublic RepositoryResult<Namespace> getNamespaces() throws RepositoryException
getNamespaces in interface RepositoryConnectionRepositoryExceptionpublic boolean isEmpty()
throws RepositoryException
isEmpty in interface RepositoryConnectionisEmpty in class RepositoryConnectionBaseRepositoryExceptionpublic long size(Resource... contexts) throws RepositoryException
size in interface RepositoryConnectionRepositoryExceptionpublic RepositoryResult<Statement> getStatements(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException
getStatements in interface RepositoryConnectionRepositoryExceptionpublic boolean hasStatement(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException
hasStatement in interface RepositoryConnectionhasStatement in class RepositoryConnectionBaseRepositoryExceptionpublic SPARQLRepository getRepository()
getRepository in interface RepositoryConnectiongetRepository in class RepositoryConnectionBasepublic Query prepareQuery(QueryLanguage ql, String query, String base) throws RepositoryException, MalformedQueryException
prepareQuery in interface RepositoryConnectionRepositoryExceptionMalformedQueryExceptionpublic BooleanQuery prepareBooleanQuery(QueryLanguage ql, String query, String base) throws RepositoryException, MalformedQueryException
prepareBooleanQuery in interface RepositoryConnectionRepositoryExceptionMalformedQueryExceptionpublic GraphQuery prepareGraphQuery(QueryLanguage ql, String query, String base) throws RepositoryException, MalformedQueryException
prepareGraphQuery in interface RepositoryConnectionRepositoryExceptionMalformedQueryExceptionpublic TupleQuery prepareTupleQuery(QueryLanguage ql, String query, String base) throws RepositoryException, MalformedQueryException
prepareTupleQuery in interface RepositoryConnectionRepositoryExceptionMalformedQueryExceptionpublic void commit()
throws RepositoryException
commit in interface RepositoryConnectionRepositoryExceptionpublic void rollback()
throws RepositoryException
rollback in interface RepositoryConnectionRepositoryExceptionpublic void begin()
throws RepositoryException
begin in interface RepositoryConnectionRepositoryExceptionpublic void add(File file, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException
add in interface RepositoryConnectionadd in class RepositoryConnectionBaseIOExceptionRDFParseExceptionRepositoryExceptionpublic void add(URL url, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException
add in interface RepositoryConnectionadd in class RepositoryConnectionBaseIOExceptionRDFParseExceptionRepositoryExceptionpublic void add(InputStream in, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException
add in interface RepositoryConnectionadd in class RepositoryConnectionBaseIOExceptionRDFParseExceptionRepositoryExceptionpublic void add(Reader reader, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException
add in interface RepositoryConnectionadd in class RepositoryConnectionBaseIOExceptionRDFParseExceptionRepositoryExceptionpublic void add(Statement st, Resource... contexts) throws RepositoryException
add in interface RepositoryConnectionadd in class RepositoryConnectionBaseRepositoryExceptionpublic void add(Iterable<? extends Statement> statements, Resource... contexts) throws RepositoryException
add in interface RepositoryConnectionadd in class RepositoryConnectionBaseRepositoryExceptionpublic void clear(Resource... contexts) throws RepositoryException
clear in interface RepositoryConnectionclear in class RepositoryConnectionBaseRepositoryExceptionpublic void clearNamespaces()
throws RepositoryException
clearNamespaces in interface RepositoryConnectionRepositoryExceptionpublic void remove(Statement st, Resource... contexts) throws RepositoryException
remove in interface RepositoryConnectionremove in class RepositoryConnectionBaseRepositoryExceptionpublic void remove(Iterable<? extends Statement> statements, Resource... contexts) throws RepositoryException
remove in interface RepositoryConnectionremove in class RepositoryConnectionBaseRepositoryExceptionpublic void removeNamespace(String prefix) throws RepositoryException
removeNamespace in interface RepositoryConnectionRepositoryExceptionpublic void setNamespace(String prefix, String name) throws RepositoryException
setNamespace in interface RepositoryConnectionRepositoryExceptionpublic Update prepareUpdate(QueryLanguage ql, String update, String baseURI) throws RepositoryException, MalformedQueryException
prepareUpdate in interface RepositoryConnectionRepositoryExceptionMalformedQueryExceptionpublic boolean isActive()
throws UnknownTransactionStateException,
RepositoryException
isActive in interface RepositoryConnectionUnknownTransactionStateExceptionRepositoryExceptionprotected void addWithoutCommit(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException
addWithoutCommit in class RepositoryConnectionBaseRepositoryExceptionprotected void removeWithoutCommit(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException
removeWithoutCommit in class RepositoryConnectionBaseRepositoryExceptionprotected boolean isQuadMode()
protected Iteration<Statement,QueryEvaluationException> toStatementIteration(TupleQueryResult iter, Resource subj, URI pred, Value obj)
TupleQueryResult resulting from the EVERYTHING_WITH_GRAPH
to a statement by using the respective values from the BindingSet or (if
provided) the ones from the arguments.iter - the TupleQueryResultsubj - the subject Resource used as input or null if wildcard was usedpred - the predicate URI used as input or null if wildcard was usedobj - the object Value used as input or null if wildcard was usedCopyright © 2001-2016 Aduna. All Rights Reserved.