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

java.lang.Object
  extended byorg.openrdf.model.impl.URIImpl
      extended byorg.openrdf.sesame.sailimpl.nativerdf.model.NativeURI
All Implemented Interfaces:
Comparable, NativeResource, NativeValue, Resource, Serializable, URI, Value

public class NativeURI
extends URIImpl
implements NativeResource

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.openrdf.model.impl.URIImpl
RDF_ALT, RDF_BAG, RDF_FIRST, RDF_LIST, RDF_NIL, RDF_OBJECT, RDF_PREDICATE, RDF_PROPERTY, RDF_REST, RDF_SEQ, RDF_STATEMENT, RDF_SUBJECT, RDF_TYPE, RDF_VALUE, RDF_XMLLITERAL, RDFS_CLASS, RDFS_COMMENT, RDFS_CONTAINER, RDFS_CONTAINERMEMBERSHIPPROPERTY, RDFS_DATATYPE, RDFS_DOMAIN, RDFS_ISDEFINEDBY, RDFS_LABEL, RDFS_LITERAL, RDFS_MEMBER, RDFS_RANGE, RDFS_RESOURCE, RDFS_SEEALSO, RDFS_SUBCLASSOF, RDFS_SUBPROPERTYOF
 
Constructor Summary
NativeURI(NativeRdfRepository repository, String uri)
           
NativeURI(NativeRdfRepository repository, String namespace, String localname)
           
NativeURI(NativeRdfRepository repository, URI uri)
           
 
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.
 StatementIterator getPredicateStatements()
          Gets all statements from the RDF graph for which this URI is the predicate.
 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.URIImpl
compareTo, equals, getLocalName, getNamespace, getURI, 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

NativeURI

public NativeURI(NativeRdfRepository repository,
                 String uri)

NativeURI

public NativeURI(NativeRdfRepository repository,
                 String namespace,
                 String localname)

NativeURI

public NativeURI(NativeRdfRepository repository,
                 URI uri)
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 URIImpl
Throws:
GraphException

getPredicateStatements

public StatementIterator getPredicateStatements()
                                         throws GraphException
Description copied from interface: URI
Gets all statements from the RDF graph for which this URI is the predicate.

Specified by:
getPredicateStatements in interface URI
Overrides:
getPredicateStatements in class URIImpl
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 URIImpl
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 URIImpl
Throws:
GraphException


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