@Override public void updateTranslation() throws UnsupportedAxiomsException { prepareUpdate(); translation.clear(); final boolean hasDisjunctions = ontologyNormalization.hasDisjunctions(); RuntimesLogger.start("ontology translation"); translation.addAll(translation(originalAxiomsTranslator)); if (hasDisjunctions) { translation.addAll(translation(doubleAxiomsTranslator)); translation.addAll(disjunctionsTranslation()); RuntimesLogger.stop("ontology translation", "loading"); RuntimesLogger.start("ontology classification"); for (final OWLEntity e : graph.getUnsatisfiableEntities()) if (e instanceof OWLClass) translation.addAll(doubleAxiomsTranslator.unsatisfiabilityTranslation((OWLClass) e)); else if (e instanceof OWLProperty) translation.addAll(doubleAxiomsTranslator.unsatisfiabilityTranslation((OWLProperty) e)); for (final OWLObjectProperty p : graph.getIrreflexiveRoles()) translation.add(doubleAxiomsTranslator.unreflexivityTranslation(p)); RuntimesLogger.stop("ontology classification", "loading"); } RuntimesLogger.stop("ontology translation", "loading"); }
/** * Translate the negative axioms of the ontology that this ontology refers with a given {@link * QLAxiomsTranslator}. * * @return the translation of the negative axioms. */ private Set<Rule> disjunctionsTranslation() { final Set<Rule> result = new HashSet<Rule>(); for (final OWLDisjointClassesAxiom disjunction : ontologyNormalization.conceptDisjunctions()) { final List<OWLClassExpression> concepts = disjunction.getClassExpressionsAsList(); assert concepts.size() <= 2; result.addAll( doubleAxiomsTranslator.disjunctionTranslation(concepts.get(0), concepts.get(1))); } for (final OWLDisjointObjectPropertiesAxiom disjunction : ontologyNormalization.roleDisjunctions()) { final List<OWLObjectPropertyExpression> roles = new LinkedList<OWLObjectPropertyExpression>(disjunction.getProperties()); assert roles.size() <= 2; result.addAll(doubleAxiomsTranslator.disjunctionTranslation(roles.get(0), roles.get(1))); } for (final OWLDisjointDataPropertiesAxiom disjunction : ontologyNormalization.dataDisjunctions()) { final List<OWLDataPropertyExpression> roles = new LinkedList<OWLDataPropertyExpression>(disjunction.getProperties()); assert roles.size() <= 2; result.addAll(doubleAxiomsTranslator.disjunctionTranslation(roles.get(0), roles.get(1))); } return result; }