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

java.lang.Object
  |
  +--com.hp.hpl.mesa.rdf.jena.common.ResourceImpl
        |
        +--com.hp.hpl.jena.daml.common.DAMLCommonImpl
              |
              +--com.hp.hpl.jena.daml.common.DAMLPropertyImpl
All Implemented Interfaces:
DAMLCommon, DAMLProperty, Property, RDFNode, Resource, ResourceI
Direct Known Subclasses:
DAMLDatatypePropertyImpl, DAMLObjectPropertyImpl

public class DAMLPropertyImpl
extends DAMLCommonImpl
implements DAMLProperty

Java encapsulation of a property in a DAML ontology. In DAML, properties are first-class values in their own right, and not just aspects of classes.

Version:
CVS info: $Id: DAMLPropertyImpl.java,v 1.6 2002/03/04 12:49:09 ian_dickinson Exp $
Author:
Ian Dickinson, HP Labs (email)

Constructor Summary
DAMLPropertyImpl(java.lang.String uri, DAMLModel store, DAMLVocabulary vocabulary)
          Constructor, takes the URI for this property, and the underlying model it will be attached to.
DAMLPropertyImpl(java.lang.String namespace, java.lang.String name, DAMLModel store, DAMLVocabulary vocabulary)
          Constructor, takes the name and namespace for this property, and the underlying model it will be attached to.
 
Method Summary
 java.util.Iterator getDomainClasses()
          Answer an iterator over all of the DAML classes that form the domain of this property.
 java.util.Iterator getEquivalentValues()
          Answer an iterator over all of the DAML objects that are equivalent to this property, which will be the union of daml:equivalentTo and daml:samePropertyAs.
 int getOrdinal()
          Answers the ordinal value of a containment property.
 java.util.Iterator getRangeClasses()
          Answer an iterator over all of the DAML classes that form the range of this property.
 java.util.Iterator getSameProperties()
          Answer an iterator over all of the DAML properties that are equivalent to this value under the daml:samePropertyAs relation.
 java.util.Iterator getSubProperties()
          Answer an iterator over all of the sub-properties of this property, using the rdfs:subPropertyOf relation (or one of its aliases).
 java.util.Iterator getSubProperties(boolean closed)
          Answer an iterator over all of the sub-properties of this property, using the rdfs:subPropertyOf relation (or one of its aliases).
 java.util.Iterator getSuperProperties()
          Answer an iterator over all of the super-properties of this property, using the rdfs:subPropertyOf relation (or one of its aliases).
 java.util.Iterator getSuperProperties(boolean closed)
          Answer an iterator over all of the super-properties of this property, using the rdfs:subPropertyOf relation (or one of its aliases).
 boolean isUnique()
          Answer true if this property is to be considered unique, that is it is characterised by the DAML class UniqueProperty
 Resource port(Model m)
          This is a Jena internal method.
 PropertyAccessor prop_domain()
          Property accessor for the 'domain' property of a property.
 PropertyAccessor prop_range()
          Property accessor for the 'range' property of a property.
 PropertyAccessor prop_samePropertyAs()
          Property accessor for the 'samePropertyAs' property of a property.
 PropertyAccessor prop_subPropertyOf()
          Property accessor for the 'subPropertyOf' property of a property.
 void setIsUnique(boolean unique)
          Set the flag to indicate that this property is to be considered unique - that is, it is defined by the DAML class UniqueProperty.
 java.lang.String toString()
          Return a readable representation of the DAML value
 
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
 
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, 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
 
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.Property
getLocalName, getNameSpace
 

Constructor Detail

DAMLPropertyImpl

public DAMLPropertyImpl(java.lang.String namespace,
                        java.lang.String name,
                        DAMLModel store,
                        DAMLVocabulary vocabulary)
Constructor, takes the name and namespace for this property, and the underlying model it will be attached to.
Parameters:
namespace - The namespace the property inhabits, or null
name - The name of the property
store - The RDF store that contains the RDF statements defining the properties of the property
vocabulary - Reference to the DAML vocabulary used by this property.

DAMLPropertyImpl

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

toString

public java.lang.String toString()
Return a readable representation of the DAML value
Specified by:
toString in interface Resource
Overrides:
toString in class DAMLCommonImpl
Returns:
a string denoting this value

setIsUnique

public void setIsUnique(boolean unique)
Set the flag to indicate that this property is to be considered unique - that is, it is defined by the DAML class UniqueProperty.
Specified by:
setIsUnique in interface DAMLProperty
Parameters:
unique - True for a unique property

isUnique

public boolean isUnique()
Answer true if this property is to be considered unique, that is it is characterised by the DAML class UniqueProperty
Specified by:
isUnique in interface DAMLProperty
Returns:
True if this property is unique

prop_domain

public PropertyAccessor prop_domain()
Property accessor for the 'domain' property of a property. This denotes the class that is the domain of the relation denoted by the property.
Specified by:
prop_domain in interface DAMLProperty
Returns:
Property accessor for 'domain'.

prop_subPropertyOf

public PropertyAccessor prop_subPropertyOf()
Property accessor for the 'subPropertyOf' property of a property. This denotes the property that is the super-property of this property
Specified by:
prop_subPropertyOf in interface DAMLProperty
Returns:
Property accessor for 'subPropertyOf'.

prop_samePropertyAs

public PropertyAccessor prop_samePropertyAs()
Property accessor for the 'samePropertyAs' property of a property. This denotes that two properties should be considered equivalent.
Specified by:
prop_samePropertyAs in interface DAMLProperty
Returns:
Property accessor for 'samePropertyAs'.

prop_range

public PropertyAccessor prop_range()
Property accessor for the 'range' property of a property. This denotes the class that is the range of the relation denoted by the property.
Specified by:
prop_range in interface DAMLProperty
Returns:
Property accessor for 'range'.

getSameProperties

public java.util.Iterator getSameProperties()
Answer an iterator over all of the DAML properties that are equivalent to this value under the daml:samePropertyAs relation. Note: only considers daml:samePropertyAs, for general equivalence, see getEquivalentValues(). Note that the first member of the iteration is always the DAMLProperty on which the method is invoked: trivially, a property is a member of the set of properties equivalent to itself. If the caller wants the set of properties equivalent to this one, not including itself, simply ignore the first element of the iteration.
Specified by:
getSameProperties in interface DAMLProperty
Returns:
an iterator ranging over every equivalent DAML property - each value of the iteration will be a DAMLProperty object.

getEquivalentValues

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

getSuperProperties

public java.util.Iterator getSuperProperties()
Answer an iterator over all of the super-properties of this property, using the rdfs:subPropertyOf relation (or one of its aliases). The set of super-properties is transitively closed over the subPropertyOf relation.
Specified by:
getSuperProperties in interface DAMLProperty
Returns:
An iterator over the super-properties of this property, whose values will be DAMLProperties.

getSuperProperties

public java.util.Iterator getSuperProperties(boolean closed)
Answer an iterator over all of the super-properties of this property, using the rdfs:subPropertyOf relation (or one of its aliases). The set of super-properties is optionally transitively closed over the subPropertyOf relation.
Specified by:
getSuperProperties in interface DAMLProperty
Parameters:
closed - If true, iterate over the super-properties of my super-properties, etc.
Returns:
An iterator over the super-properties of this property, whose values will be DAMLProperties.

getSubProperties

public java.util.Iterator getSubProperties()
Answer an iterator over all of the sub-properties of this property, using the rdfs:subPropertyOf relation (or one of its aliases). The set of sub-properties is transitively closed over the subPropertyOf relation.
Specified by:
getSubProperties in interface DAMLProperty
Returns:
An iterator over the sub-properties of this property, whose values will be DAMLProperties.

getSubProperties

public java.util.Iterator getSubProperties(boolean closed)
Answer an iterator over all of the sub-properties of this property, using the rdfs:subPropertyOf relation (or one of its aliases). The set of sub-properties is optionally transitively closed over the subPropertyOf relation.
Specified by:
getSubProperties in interface DAMLProperty
Parameters:
closed - If true, iterate over the sub-properties of my sub-properties, etc.
Returns:
An iterator over the sub-properties of this property, whose values will be DAMLProperties.

getDomainClasses

public java.util.Iterator getDomainClasses()
Answer an iterator over all of the DAML classes that form the domain of this property. The actual domain of the relation denoted by this property is the conjunction of all of the classes mention by the RDFS:domain property of this DAML property and all of its super-properties.
Specified by:
getDomainClasses in interface DAMLProperty
Returns:
an iterator whose values will be the DAML classes that define the domain of the relation

getRangeClasses

public java.util.Iterator getRangeClasses()
Answer an iterator over all of the DAML classes that form the range of this property. The actual range of the relation denoted by this property is the conjunction of all of the classes mention by the RDFS:range property of this DAML property and all of its super-properties.
Specified by:
getRangeClasses in interface DAMLProperty
Returns:
an iterator whose values will be the DAML classes that define the range of the relation

getOrdinal

public int getOrdinal()
Answers the ordinal value of a containment property. Since DAML properties are not used as containment properties, this method always returns 0. See getOrdinal for more details.
Specified by:
getOrdinal in interface Property
Returns:
zero.

port

public Resource port(Model m)
              throws RDFException
This is a Jena internal method. I need to override the one in ResourceImpl to prevent a ClassCastException in some circumstances.
Overrides:
port in class ResourceImpl
Parameters:
m - The model to port to
Returns:
The ported resource
Throws:
RDFException - if an RDF processing error ocurrs.


Copyright © 2001 Hewlett-Packard. All Rights Reserved.