Class OWLObjectWalker<O extends OWLObject>

java.lang.Object
org.semanticweb.owlapi.util.OWLObjectWalker<O>
Type Parameters:
O - the returned type
Direct Known Subclasses:
OWLClassLiteralCollector, OWLOntologyWalker

public class OWLObjectWalker<O extends OWLObject> extends Object
Since:
2.2.0
Author:
Matthew Horridge, The University Of Manchester, Information Management Group
  • Constructor Details

    • OWLObjectWalker

      public OWLObjectWalker(Collection<O> objects)
      Parameters:
      objects - objects to visit
    • OWLObjectWalker

      public OWLObjectWalker(Stream<O> objects)
      Parameters:
      objects - objects to visit
    • OWLObjectWalker

      public OWLObjectWalker(Collection<O> objects, boolean walkDuplicates)
      Parameters:
      objects - objects to visit
      walkDuplicates - true if duplicates should be visited
    • OWLObjectWalker

      public OWLObjectWalker(Stream<O> objects, boolean walkDuplicates)
      Parameters:
      objects - objects to visit
      walkDuplicates - true if duplicates should be visited
    • OWLObjectWalker

      public OWLObjectWalker(Stream<O> objects, boolean walkDuplicates, AnnotationWalkingControl walkFlag)
      Parameters:
      objects - objects to visit
      walkDuplicates - true if duplicates should be visited
      walkFlag - control which annotations to visit
    • OWLObjectWalker

      public OWLObjectWalker(Collection<O> objects, boolean visitDuplicates, AnnotationWalkingControl walkFlag)
      Parameters:
      objects - the set of objects to visit
      visitDuplicates - true if duplicates should be visited
      walkFlag - control which annotations to visit
  • Method Details

    • setStructureWalker

      public void setStructureWalker(StructureWalker<O> walker)
      Parameters:
      walker - the structure walker to use with this object walker
    • walkStructure

      public void walkStructure(OWLObjectVisitorEx<?> v)
      Parameters:
      v - visitor to use over the objects
    • walkStructure

      public void walkStructure(OWLObjectVisitor v)
      Parameters:
      v - visitor to use over the objects
    • getOntology

      @Nullable public OWLOntology getOntology()
      Gets the last ontology to be visited.
      Returns:
      The last ontology to be visited
    • getAxiom

      @Nullable public OWLAxiom getAxiom()
      Gets the last axiom to be visited.
      Returns:
      The last axiom to be visited, or null if an axiom has not be visited
    • setAxiom

      public void setAxiom(@Nullable OWLAxiom axiom)
      Allow the structure walker to set the current axiom.
      Parameters:
      axiom - the axiom to set
    • getAnnotation

      @Nullable public OWLAnnotation getAnnotation()
      Gets the last annotation to be visited.
      Returns:
      The last annotation to be visited (may be null)
    • setAnnotation

      public void setAnnotation(OWLAnnotation node)
      Allow the structure walker to set the current annotation.
      Parameters:
      node - the annotation to set
    • getClassExpressionPath

      public List<OWLClassExpression> getClassExpressionPath()
      Gets the current class expression path. The current class expression path is a list of class expressions that represents the containing expressions for the current class expressions. The first item in the path (list) is the root class expression that was visited. For i between 0 and pathLength, the item at index i+1 is a direct sub-expression of the item at index i. The last item in the path is the current class expression being visited.
      Returns:
      A list of class expressions that represents the path of class expressions, with the root of the class expression being the first element in the list.
    • isFirstClassExpressionInPath

      public boolean isFirstClassExpressionInPath(OWLClassExpression classExpression)
      Determines if a particular class expression is the first (or root) class expression in the current class expression path.
      Parameters:
      classExpression - The class expression
      Returns:
      true if the specified class expression is the first class expression in the current class expression path, otherwise false (false if the path is empty)
    • getDataRangePath

      public List<OWLDataRange> getDataRangePath()
      Gets the current data range path. The current data range path is a list of data ranges that represents the containing expressions for the current data ranges. The first item in the path (list) is the root data range that was visited. For i between 0 and pathLength, the item at index i+1 is a direct sub-expression of the item at index i. The last item in the path is the current data range being visited.
      Returns:
      A list of data ranges that represents the path of data ranges, with the root of the data range being the first element in the list.