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
FieldsModifier and TypeFieldDescriptionprotected FedXConfigprotected FederatedServiceResolverprotected Fileprotected static final org.slf4j.Loggerprotected RepositoryResolverprotected FederationEvaluationStrategyFactoryprotected WriteStrategyFactory -
Method Summary
Modifier and TypeMethodDescriptioncreate()Create the federation using the provided configurationstatic FedXRepositorycreateFederation(File dataConfig) Create the federation with a specified data source configuration file (*.ttl).static FedXRepositorycreateFederation(List<Endpoint> endpoints) Create the federation by providing the endpoints to add.static FedXRepositorycreateSparqlFederation(List<String> sparqlEndpoints) Create a federation with the provided sparql endpointsstatic FedXFactoryCreate 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 theWriteStrategyFactoryto 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
Sailwrapped 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
Sailwrapped 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
Sailwrapped in aFedXRepository - Throws:
FedXException
-
newFederation
Create a new customizable FedX federation. Once all configuration is supplied, the Federation can be created usingcreate()- Returns:
- the
FedXFactorybuilder
-
withRepositoryResolver
-
withFederatedServiceResolver
-
withFederationEvaluationStrategyFactory
public FedXFactory withFederationEvaluationStrategyFactory(FederationEvaluationStrategyFactory strategyFactory) -
withWriteStrategyFactory
Specify theWriteStrategyFactoryto be used. If not explicitly set,DefaultWriteStrategyFactoryis used.- Parameters:
writeStrategyFactory- theWriteStrategyFactoryto 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,ResolvableRepositoryInformationandSPARQLRepositoryInformation.- 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
FedXFactoryinstance
-
create
Create the federation using the provided configuration- Returns:
- the configured
FedXRepository
-