|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openrdf.model.impl.ValueFactoryBase
org.openrdf.sail.nativerdf.ValueStore
public class ValueStore
File-based indexed storage and retrieval of RDF values. ValueStore maps RDF values to integer IDs and vice-versa.
| Constructor Summary | |
|---|---|
ValueStore(File dataDir)
|
|
ValueStore(File dataDir,
boolean forceSync)
|
|
| Method Summary | |
|---|---|
void |
clear()
Removes all values from the ValueStore. |
void |
close()
Closes the ValueStore, releasing any file references, etc. |
NativeBNode |
createBNode(String nodeID)
Creates a new blank node with the given node identifier. |
NativeLiteral |
createLiteral(String value)
Creates a new literal with the supplied label. |
NativeLiteral |
createLiteral(String value,
String language)
Creates a new literal with the supplied label and language attribute. |
NativeLiteral |
createLiteral(String value,
URI datatype)
Creates a new literal with the supplied label and datatype. |
Statement |
createStatement(Resource subject,
URI predicate,
Value object)
Creates a new statement with the supplied subject, predicate and object. |
Statement |
createStatement(Resource subject,
URI predicate,
Value object,
Resource context)
Creates a new statement with the supplied subject, predicate and object and associated context. |
NativeURI |
createURI(String uri)
Creates a new URI from the supplied string-representation. |
NativeURI |
createURI(String namespace,
String localName)
Creates a new URI from the supplied namespace and local name. |
int |
getID(Value value)
Gets the ID for the specified value. |
NativeBNode |
getNativeBNode(BNode bnode)
Creates a NativeBNode that is equal to the supplied bnode. |
NativeLiteral |
getNativeLiteral(Literal l)
Creates an NativeLiteral that is equal to the supplied literal. |
NativeResource |
getNativeResource(Resource resource)
|
NativeURI |
getNativeURI(URI uri)
Creates a NativeURI that is equal to the supplied URI. |
NativeValue |
getNativeValue(Value value)
|
Lock |
getReadLock()
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()
|
NativeValue |
getValue(int id)
Gets the value for the specified ID. |
static void |
main(String[] args)
|
int |
storeValue(Value value)
Stores the supplied value and returns the ID that has been assigned to it. |
void |
sync()
Synchronizes any changes that are cached in memory to disk. |
| Methods inherited from class org.openrdf.model.impl.ValueFactoryBase |
|---|
createBNode, createFPLiteral, createIntegerLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createNumericLiteral, initBNodeParams |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ValueStore(File dataDir)
throws IOException
IOException
public ValueStore(File dataDir,
boolean forceSync)
throws IOException
IOException| Method Detail |
|---|
public ValueStoreRevision getRevision()
public Lock getReadLock()
throws InterruptedException
InterruptedException
public NativeValue getValue(int id)
throws IOException
id - A value ID.
IOException - If an I/O error occurred.
public int getID(Value value)
throws IOException
value - A value.
NativeValue.UNKNOWN_ID
if no such ID could be found.
IOException - If an I/O error occurred.
public int storeValue(Value value)
throws IOException
value - The Value to store.
IOException - If an I/O error occurred.
public void clear()
throws IOException
IOException - If an I/O error occurred.
public void sync()
throws IOException
IOException - If an I/O error occurred.
public void close()
throws IOException
IOException - If an I/O error occurred.public NativeURI createURI(String uri)
ValueFactory
uri - A string-representation of a URI.
public NativeURI createURI(String namespace,
String localName)
ValueFactorycreateURI(namespace+localName), but allows the
ValueFactory to reuse supplied namespace and local name strings whenever
possible. Note that the values returned by URI.getNamespace() and
URI.getLocalName() are not necessarily the same as the values that
are supplied to this method.
namespace - The URI's namespace.localName - The URI's local name.public NativeBNode createBNode(String nodeID)
ValueFactory
nodeID - The blank node identifier.
public NativeLiteral createLiteral(String value)
ValueFactory
value - The literal's label.
public NativeLiteral createLiteral(String value,
String language)
ValueFactory
value - The literal's label.language - The literal's language attribute, or null if the literal
doesn't have a language.
public NativeLiteral createLiteral(String value,
URI datatype)
ValueFactory
value - The literal's label.datatype - The literal's datatype, or null if the literal doesn't
have a datatype.
public Statement createStatement(Resource subject,
URI predicate,
Value object)
ValueFactory
subject - The statement's subject.predicate - The statement's predicate.object - The statement's object.
public Statement createStatement(Resource subject,
URI predicate,
Value object,
Resource context)
ValueFactory
subject - The statement's subject.predicate - The statement's predicate.object - The statement's object.context - The statement's context.
public NativeValue getNativeValue(Value value)
public NativeResource getNativeResource(Resource resource)
public NativeURI getNativeURI(URI uri)
public NativeBNode getNativeBNode(BNode bnode)
public NativeLiteral getNativeLiteral(Literal l)
public static void main(String[] args)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||