public class RepositoryFederatedService extends Object implements FederatedService
Repository to communicate with a
SPARQL endpoint.| Modifier and Type | Field and Description |
|---|---|
protected RepositoryConnection |
conn |
protected Repository |
rep |
protected boolean |
shutDown |
| Constructor and Description |
|---|
RepositoryFederatedService(Repository repo) |
RepositoryFederatedService(Repository repo,
boolean shutDown) |
| Modifier and Type | Method and Description |
|---|---|
protected static StringBuilder |
appendLiteral(StringBuilder sb,
Literal lit)
Append the literal to the stringbuilder: "myLiteral"^^
|
protected static StringBuilder |
appendURI(StringBuilder sb,
URI uri)
Append the uri to the stringbuilder, i.e.
|
protected StringBuilder |
appendValueAsString(StringBuilder sb,
Value value) |
boolean |
ask(Service service,
BindingSet bindings,
String baseUri)
Evaluate the provided sparqlQueryString at the initialized
Repository of this FederatedService. |
CloseableIteration<BindingSet,QueryEvaluationException> |
evaluate(Service service,
CloseableIteration<BindingSet,QueryEvaluationException> bindings,
String baseUri) |
protected CloseableIteration<BindingSet,QueryEvaluationException> |
evaluateInternal(Service service,
CloseableIteration<BindingSet,QueryEvaluationException> bindings,
String baseUri)
Evaluate the SPARQL query that can be constructed from the SERVICE node at
the initialized
Repository of this FederatedService. |
protected RepositoryConnection |
getConnection() |
void |
initialize() |
boolean |
isInitialized() |
CloseableIteration<BindingSet,QueryEvaluationException> |
select(Service service,
Set<String> projectionVars,
BindingSet bindings,
String baseUri)
Evaluate the provided sparqlQueryString at the initialized
Repository of this FederatedService. |
void |
shutdown() |
protected final Repository rep
protected boolean shutDown
protected RepositoryConnection conn
public RepositoryFederatedService(Repository repo)
repo - the repository to be usedpublic RepositoryFederatedService(Repository repo, boolean shutDown)
repo - the repository to be usedshutDown - a flag indicating whether the repository shall be closed in shutdown()public CloseableIteration<BindingSet,QueryEvaluationException> select(Service service, Set<String> projectionVars, BindingSet bindings, String baseUri) throws QueryEvaluationException
Repository of this FederatedService. Insert bindings
into SELECT query and evaluateselect in interface FederatedServiceQueryEvaluationExceptionpublic boolean ask(Service service, BindingSet bindings, String baseUri) throws QueryEvaluationException
Repository of this FederatedService. Insert
bindings, send ask query and return final resultask in interface FederatedServiceQueryEvaluationExceptionpublic CloseableIteration<BindingSet,QueryEvaluationException> evaluate(Service service, CloseableIteration<BindingSet,QueryEvaluationException> bindings, String baseUri) throws QueryEvaluationException
evaluate in interface FederatedServiceQueryEvaluationExceptionprotected CloseableIteration<BindingSet,QueryEvaluationException> evaluateInternal(Service service, CloseableIteration<BindingSet,QueryEvaluationException> bindings, String baseUri) throws QueryEvaluationException
Repository of this FederatedService.
Use specified bindings as constraints to the query. Try to evaluate using
BINDINGS clause, if this yields an exception fall back to the naive
implementation. This method deals with SILENT SERVICEs.QueryEvaluationExceptionpublic void initialize()
throws QueryEvaluationException
initialize in interface FederatedServiceQueryEvaluationExceptionpublic boolean isInitialized()
isInitialized in interface FederatedServicepublic void shutdown()
throws QueryEvaluationException
shutdown in interface FederatedServiceQueryEvaluationExceptionprotected RepositoryConnection getConnection() throws RepositoryException
RepositoryExceptionprotected StringBuilder appendValueAsString(StringBuilder sb, Value value)
protected static StringBuilder appendURI(StringBuilder sb, URI uri)
sb - uri - protected static StringBuilder appendLiteral(StringBuilder sb, Literal lit)
sb - lit - Copyright © 2001-2015 Aduna. All Rights Reserved.