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
VocabularyDecls 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
Values but not
BigdataValues since the AbstractTripleStore reference is
not available and we can not obtain the appropriate
BigdataValueFactory instance without it. |
int |
size()
The #of defined
Values. |
Iterator<BigdataValue> |
values()
The
Values 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()
VocabularyDecls using
addDecl(VocabularyDecl).protected final void addDecl(VocabularyDecl decl)
decl - The vocabulary declaration.public final String getNamespace()
VocabularyLexiconRelation.getNamespace in interface Vocabularypublic final int size()
VocabularyValues.size in interface Vocabularypublic final Iterator<BigdataValue> values()
VocabularyValues in an arbitrary order.values in interface Vocabularypublic final BigdataValue asValue(IV iv)
VocabularyIV defined by this vocabulary.asValue in interface Vocabularyiv - The IV.BigdataValue -or- null if the IV
was not defined by the vocabulary.public final IV get(org.openrdf.model.Value value)
VocabularyValue.get in interface Vocabularyvalue - 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)
VocabularyIConstant for the Value.getConstant in interface Vocabularyvalue - The value.IConstant.public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
Values but not
BigdataValues 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 Values is via get(Value)
and getConstant(Value).readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.