com.bigdata.rdf.axioms
Class BaseAxioms

java.lang.Object
  extended by com.bigdata.rdf.axioms.BaseAxioms
All Implemented Interfaces:
Axioms, Externalizable, Serializable
Direct Known Subclasses:
NoAxioms, RdfsAxioms

public abstract class BaseAxioms
extends Object
implements Axioms, Externalizable

A collection of axioms.

Axioms are generated by AbstractTripleStore.create() based on its configured properties. While the implementation class declares axioms in terms of RDF Values, the BaseAxioms only retains the set of {s:p:o} tuples for the term identifiers corresponding those those Values. That {s:p:o} tuple array is the serialized state of this class. When an AbstractTripleStore is reopened, the axioms are de-serialized from a property in the global row store.

Version:
$Id: BaseAxioms.java 4642 2011-06-08 17:38:38Z thompsonbry $
Author:
personickm, Bryan Thompson
See Also:
Serialized Form

Constructor Summary
protected BaseAxioms()
          De-serialization constructor.
protected BaseAxioms(String namespace)
          Ctor variant used by AbstractTripleStore.create().
 
Method Summary
protected  void addAxioms(Collection<BigdataStatement> axioms)
          Adds all axioms declared by this class into axioms.
 Iterator<SPO> axioms()
          The axioms in {s:p:o} order by their term identifiers.
 String getNamespace()
          The namespace of the owning LexiconRelation.
protected  BigdataValueFactory getValueFactory()
          The value factory to be used when creating axioms.
 void init(AbstractTripleStore db)
          Uses addAxioms(Collection) to collect the declared axioms and then writes the axioms onto the database specified to the BaseAxioms#BaseAxioms(AbstractTripleStore) ctor.
 boolean isAxiom(IV s, IV p, IV o)
          Test for an axiom.
 void readExternal(ObjectInput in)
           
 int size()
          The #of defined axioms.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bigdata.rdf.axioms.Axioms
isNone, isOwlSameAs, isRdfSchema
 

Constructor Detail

BaseAxioms

protected BaseAxioms()
De-serialization constructor.


BaseAxioms

protected BaseAxioms(String namespace)
Ctor variant used by AbstractTripleStore.create().

Note: When de-serializing a BaseAxioms object the zero-arg ctor will be used.

Parameters:
namespace - The namespace for the AbstractTripleStore instance.
Method Detail

getNamespace

public final String getNamespace()
Description copied from interface: Axioms
The namespace of the owning LexiconRelation.

Specified by:
getNamespace in interface Axioms
Returns:

getValueFactory

protected final BigdataValueFactory getValueFactory()
The value factory to be used when creating axioms.

Throws:
IllegalStateException - unless the ctor variant was used that specifies the database.

init

public final void init(AbstractTripleStore db)
Uses addAxioms(Collection) to collect the declared axioms and then writes the axioms onto the database specified to the BaseAxioms#BaseAxioms(AbstractTripleStore) ctor.

Throws:
IllegalStateException - if that ctor was not used.

addAxioms

protected void addAxioms(Collection<BigdataStatement> axioms)
Adds all axioms declared by this class into axioms.

Note: Subclasses MUST extend this method to add their axioms into the axioms collection.

Parameters:
axioms - A collection into which the axioms will be inserted.
Throws:
IllegalArgumentException - if the parameter is null.

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

isAxiom

public final boolean isAxiom(IV s,
                             IV p,
                             IV o)
Description copied from interface: Axioms
Test for an axiom.

Specified by:
isAxiom in interface Axioms
Parameters:
s - The internal value (IV) in the subject position.
p - The internal value (IV) in the predicate position.
o - The internal value (IV) in the object position.

size

public final int size()
Description copied from interface: Axioms
The #of defined axioms.

Specified by:
size in interface Axioms

axioms

public final Iterator<SPO> axioms()
Description copied from interface: Axioms
The axioms in {s:p:o} order by their term identifiers.

Specified by:
axioms in interface Axioms


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.