org.eclipse.rdf4j.sail.nativerdf

## Class ValueStore

- java.lang.Object
- - org.eclipse.rdf4j.model.impl.AbstractValueFactory
  - - org.eclipse.rdf4j.sail.nativerdf.ValueStore

- All Implemented Interfaces:
    ValueFactory

  Deprecated.
  since 3.0. This feature is for internal use only: its existence, signature or behavior may change without warning from one release to the next.

      @InternalUseOnly
       @Deprecated
      public class ValueStore
      extends AbstractValueFactory

  File-based indexed storage and retrieval of RDF values. ValueStore maps RDF values to integer IDs and vice-versa.
  Author:
    Arjohn Kampman

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `NAMESPACE_CACHE_SIZE` Deprecated. The default namespace cache size.
    `static int` | `NAMESPACE_ID_CACHE_SIZE` Deprecated. The default namespace id cache size.
    `static int` | `VALUE_CACHE_SIZE` Deprecated. The default value cache size.
    `static int` | `VALUE_ID_CACHE_SIZE` Deprecated. The default value id cache size.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ValueStore(File dataDir)` Deprecated.
    `ValueStore(File dataDir, boolean forceSync)` Deprecated.
    `ValueStore(File dataDir, boolean forceSync, int valueCacheSize, int valueIDCacheSize, int namespaceCacheSize, int namespaceIDCacheSize)` Deprecated.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkConsistency()` Deprecated. Checks that every value has exactly one ID.
    `void` | `clear()` Deprecated. Removes all values from the ValueStore.
    `void` | `close()` Deprecated. Closes the ValueStore, releasing any file references, etc.
    `NativeBNode` | `createBNode(String nodeID)` Deprecated. Creates a new blank node with the given node identifier.
    `NativeIRI` | `createIRI(String uri)` Deprecated. Creates a new IRI from the supplied string-representation.
    `NativeIRI` | `createIRI(String namespace, String localName)` Deprecated. Creates a new IRI from the supplied namespace and local name.
    `NativeLiteral` | `createLiteral(String value)` Deprecated. Creates a new literal with the supplied label.
    `NativeLiteral` | `createLiteral(String value, IRI datatype)` Deprecated. Creates a new literal with the supplied label and datatype.
    `NativeLiteral` | `createLiteral(String value, String language)` Deprecated. Creates a new literal with the supplied label and language attribute.
    `int` | `getID(Value value)` Deprecated. Gets the ID for the specified value.
    `NativeBNode` | `getNativeBNode(BNode bnode)` Deprecated. Creates a NativeBNode that is equal to the supplied bnode.
    `NativeLiteral` | `getNativeLiteral(Literal l)` Deprecated. Creates an NativeLiteral that is equal to the supplied literal.
    `NativeResource` | `getNativeResource(Resource resource)` Deprecated.
    `NativeIRI` | `getNativeURI(IRI uri)` Deprecated. Creates a NativeURI that is equal to the supplied URI.
    `NativeValue` | `getNativeValue(Value value)` Deprecated.
    `Lock` | `getReadLock()` Deprecated. Gets a read lock on this value store that can be used to prevent values from being removed while the lock is active.
    `ValueStoreRevision` | `getRevision()` Deprecated.
    `NativeValue` | `getValue(int id)` Deprecated. Gets the value for the specified ID.
    `static void` | `main(String[] args)` Deprecated.
    `int` | `storeValue(Value value)` Deprecated. Stores the supplied value and returns the ID that has been assigned to it.
    `void` | `sync()` Deprecated. Synchronizes any changes that are cached in memory to disk.

    - ### Methods inherited from class org.eclipse.rdf4j.model.impl.AbstractValueFactory

      `createBNode, createFPLiteral, createIntegerLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createNumericLiteral, createStatement, createStatement, createTriple, initBNodeParams`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.rdf4j.model.ValueFactory

      `createLiteral, createStatement, createStatement, createURI, createURI`

- - ### Field Detail

    - #### VALUE_CACHE_SIZE

          public static final int VALUE_CACHE_SIZE

      Deprecated.
      The default value cache size.
      See Also:
        Constant Field Values

    - #### VALUE_ID_CACHE_SIZE

          public static final int VALUE_ID_CACHE_SIZE

      Deprecated.
      The default value id cache size.
      See Also:
        Constant Field Values

    - #### NAMESPACE_CACHE_SIZE

          public static final int NAMESPACE_CACHE_SIZE

      Deprecated.
      The default namespace cache size.
      See Also:
        Constant Field Values

    - #### NAMESPACE_ID_CACHE_SIZE

          public static final int NAMESPACE_ID_CACHE_SIZE

      Deprecated.
      The default namespace id cache size.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ValueStore

          public ValueStore(File dataDir)
                     throws IOException

      Deprecated.
      Throws:
        `IOException`

    - #### ValueStore

          public ValueStore(File dataDir,
                            boolean forceSync)
                     throws IOException

      Deprecated.
      Throws:
        `IOException`

    - #### ValueStore

          public ValueStore(File dataDir,
                            boolean forceSync,
                            int valueCacheSize,
                            int valueIDCacheSize,
                            int namespaceCacheSize,
                            int namespaceIDCacheSize)
                     throws IOException

      Deprecated.
      Throws:
        `IOException`

  - ### Method Detail

    - #### getRevision

          public ValueStoreRevision getRevision()

      Deprecated.

    - #### getReadLock

          public Lock getReadLock()
                           throws InterruptedException

      Deprecated.
      Gets a read lock on this value store that can be used to prevent values from being removed while the lock is active.
      Throws:
        `InterruptedException`

    - #### getValue

          public NativeValue getValue(int id)
                               throws IOException

      Deprecated.
      Gets the value for the specified ID.
      Parameters:
        `id` - A value ID.
      Returns:
        The value for the ID, or `null` no such value could be found.
      Throws:
        `IOException` - If an I/O error occurred.

    - #### getID

          public int getID(Value value)
                    throws IOException

      Deprecated.
      Gets the ID for the specified value.
      Parameters:
        `value` - A value.
      Returns:
        The ID for the specified value, or `NativeValue.UNKNOWN_ID` if no such ID could be found.
      Throws:
        `IOException` - If an I/O error occurred.

    - #### storeValue

          public int storeValue(Value value)
                         throws IOException

      Deprecated.
      Stores the supplied value and returns the ID that has been assigned to it. In case the value was already present, the value will not be stored again and the ID of the existing value is returned.
      Parameters:
        `value` - The Value to store.
      Returns:
        The ID that has been assigned to the value.
      Throws:
        `IOException` - If an I/O error occurred.

    - #### clear

          public void clear()
                     throws IOException

      Deprecated.
      Removes all values from the ValueStore.
      Throws:
        `IOException` - If an I/O error occurred.

    - #### sync

          public void sync()
                    throws IOException

      Deprecated.
      Synchronizes any changes that are cached in memory to disk.
      Throws:
        `IOException` - If an I/O error occurred.

    - #### close

          public void close()
                     throws IOException

      Deprecated.
      Closes the ValueStore, releasing any file references, etc. Once closed, the ValueStore can no longer be used.
      Throws:
        `IOException` - If an I/O error occurred.

    - #### checkConsistency

          public void checkConsistency()
                                throws SailException,
                                       IOException

      Deprecated.
      Checks that every value has exactly one ID.
      Throws:
        `IOException`
        `SailException`

    - #### createIRI

          public NativeIRI createIRI(String uri)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new IRI from the supplied string-representation.
      Specified by:
        `createIRI` in interface `ValueFactory`
      Overrides:
        `createIRI` in class `AbstractValueFactory`
      Parameters:
        `uri` - A string-representation of a IRI.
      Returns:
        An object representing the IRI.

    - #### createIRI

          public NativeIRI createIRI(String namespace,
                                     String localName)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new IRI from the supplied namespace and local name. Calling this method is funtionally equivalent to calling `createIRI(namespace+localName)`, but allows the ValueFactory to reuse supplied namespace and local name strings whenever possible. Note that the values returned by `IRI.getNamespace()` and `IRI.getLocalName()` are not necessarily the same as the values that are supplied to this method.
      Specified by:
        `createIRI` in interface `ValueFactory`
      Overrides:
        `createIRI` in class `AbstractValueFactory`
      Parameters:
        `namespace` - The IRI's namespace.
        `localName` - The IRI's local name.

    - #### createBNode

          public NativeBNode createBNode(String nodeID)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new blank node with the given node identifier.
      Specified by:
        `createBNode` in interface `ValueFactory`
      Overrides:
        `createBNode` in class `AbstractValueFactory`
      Parameters:
        `nodeID` - The blank node identifier.
      Returns:
        An object representing the blank node.

    - #### createLiteral

          public NativeLiteral createLiteral(String value)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new literal with the supplied label. The return value of `Literal.getDatatype()` for the returned object must be `XSD.STRING`.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`
      Parameters:
        `value` - The literal's label, must not be `null`.

    - #### createLiteral

          public NativeLiteral createLiteral(String value,
                                             String language)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new literal with the supplied label and language attribute. The return value of `Literal.getDatatype()` for the returned object must be `RDF.LANGSTRING`.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`
      Parameters:
        `value` - The literal's label, must not be `null`.
        `language` - The literal's language attribute, must not be `null`.

    - #### createLiteral

          public NativeLiteral createLiteral(String value,
                                             IRI datatype)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new literal with the supplied label and datatype.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`
      Parameters:
        `value` - The literal's label, must not be `null`.
        `datatype` - The literal's datatype. If it is null, the datatype `XSD.STRING` will be assigned to this literal.

    - #### getNativeValue

          public NativeValue getNativeValue(Value value)

      Deprecated.

    - #### getNativeResource

          public NativeResource getNativeResource(Resource resource)

      Deprecated.

    - #### getNativeURI

          public NativeIRI getNativeURI(IRI uri)

      Deprecated.
      Creates a NativeURI that is equal to the supplied URI. This method returns the supplied URI itself if it is already a NativeURI that has been created by this ValueStore, which prevents unnecessary object creations.
      Returns:
        A NativeURI for the specified URI.

    - #### getNativeBNode

          public NativeBNode getNativeBNode(BNode bnode)

      Deprecated.
      Creates a NativeBNode that is equal to the supplied bnode. This method returns the supplied bnode itself if it is already a NativeBNode that has been created by this ValueStore, which prevents unnecessary object creations.
      Returns:
        A NativeBNode for the specified bnode.

    - #### getNativeLiteral

          public NativeLiteral getNativeLiteral(Literal l)

      Deprecated.
      Creates an NativeLiteral that is equal to the supplied literal. This method returns the supplied literal itself if it is already a NativeLiteral that has been created by this ValueStore, which prevents unnecessary object creations.
      Returns:
        A NativeLiteral for the specified literal.

    - #### main

          public static void main(String[] args)
                           throws Exception

      Deprecated.
      Throws:
        `Exception`

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