org.openanzo.jastor
Class DatasetThingImpl

java.lang.Object
  extended by org.openanzo.jastor.DatasetThingImpl
All Implemented Interfaces:
CoreThing, DatasetThing
Direct Known Subclasses:
_PropertyImpl, _ResourceImpl, _ThingImpl, AltImpl, AnnotationPropertyImpl, AntisymmetricPropertyImpl, BagImpl, ClassImpl, ClassImpl, ConstantImpl, ContainerImpl, ContainerMembershipPropertyImpl, DataRangeImpl, DataRestrictionImpl, DatatypeImpl, DatatypePropertyImpl, FunctionalDataPropetyImpl, FunctionalObjectPropertyImpl, FunctionalPropertyImpl, FunctionalPropetyImpl, IndividualImpl, InverseFunctionalPropertyImpl, IrreflexivePropertyImpl, ListImpl, LiteralImpl, NothingImpl, ObjectPropertyImpl, ObjectRestrictionImpl, OntologyImpl, OWLEntityImpl, ReflexivePropertyImpl, RestrictionImpl, SeqImpl, SymmetricPropertyImpl, TransitivePropertyImpl

public class DatasetThingImpl
extends java.lang.Object
implements DatasetThing

Implementation of DatasetThing

Author:
Joe Betz, Ben Szekely (bhszekel@us.ibm.com)

Field Summary
 
Fields inherited from interface org.openanzo.jastor.CoreThing
TYPE
 
Constructor Summary
DatasetThingImpl(org.openrdf.model.Resource resource, org.openrdf.model.URI _namedGraphUri, IDataset _dataset)
          Create a new DatasetThingImple for given resource
 
Method Summary
 void clearCache()
          Clear any property caches for this THING
 IDataset dataset()
          Get the Dataset where this THING resides
 boolean equals(java.lang.Object obj)
           
 org.openrdf.model.Literal getLiteral(java.lang.Object value, java.lang.String returnType, java.lang.String rangeUri)
          Get the Literal value for the raw data
<T> T
getLiteralValue(org.openrdf.model.Literal literal, java.lang.Class<T> expectedType)
          Get the native value of a literal
 info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> getProperties(org.openrdf.model.Resource... contexts)
          Retrieve set of statements containing all properties for THING's resource
 org.openrdf.model.Value getPropertyValue(java.lang.String property, org.openrdf.model.Resource... contexts)
          Retrieve single DatasetProperty for the given property within set of provided contexts
 org.openrdf.model.Value getPropertyValue(org.openrdf.model.URI property, org.openrdf.model.Resource... contexts)
          Retrieve single DatasetProperty for the given property within set of provided contexts
 DatasetPropertyIterator<org.openrdf.model.Value> getPropertyValues(java.lang.String property, org.openrdf.model.Resource... contexts)
          Retrieve iterator of DatasetProperties for the given property within set of provided contexts
 DatasetPropertyIterator<org.openrdf.model.Value> getPropertyValues(org.openrdf.model.URI property, org.openrdf.model.Resource... contexts)
          Retrieve iterator of DatasetProperties for the given property within set of provided contexts
 boolean isRDFType(org.openrdf.model.Resource type)
          Verify if this THING is of RDFType type
 java.util.Collection<org.openrdf.model.Statement> listStatements()
          Get set of statements that makeup this THINGS's properties and types
 org.openrdf.model.URI namedGraphUri()
          Get the URI of the NamedGraph where this THING resides
 void registerListener(ThingListener listener)
          Register a ThingListener for this THING
 void removeStatements()
          Remove set of statements that makeup this THINGS's properties and types
 org.openrdf.model.Resource resource()
          Resource representation of this THING's resource
 void setPropertyValue(java.lang.String property, org.openrdf.model.Value value, org.openrdf.model.Resource context)
          Set the property value for THING within given context
 void setPropertyValue(org.openrdf.model.URI property, org.openrdf.model.Value value, org.openrdf.model.Resource context)
          Set the property value for THING within given context
 java.lang.String toString()
           
 void unregisterListener(ThingListener listener)
          Unregister a ThingListener for this THING
 java.lang.String uri()
          String representation of this THING's resource
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DatasetThingImpl

public DatasetThingImpl(org.openrdf.model.Resource resource,
                        org.openrdf.model.URI _namedGraphUri,
                        IDataset _dataset)
                 throws JastorException
Create a new DatasetThingImple for given resource

Parameters:
resource - Resource of Thing
_namedGraphUri - URI of NamedGraph where this Thing resides
_dataset - Dataset where data for this Thing resides
Throws:
JastorException - if dataset is null
Method Detail

uri

public java.lang.String uri()
Description copied from interface: CoreThing
String representation of this THING's resource

Specified by:
uri in interface CoreThing
Returns:
String representation of this THING's resource

dataset

public IDataset dataset()
Description copied from interface: DatasetThing
Get the Dataset where this THING resides

Specified by:
dataset in interface DatasetThing
Returns:
Dataset where this THING resides

resource

public org.openrdf.model.Resource resource()
Description copied from interface: CoreThing
Resource representation of this THING's resource

Specified by:
resource in interface CoreThing
Returns:
Resource representation of this THING's resource

listStatements

public java.util.Collection<org.openrdf.model.Statement> listStatements()
Description copied from interface: CoreThing
Get set of statements that makeup this THINGS's properties and types

Specified by:
listStatements in interface CoreThing
Returns:
set of statements that makeup this THINGS's properties and types

removeStatements

public void removeStatements()
Description copied from interface: CoreThing
Remove set of statements that makeup this THINGS's properties and types

Specified by:
removeStatements in interface CoreThing

clearCache

public void clearCache()
Description copied from interface: CoreThing
Clear any property caches for this THING

Specified by:
clearCache in interface CoreThing

registerListener

public void registerListener(ThingListener listener)
Description copied from interface: CoreThing
Register a ThingListener for this THING

Specified by:
registerListener in interface CoreThing
Parameters:
listener - ThingListener

unregisterListener

public void unregisterListener(ThingListener listener)
Description copied from interface: CoreThing
Unregister a ThingListener for this THING

Specified by:
unregisterListener in interface CoreThing
Parameters:
listener - ThingListener

isRDFType

public boolean isRDFType(org.openrdf.model.Resource type)
Description copied from interface: CoreThing
Verify if this THING is of RDFType type

Specified by:
isRDFType in interface CoreThing
Parameters:
type - type to verify
Returns:
true if THING is of RDFType type

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getLiteralValue

public <T> T getLiteralValue(org.openrdf.model.Literal literal,
                             java.lang.Class<T> expectedType)
Get the native value of a literal

Type Parameters:
T - Type of class for which to convert
Parameters:
literal - literal value to convert
expectedType - expected java type
Returns:
native value of literal

getLiteral

public org.openrdf.model.Literal getLiteral(java.lang.Object value,
                                            java.lang.String returnType,
                                            java.lang.String rangeUri)
Get the Literal value for the raw data

Parameters:
value - the native value to convert
returnType - the expected native type
rangeUri - the range type
Returns:
native value of literal

getProperties

public info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> getProperties(org.openrdf.model.Resource... contexts)
Description copied from interface: DatasetThing
Retrieve set of statements containing all properties for THING's resource

Specified by:
getProperties in interface DatasetThing
Parameters:
contexts - context to do search over
Returns:
set of statements containing all properties for THING's resource

getPropertyValues

public DatasetPropertyIterator<org.openrdf.model.Value> getPropertyValues(java.lang.String property,
                                                                          org.openrdf.model.Resource... contexts)
Description copied from interface: DatasetThing
Retrieve iterator of DatasetProperties for the given property within set of provided contexts

Specified by:
getPropertyValues in interface DatasetThing
Parameters:
property - property containing DatasetProperty
contexts - context to do search over
Returns:
iterator of DatasetProperties for the given property within set of provided contexts

getPropertyValues

public DatasetPropertyIterator<org.openrdf.model.Value> getPropertyValues(org.openrdf.model.URI property,
                                                                          org.openrdf.model.Resource... contexts)
Description copied from interface: DatasetThing
Retrieve iterator of DatasetProperties for the given property within set of provided contexts

Specified by:
getPropertyValues in interface DatasetThing
Parameters:
property - property containing DatasetProperty
contexts - context to do search over
Returns:
iterator of DatasetProperties for the given property within set of provided contexts

getPropertyValue

public org.openrdf.model.Value getPropertyValue(java.lang.String property,
                                                org.openrdf.model.Resource... contexts)
Description copied from interface: DatasetThing
Retrieve single DatasetProperty for the given property within set of provided contexts

Specified by:
getPropertyValue in interface DatasetThing
Parameters:
property - property containing DatasetProperty
contexts - context to do search over
Returns:
single DatasetProperty for the given property within set of provided contexts

setPropertyValue

public void setPropertyValue(org.openrdf.model.URI property,
                             org.openrdf.model.Value value,
                             org.openrdf.model.Resource context)
Description copied from interface: DatasetThing
Set the property value for THING within given context

Specified by:
setPropertyValue in interface DatasetThing
Parameters:
property - URI of property to set
value - Value of property to set
context - Context where statement should be created

setPropertyValue

public void setPropertyValue(java.lang.String property,
                             org.openrdf.model.Value value,
                             org.openrdf.model.Resource context)
Description copied from interface: DatasetThing
Set the property value for THING within given context

Specified by:
setPropertyValue in interface DatasetThing
Parameters:
property - String representation of URI of property to set
value - Value of property to set
context - Context where statement should be created

getPropertyValue

public org.openrdf.model.Value getPropertyValue(org.openrdf.model.URI property,
                                                org.openrdf.model.Resource... contexts)
Description copied from interface: DatasetThing
Retrieve single DatasetProperty for the given property within set of provided contexts

Specified by:
getPropertyValue in interface DatasetThing
Parameters:
property - property containing DatasetProperty
contexts - context to do search over
Returns:
single DatasetProperty for the given property within set of provided contexts

namedGraphUri

public org.openrdf.model.URI namedGraphUri()
Description copied from interface: DatasetThing
Get the URI of the NamedGraph where this THING resides

Specified by:
namedGraphUri in interface DatasetThing
Returns:
URI of the NamedGraph where this THING resides


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.