/** * Instantiates a new coerce constants into data property range. * * @param m The manager providing data factory and config to be used for the duplication. * @param ontologies the ontologies to use */ public CoerceConstantsIntoDataPropertyRange(OWLOntologyManager m, Collection<OWLOntology> ontologies) { super(m.getOWLDataFactory()); checkNotNull(ontologies, "ontologies cannot be null"); Map<OWLDataPropertyExpression, OWLDatatype> map = asMap(datatypes(ontologies), ax -> ax.getProperty(), ax -> ax .getRange().asOWLDatatype()); OWLConstantReplacer replacer = new OWLConstantReplacer(m, map); ontologies.forEach(o -> o.logicalAxioms().forEach(ax -> duplicate(replacer, o, ax))); }
public void actionPerformed(ActionEvent e) { CoerceConstantsIntoDataPropertyRange refactor = new CoerceConstantsIntoDataPropertyRange(getOWLDataFactory(), getOWLModelManager().getOntologies()); getOWLModelManager().applyChanges(refactor.getChanges()); }
/** * Instantiates a new coerce constants into data property range. * * @param m The manager providing data factory and config to be used for the duplication. * @param ontologies the ontologies to use */ public CoerceConstantsIntoDataPropertyRange(OWLOntologyManager m, Collection<OWLOntology> ontologies) { super(m.getOWLDataFactory()); checkNotNull(ontologies, "ontologies cannot be null"); Map<OWLDataPropertyExpression, OWLDatatype> map = asMap(datatypes(ontologies), ax -> ax.getProperty(), ax -> ax .getRange().asOWLDatatype()); OWLConstantReplacer replacer = new OWLConstantReplacer(m, map); ontologies.forEach(o -> o.logicalAxioms().forEach(ax -> duplicate(replacer, o, ax))); }
public void actionPerformed(ActionEvent e) { CoerceConstantsIntoDataPropertyRange refactor = new CoerceConstantsIntoDataPropertyRange(getOWLDataFactory(), getOWLModelManager().getOntologies()); getOWLModelManager().applyChanges(refactor.getChanges()); }
/** * Instantiates a new coerce constants into data property range. * * @param m The manager providing data factory and config to be used for the duplication. * @param ontologies the ontologies to use */ public CoerceConstantsIntoDataPropertyRange(OWLOntologyManager m, Collection<OWLOntology> ontologies) { super(m.getOWLDataFactory()); checkNotNull(ontologies, "ontologies cannot be null"); Map<OWLDataPropertyExpression, OWLDatatype> map = asMap(datatypes(ontologies), ax -> ax.getProperty(), ax -> ax .getRange().asOWLDatatype()); OWLConstantReplacer replacer = new OWLConstantReplacer(m, map); ontologies.forEach(o -> o.logicalAxioms().forEach(ax -> duplicate(replacer, o, ax))); }