com.hp.hpl.jena.daml.common
Class DAMLInstanceImpl
java.lang.Object
|
+--com.hp.hpl.mesa.rdf.jena.common.ResourceImpl
|
+--com.hp.hpl.jena.daml.common.DAMLCommonImpl
|
+--com.hp.hpl.jena.daml.common.DAMLInstanceImpl
- All Implemented Interfaces:
- DAMLCommon, DAMLInstance, RDFNode, Resource, ResourceI
- public class DAMLInstanceImpl
- extends DAMLCommonImpl
- implements DAMLInstance
Java representation of a DAML Instance.
- Version:
- CVS info: $Id: DAMLInstanceImpl.java,v 1.2 2002/01/08 22:31:26 ijd Exp $
- Author:
- Ian Dickinson, HP Labs (email)
|
Constructor Summary |
DAMLInstanceImpl(java.lang.String uri,
DAMLModel store,
DAMLVocabulary vocabulary)
Constructor, takes the URI for this instance, and the underlying
model it will be attached to. |
DAMLInstanceImpl(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 |
PropertyAccessor |
accessProperty(Property property)
Answer a property accessor for a user defined property. |
java.util.Iterator |
getEquivalentValues()
Answer an iterator over all of the DAML objects that are equivalent to this
instance, which will be the union of daml:equivalentTo and
daml:sameIndividualAs. |
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. |
PropertyAccessor |
prop_sameIndividualAs()
Property accessor for daml:sameIndividualAs property on a DAML instance. |
| Methods inherited from class com.hp.hpl.jena.daml.common.DAMLCommonImpl |
getAll, getDAMLModel, getEquivalenceSet, 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, 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 |
DAMLInstanceImpl
public DAMLInstanceImpl(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 nullname - The name of the instancestore - The RDF store that contains the RDF statements defining the properties of the instancevocabulary - Reference to the DAML vocabulary used by this instance.
DAMLInstanceImpl
public DAMLInstanceImpl(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 instancestore - The RDF store that contains the RDF statements defining the properties of the instancevocabulary - Reference to the DAML vocabulary used by this instance.
prop_sameIndividualAs
public PropertyAccessor prop_sameIndividualAs()
- Property accessor for
daml:sameIndividualAs property on a DAML instance.
- Specified by:
prop_sameIndividualAs in interface DAMLInstance
- 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 DAMLInstance
- Returns:
- an iterator whose values will all be DAMLInstance objects
getEquivalentValues
public java.util.Iterator getEquivalentValues()
- Answer an iterator over all of the DAML objects that are equivalent to this
instance, which will be the union of
daml:equivalentTo and
daml:sameIndividualAs.
- Specified by:
getEquivalentValues in interface DAMLInstance- Overrides:
getEquivalentValues in class DAMLCommonImpl
- Returns:
- an iterator ranging over every equivalent DAML instance - each value of
the iteration should be a DAMLInstance object.
accessProperty
public PropertyAccessor accessProperty(Property property)
- Answer a property accessor for a user defined property. TODO: think of
a better name for this method!
- Specified by:
accessProperty in interface DAMLInstance
- Parameters:
property - An RDF or DAML property- Returns:
- a property accessor, that simplifies some of the basic operations
of a given property on a given object
Copyright © 2001 Hewlett-Packard. All Rights Reserved.