/** * Instantiates a new amalgamate sub class axioms. * * @param dataFactory the data factory * @param ontologies the ontologies to use */ public AmalgamateSubClassAxioms(OWLDataFactory dataFactory, Collection<OWLOntology> ontologies) { super(dataFactory); checkNotNull(ontologies, "ontologies cannot be null"); ontologies.forEach(o -> o.classesInSignature().forEach(cls -> amalgamate(o, cls))); }
protected void amalgamate(OWLOntology ont, OWLClass cls) { List<OWLSubClassOfAxiom> axioms = asList(ont.subClassAxiomsForSubClass(cls)); if (axioms.size() < 2) { return; } axioms.forEach(ax -> addChange(new RemoveAxiom(ont, ax))); Stream<OWLClassExpression> superclasses = axioms.stream() .map(OWLSubClassOfAxiom::getSuperClass); OWLObjectIntersectionOf intersection = df.getOWLObjectIntersectionOf(superclasses); addChange(new AddAxiom(ont, df.getOWLSubClassOfAxiom(cls, intersection))); } }
public void actionPerformed(ActionEvent e) { AmalgamateSubClassAxioms change = new AmalgamateSubClassAxioms( getOWLModelManager().getOWLDataFactory(), getOWLModelManager().getOntologies()); getOWLModelManager().applyChanges(change.getChanges()); } }
protected void amalgamate(OWLOntology ont, OWLClass cls) { List<OWLSubClassOfAxiom> axioms = asList(ont.subClassAxiomsForSubClass(cls)); if (axioms.size() < 2) { return; } axioms.forEach(ax -> addChange(new RemoveAxiom(ont, ax))); Stream<OWLClassExpression> superclasses = axioms.stream() .map(OWLSubClassOfAxiom::getSuperClass); OWLObjectIntersectionOf intersection = df.getOWLObjectIntersectionOf(superclasses); addChange(new AddAxiom(ont, df.getOWLSubClassOfAxiom(cls, intersection))); } }
public void actionPerformed(ActionEvent e) { AmalgamateSubClassAxioms change = new AmalgamateSubClassAxioms( getOWLModelManager().getOWLDataFactory(), getOWLModelManager().getOntologies()); getOWLModelManager().applyChanges(change.getChanges()); } }
/** * Instantiates a new amalgamate sub class axioms. * * @param dataFactory the data factory * @param ontologies the ontologies to use */ public AmalgamateSubClassAxioms(OWLDataFactory dataFactory, Collection<OWLOntology> ontologies) { super(dataFactory); checkNotNull(ontologies, "ontologies cannot be null"); ontologies.forEach(o -> o.classesInSignature().forEach(cls -> amalgamate(o, cls))); }
protected void amalgamate(OWLOntology ont, OWLClass cls) { List<OWLSubClassOfAxiom> axioms = asList(ont.subClassAxiomsForSubClass(cls)); if (axioms.size() < 2) { return; } axioms.forEach(ax -> addChange(new RemoveAxiom(ont, ax))); Stream<OWLClassExpression> superclasses = axioms.stream() .map(OWLSubClassOfAxiom::getSuperClass); OWLObjectIntersectionOf intersection = df.getOWLObjectIntersectionOf(superclasses); addChange(new AddAxiom(ont, df.getOWLSubClassOfAxiom(cls, intersection))); } }
/** * Instantiates a new amalgamate sub class axioms. * * @param dataFactory the data factory * @param ontologies the ontologies to use */ public AmalgamateSubClassAxioms(OWLDataFactory dataFactory, Collection<OWLOntology> ontologies) { super(dataFactory); checkNotNull(ontologies, "ontologies cannot be null"); ontologies.forEach(o -> o.classesInSignature().forEach(cls -> amalgamate(o, cls))); }