Class FedXFactory

java.lang.Object
org.eclipse.rdf4j.federated.FedXFactory

public class FedXFactory extends Object
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 Details

  • Method Details

    • 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 Sail wrapped in a FedXRepository
    • 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 Sail wrapped in a FedXRepository
    • 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 Sail wrapped in a FedXRepository
      Throws:
      FedXException
    • newFederation

      public static FedXFactory newFederation()
      Create a new customizable FedX federation. Once all configuration is supplied, the Federation can be created using create()
      Returns:
      the FedXFactory builder
    • 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 the WriteStrategyFactory to be used. If not explicitly set, DefaultWriteStrategyFactory is used.
      Parameters:
      writeStrategyFactory - the WriteStrategyFactory to 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, ResolvableRepositoryInformation and SPARQLRepositoryInformation.

      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 FedXFactory instance
    • create

      public FedXRepository create()
      Create the federation using the provided configuration
      Returns:
      the configured FedXRepository