Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.AddAxiom


        T object = buildObject();
        if (!(object instanceof OWLAxiom)) {
            return CollectionFactory.emptyList();
        }
        // create and apply the new change
        AddAxiom change = new AddAxiom(o, (OWLAxiom) object);
        o.getOWLOntologyManager().applyChange(change);
        List<OWLOntologyChange> changes = new ArrayList<>();
        // check conformity to the profile
        OWLProfileReport report = profile.checkOntology(o);
        for (OWLProfileViolation v : report.getViolations()) {
View Full Code Here


                reasoner, verbose);
        OWLOntology newOnt = manager.createOntology(iri);
        LinkedList<AddAxiom> addaxs = new LinkedList<>();
        for (OWLAxiom ax : axs) {
            assert ax != null;
            addaxs.add(new AddAxiom(newOnt, ax));
        }
        manager.applyChanges(addaxs);
        return newOnt;
    }
View Full Code Here

        }
    }

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

                        addChange(new RemoveAxiom(ont, ax));
                        superClasses.add(ax.getSuperClass());
                    }
                    OWLClassExpression combinedSuperClass = getDataFactory()
                            .getOWLObjectIntersectionOf(superClasses);
                    addChange(new AddAxiom(ont, getDataFactory()
                            .getOWLSubClassOfAxiom(cls, combinedSuperClass)));
                }
            }
        }
    }
View Full Code Here

        OWLClassExpression equivalentClass = getDataFactory()
                .getOWLObjectIntersectionOf(descs);
        Set<OWLClassExpression> equivalentClasses = new HashSet<>();
        equivalentClasses.add(cls);
        equivalentClasses.add(equivalentClass);
        addChange(new AddAxiom(targetOntology, getDataFactory()
                .getOWLEquivalentClassesAxiom(equivalentClasses)));
    }
View Full Code Here

        // values, a value partition class, a property we...
        // 1) Make the classes which represent the values, subclasses of the
        // value partition class
        for (OWLClassExpression valuePartitionValue : valuePartitionClasses) {
            assert valuePartitionValue != null;
            addChange(new AddAxiom(targetOntology, getDataFactory()
                    .getOWLSubClassOfAxiom(valuePartitionValue,
                            valuePartitionClass)));
        }
        // 2) Make the values disjoint
        addChange(new AddAxiom(targetOntology, getDataFactory()
                .getOWLDisjointClassesAxiom(valuePartitionClasses)));
        // 3) Add a covering axiom to the value partition
        OWLClassExpression union = getDataFactory().getOWLObjectUnionOf(
                valuePartitionClasses);
        addChange(new AddAxiom(targetOntology, getDataFactory()
                .getOWLSubClassOfAxiom(valuePartitionClass, union)));
        // 4) Make the property functional
        addChange(new AddAxiom(targetOntology, getDataFactory()
                .getOWLFunctionalObjectPropertyAxiom(valuePartitionProperty)));
        // 5) Set the range of the property to be the value partition
        addChange(new AddAxiom(targetOntology, getDataFactory()
                .getOWLObjectPropertyRangeAxiom(valuePartitionProperty,
                        valuePartitionClass)));
    }
View Full Code Here

    }

    protected void addAxiom(OWLAxiom ax) {
        if (!(ax instanceof OWLAnnotationAxiom)
                || configuration.isLoadAnnotationAxioms()) {
            AddAxiom addAxiom = new AddAxiom(ontology, ax);
            applyChange(addAxiom);
        }
    }
View Full Code Here

        }
        List<OWLOntologyChange> changes = new ArrayList<>(axioms.size());
        changes.addAll(imports);
        changes.addAll(ontologyAnnotations);
        for (OntologyAxiomPair pair : axioms) {
            changes.add(new AddAxiom(ont, pair.getAxiom()));
        }
        changes.add(new SetOntologyID(ont, ontologyID));
        ont.getOWLOntologyManager().applyChanges(changes);
        ManchesterSyntaxDocumentFormat format = new ManchesterSyntaxDocumentFormat();
        format.copyPrefixesFrom(pm);
View Full Code Here

        }
        Set<OWLEntity> processed = new HashSet<>();
        for (OWLOntologyChange chg : changes) {
            if (ontologies.contains(chg.getOntology())) {
                if (chg.isAddAxiom()) {
                    AddAxiom addAx = (AddAxiom) chg;
                    for (OWLEntity ent : addAx.getSignature()) {
                        assert ent != null;
                        if (!processed.contains(ent)) {
                            processed.add(ent);
                            add(ent);
                        }
View Full Code Here

        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

TOP

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

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.