Examples of AddAxiom


Examples of org.semanticweb.owlapi.model.AddAxiom

        List<AddAxiom> changes = new ArrayList<>();
        for (OWLOntology ont : setProvider.getOntologies()) {
            for (OWLAxiom ax : getAxioms(ont)) {
                assert ax != null;
                if (axiomFilter.passes(ax)) {
                    changes.add(new AddAxiom(ontology, ax));
                }
            }
        }
        ontologyManager.applyChanges(changes);
        return ontology;
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddAxiom

            @Nonnull OWLOntology ont, OWLObjectDuplicator duplicator) {
        for (OWLAxiom ax : axioms) {
            assert ax != null;
            changes.add(new RemoveAxiom(ont, ax));
            OWLAxiom dupAx = duplicator.duplicateObject(ax);
            changes.add(new AddAxiom(ont, dupAx));
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddAxiom

        checkNotNull(ontology, "ontology cannot be null");
        List<AddAxiom> changes = new ArrayList<>();
        for (InferredAxiomGenerator<? extends OWLAxiom> axiomGenerator : axiomGenerators) {
            for (OWLAxiom ax : axiomGenerator.createAxioms(df, reasoner)) {
                assert ax != null;
                changes.add(new AddAxiom(ontology, ax));
            }
        }
        ontology.getOWLOntologyManager().applyChanges(changes);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddAxiom

    public List<OWLOntologyChange> addAxioms(@Nonnull OWLOntology ont,
            @Nonnull Set<? extends OWLAxiom> axioms) {
        List<AddAxiom> changes = new ArrayList<>(axioms.size() + 2);
        for (OWLAxiom ax : axioms) {
            assert ax != null;
            changes.add(new AddAxiom(ont, ax));
        }
        return applyChanges(changes);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddAxiom

    @Test
    public void testSaveAndReload() throws Exception {
        OWLOntology ontA = m.createOntology(IRI("http://rdfxmltests/ontology"));
        for (OWLAxiom ax : getAxioms()) {
            assert ax != null;
            m.applyChange(new AddAxiom(ontA, ax));
        }
        OWLOntology ontB = roundTrip(ontA);
        Set<OWLLogicalAxiom> aMinusB = ontA.getLogicalAxioms();
        aMinusB.removeAll(ontB.getAxioms());
        Set<OWLLogicalAxiom> bMinusA = ontB.getLogicalAxioms();
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddAxiom

        nameResolution = NameResolverStrategy.CHECK;
    }

    protected void addAxiom(OWLAxiom ax) {
        try {
            ((OWLMutableOntology) ontology).applyChange(new AddAxiom(ontology,
                    ax));
        } catch (OWLOntologyChangeException e) {
            throw new KRSS2OWLParserException(e);
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddAxiom

            OWLClass filler = getDataFactory().getOWLClass(fillerIRI);
            OWLClassExpression restriction = getDataFactory()
                    .getOWLObjectSomeValuesFrom(prop, filler);
            OWLClass subCls = getDataFactory().getOWLClass(
                    getIRIFromOBOId(currentId));
            applyChange(new AddAxiom(getOntology(), getDataFactory()
                    .getOWLSubClassOfAxiom(subCls, restriction)));
            applyChange(new AddAxiom(getOntology(), getDataFactory()
                    .getOWLDeclarationAxiom(prop)));
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddAxiom

            String comment) {
        if (Boolean.parseBoolean(value)) {
            OWLObjectProperty prop = getOWLObjectProperty(currentId);
            OWLAxiom ax = getDataFactory().getOWLSymmetricObjectPropertyAxiom(
                    prop);
            applyChange(new AddAxiom(getOntology(), ax));
        } else {
            addAnnotation(currentId, OBOVocabulary.IS_SYMMETRIC.getName(),
                    getBooleanConstant(false));
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddAxiom

            assert synonym != null;
            OWLLiteral synonymLiteral = df.getOWLLiteral(synonym);
            OWLAnnotationAssertionAxiom annoAssertion = df
                    .getOWLAnnotationAssertionAxiom(property, subject.getIRI(),
                            synonymLiteral, annotations);
            applyChange(new AddAxiom(getOntology(), annoAssertion));
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddAxiom

            OWLClassExpression universal = factory.getOWLObjectAllValuesFrom(
                    prop, union);
            /* Create a new axiom */
            OWLAxiom newAxiom = factory.getOWLSubClassOfAxiom(clazz, universal);
            /* Now add the axiom to the ontology */
            AddAxiom addAxiom = new AddAxiom(ontology, newAxiom);
            /* Use the manager to apply the change */
            manager.applyChange(addAxiom);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.