protected void expandAndAddAnnotations(String expandTo, AtomicBoolean expandedSomething, Set<OWLAnnotation> annotations) { visitor.getTool().parseManchesterExpressionFrames(expandTo).stream() .map(axp -> axp.getAxiom()).map( ax -> shouldTransferAnnotations() ? ax.getAnnotatedAxiom(annotations) : ax) .forEach(expandedAxiom -> { newAxioms.add(expandedAxiom); expandedSomething.set(true); }); } }
protected void expandAndAddAnnotations(String expandTo, AtomicBoolean expandedSomething, Set<OWLAnnotation> annotations) { visitor.getTool().parseManchesterExpressionFrames(expandTo).stream() .map(axp -> axp.getAxiom()).map( ax -> shouldTransferAnnotations() ? ax.getAnnotatedAxiom(annotations) : ax) .forEach(expandedAxiom -> { newAxioms.add(expandedAxiom); expandedSomething.set(true); }); } }
protected void expandAndAddAnnotations(String expandTo, AtomicBoolean expandedSomething, Set<OWLAnnotation> annotations) { visitor.getTool().parseManchesterExpressionFrames(expandTo).stream() .map(axp -> axp.getAxiom()).map( ax -> shouldTransferAnnotations() ? ax.getAnnotatedAxiom(annotations) : ax) .forEach(expandedAxiom -> { newAxioms.add(expandedAxiom); expandedSomething.set(true); }); } }
protected void expandAndAddAnnotations(String expandTo, AtomicBoolean expandedSomething, Set<OWLAnnotation> annotations) { visitor.getTool().parseManchesterExpressionFrames(expandTo).stream() .map(axp -> axp.getAxiom()).map( ax -> shouldTransferAnnotations() ? ax.getAnnotatedAxiom(annotations) : ax) .forEach(expandedAxiom -> { newAxioms.add(expandedAxiom); expandedSomething.set(true); }); } }
public Object read() throws IOException { int typeIndex = inputStream.read(); OWLObjectType type = OWLObjectType.values()[typeIndex]; Object o = type.read(this); if (o instanceof OWLAxiom) { @SuppressWarnings("unchecked") Set<OWLAnnotation> annotations = (Set<OWLAnnotation>) read(); if (!annotations.isEmpty()) { return ((OWLAxiom) o).getAnnotatedAxiom(annotations); } } return o; }
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 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> 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 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<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; }
private void initialiseIndividualFrameSections() { //@formatter:off initialiseSection(new AnnAxiom<OWLIndividual, OWLAnnotation>(x -> parseAnnotation(), ANNOTATIONS, (s, o, anns) -> create(df, s, o, anns)), individualFrameSections); initialiseSection(new AnnAxiom<OWLIndividual, OWLClassExpression>(x -> parseUnion(), TYPES, (s, o, anns) -> df.getOWLClassAssertionAxiom(o, s, anns)), individualFrameSections); initialiseSection(new AnnAxiom<>(this::parseFact, FACTS, (s, o, anns) -> o.getAnnotatedAxiom(anns)), individualFrameSections); initialiseSection(new AnnAxiom<OWLIndividual, OWLIndividual>(x -> parseIndividual(), SAME_AS, (s, o, anns) -> df.getOWLSameIndividualAxiom(s, o, anns)), individualFrameSections); initialiseSection(new AnnAxiom<OWLIndividual, OWLIndividual>(x -> parseIndividual(), DIFFERENT_FROM, (s, o, anns) -> df.getOWLDifferentIndividualsAxiom(s, o, anns)), individualFrameSections); // Extensions initialiseSection(new AnnAxiom<OWLIndividual, Set<OWLIndividual>>(x -> parseIndividualList(), DIFFERENT_INDIVIDUALS, (s, o, anns) -> create(df, s, o, anns)), individualFrameSections); //@formatter:on }
private void initialiseIndividualFrameSections() { //@formatter:off initialiseSection(new AnnAxiom<OWLIndividual, OWLAnnotation>(x -> parseAnnotation(), ANNOTATIONS, (s, o, anns) -> create(df, s, o, anns)), individualFrameSections); initialiseSection(new AnnAxiom<OWLIndividual, OWLClassExpression>(x -> parseUnion(), TYPES, (s, o, anns) -> df.getOWLClassAssertionAxiom(o, s, anns)), individualFrameSections); initialiseSection(new AnnAxiom<>(this::parseFact, FACTS, (s, o, anns) -> o.getAnnotatedAxiom(anns)), individualFrameSections); initialiseSection(new AnnAxiom<OWLIndividual, OWLIndividual>(x -> parseIndividual(), SAME_AS, (s, o, anns) -> df.getOWLSameIndividualAxiom(s, o, anns)), individualFrameSections); initialiseSection(new AnnAxiom<OWLIndividual, OWLIndividual>(x -> parseIndividual(), DIFFERENT_FROM, (s, o, anns) -> df.getOWLDifferentIndividualsAxiom(s, o, anns)), individualFrameSections); // Extensions initialiseSection(new AnnAxiom<OWLIndividual, Set<OWLIndividual>>(x -> parseIndividualList(), DIFFERENT_INDIVIDUALS, (s, o, anns) -> create(df, s, o, anns)), individualFrameSections); //@formatter:on }
private void initialiseIndividualFrameSections() { //@formatter:off initialiseSection(new AnnAxiom<OWLIndividual, OWLAnnotation>(x -> parseAnnotation(), ANNOTATIONS, (s, o, anns) -> create(df, s, o, anns)), individualFrameSections); initialiseSection(new AnnAxiom<OWLIndividual, OWLClassExpression>(x -> parseUnion(), TYPES, (s, o, anns) -> df.getOWLClassAssertionAxiom(o, s, anns)), individualFrameSections); initialiseSection(new AnnAxiom<>(this::parseFact, FACTS, (s, o, anns) -> o.getAnnotatedAxiom(anns)), individualFrameSections); initialiseSection(new AnnAxiom<OWLIndividual, OWLIndividual>(x -> parseIndividual(), SAME_AS, (s, o, anns) -> df.getOWLSameIndividualAxiom(s, o, anns)), individualFrameSections); initialiseSection(new AnnAxiom<OWLIndividual, OWLIndividual>(x -> parseIndividual(), DIFFERENT_FROM, (s, o, anns) -> df.getOWLDifferentIndividualsAxiom(s, o, anns)), individualFrameSections); // Extensions initialiseSection(new AnnAxiom<OWLIndividual, Set<OWLIndividual>>(x -> parseIndividualList(), DIFFERENT_INDIVIDUALS, (s, o, anns) -> create(df, s, o, anns)), individualFrameSections); //@formatter:on }
private void initialiseIndividualFrameSections() { //@formatter:off initialiseSection(new AnnAxiom<OWLIndividual, OWLAnnotation>(x -> parseAnnotation(), ANNOTATIONS, (s, o, anns) -> create(df, s, o, anns)), individualFrameSections); initialiseSection(new AnnAxiom<OWLIndividual, OWLClassExpression>(x -> parseUnion(), TYPES, (s, o, anns) -> df.getOWLClassAssertionAxiom(o, s, anns)), individualFrameSections); initialiseSection(new AnnAxiom<>(this::parseFact, FACTS, (s, o, anns) -> o.getAnnotatedAxiom(anns)), individualFrameSections); initialiseSection(new AnnAxiom<OWLIndividual, OWLIndividual>(x -> parseIndividual(), SAME_AS, (s, o, anns) -> df.getOWLSameIndividualAxiom(s, o, anns)), individualFrameSections); initialiseSection(new AnnAxiom<OWLIndividual, OWLIndividual>(x -> parseIndividual(), DIFFERENT_FROM, (s, o, anns) -> df.getOWLDifferentIndividualsAxiom(s, o, anns)), individualFrameSections); // Extensions initialiseSection(new AnnAxiom<OWLIndividual, Set<OWLIndividual>>(x -> parseIndividualList(), DIFFERENT_INDIVIDUALS, (s, o, anns) -> create(df, s, o, anns)), individualFrameSections); //@formatter:on }