コード例 #1
0
 private void populateResultUsingVisitor(List<OWLAxiom> result, OWLAxiomToTurtleVisitor visitor) {
   if (result != null) {
     for (OWLAxiom axiom : result) {
       axiom.accept(visitor);
     }
   }
 }
コード例 #2
0
 /**
  * Convert.
  *
  * @param axiom axiom to convert
  * @return converted class expression
  */
 public OWLClassExpression convert(OWLAxiom axiom) {
   converter.reset();
   axiom.accept(converter);
   OWLClassExpression result = converter.getResult();
   if (result == null) {
     throw new RuntimeException("Not supported yet");
   }
   return result;
 }
 public void visit(OWLOntology ontology) {
   checkOccurrence(ontology.getAnnotations());
   for (AxiomType<?> t : AxiomType.AXIOM_TYPES) {
     for (OWLAxiom ax : ontology.getAxioms(t)) {
       checkOccurrence(ax.getAnnotations());
       ax.accept(this);
     }
   }
   singleAppearance.clear();
 }
コード例 #4
0
 public Integer visit(OWLOntology ontology) {
   int max = _0;
   for (OWLAxiom axiom : ontology.getLogicalAxioms()) {
     int depth = axiom.accept(this);
     if (depth > max) {
       max = depth;
     }
   }
   return max;
 }
コード例 #5
0
 private List<Construct> getOrderedConstructs() {
   constructs.clear();
   constructs.add(AL);
   for (OWLOntology ont : ontologies) {
     for (OWLAxiom ax : ont.getLogicalAxioms()) {
       ax.accept(this);
     }
   }
   pruneConstructs();
   List<Construct> cons = new ArrayList<Construct>(constructs);
   Collections.sort(cons, new ConstructComparator());
   return cons;
 }
コード例 #6
0
 public Object getRelationshipType(Object parentObject, Object childObject) {
   AxiomEdge edge = new AxiomEdge(childObject, parentObject);
   OWLObject edgeObject = edgeMap.get(edge);
   if (edgeObject != null) {
     edgeNameGenerator.reset();
     if (edgeObject instanceof OWLClassExpression) {
       ((OWLClassExpression) edgeObject).accept(edgeNameGenerator);
     } else {
       ((OWLAxiom) edgeObject).accept(edgeNameGenerator);
     }
     return edgeNameGenerator.edgeName;
   } else {
     return null;
   }
 }
コード例 #7
0
 public int getRelationshipDirection(Object parentObject, Object childObject) {
   AxiomEdge edge = new AxiomEdge(childObject, parentObject);
   OWLObject edgeObject = edgeMap.get(edge);
   if (edgeObject != null) {
     edgeNameGenerator.reset();
     if (edgeObject instanceof OWLAxiom) {
       ((OWLAxiom) edgeObject).accept(edgeNameGenerator);
     } else {
       ((OWLClassExpression) edgeObject).accept(edgeNameGenerator);
     }
     return edgeNameGenerator.direction;
   }
   return -1; // if no edge found, negative direction for handling in
   // DefaultEdgeFactory
 }
コード例 #8
0
 private boolean isOBOAxiom(OWLAxiom axiom) {
   return axiom.accept(checker);
 }
コード例 #9
0
 public AxiomType<?> getAxiomType(OWLAxiom axiom) {
   axiom.accept(this);
   return axiomType;
 }
コード例 #10
0
 /**
  * This method clears all the map (invokes the clearMaps-method) at first. Then it iterates over
  * all axioms and invokes their accept-Method with "this" as parameter.
  *
  * @param axioms The axioms to visualize
  */
 public void addAndClearAxioms(Set<OWLAxiom> axioms) {
   this.clearMaps();
   for (OWLAxiom ax : axioms) {
     ax.accept(this);
   }
 }