/** * Gets an axiom that is structurally equivalent to the input axiom without * annotations. This essentially returns a version of the axiom stripped of * any annotations. * * @param axiom axiom to divest of annotations * @return The annotationless version of the axiom */ @SuppressWarnings("unchecked") static <T extends OWLAxiom> T getAxiomWithoutAnnotations(T axiom) { return axiom.getAxiomWithoutAnnotations((Class<T>) axiom.getClass()); }
/** * Gets an axiom that is structurally equivalent to the input axiom without * annotations. This essentially returns a version of the axiom stripped of * any annotations. * * @param axiom axiom to divest of annotations * @return The annotationless version of the axiom */ @SuppressWarnings("unchecked") static <T extends OWLAxiom> T getAxiomWithoutAnnotations(T axiom) { return axiom.getAxiomWithoutAnnotations((Class<T>) axiom.getClass()); }
/** * Gets an axiom that is structurally equivalent to the input axiom without * annotations. This essentially returns a version of the axiom stripped of * any annotations. * * @param axiom axiom to divest of annotations * @return The annotationless version of the axiom */ @SuppressWarnings("unchecked") static <T extends OWLAxiom> T getAxiomWithoutAnnotations(T axiom) { return axiom.getAxiomWithoutAnnotations((Class<T>) axiom.getClass()); }
public LaconicExplanationGeneratorBasedOnIncrementalOPlusWithDeltaPlusFiltering(Set<OWLAxiom> inputAxioms, EntailmentCheckerFactory<OWLAxiom> cf, ExplanationGeneratorFactory<OWLAxiom> delegate, ExplanationProgressMonitor<OWLAxiom> progressMonitor, OWLDataFactory df, Supplier<OWLOntologyManager> m) { this.dataFactory=df; this.inputAxioms = new HashSet<>(inputAxioms.size()); for (OWLAxiom in : inputAxioms) { this.inputAxioms.add(in.getAxiomWithoutAnnotations()); } this.delegate = delegate; this.entailmentCheckerFactory = cf; this.progressMonitor = progressMonitor; this.m = m; }
@Override public BigDecimal getParameter(OWLAxiom ax) { BigDecimal parameter = super.getParameter(ax); if (parameter == null) { String msg = "the given axiom: " + ax.getAxiomWithoutAnnotations() + " is not probabilistic or does not exist"; logger.warn(msg); } return parameter; }
/** * Determines if another axiom is equal to this axiom not taking into consideration the annotations on the axiom * * @param axiom The axiom to test if equal * @return <code>true</code> if <code>axiom</code> without annotations is equal to this axiom without annotations * otherwise <code>false</code>. */ public boolean equalsIgnoreAnnotations(OWLAxiom axiom) { return this.getAxiomWithoutAnnotations().equals(axiom.getAxiomWithoutAnnotations()); }
public void initialise(Engine e) { changes = e.getChanges(); for (OWLAxiom axiom : e.getOwlDiffMap().getUnmatchedTargetAxioms()) { logicalAxiomToAddedAxiomMap.put(axiom.getAxiomWithoutAnnotations(), axiom); } }
protected List<OWLOntologyChange> getReplaceChanges(OWLAnnotation oldAnnotation, OWLAnnotation newAnnotation) { List<OWLOntologyChange> changes = new ArrayList<>(); final OWLAxiom ax = getRoot().getAxiom(); final OWLOntology ont = getRoot().getOntology(); Set<OWLAnnotation> annotations = new HashSet<>(ax.getAnnotations()); annotations.remove(oldAnnotation); annotations.add(newAnnotation); newAxiom = ax.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); changes.add(new RemoveAxiom(ont, ax)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected List<OWLOntologyChange> getReplaceChanges(OWLAnnotation oldAnnotation, OWLAnnotation newAnnotation) { List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); final OWLAxiom ax = getRoot().getAxiom(); final OWLOntology ont = getRoot().getOntology(); Set<OWLAnnotation> annotations = new HashSet<OWLAnnotation>(ax.getAnnotations()); annotations.remove(oldAnnotation); annotations.add(newAnnotation); newAxiom = ax.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); changes.add(new RemoveAxiom(ont, ax)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected List<OWLOntologyChange> getReplaceChanges(OWLAnnotation oldAnnotation, OWLAnnotation newAnnotation) { List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); final OWLAxiom ax = getRoot().getAxiom(); final OWLOntology ont = getRoot().getOntology(); Set<OWLAnnotation> annotations = new HashSet<OWLAnnotation>(ax.getAnnotations()); annotations.remove(oldAnnotation); annotations.add(newAnnotation); newAxiom = ax.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); changes.add(new RemoveAxiom(ont, ax)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected List<OWLOntologyChange> getReplaceChanges(OWLAnnotation oldAnnotation, OWLAnnotation newAnnotation) { List<OWLOntologyChange> changes = new ArrayList<>(); final OWLAxiom ax = getRoot().getAxiom(); final OWLOntology ont = getRoot().getOntology(); Set<OWLAnnotation> annotations = new HashSet<>(ax.getAnnotations()); annotations.remove(oldAnnotation); annotations.add(newAnnotation); newAxiom = ax.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); changes.add(new RemoveAxiom(ont, ax)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected java.util.List<OWLOntologyChange> getAddChanges(OWLAnnotation annot) { List<OWLOntologyChange> changes = new ArrayList<>(); final OWLAxiom oldAxiom = getRoot().getAxiom(); Set<OWLAnnotation> annotations = new HashSet<>(oldAxiom.getAnnotations()); annotations.add(annot); // because for some reason the merge does not work newAxiom = oldAxiom.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); final OWLOntology ont = getRoot().getOntology(); changes.add(new RemoveAxiom(ont, oldAxiom)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected List<OWLOntologyChange> getDeleteChanges(OWLAnnotation oldAnnotation) { List<OWLOntologyChange> changes = new ArrayList<>(); final OWLAxiom ax = getRoot().getAxiom(); final OWLOntology ont = getRoot().getOntology(); Set<OWLAnnotation> annotations = new HashSet<>(ax.getAnnotations()); annotations.remove(oldAnnotation); newAxiom = ax.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); changes.add(new RemoveAxiom(ont, ax)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected List<OWLOntologyChange> getDeleteChanges(OWLAnnotation oldAnnotation) { List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); final OWLAxiom ax = getRoot().getAxiom(); final OWLOntology ont = getRoot().getOntology(); Set<OWLAnnotation> annotations = new HashSet<OWLAnnotation>(ax.getAnnotations()); annotations.remove(oldAnnotation); newAxiom = ax.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); changes.add(new RemoveAxiom(ont, ax)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected java.util.List<OWLOntologyChange> getAddChanges(OWLAnnotation annot) { List<OWLOntologyChange> changes = new ArrayList<>(); final OWLAxiom oldAxiom = getRoot().getAxiom(); Set<OWLAnnotation> annotations = new HashSet<>(oldAxiom.getAnnotations()); annotations.add(annot); // because for some reason the merge does not work newAxiom = oldAxiom.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); final OWLOntology ont = getRoot().getOntology(); changes.add(new RemoveAxiom(ont, oldAxiom)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected java.util.List<OWLOntologyChange> getAddChanges(OWLAnnotation annot) { List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); final OWLAxiom oldAxiom = getRoot().getAxiom(); Set<OWLAnnotation> annotations = new HashSet<OWLAnnotation>(oldAxiom.getAnnotations()); annotations.add(annot); // because for some reason the merge does not work newAxiom = oldAxiom.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); final OWLOntology ont = getRoot().getOntology(); changes.add(new RemoveAxiom(ont, oldAxiom)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected List<OWLOntologyChange> getDeleteChanges(OWLAnnotation oldAnnotation) { List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); final OWLAxiom ax = getRoot().getAxiom(); final OWLOntology ont = getRoot().getOntology(); Set<OWLAnnotation> annotations = new HashSet<OWLAnnotation>(ax.getAnnotations()); annotations.remove(oldAnnotation); newAxiom = ax.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); changes.add(new RemoveAxiom(ont, ax)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected java.util.List<OWLOntologyChange> getAddChanges(OWLAnnotation annot) { List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); final OWLAxiom oldAxiom = getRoot().getAxiom(); Set<OWLAnnotation> annotations = new HashSet<OWLAnnotation>(oldAxiom.getAnnotations()); annotations.add(annot); // because for some reason the merge does not work newAxiom = oldAxiom.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); final OWLOntology ont = getRoot().getOntology(); changes.add(new RemoveAxiom(ont, oldAxiom)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected List<OWLOntologyChange> getDeleteChanges(OWLAnnotation oldAnnotation) { List<OWLOntologyChange> changes = new ArrayList<>(); final OWLAxiom ax = getRoot().getAxiom(); final OWLOntology ont = getRoot().getOntology(); Set<OWLAnnotation> annotations = new HashSet<>(ax.getAnnotations()); annotations.remove(oldAnnotation); newAxiom = ax.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); changes.add(new RemoveAxiom(ont, ax)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected OWLReasonerBase(OWLOntology rootOntology, OWLReasonerConfiguration configuration, BufferingMode bufferingMode) { this.rootOntology = checkNotNull(rootOntology, "rootOntology cannot be null"); this.bufferingMode = checkNotNull(bufferingMode, "bufferingMode cannot be null"); this.configuration = checkNotNull(configuration, "configuration cannot be null"); timeOut = configuration.getTimeOut(); manager = rootOntology.getOWLOntologyManager(); manager.addOntologyChangeListener(this::handleRawOntologyChanges); reasonerAxioms = asUnorderedSet( rootOntology.importsClosure().flatMap(o -> Stream.concat(o.logicalAxioms(), o .axioms(AxiomType.DECLARATION))) .map(ax -> OWLAxiom.getAxiomWithoutAnnotations(ax))); }