org.eclipse.rdf4j.sail

## Interface Sail

- All Known Subinterfaces:
    NotifyingSail, StackableSail
  All Known Implementing Classes:
    AbstractForwardChainingInferencer, AbstractNotifyingSail, AbstractSail, CustomGraphQueryInferencer, DedupingInferencer, DirectTypeHierarchyInferencer, ElasticsearchStore, ExtensibleStore, Federation, FedX, FedXConnection.SailBaseDefaultImpl, ForwardChainingRDFSInferencer, LimitedSizeNativeStore, LuceneSail, LuceneSpinSail, MemoryStore, NativeStore, NotifyingSailBase, NotifyingSailWrapper, SailBase, SailWrapper, SchemaCachingRDFSInferencer, ShaclSail, SpinSail

      public interface Sail

  Sail (Storage And Inference Layer) is an interface for RDF storage. RDF Sails can store RDF statements and evaluate queries over them. Statements can be stored in named contexts or in the null context. Contexts can be used to group sets of statements that logically belong together, for example because they come from the same source. Both URIs and blank nodes can be used as context identifiers.
  Author:
    Arjohn Kampman

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `SailConnection` | `getConnection()` Opens a connection on the Sail which can be used to query and update data.
    `File` | `getDataDir()` Gets the Sail's data directory.
    `IsolationLevel` | `getDefaultIsolationLevel()` Retrieves the default `IsolationLevel` level on which transactions in this Sail operate.
    `List<IsolationLevel>` | `getSupportedIsolationLevels()` Retrieve the `IsolationLevel`s supported by this SAIL, ordered by increasing complexity.
    `ValueFactory` | `getValueFactory()` Gets a ValueFactory object that can be used to create IRI-, blank node-, literal- and statement objects.
    `default void` | `init()` Initializes the Sail.
    `void` | `initialize()` Deprecated. Use {`init()` instead.
    `boolean` | `isWritable()` Checks whether this Sail object is writable, i.e.
    `void` | `setDataDir(File dataDir)` Sets the data directory for the Sail.
    `void` | `shutDown()` Shuts down the Sail, giving it the opportunity to synchronize any stale data.

- - ### Method Detail

    - #### setDataDir

          void setDataDir(File dataDir)

      Sets the data directory for the Sail. The Sail can use this directory for storage of data, parameters, etc. This directory must be set before the Sail is `initialized`.
      Throws:
        `IllegalStateException` - If this method is called when the Sail has already been initialized.

    - #### getDataDir

          File getDataDir()

      Gets the Sail's data directory.
      See Also:
        `setDataDir(File)`

    - #### initialize

          @Deprecated
          void initialize()
                               throws SailException

      Deprecated. Use {`init()` instead.
      Initializes the Sail. Care should be taken that required initialization parameters have been set before this method is called. Please consult the specific Sail implementation for information about the relevant parameters.
      Throws:
        `SailException` - If the Sail could not be initialized.

    - #### init

          default void init()
                     throws SailException

      Initializes the Sail. Care should be taken that required initialization parameters have been set before this method is called. Please consult the specific Sail implementation for information about the relevant parameters.
      Throws:
        `SailException` - If the Sail could not be initialized.
      Since:
        2.5

    - #### shutDown

          void shutDown()
                 throws SailException

      Shuts down the Sail, giving it the opportunity to synchronize any stale data. Care should be taken that all initialized Sails are being shut down before an application exits to avoid potential loss of data. Once shut down, a Sail can no longer be used until it is re-initialized.
      Throws:
        `SailException` - If the Sail object encountered an error or unexpected situation internally.

    - #### isWritable

          boolean isWritable()
                      throws SailException

      Checks whether this Sail object is writable, i.e. if the data contained in this Sail object can be changed.
      Throws:
        `SailException`

    - #### getConnection

          SailConnection getConnection()
                                throws SailException

      Opens a connection on the Sail which can be used to query and update data. Depending on how the implementation handles concurrent access, a call to this method might block when there is another open connection on this Sail.
      Throws:
        `SailException` - If no transaction could be started, for example because the Sail is not writable.
        `IllegalStateException` - If the Sail has not been initialized or has been shut down.

    - #### getValueFactory

          ValueFactory getValueFactory()

      Gets a ValueFactory object that can be used to create IRI-, blank node-, literal- and statement objects.
      Returns:
        a ValueFactory object for this Sail object.

    - #### getSupportedIsolationLevels

          List<IsolationLevel> getSupportedIsolationLevels()

      Retrieve the `IsolationLevel`s supported by this SAIL, ordered by increasing complexity.
      Returns:
        a non-empty List of supported Isolation Levels, in order of increasing complexity. Every SAIL supports at least one `IsolationLevel`.

    - #### getDefaultIsolationLevel

          IsolationLevel getDefaultIsolationLevel()

      Retrieves the default `IsolationLevel` level on which transactions in this Sail operate.
      Returns:
        the `IsolationLevel` that will be used with `SailConnection.begin()`, for SAIL connections returned by `getConnection()`.

Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.