org.openrdf.sesame.sailimpl.nativerdf.model
Class NativeBNode

java.lang.Object
  extended byorg.openrdf.model.impl.BNodeImpl
      extended byorg.openrdf.sesame.sailimpl.nativerdf.model.NativeBNode
All Implemented Interfaces:
BNode, Comparable, NativeResource, NativeValue, Resource, Serializable, Value

public class NativeBNode
extends BNodeImpl
implements NativeResource

See Also:
Serialized Form

Constructor Summary
NativeBNode(NativeRdfRepository repository, BNode bnode)
           
NativeBNode(NativeRdfRepository repository, String nodeID)
           
 
Method Summary
 void addProperty(URI property, Value value)
          Adds a property to this Resource in the RDF graph.
 int getInternalId()
          Gets the ID that is used in the native RDF repository for this Value.
 StatementIterator getObjectStatements()
          Gets all statements from the RDF graph for which this value is the object.
 NativeRdfRepository getRepository()
          Returns the NativeRdfRepository that contains this NativeValue.
 StatementIterator getSubjectStatements()
          Gets all statements from the RDF graph for which this resource is the subject.
 ValueStoreRevision getValueStoreRevision()
          Gets the revision of the value store that created this value.
 void setInternalId(int id, ValueStoreRevision revision)
          Sets the ID that is used for this value in a specific revision of the value store.
 
Methods inherited from class org.openrdf.model.impl.BNodeImpl
compareTo, equals, getID, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

NativeBNode

public NativeBNode(NativeRdfRepository repository,
                   String nodeID)

NativeBNode

public NativeBNode(NativeRdfRepository repository,
                   BNode bnode)
Method Detail

getRepository

public NativeRdfRepository getRepository()
Description copied from interface: NativeValue
Returns the NativeRdfRepository that contains this NativeValue. IDs are only unique within a single repository, but an application could use several repositories at the same time, passing NativeValue objects generated by one Sail to another Sail. In such situations, the ID of the first Sail cannot be used by the second Sail. Hence, the NativeRdfRepository should verify that it is the 'owner' of a value before using the recorded internal ID.

Specified by:
getRepository in interface NativeValue

setInternalId

public void setInternalId(int id,
                          ValueStoreRevision revision)
Description copied from interface: NativeValue
Sets the ID that is used for this value in a specific revision of the value store.

Specified by:
setInternalId in interface NativeValue

getInternalId

public int getInternalId()
Description copied from interface: NativeValue
Gets the ID that is used in the native RDF repository for this Value.

Specified by:
getInternalId in interface NativeValue
Returns:
The value's ID, or 0 if not yet set.

getValueStoreRevision

public ValueStoreRevision getValueStoreRevision()
Description copied from interface: NativeValue
Gets the revision of the value store that created this value. The value's internal ID is only valid when it's value store revision is equal to the value store's current revision.

Specified by:
getValueStoreRevision in interface NativeValue
Returns:
The revision of the value store that created this value, or null if the internal ID has not yet been set.

getSubjectStatements

public StatementIterator getSubjectStatements()
                                       throws GraphException
Description copied from interface: Resource
Gets all statements from the RDF graph for which this resource is the subject.

Specified by:
getSubjectStatements in interface Resource
Overrides:
getSubjectStatements in class BNodeImpl
Throws:
GraphException

getObjectStatements

public StatementIterator getObjectStatements()
                                      throws GraphException
Description copied from interface: Value
Gets all statements from the RDF graph for which this value is the object.

Specified by:
getObjectStatements in interface Value
Overrides:
getObjectStatements in class BNodeImpl
Throws:
GraphException

addProperty

public void addProperty(URI property,
                        Value value)
                 throws GraphException
Description copied from interface: Resource
Adds a property to this Resource in the RDF graph. The result is that a statement of the form (this, property, value) is added.

Specified by:
addProperty in interface Resource
Overrides:
addProperty in class BNodeImpl
Throws:
GraphException


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.