|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.hp.hpl.jena.daml.PropertyIterator
Provides a means of traversing the relationships in a DAML model, respecting some of the extended semantics of DAML+OIL over RDF. In particular, the PropertyIterator knows about class, property and instance equivalence, transitive properties, inverse properties, the class hierarchy and the property hierarchy.
Given a property P, and a resource x, iterates over all the y such that
x P y
, respecting the fact that P may be transitive (so
x P y
and y P z
implies x P z
), and
symmetric (so x P y
implies y P x
). The iterator
is lazily evaluated, so changes to the model while iterating could generate
unpredictable results. The iterator does do loop detection, so should always
terminate (assuming the model is finite!). Deletion is not supported.
This iterator also supports the setting of a default value. The default value is an object that will be returned as the last value of the iteration, unless it has already been returned earlier.
Constructor Summary | |
PropertyIterator(java.util.Iterator roots,
Property pred,
Property inverse,
boolean isTransitive,
boolean isReflexive)
Construct a property iterator for the given property, starting from the given set of resources. |
|
PropertyIterator(java.util.Iterator roots,
Property pred,
Property inverse,
boolean isTransitive,
boolean isReflexive,
boolean useEquivalence)
Construct a property iterator for the given property, starting from the given set of resources. |
|
PropertyIterator(Resource root,
Property pred,
Property inverse,
boolean isTransitive,
boolean isReflexive)
Construct a property iterator for the given property, starting from the given resource. |
|
PropertyIterator(Resource root,
Property pred,
Property inverse,
boolean isTransitive,
boolean isReflexive,
boolean useEquivalence)
Construct a property iterator for the given property, starting from the given resource. |
Method Summary | |
boolean |
hasDefaultValue()
Answer true if this iteration has a default value. |
boolean |
hasNext()
Answer true if the iteration over the closure of the predicate will answer any values that have not yet been returned. |
java.lang.Object |
next()
Answer the next RDFNode in the iteration over the given predicate. |
void |
remove()
Unsupported operation in this iterator. |
void |
setDefaultValue(java.lang.Object defaultValue)
Set the default value for this iteration, which will be a value that is guaranteed to be returned as a member of the iteration. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PropertyIterator(Resource root, Property pred, Property inverse, boolean isTransitive, boolean isReflexive)
root
- The root resource from whence to start iterating over the closure of predpred
- The property to iterate overinverse
- The inverse of pred, or null if pred has no inverse. The inverse is used
to include resource y in the iteration if P' = inverse(P) and y P' x.isTransitive
- If true, the property is transitiveisReflexive
- If true, the property is reflexive (so, the root resource will be included
in the iteration).public PropertyIterator(Resource root, Property pred, Property inverse, boolean isTransitive, boolean isReflexive, boolean useEquivalence)
root
- The root resource from whence to start iterating over the closure of predpred
- The property to iterate overinverse
- The inverse of pred, or null if pred has no inverse. The inverse is used
to include resource y in the iteration if P' = inverse(P) and y P' x.isTransitive
- If true, the property is transitiveisReflexive
- If true, the property is reflexive (so, the root resource will be included
in the iteration).useEquivalence
- If true, equivalence between DAML values will be included in the
iteration (unless the model containing the DAML values has equivalence
switched off via com.hp.hpl.jena.daml.Model#setUseEquivalence
.public PropertyIterator(java.util.Iterator roots, Property pred, Property inverse, boolean isTransitive, boolean isReflexive)
roots
- A set of root resources from whence to start iterating over the closure of pred,
represented as an iteratorpred
- The property to iterate overinverse
- The inverse of pred, or null if pred has no inverse. The inverse is used
to include resource y in the iteration if P' = inverse(P) and y P' x.isTransitive
- If true, the property is transitiveisReflexive
- If true, the property is reflexive (so, the root resources will be included
in the iteration).public PropertyIterator(java.util.Iterator roots, Property pred, Property inverse, boolean isTransitive, boolean isReflexive, boolean useEquivalence)
roots
- A set of root resources from whence to start iterating over the closure of pred,
represented as an iteratorpred
- The property to iterate overinverse
- The inverse of pred, or null if pred has no inverse. The inverse is used
to include resource y in the iteration if P' = inverse(P) and y P' x.isTransitive
- If true, the property is transitiveisReflexive
- If true, the property is reflexive (so, the root resources will be included
in the iteration).useEquivalence
- If true, equivalence between DAML values will be included in the
iteration (unless the model containing the DAML values has equivalence
switched off via com.hp.hpl.jena.daml.Model#setUseEquivalence
.Method Detail |
public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
java.util.NoSuchElementException
- if the iterator has no more elementspublic void remove()
remove
in interface java.util.Iterator
java.lang.UnsupportedOperationException
- public void setDefaultValue(java.lang.Object defaultValue)
next()
.defaultValue
- The default value for the iteration, or null for
there to be no default value. The default default
value is null.public boolean hasDefaultValue()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |