Package org.eclipse.rdf4j.federated
Class FedXFactory
- java.lang.Object
-
- org.eclipse.rdf4j.federated.FedXFactory
-
public class FedXFactory extends Object
FedX initialization factory methods for convenience: methods initialize theFederationManagerand all required FedX structures. SeeFederationManagerfor some a code snippet.Use the
newFederation()builder to create an advanced and customized federation- Author:
- Andreas Schwarte
-
-
Field Summary
Fields Modifier and Type Field Description protected FedXConfigconfigprotected FederatedServiceResolverfederatedServiceResolverprotected FilefedxBaseDirprotected static org.slf4j.Loggerlogprotected List<Endpoint>membersprotected RepositoryResolverrepositoryResolverprotected FederationEvaluationStrategyFactorystrategyFactoryprotected WriteStrategyFactorywriteStrategyFactory
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FedXRepositorycreate()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 FedXFactorynewFederation()Create a new customizable FedX federation.FedXFactorywithConfig(FedXConfig config)FedXFactorywithFederatedServiceResolver(FederatedServiceResolver federatedServiceResolver)FedXFactorywithFederationEvaluationStrategyFactory(FederationEvaluationStrategyFactory strategyFactory)FedXFactorywithFedXBaseDir(File fedxBaseDir)Configure the FedX base directory at federation construction time.FedXFactorywithMembers(File dataConfig)FedXFactorywithMembers(List<Endpoint> endpoints)FedXFactorywithMembers(Model model)Initialize the federation with members from the model.FedXFactorywithRepositoryResolver(RepositoryResolver repositoryResolver)FedXFactorywithResolvableEndpoint(String repositoryId)FedXFactorywithResolvableEndpoint(String repositoryId, boolean writable)FedXFactorywithSparqlEndpoint(String sparqlEndpoint)FedXFactorywithSparqlEndpoints(List<String> sparqlEndpoints)FedXFactorywithWriteStrategyFactory(WriteStrategyFactory writeStrategyFactory)Specify theWriteStrategyFactoryto be used.
-
-
-
Field Detail
-
log
protected static final org.slf4j.Logger log
-
repositoryResolver
protected RepositoryResolver repositoryResolver
-
federatedServiceResolver
protected FederatedServiceResolver federatedServiceResolver
-
strategyFactory
protected FederationEvaluationStrategyFactory strategyFactory
-
writeStrategyFactory
protected WriteStrategyFactory writeStrategyFactory
-
config
protected FedXConfig config
-
fedxBaseDir
protected File fedxBaseDir
-
-
Method Detail
-
createSparqlFederation
public static FedXRepository createSparqlFederation(List<String> sparqlEndpoints)
Create a federation with the provided sparql endpoints- Parameters:
sparqlEndpoints- the list of SPARQL endpoints- Returns:
- the configured FedX federation
Sailwrapped in aFedXRepository
-
createFederation
public static FedXRepository createFederation(File dataConfig)
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
-
createFederation
public static FedXRepository createFederation(List<Endpoint> endpoints) throws FedXException
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
public static FedXFactory newFederation()
Create a new customizable FedX federation. Once all configuration is supplied, the Federation can be created usingcreate()- Returns:
- the
FedXFactorybuilder
-
withRepositoryResolver
public FedXFactory withRepositoryResolver(RepositoryResolver repositoryResolver)
-
withFederatedServiceResolver
public FedXFactory withFederatedServiceResolver(FederatedServiceResolver federatedServiceResolver)
-
withFederationEvaluationStrategyFactory
public FedXFactory withFederationEvaluationStrategyFactory(FederationEvaluationStrategyFactory strategyFactory)
-
withWriteStrategyFactory
public FedXFactory withWriteStrategyFactory(WriteStrategyFactory writeStrategyFactory)
Specify theWriteStrategyFactoryto be used. If not explicitly set,DefaultWriteStrategyFactoryis used.- Parameters:
writeStrategyFactory- theWriteStrategyFactoryto be used.- Returns:
- this factory
-
withMembers
public FedXFactory withMembers(List<Endpoint> endpoints)
-
withMembers
public FedXFactory withMembers(File dataConfig)
-
withMembers
public FedXFactory withMembers(Model model)
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
public FedXFactory withSparqlEndpoint(String sparqlEndpoint)
-
withSparqlEndpoints
public FedXFactory withSparqlEndpoints(List<String> sparqlEndpoints)
-
withResolvableEndpoint
public FedXFactory withResolvableEndpoint(String repositoryId)
-
withResolvableEndpoint
public FedXFactory withResolvableEndpoint(String repositoryId, boolean writable)
-
withConfig
public FedXFactory withConfig(FedXConfig config)
-
withFedXBaseDir
public FedXFactory withFedXBaseDir(File fedxBaseDir)
Configure the FedX base directory at federation construction time.- Parameters:
fedxBaseDir- the fedx base directory- Returns:
- the
FedXFactoryinstance
-
create
public FedXRepository create()
Create the federation using the provided configuration- Returns:
- the configured
FedXRepository
-
-