Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.RemoveAxiom


        for (OWLOntology o : ontologies) {
            assert o != null;
            for (OWLEquivalentClassesAxiom ax : o
                    .getEquivalentClassesAxioms(cls)) {
                assert ax != null;
                addChange(new RemoveAxiom(o, ax));
                for (OWLClassExpression equivCls : ax.getClassExpressions()) {
                    assert equivCls != null;
                    supers.addAll(getClassExpressions(equivCls));
                }
            }
View Full Code Here


    }

    @Test
    public void testCreateOntologyChange() {
        RemoveAxiomData data = new RemoveAxiomData(mockAxiom);
        RemoveAxiom change = data.createOntologyChange(mockOntology);
        assertNotNull(change);
        assertEquals(change.getOntology(), mockOntology);
        assertEquals(change.getAxiom(), mockAxiom);
    }
View Full Code Here

    }

    @Test
    public void testRoundTripChange() {
        RemoveAxiomData data = new RemoveAxiomData(mockAxiom);
        RemoveAxiom change = new RemoveAxiom(mockOntology, mockAxiom);
        assertEquals(data, change.getChangeData());
    }
View Full Code Here

            assert ont != null;
            for (OWLAxiom ax : ont.getAxioms()) {
                assert ax != null;
                OWLAxiom dupAx = dup.duplicateObject(ax);
                if (!dupAx.equals(ax)) {
                    changes.add(new RemoveAxiom(ont, ax));
                    changes.add(new AddAxiom(ont, dupAx));
                }
            }
        }
        return changes;
View Full Code Here

        checkNotNull(manager, "manager cannot be null");
        for (OWLOntology ont : checkNotNull(ontologies,
                "ontologies cannot be null")) {
            if (ont.getAxioms().contains(axiom)) {
                modifiedOnts.add(ont);
                manager.applyChange(new RemoveAxiom(ont, axiom));
            }
        }
        return modifiedOnts;
    }
View Full Code Here

            assert ont != null;
            for (OWLSubClassOfAxiom ax : ont.getAxioms(AxiomType.SUBCLASS_OF)) {
                ConjunctSplitter splitter = new ConjunctSplitter();
                ax.getSuperClass().accept(splitter);
                if (splitter.result.size() > 1) {
                    addChange(new RemoveAxiom(ont, ax));
                    for (OWLClassExpression desc : splitter.result) {
                        assert desc != null;
                        OWLAxiom replAx = getDataFactory()
                                .getOWLSubClassOfAxiom(ax.getSubClass(), desc);
                        addChange(new AddAxiom(ont, replAx));
View Full Code Here

    @Override
    public List<OWLOntologyChange> repair() {
        // XXX arbitrary decision: drop the axiom
        // better fix would be to look for usage and remove the smallest number
        // of axioms
        return list(new RemoveAxiom(ontology, getAxiom()));
    }
View Full Code Here

    private void removeDeclarationsAndAxioms(@Nonnull OWLDataProperty prop) {
        for (OWLOntology ont : ontologies) {
            assert ont != null;
            for (OWLAxiom ax : ont.getDeclarationAxioms(prop)) {
                assert ax != null;
                addChange(new RemoveAxiom(ont, ax));
            }
            for (OWLAxiom ax : ont.getAxioms(prop, EXCLUDED)) {
                assert ax != null;
                addChange(new RemoveAxiom(ont, ax));
            }
        }
    }
View Full Code Here

            @Nonnull OWLNamedIndividual ind) {
        for (OWLOntology ont : ontologies) {
            assert ont != null;
            for (OWLAxiom ax : ont.getDeclarationAxioms(ind)) {
                assert ax != null;
                addChange(new RemoveAxiom(ont, ax));
            }
            for (OWLClassAssertionAxiom ax : ont.getClassAssertionAxioms(ind)) {
                assert ax != null;
                addChange(new RemoveAxiom(ont, ax));
            }
        }
    }
View Full Code Here

        for (OWLOntology ont : ontologies) {
            assert ont != null;
            for (OWLDataPropertyAssertionAxiom ax : ont
                    .getDataPropertyAssertionAxioms(ind)) {
                if (!ax.getProperty().isAnonymous()) {
                    addChange(new RemoveAxiom(ont, ax));
                    addChange(new AddAxiom(ont, convertToAnnotation(ind, ax)));
                    convertedDataProperties.add((OWLDataProperty) ax
                            .getProperty());
                }
            }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.RemoveAxiom

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.