com.hp.hpl.jena.ontology.daml
Interface PropertyAccessor

All Known Subinterfaces:
IntLiteralAccessor, LiteralAccessor

public interface PropertyAccessor

Encapsulates the standard methods of modifying a property on a DAML value.

Version:
CVS info: $Id: PropertyAccessor.java,v 1.5 2004/12/06 13:50:18 andy_seaborne Exp $
Author:
Ian Dickinson, HP Labs (email)

Method Summary
 void add(RDFNode value)
          Add a value to the encapsulated property.
 int count()
          Answer the number of values that the encapsulated property has in the RDF model.
 RDFNode get()
          Answer a general value of the encapsulated property.
 NodeIterator getAll()
          Answer an iteration over the DAML values that this property has in the RDF model.
 DAMLCommon getDAMLValue()
          Answer a value of the encapsulated property, converted to a DAML common value
 DAMLList getList()
          Answer the value of the encapsulated property, presented as a DAML list.
 Property getProperty()
          Answer the property that this accessor works on
 boolean hasValue(RDFNode value)
          Answer true if the encapsulated property has the given value as one of its values.
 void remove(RDFNode value)
          Remove a value from the encapsulated property.
 

Method Detail

getProperty

Property getProperty()

Answer the property that this accessor works on

Returns:
A property

count

int count()

Answer the number of values that the encapsulated property has in the RDF model.

Returns:
The number statements for this property in the model.

getAll

NodeIterator getAll()

Answer an iteration over the DAML values that this property has in the RDF model.

Note: In Jena 1, this method took a paramter closed, to control whether the transitive closure of the class and property hierarchies was considered. Computing these entailments is now handled by the reaoner attached to the DAML or Ontology model, and is not controlled by a method parameter at the API level. Accordingly, this parameter has been removed. See the documentation for details on controlling the operation of the reasoners.

Returns:
An iteration over the values of the encapsulated property.

get

RDFNode get()

Answer a general value of the encapsulated property. If it has no values, answer null. If it has one value, answer that value. Otherwise, answer an undetermined member of the set of values. See also getDAMLValue().

Returns:
A value for the encapsulated property in the RDF model, or null if the property has no value.

getList

DAMLList getList()

Answer the value of the encapsulated property, presented as a DAML list. If it has no values, answer null. If it has one value, answer that value (as a list). Otherwise, answer an undetermined member of the set of values. See also getDAMLValue().

Returns:
A value for the encapsulated property in the RDF model, or null if the property has no value.
Throws:
ConversionException - if the value is not a list

getDAMLValue

DAMLCommon getDAMLValue()

Answer a value of the encapsulated property, converted to a DAML common value

Returns:
A DAML value for the encapsulated property in the RDF model, or null if the property has no value.

add

void add(RDFNode value)

Add a value to the encapsulated property.

Parameters:
value - The value to be added.

remove

void remove(RDFNode value)

Remove a value from the encapsulated property.

Parameters:
value - The value to be removed.

hasValue

boolean hasValue(RDFNode value)

Answer true if the encapsulated property has the given value as one of its values.

Parameters:
value - A value to test for
Returns:
True if the RDF model contains a statement giving a value for the encapsulated property matching the given value.


Copyright © 2000, 2001, 2002, 2003, 2004 Hewlett-Packard Development Company, LP