public abstract class BaseVocabulary extends Object implements Vocabulary, Externalizable
Vocabulary
implementations.Modifier and Type | Class and Description |
---|---|
static class |
BaseVocabulary.VocabularyVersioningException
An instance of this class indicates a versioning problem with the
declaration classes . |
Modifier | Constructor and Description |
---|---|
protected |
BaseVocabulary()
De-serialization ctor.
|
protected |
BaseVocabulary(String namespace)
Ctor used by
AbstractTripleStore.create() . |
Modifier and Type | Method and Description |
---|---|
protected void |
addDecl(VocabularyDecl decl)
Add a declared vocabulary.
|
protected abstract void |
addValues()
Hook for subclasses to provide their
VocabularyDecl s using
addDecl(VocabularyDecl) . |
BigdataValue |
asValue(IV iv)
Reverse lookup of an
IV defined by this vocabulary. |
IV |
get(org.openrdf.model.Value value)
The term identifier for the pre-defined
Value . |
IConstant<IV> |
getConstant(org.openrdf.model.Value value)
Returns the
IConstant for the Value . |
String |
getNamespace()
The namespace of the owning
LexiconRelation . |
void |
init()
Invoked by
AbstractTripleStore.create() to initialize the
Vocabulary . |
void |
readExternal(ObjectInput in)
Note: The de-serialized state contains
Value s but not
BigdataValue s since the AbstractTripleStore reference is
not available and we can not obtain the appropriate
BigdataValueFactory instance without it. |
int |
size()
The #of defined
Value s. |
Iterator<BigdataValue> |
values()
The
Value s in an arbitrary order. |
void |
writeExternal(ObjectOutput out) |
protected BaseVocabulary()
protected BaseVocabulary(String namespace)
AbstractTripleStore.create()
.database
- The database.public final void init()
AbstractTripleStore.create()
to initialize the
Vocabulary
.IllegalStateException
- if init()
has already been invoked.protected abstract void addValues()
VocabularyDecl
s using
addDecl(VocabularyDecl)
.protected final void addDecl(VocabularyDecl decl)
decl
- The vocabulary declaration.public final String getNamespace()
Vocabulary
LexiconRelation
.getNamespace
in interface Vocabulary
public final int size()
Vocabulary
Value
s.size
in interface Vocabulary
public final Iterator<BigdataValue> values()
Vocabulary
Value
s in an arbitrary order.values
in interface Vocabulary
public final BigdataValue asValue(IV iv)
Vocabulary
IV
defined by this vocabulary.asValue
in interface Vocabulary
iv
- The IV
.BigdataValue
-or- null
if the IV
was not defined by the vocabulary.public final IV get(org.openrdf.model.Value value)
Vocabulary
Value
.get
in interface Vocabulary
value
- The value.IV
for that Value
-or- null
if
the Value
was not defined by this Vocabulary
.public final IConstant<IV> getConstant(org.openrdf.model.Value value)
Vocabulary
IConstant
for the Value
.getConstant
in interface Vocabulary
value
- The value.IConstant
.public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
Value
s but not
BigdataValue
s since the AbstractTripleStore
reference is
not available and we can not obtain the appropriate
BigdataValueFactory
instance without it. This should not matter
since the only access to the Value
s is via get(Value)
and getConstant(Value)
.readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.