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

java.lang.Object
  |
  +--com.hp.hpl.mesa.rdf.jena.common.ResourceImpl
        |
        +--com.hp.hpl.jena.daml.common.DAMLCommonImpl
              |
              +--com.hp.hpl.jena.daml.common.DAMLClassImpl
All Implemented Interfaces:
DAMLClass, DAMLClassExpression, DAMLCommon, RDFNode, Resource, ResourceI
Direct Known Subclasses:
DAMLRestrictionImpl

public class DAMLClassImpl
extends DAMLCommonImpl
implements DAMLClass

Java representation of a DAML ontology Class. Note that the ontology classes are not the same as Java classes: think of classifications rather than active data structures.

Version:
CVS info: $Id: DAMLClassImpl.java,v 1.7 2002/01/18 10:00:24 ijd Exp $
Author:
Ian Dickinson, HP Labs (email)

Constructor Summary
DAMLClassImpl(java.lang.String uri, DAMLModel store, DAMLVocabulary vocabulary)
          Constructor, takes URI for this class, and the underlying model it will be attached to.
DAMLClassImpl(java.lang.String namespace, java.lang.String name, DAMLModel model, DAMLVocabulary vocabulary)
          Constructor, takes the name and namespace for this class, and the underlying model it will be attached to.
 
Method Summary
 java.util.Iterator getDefinedProperties()
          Answer an iteration of the properties that may be used for instances of this class: i.e.
 java.util.Iterator getDefinedProperties(boolean closed)
          Answer an iteration of the properties that may be used for instances of this class: i.e.
 java.util.Iterator getEquivalentValues()
          Answer an iterator over all of the DAML objects that are equivalent to this class, which will be the union of daml:equivalentTo and daml:sameClassAs.
 java.util.Iterator getInstances()
          Answer an iterator over the instances of this class that currently exist in the model.
 java.util.Iterator getSameClasses()
          Answer an iterator over all of the DAML classes that are equivalent to this value under the daml:sameClassAs relation.
 java.util.Iterator getSubClasses()
          Answer an iterator over the DAML classes (or, strictly, class expressions) that mention this class as one of its super-classes.
 java.util.Iterator getSubClasses(boolean closed)
          Answer an iterator over the DAML classes (or, strictly, class expressions) that mention this class as one of its super-classes.
 java.util.Iterator getSuperClasses()
          Answer an iterator over the DAML classes (or, strictly, class expressions) that mention this class as one of its sub-classes.
 java.util.Iterator getSuperClasses(boolean closed)
          Answer an iterator over the DAML classes (or, strictly, class expressions) that mention this class as one of its sub-classes.
 boolean hasSubClass(DAMLClass cls)
          Answer true if the given class is a sub-class of this class, using information from the rdf:subClassOf or daml:subClassOf relation.
 boolean hasSuperClass(DAMLClass cls)
          Answer true if the given class is a super-class of this class, using information from the rdf:subClassOf or daml:subClassOf relation.
 boolean isComplement()
          Answer true if this class expression is an boolean complement of a list of class expressions.
 boolean isDisjointUnion()
          Answer true if this class expression is a disjoint union of a list of class expressions.
 boolean isEnumeration()
          Answer true if this class expression is an enumeration (i.e.
 boolean isIntersection()
          Answer true if this class expression is an boolean intersection of a list of class expressions.
 boolean isNamedClass()
          Answer true if this class expression is an named class (i.e.
 boolean isRestriction()
          Answer true if this class expression is an property restriction (i.e.
 boolean isUnion()
          Answer true if this class expression is an boolean union of a list of class expressions.
 PropertyAccessor prop_complementOf()
          Property accessor for the property 'compelementOf', which is one element of the range of boolean expressions over classes permitted by DAML.
 PropertyAccessor prop_disjointUnionOf()
          Property accessor for the 'disjointUnionOf' property of a class.
 PropertyAccessor prop_disjointWith()
          Property accessor for the 'disjointWith' property of a class.
 PropertyAccessor prop_intersectionOf()
          Property accessor for the property 'intersectionOf', which is one element of the range of boolean expressions over classes permitted by DAML.
 PropertyAccessor prop_oneOf()
          Property accessor for the 'oneOf' property, which defines a class expression denoting that the class is exactly one of the given list of class expressions.
 PropertyAccessor prop_sameClassAs()
          Property accessor for the 'sameClassAs' property of a class.
 PropertyAccessor prop_subClassOf()
          Property accessor for the 'subClassOf' property of a class.
 PropertyAccessor prop_unionOf()
          Property accessor for the property 'unionOf', which is one element of the range of boolean expressions over classes permitted by DAML.
 
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
 

Constructor Detail

DAMLClassImpl

public DAMLClassImpl(java.lang.String namespace,
                     java.lang.String name,
                     DAMLModel model,
                     DAMLVocabulary vocabulary)
Constructor, takes the name and namespace for this class, and the underlying model it will be attached to.
Parameters:
namespace - The namespace the class inhabits, or null
name - The name of the class
model - Reference to the DAML model that will contain statements about this DAML class.
vocabulary - Reference to the DAML vocabulary used by this class.

DAMLClassImpl

public DAMLClassImpl(java.lang.String uri,
                     DAMLModel store,
                     DAMLVocabulary vocabulary)
Constructor, takes URI for this class, and the underlying model it will be attached to.
Parameters:
uri - The URI of the class
store - Reference to the DAML store that will contain statements about this DAML class.
vocabulary - Reference to the DAML vocabulary used by this class.
Method Detail

prop_subClassOf

public PropertyAccessor prop_subClassOf()
Property accessor for the 'subClassOf' property of a class. This denotes a class-expression that is a super-class of this class.
Specified by:
prop_subClassOf in interface DAMLClass
Returns:
Property accessor for 'onProperty'.

prop_disjointWith

public PropertyAccessor prop_disjointWith()
Property accessor for the 'disjointWith' property of a class. This denotes a class-expression with which this class has no instances in common.
Specified by:
prop_disjointWith in interface DAMLClass
Returns:
Property accessor for 'disjointWith'.

prop_disjointUnionOf

public PropertyAccessor prop_disjointUnionOf()
Property accessor for the 'disjointUnionOf' property of a class. This denotes a list of class expressions that are each pair-wise disjoint, and whose union describes this class.
Specified by:
prop_disjointUnionOf in interface DAMLClass
Returns:
Property accessor for 'disjointUnionOf'.

prop_sameClassAs

public PropertyAccessor prop_sameClassAs()
Property accessor for the 'sameClassAs' property of a class. This denotes a class-expression whose instances are the same those of this class.
Specified by:
prop_sameClassAs in interface DAMLClass
Returns:
Property accessor for 'sameClassAs'.

prop_unionOf

public PropertyAccessor prop_unionOf()
Property accessor for the property 'unionOf', which is one element of the range of boolean expressions over classes permitted by DAML.
Specified by:
prop_unionOf in interface DAMLClass
Returns:
property accessor for 'unionOf'.

prop_intersectionOf

public PropertyAccessor prop_intersectionOf()
Property accessor for the property 'intersectionOf', which is one element of the range of boolean expressions over classes permitted by DAML.
Specified by:
prop_intersectionOf in interface DAMLClass
Returns:
property accessor for 'intersectionOf'.

prop_complementOf

public PropertyAccessor prop_complementOf()
Property accessor for the property 'compelementOf', which is one element of the range of boolean expressions over classes permitted by DAML.
Specified by:
prop_complementOf in interface DAMLClass
Returns:
property accessor for 'complementOf'.

prop_oneOf

public PropertyAccessor prop_oneOf()
Property accessor for the 'oneOf' property, which defines a class expression denoting that the class is exactly one of the given list of class expressions.
Specified by:
prop_oneOf in interface DAMLClass
Returns:
property accessor for 'oneOf'

isEnumeration

public boolean isEnumeration()
Answer true if this class expression is an enumeration (i.e. has a property 'oneOf' with a list of values). This is not an exclusive property, a class expression can be an enumeration at the same time as one of the other kinds of class expression, though the conjunction of these may produce the Nothing class.
Specified by:
isEnumeration in interface DAMLClassExpression
Returns:
true if this class expression is an enumeration.

isNamedClass

public boolean isNamedClass()
Answer true if this class expression is an named class (i.e. is not an anonymous class expression). This is not an exclusive property, a class expression can be named at the same time as one of the other kinds of class expression, though the conjunction of these may produce the Nothing class.
Specified by:
isNamedClass in interface DAMLClassExpression
Returns:
true if this class expression is a named class.

isRestriction

public boolean isRestriction()
Answer true if this class expression is an property restriction (i.e. is a Restriction value). This is not an exclusive property, a class expression can be a property restriction at the same time as one of the other kinds of class expression, though the conjunction of these may produce the Nothing class.
Specified by:
isRestriction in interface DAMLClassExpression
Returns:
necessarily false, since restrictions are represented by a different Java class (see DAMLRestriction).

isIntersection

public boolean isIntersection()
Answer true if this class expression is an boolean intersection of a list of class expressions. This is not an exclusive property, a class expression can be an intersection at the same time as one of the other kinds of class expression, though the conjunction of these may produce the Nothing class.
Specified by:
isIntersection in interface DAMLClassExpression
Returns:
true if this class expression is an intersection.

isUnion

public boolean isUnion()
Answer true if this class expression is an boolean union of a list of class expressions. This is not an exclusive property, a class expression can be an union at the same time as one of the other kinds of class expression, though the conjunction of these may produce the Nothing class.
Specified by:
isUnion in interface DAMLClassExpression
Returns:
true if this class expression is a union.

isDisjointUnion

public boolean isDisjointUnion()
Answer true if this class expression is a disjoint union of a list of class expressions. This is not an exclusive property, a class expression can be a disjoint union at the same time as one of the other kinds of class expression, though the conjunction of these may produce the Nothing class.
Specified by:
isDisjointUnion in interface DAMLClassExpression
Returns:
true if this class expression is a disjoint union.

isComplement

public boolean isComplement()
Answer true if this class expression is an boolean complement of a list of class expressions. This is not an exclusive property, a class expression can be an complement at the same time as one of the other kinds of class expression, though the conjunction of these may produce the Nothing class.
Specified by:
isComplement in interface DAMLClassExpression
Returns:
true if this class expression is a complement.

getSubClasses

public java.util.Iterator getSubClasses()
Answer an iterator over the DAML classes (or, strictly, class expressions) that mention this class as one of its super-classes. Will generate the closure of the iteration over the sub-class relationship.
Specified by:
getSubClasses in interface DAMLClass
Returns:
an iterator over this class's sub-classes. The members of the iteration will be DAMLClass objects.

getSubClasses

public java.util.Iterator getSubClasses(boolean closed)
Answer an iterator over the DAML classes (or, strictly, class expressions) that mention this class as one of its super-classes.
Specified by:
getSubClasses in interface DAMLClass
Parameters:
closed - If true, close the iteration over the sub-class relation: i.e. return the sub-classes of the sub-classes, etc.
Returns:
an iterator over this class's sub-classes. The members of the iteration will be DAMLClass objects.

getSuperClasses

public java.util.Iterator getSuperClasses()
Answer an iterator over the DAML classes (or, strictly, class expressions) that mention this class as one of its sub-classes. Will generate the closure of the iteration over the super-class relationship.
Specified by:
getSuperClasses in interface DAMLClass
Returns:
an iterator over this class's super-classes. The members of the iteration will be DAMLClass objects.

getSuperClasses

public java.util.Iterator getSuperClasses(boolean closed)
Answer an iterator over the DAML classes (or, strictly, class expressions) that mention this class as one of its sub-classes.
Specified by:
getSuperClasses in interface DAMLClass
Parameters:
closed - If true, close the iteration over the super-class relation: i.e. return the super-classes of the super-classes, etc.
Returns:
an iterator over this class's sub-classes. The members of the iteration will be DAMLClass objects.

getSameClasses

public java.util.Iterator getSameClasses()
Answer an iterator over all of the DAML classes that are equivalent to this value under the daml:sameClassAs relation. Note: only considers daml:sameClassAs, for general equivalence, see getEquivalentValues().
Specified by:
getSameClasses in interface DAMLClass
Returns:
an iterator ranging over every equivalent DAML class - each value of the iteration will be a DAMLClass object.

getEquivalentValues

public java.util.Iterator getEquivalentValues()
Answer an iterator over all of the DAML objects that are equivalent to this class, which will be the union of daml:equivalentTo and daml:sameClassAs.
Specified by:
getEquivalentValues in interface DAMLClass
Overrides:
getEquivalentValues in class DAMLCommonImpl
Returns:
an iterator ranging over every equivalent DAML class - each value of the iteration should be a DAMLClass object.

hasSubClass

public boolean hasSubClass(DAMLClass cls)
Answer true if the given class is a sub-class of this class, using information from the rdf:subClassOf or daml:subClassOf relation.
Specified by:
hasSubClass in interface DAMLClass
Parameters:
cls - A DAMLClass object
Returns:
True if this class is a super-class of the given class.

hasSuperClass

public boolean hasSuperClass(DAMLClass cls)
Answer true if the given class is a super-class of this class, using information from the rdf:subClassOf or daml:subClassOf relation.
Specified by:
hasSuperClass in interface DAMLClass
Parameters:
cls - A DAMLClass object
Returns:
True if this class is a sub-class of the given class.

getInstances

public java.util.Iterator getInstances()
Answer an iterator over the instances of this class that currently exist in the model.
Specified by:
getInstances in interface DAMLClass
Returns:
An iterator over those instances that have this class as one of the classes to which they belong
See Also:
DAMLCommon.getRDFTypes(boolean)

getDefinedProperties

public java.util.Iterator getDefinedProperties()
Answer an iteration of the properties that may be used for instances of this class: i.e. the properties that have this class, or one of its super-classes, as domain.
Specified by:
getDefinedProperties in interface DAMLClass
Returns:
An iteration of the properties that have this class as domain

getDefinedProperties

public java.util.Iterator getDefinedProperties(boolean closed)
Answer an iteration of the properties that may be used for instances of this class: i.e. the properties that have this class, or optionally one of its super-classes, as domain.
Specified by:
getDefinedProperties in interface DAMLClass
Parameters:
closed - If true, close the iteration over the super-classes of this class.
Returns:
An iteration of the properties that have this class as domain


Copyright © 2001 Hewlett-Packard. All Rights Reserved.