Package org.eclipse.rdf4j.federated
Class FedXFactory
java.lang.Object
org.eclipse.rdf4j.federated.FedXFactory
FedX initialization factory methods for convenience: methods initialize the
FederationManager
and all
required FedX structures. See FederationManager
for some a code snippet.
Use the newFederation()
builder to create an advanced and customized federation
- Author:
- Andreas Schwarte
-
Field Summary
Modifier and TypeFieldDescriptionprotected FedXConfig
protected FederatedServiceResolver
protected File
protected static final org.slf4j.Logger
protected RepositoryResolver
protected FederationEvaluationStrategyFactory
protected WriteStrategyFactory
-
Method Summary
Modifier and TypeMethodDescriptioncreate()
Create the federation using the provided configurationstatic FedXRepository
createFederation
(File dataConfig) Create the federation with a specified data source configuration file (*.ttl).static FedXRepository
createFederation
(List<Endpoint> endpoints) Create the federation by providing the endpoints to add.static FedXRepository
createSparqlFederation
(List<String> sparqlEndpoints) Create a federation with the provided sparql endpointsstatic FedXFactory
Create a new customizable FedX federation.withConfig
(FedXConfig config) withFederatedServiceResolver
(FederatedServiceResolver federatedServiceResolver) withFedXBaseDir
(File fedxBaseDir) Configure the FedX base directory at federation construction time.withMembers
(File dataConfig) withMembers
(List<Endpoint> endpoints) withMembers
(Model model) Initialize the federation with members from the model.withRepositoryResolver
(RepositoryResolver repositoryResolver) withResolvableEndpoint
(String repositoryId) withResolvableEndpoint
(String repositoryId, boolean writable) withSparqlEndpoint
(String sparqlEndpoint) withSparqlEndpoints
(List<String> sparqlEndpoints) withWriteStrategyFactory
(WriteStrategyFactory writeStrategyFactory) Specify theWriteStrategyFactory
to be used.
-
Field Details
-
log
protected static final org.slf4j.Logger log -
repositoryResolver
-
federatedServiceResolver
-
strategyFactory
-
writeStrategyFactory
-
members
-
config
-
fedxBaseDir
-
-
Method Details
-
createSparqlFederation
Create a federation with the provided sparql endpoints- Parameters:
sparqlEndpoints
- the list of SPARQL endpoints- Returns:
- the configured FedX federation
Sail
wrapped in aFedXRepository
- Throws:
Exception
-
createFederation
Create the federation with a specified data source configuration file (*.ttl). Federation members are constructed from the data source configuration. Sample data source configuration files can be found in the documentation.- Parameters:
dataConfig
- the location of the data source configuration- Returns:
- the configured FedX federation
Sail
wrapped in aFedXRepository
- Throws:
Exception
-
createFederation
Create the federation by providing the endpoints to add. The fedx configuration can provide information about the dataConfig to be used which may contain the default federation members.- Parameters:
endpoints
- additional endpoints to be added, may be null or empty- Returns:
- the configured FedX federation
Sail
wrapped in aFedXRepository
- Throws:
FedXException
-
newFederation
Create a new customizable FedX federation. Once all configuration is supplied, the Federation can be created usingcreate()
- Returns:
- the
FedXFactory
builder
-
withRepositoryResolver
-
withFederatedServiceResolver
-
withFederationEvaluationStrategyFactory
public FedXFactory withFederationEvaluationStrategyFactory(FederationEvaluationStrategyFactory strategyFactory) -
withWriteStrategyFactory
Specify theWriteStrategyFactory
to be used. If not explicitly set,DefaultWriteStrategyFactory
is used.- Parameters:
writeStrategyFactory
- theWriteStrategyFactory
to be used.- Returns:
- this factory
-
withMembers
-
withMembers
-
withMembers
Initialize the federation with members from the model.Currently the types NativeStore, ResolvableEndpoint and SPARQLEndpoint are supported. For details please refer to the documentation in
NativeRepositoryInformation
,ResolvableRepositoryInformation
andSPARQLRepositoryInformation
.- Parameters:
model
- the model defining the federation members- Returns:
- the factory
-
withSparqlEndpoint
-
withSparqlEndpoints
-
withResolvableEndpoint
-
withResolvableEndpoint
-
withConfig
-
withFedXBaseDir
Configure the FedX base directory at federation construction time.- Parameters:
fedxBaseDir
- the fedx base directory- Returns:
- the
FedXFactory
instance
-
create
Create the federation using the provided configuration- Returns:
- the configured
FedXRepository
-