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(); }
public ArrayList<OWLAxiom> rebuild(OWLAxiom axiom) throws TranscriptionException { this.rebuiltAxioms = new ArrayList<OWLAxiom>(); this.rebuiltObjects = new ArrayList<OWLObject>(); if (axiom instanceof OWLSubClassAxiom || axiom instanceof OWLSubClassAxiomImpl) { this.rebuild((OWLSubClassAxiom) axiom); } else if (axiom instanceof OWLEquivalentClassesAxiom) { this.rebuild((OWLEquivalentClassesAxiom) axiom); } else if (axiom instanceof OWLDisjointUnionAxiom) { this.rebuild((OWLDisjointUnionAxiom) axiom); } else if (axiom instanceof OWLDisjointClassesAxiom) { this.rebuild((OWLDisjointClassesAxiom) axiom); } else if (axiom instanceof OWLDataPropertyDomainAxiom) { this.rebuild((OWLDataPropertyDomainAxiom) axiom); } else if (axiom instanceof OWLDataPropertyRangeAxiom) { this.rebuild((OWLDataPropertyRangeAxiom) axiom); } else if (axiom instanceof OWLObjectPropertyDomainAxiom) { this.rebuild((OWLObjectPropertyDomainAxiom) axiom); } else if (axiom instanceof OWLObjectPropertyRangeAxiom) { this.rebuild((OWLObjectPropertyRangeAxiom) axiom); } else { throw new TranscriptionException( "could not rewrite ontology to get rid of nominals (" + axiom + " is " + axiom.getClass() + ")"); } return this.rebuiltAxioms; }
private Set<OWLAnnotation> duplicateAxiomAnnotations(OWLAxiom axiom) { Set<OWLAnnotation> duplicatedAnnos = new HashSet<OWLAnnotation>(); for (OWLAnnotation anno : axiom.getAnnotations()) { anno.accept(this); duplicatedAnnos.add((OWLAnnotation) obj); } return duplicatedAnnos; }
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; } }
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 }
private boolean isOBOAxiom(OWLAxiom axiom) { return axiom.accept(checker); }
// //////////////////////////////////////////////////////////////////////////////////////////// // // Axiom Visitor stuff // // //////////////////////////////////////////////////////////////////////////////////////////// protected void processAxiomAnnotations(OWLAxiom ax) { // default behavior: iterate over the annotations outside the axiom for (OWLAnnotation anno : ax.getAnnotations()) { anno.accept(this); } }
/** * 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); } }