Class FedXRepositoryConnection
- java.lang.Object
-
- org.eclipse.rdf4j.repository.base.AbstractRepositoryConnection
-
- org.eclipse.rdf4j.repository.sail.SailRepositoryConnection
-
- org.eclipse.rdf4j.federated.repository.FedXRepositoryConnection
-
- All Implemented Interfaces:
AutoCloseable,HttpClientDependent,SessionManagerDependent,FederatedServiceResolverClient,RepositoryConnection,RepositoryResolverClient
public class FedXRepositoryConnection extends SailRepositoryConnection
A specialSailRepositoryConnectionwhich adds the original query string as binding to the returned query. The binding name is defined byBINDING_ORIGINAL_QUERYand is added to all query instances returned by the available prepare methods.- Author:
- Andreas Schwarte
-
-
Field Summary
Fields Modifier and Type Field Description static StringBINDING_ORIGINAL_BASE_URIstatic StringBINDING_ORIGINAL_MAX_EXECUTION_TIMEstatic StringBINDING_ORIGINAL_QUERYWe add a binding to each parsed query mapping the original query in order to send the original query to the endpoint if there is only a single federation member is relevant for this query.static StringBINDING_ORIGINAL_QUERY_TYPEstatic Set<String>FEDX_BINDINGSThe number of bindings in the external binding set that are added by FedX.-
Fields inherited from class org.eclipse.rdf4j.repository.base.AbstractRepositoryConnection
logger
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFedXRepositoryConnection(FedXRepository repository, SailConnection sailConnection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SailBooleanQueryprepareBooleanQuery(QueryLanguage ql, String queryString, String baseURI)Prepares queries that return true or false.FedXGraphQueryprepareGraphQuery(QueryLanguage ql, String queryString, String baseURI)Prepares queries that produce RDF graphs.SailQueryprepareQuery(QueryLanguage ql, String queryString, String baseURI)Prepares a query for evaluation on this repository (optional operation).FedXTupleQueryprepareTupleQuery(QueryLanguage ql, String queryString, String baseURI)Prepares a query that produces sets of value tuples.UpdateprepareUpdate(QueryLanguage ql, String updateString, String baseURI)Prepares an Update operation.-
Methods inherited from class org.eclipse.rdf4j.repository.sail.SailRepositoryConnection
addWithoutCommit, begin, begin, begin, clear, clearNamespaces, close, commit, createRepositoryResult, exportStatements, getContextIDs, getFederatedServiceResolver, getHttpClient, getHttpClientSessionManager, getNamespace, getNamespaces, getSailConnection, getStatements, hasStatement, isActive, isEmpty, isOpen, prepare, removeNamespace, removeWithoutCommit, rollback, setFederatedServiceResolver, setHttpClient, setHttpClientSessionManager, setNamespace, setRepositoryResolver, size, toString
-
Methods inherited from class org.eclipse.rdf4j.repository.base.AbstractRepositoryConnection
add, add, add, add, add, add, add, add, addWithoutCommit, conditionalCommit, conditionalRollback, export, getIsolationLevel, getParserConfig, getRepository, getValueFactory, hasStatement, isAutoCommit, prepareBooleanQuery, prepareGraphQuery, prepareQuery, prepareTupleQuery, prepareUpdate, remove, remove, remove, remove, removeWithoutCommit, setAutoCommit, setIsolationLevel, setParserConfig, startLocalTransaction
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.repository.RepositoryConnection
add, add, add, add, add, add, add, add, getStatements, prepareBooleanQuery, prepareGraphQuery, prepareQuery, prepareTupleQuery, prepareUpdate, remove, remove
-
-
-
-
Field Detail
-
BINDING_ORIGINAL_QUERY
public static final String BINDING_ORIGINAL_QUERY
We add a binding to each parsed query mapping the original query in order to send the original query to the endpoint if there is only a single federation member is relevant for this query.- See Also:
- Constant Field Values
-
BINDING_ORIGINAL_BASE_URI
public static final String BINDING_ORIGINAL_BASE_URI
- See Also:
- Constant Field Values
-
BINDING_ORIGINAL_QUERY_TYPE
public static final String BINDING_ORIGINAL_QUERY_TYPE
- See Also:
- Constant Field Values
-
BINDING_ORIGINAL_MAX_EXECUTION_TIME
public static final String BINDING_ORIGINAL_MAX_EXECUTION_TIME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FedXRepositoryConnection
protected FedXRepositoryConnection(FedXRepository repository, SailConnection sailConnection)
-
-
Method Detail
-
prepareQuery
public SailQuery prepareQuery(QueryLanguage ql, String queryString, String baseURI) throws MalformedQueryException
Description copied from interface:RepositoryConnectionPrepares a query for evaluation on this repository (optional operation).If you already know the type of query, using the more specific
RepositoryConnection.prepareTupleQuery(java.lang.String),RepositoryConnection.prepareGraphQuery(java.lang.String)orRepositoryConnection.prepareBooleanQuery(java.lang.String)is likely to be more efficient.- Specified by:
prepareQueryin interfaceRepositoryConnection- Overrides:
prepareQueryin classSailRepositoryConnection- Parameters:
ql- Thequery languagein which the query is formulated.queryString- The query string.baseURI- The base URI to resolve any relative URIs that are in the query against, can be null if the query does not contain any relative URIs.- Returns:
- A query ready to be evaluated on this repository.
- Throws:
MalformedQueryException- If the supplied query is malformed.
-
prepareTupleQuery
public FedXTupleQuery prepareTupleQuery(QueryLanguage ql, String queryString, String baseURI) throws MalformedQueryException
Description copied from interface:RepositoryConnectionPrepares a query that produces sets of value tuples.- Specified by:
prepareTupleQueryin interfaceRepositoryConnection- Overrides:
prepareTupleQueryin classSailRepositoryConnection- Parameters:
ql- Thequery languagein which the query is formulated.queryString- The query string.baseURI- The base URI to resolve any relative URIs that are in the query against, can be null if the query does not contain any relative URIs.- Returns:
- a
TupleQueryready to be evaluated on thisRepositoryConnection. - Throws:
MalformedQueryException- If the supplied query is malformed.
-
prepareGraphQuery
public FedXGraphQuery prepareGraphQuery(QueryLanguage ql, String queryString, String baseURI) throws MalformedQueryException
Description copied from interface:RepositoryConnectionPrepares queries that produce RDF graphs.- Specified by:
prepareGraphQueryin interfaceRepositoryConnection- Overrides:
prepareGraphQueryin classSailRepositoryConnection- Parameters:
ql- Thequery languagein which the query is formulated.queryString- The query string.baseURI- The base URI to resolve any relative URIs that are in the query against, can be null if the query does not contain any relative URIs.- Returns:
- a
GraphQueryready to be evaluated on thisRepositoryConnection. - Throws:
MalformedQueryException- If the supplied query is malformed.
-
prepareBooleanQuery
public SailBooleanQuery prepareBooleanQuery(QueryLanguage ql, String queryString, String baseURI) throws MalformedQueryException
Description copied from interface:RepositoryConnectionPrepares queries that return true or false.- Specified by:
prepareBooleanQueryin interfaceRepositoryConnection- Overrides:
prepareBooleanQueryin classSailRepositoryConnection- Parameters:
ql- Thequery languagein which the query is formulated.queryString- The query string.baseURI- The base URI to resolve any relative URIs that are in the query against, can be null if the query does not contain any relative URIs.- Returns:
- a
BooleanQueryready to be evaluated on thisRepositoryConnection. - Throws:
MalformedQueryException- If the supplied query is malformed.
-
prepareUpdate
public Update prepareUpdate(QueryLanguage ql, String updateString, String baseURI) throws RepositoryException, MalformedQueryException
Description copied from interface:RepositoryConnectionPrepares an Update operation.- Specified by:
prepareUpdatein interfaceRepositoryConnection- Overrides:
prepareUpdatein classSailRepositoryConnection- Parameters:
ql- Thequery languagein which the update operation is formulated.updateString- The update operation string.baseURI- The base URI to resolve any relative URIs that are in the update against, can be null if the update does not contain any relative URIs.- Returns:
- a
Updateready to be executed on thisRepositoryConnection. - Throws:
MalformedQueryException- If the supplied update operation string is malformed.RepositoryException
-
-