com.hp.hpl.jena.daml.common
Class DAMLDataInstanceImpl

java.lang.Object
  |
  +--com.hp.hpl.mesa.rdf.jena.common.ResourceImpl
        |
        +--com.hp.hpl.jena.daml.common.DAMLCommonImpl
              |
              +--com.hp.hpl.jena.daml.common.DAMLDataInstanceImpl
All Implemented Interfaces:
DAMLCommon, DAMLDataInstance, RDFNode, Resource, ResourceI

public class DAMLDataInstanceImpl
extends DAMLCommonImpl
implements DAMLDataInstance

A DAML data instance is an instance of a DAML Dataype (compared to an DAML instance which is an instance of a DAML Class; Class and Datatype are disjoint).

Version:
CVS info: $Id: DAMLDataInstanceImpl.java,v 1.2 2002/01/08 22:31:26 ijd Exp $
Author:
Ian Dickinson, HP Labs (email)

Constructor Summary
DAMLDataInstanceImpl(java.lang.String uri, DAMLModel store, DAMLVocabulary vocabulary)
          Constructor, takes the URI for this instance, and the underlying model it will be attached to.
DAMLDataInstanceImpl(java.lang.String namespace, java.lang.String name, DAMLModel store, DAMLVocabulary vocabulary)
          Constructor, takes the name and namespace for this instance, and the underlying model it will be attached to.
 
Method Summary
 java.util.Iterator getSameInstances()
          Return an iterator over all of the instances that are the same as this one, by generating the transitive closure over the daml:samePropertyAs property.
 DatatypeTranslator getTranslator()
          Answer the Datatype translator for values encoded by the datatype of this instance.
 java.lang.Object getValue()
          Answer the value of this instance as a Java object, translated from the serialised RDF representation by the Dataype's translator.
 PropertyAccessor prop_sameIndividualAs()
          Property accessor for daml:sameIndividualAs property on a DAML instance.
 void setValue(java.lang.Object value)
          Set the value of this instance to the given Java value, which will be serialised into the RDF graph by the datatype's translator.
 
Methods inherited from class com.hp.hpl.jena.daml.common.DAMLCommonImpl
getAll, getDAMLModel, getEquivalenceSet, getEquivalentValues, getNumPropertyValues, getPropertyValue, getPropertyValues, getRDFTypes, getSelfIterator, getVocabulary, hasRDFType, hasRDFType, prop_comment, prop_equivalentTo, prop_label, prop_type, remove, removeAll, removeProperty, replaceProperty, setPropertyValue, setRDFType, setRDFType, toString
 
Methods inherited from class com.hp.hpl.mesa.rdf.jena.common.ResourceImpl
abort, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getEmbeddedResource, getId, getLocalName, getModel, getNameSpace, getProperty, getURI, hashCode, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, isAnon, listProperties, listProperties, port, removeProperties
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.jena.daml.DAMLCommon
getAll, getDAMLModel, getEquivalenceSet, getEquivalentValues, getNumPropertyValues, getPropertyValue, getPropertyValues, getRDFTypes, getVocabulary, hasRDFType, hasRDFType, prop_comment, prop_equivalentTo, prop_label, prop_type, remove, removeAll, removeProperty, replaceProperty, setPropertyValue, setRDFType, setRDFType
 
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.Resource
abort, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getId, getLocalName, getModel, getNameSpace, getProperty, getURI, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, isAnon, listProperties, listProperties, removeProperties, toString
 

Constructor Detail

DAMLDataInstanceImpl

public DAMLDataInstanceImpl(java.lang.String namespace,
                            java.lang.String name,
                            DAMLModel store,
                            DAMLVocabulary vocabulary)
Constructor, takes the name and namespace for this instance, and the underlying model it will be attached to. Note that it is assumed that the RDF store will contain a statement of the class to which this instance belongs.
Parameters:
namespace - The namespace the instance inhabits, or null
name - The name of the instance
store - The RDF store that contains the RDF statements defining the properties of the instance
vocabulary - Reference to the DAML vocabulary used by this instance.

DAMLDataInstanceImpl

public DAMLDataInstanceImpl(java.lang.String uri,
                            DAMLModel store,
                            DAMLVocabulary vocabulary)
Constructor, takes the URI for this instance, and the underlying model it will be attached to. Note that it is assumed that the RDF store will contain a statement of the class to which this instance belongs.
Parameters:
uri - The URI of the instance
store - The RDF store that contains the RDF statements defining the properties of the instance
vocabulary - Reference to the DAML vocabulary used by this instance.
Method Detail

prop_sameIndividualAs

public PropertyAccessor prop_sameIndividualAs()
Property accessor for daml:sameIndividualAs property on a DAML instance.
Specified by:
prop_sameIndividualAs in interface DAMLDataInstance
Returns:
a property accessor

getSameInstances

public java.util.Iterator getSameInstances()
Return an iterator over all of the instances that are the same as this one, by generating the transitive closure over the daml:samePropertyAs property.
Specified by:
getSameInstances in interface DAMLDataInstance
Returns:
an iterator whose values will all be DAMLInstance objects

getTranslator

public DatatypeTranslator getTranslator()
Answer the Datatype translator for values encoded by the datatype of this instance.
Specified by:
getTranslator in interface DAMLDataInstance
Returns:
the datatype translator defined by the DAMLDatatype that is the rdf:type of this instance, or null if it is not defined.

getValue

public java.lang.Object getValue()
Answer the value of this instance as a Java object, translated from the serialised RDF representation by the Dataype's translator.
Specified by:
getValue in interface DAMLDataInstance
Returns:
the value of this instance, or null if either the translator or the serialised value is defined

setValue

public void setValue(java.lang.Object value)
Set the value of this instance to the given Java value, which will be serialised into the RDF graph by the datatype's translator.
Specified by:
setValue in interface DAMLDataInstance
Parameters:
value - A Java value whose serialisation will be made the value of this data instance by setting the rdf:value relation.


Copyright © 2001 Hewlett-Packard. All Rights Reserved.