Class StorageBuilder

java.lang.Object
fr.inria.rules.integraal.storage.builder.StorageBuilder

public class StorageBuilder extends Object
This Builder creates storages for atoms according to the configuration
  • Constructor Details

    • StorageBuilder

      public StorageBuilder()
      Creates a storage builder with default factories and strategy.
  • Method Details

    • build

      public Optional<FactBase> build()
      Creates and return the FactStorage associated to the current configuration
      Returns:
      an optional containing the created storage if the configuration was correct or an empty optional otherwise.
    • defaultBuilder

      public static StorageBuilder defaultBuilder()
      Returns a builder configured with the default storage settings.
      Returns:
      a default configuration of the builder
    • defaultStorage

      public static FactBase defaultStorage()
      The default storage is a LightInMemoryGraphStore
      Returns:
      the default storage used by Graal
    • getSimpleInMemoryGraphStore

      public static SimpleInMemoryGraphStore getSimpleInMemoryGraphStore()
      Returns a simple in-memory graph store.
      Returns:
      a new SimpleInMemoryGraphStore
    • getLightInMemoryGraphStore

      public static LightInMemoryGraphStore getLightInMemoryGraphStore()
      Returns the light in-memory graph store implementation.
      Returns:
      a new LightInMemoryGraphStore
    • getDefaultInMemoryAtomSet

      public static DefaultInMemoryAtomSet getDefaultInMemoryAtomSet()
      Returns the default in-memory atom set implementation.
      Returns:
      a new DefaultInMemoryAtomSet
    • useHSQLDB

      public StorageBuilder useHSQLDB(String params)
      Configure this builder to use a HSQLDB driver with the given parameters
      Parameters:
      params - jdbc parameters
      Returns:
      this object
    • useMySQLDB

      public StorageBuilder useMySQLDB(String params)
      Configure this builder to use a MySQL driver with the given parameters
      Parameters:
      params - jdbc parameters
      Returns:
      this object
    • usePostgreSQLDB

      public StorageBuilder usePostgreSQLDB(String params)
      Configure this builder to use a Postgres driver with the given parameters
      Parameters:
      params - jdbc parameters
      Returns:
      this object
    • clearDBOnConstruction

      public StorageBuilder clearDBOnConstruction()
      Configure this builder to clear the database at construction
      Returns:
      this object
    • useSQLiteDB

      public StorageBuilder useSQLiteDB(String params)
      Configure this builder to use a SQLite driver with the given parameters
      Parameters:
      params - jdbc parameters
      Returns:
      this object
    • useSPARQLEndpoint

      public StorageBuilder useSPARQLEndpoint(String params)
      Configure this builder to use a SPARQL endpoint with the given parameters
      Parameters:
      params - rdf4j parameters, null for memory store
      Returns:
      this object
    • useAdHocSQLStrategy

      public StorageBuilder useAdHocSQLStrategy()
      Configure this builder to use a AdHoc storage strategy
      Returns:
      this object
    • useEncodingAdHocSQLStrategy

      public StorageBuilder useEncodingAdHocSQLStrategy()
      Configure this builder to use a AdHoc storage strategy with encoding
      Returns:
      this object
    • useNaturalSQLStrategy

      public StorageBuilder useNaturalSQLStrategy()
      Configure this builder to use a Natural SQL storage strategy
      Returns:
      this object
    • setTermFactory

      public StorageBuilder setTermFactory(TermFactory f)
      Directly sets the factory for terms for this builder as given by the user
      Parameters:
      f - the term factory
      Returns:
      this object
    • setPredicateFactory

      public StorageBuilder setPredicateFactory(PredicateFactory f)
      Directly sets the factory for predicates for this builder as given by the user
      Parameters:
      f - the predicate factory
      Returns:
      this object
    • setDriver

      public StorageBuilder setDriver(RDBMSDriver d)
      Directly sets the RDBMS driver for this builder as given by the user
      Parameters:
      d - the rdbms driver
      Returns:
      this object
    • setStorageStrategy

      public StorageBuilder setStorageStrategy(RDBMSStorageLayout s)
      Directly sets the storage strategy for this builder as given by the user
      Parameters:
      s - the rdbms storage strategy
      Returns:
      this object
    • setFactBase

      public StorageBuilder setFactBase(FactBase f)
      Directly sets the fact storage for this builder as given by the user
      Parameters:
      f - the factbase
      Returns:
      this object