org.openanzo.jastor
Class GraphThingImpl

java.lang.Object
  extended by org.openanzo.jastor.GraphThingImpl
All Implemented Interfaces:
CoreThing, GraphThing
Direct Known Subclasses:
_PropertyImpl, _PropertyImpl, _ResourceImpl, _ResourceImpl, _StatementImpl, _ThingImpl, ACLImpl, AgentImpl, AltImpl, AltImpl, AnnotationPropertyImpl, AntisymmetricPropertyImpl, AnzoServerImpl, AskResultImpl, BagImpl, BagImpl, BinaryContentImpl, CategoryImpl, ClassImpl, ClassImpl, ClassImpl, CollectionImpl, CommandImpl, ConstantImpl, ContainerImpl, ContainerImpl, ContainerMembershipPropertyImpl, ContainerMembershipPropertyImpl, ContentImpl, ContentImpl, DataRangeImpl, DataRestrictionImpl, DatasetImpl, DatatypeImpl, DatatypeImpl, DatatypePropertyImpl, DeletedEntryImpl, DocumentImpl, EntryImpl, EntryImpl, FeedImpl, FeedOrEntryImpl, FunctionalDataPropetyImpl, FunctionalObjectPropertyImpl, FunctionalPropertyImpl, FunctionalPropetyImpl, GeneratorImpl, GroupImpl, HTMLImpl, ImageImpl, IndividualImpl, InformationResourceImpl, IntrospectionGraphImpl, InverseFunctionalPropertyImpl, IrreflexivePropertyImpl, LinkImpl, ListImpl, ListImpl, LiteralImpl, LiteralImpl, NamedGraphImpl, NothingImpl, ObjectPropertyImpl, ObjectPropertyImpl, ObjectRestrictionImpl, OnlineAccountImpl, OnlineChatAccountImpl, OnlineEcommerceAccountImpl, OnlineGamingAccountImpl, OntologyImpl, OrganizationImpl, OWLEntityImpl, PersonalProfileDocumentImpl, PersonImpl, PersonImpl, PlainTextImpl, PreconditionImpl, ProjectImpl, PurgedEntryImpl, QueryImpl, RDFContentImpl, ReflexivePropertyImpl, RelationTypeImpl, RepresentationImpl, RestrictionImpl, ResultImpl, RoleImpl, SelectorTrackerImpl, SeqImpl, SeqImpl, SymmetricPropertyImpl, TextContentImpl, TextContentImpl, TrackerImpl, TransitivePropertyImpl, TypedContentImpl, UserImpl, VersionImpl, XHTMLImpl, XMLImpl, XMLLiteralImpl

public class GraphThingImpl
extends java.lang.Object
implements GraphThing

Implementation of GraphThing

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

Field Summary
 
Fields inherited from interface org.openanzo.jastor.CoreThing
TYPE
 
Constructor Summary
GraphThingImpl(org.openrdf.model.Resource resource, INamedGraph graph)
          Create a new GraphThingImpl for given resource
 
Method Summary
 void clearCache()
          Clear any property caches for this THING
 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()
          Retrieve set of statements containing all properties for THING's resource
 org.openrdf.model.Value getPropertyValue(java.lang.String property)
          Retrieve single DatasetProperty for the given property
 org.openrdf.model.Value getPropertyValue(org.openrdf.model.URI property)
          Retrieve single DatasetProperty for the given property
 INamedGraph graph()
          Get the INamedGraph where this THING resides
 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
 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)
          Set the property value for THING
 void setPropertyValue(org.openrdf.model.URI property, org.openrdf.model.Value value)
          Set the property value for THING
 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

GraphThingImpl

public GraphThingImpl(org.openrdf.model.Resource resource,
                      INamedGraph graph)
               throws JastorException
Create a new GraphThingImpl for given resource

Parameters:
resource - Resource of Thing
graph - NamedGraph where data for this Thing resides
Throws:
JastorException - if graph 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

graph

public INamedGraph graph()
Description copied from interface: GraphThing
Get the INamedGraph where this THING resides

Specified by:
graph in interface GraphThing
Returns:
INamedGraph 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()
Description copied from interface: GraphThing
Retrieve set of statements containing all properties for THING's resource

Specified by:
getProperties in interface GraphThing
Returns:
set of statements containing all properties for THING's resource

getPropertyValue

public org.openrdf.model.Value getPropertyValue(java.lang.String property)
Description copied from interface: GraphThing
Retrieve single DatasetProperty for the given property

Specified by:
getPropertyValue in interface GraphThing
Parameters:
property - property containing DatasetProperty
Returns:
single DatasetProperty for the given property

setPropertyValue

public void setPropertyValue(org.openrdf.model.URI property,
                             org.openrdf.model.Value value)
Description copied from interface: GraphThing
Set the property value for THING

Specified by:
setPropertyValue in interface GraphThing
Parameters:
property - URI of property to set
value - Value of property to set

setPropertyValue

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

Specified by:
setPropertyValue in interface GraphThing
Parameters:
property - String representation of URI of property to set
value - Value of property to set

getPropertyValue

public org.openrdf.model.Value getPropertyValue(org.openrdf.model.URI property)
Description copied from interface: GraphThing
Retrieve single DatasetProperty for the given property

Specified by:
getPropertyValue in interface GraphThing
Parameters:
property - property containing DatasetProperty
Returns:
single DatasetProperty for the given property


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