Examples of AddAxiom


Examples of org.semanticweb.owl.model.AddAxiom

      Set<OWLLogicalAxiom> axioms = ontology.getLogicalAxioms();
      logger.info("Number of logical axioms: "+axioms.size());
      for (OWLLogicalAxiom axiom : axioms){
        if (axiom instanceof OWLIndividualAxiom){
          // put it in abox
          AddAxiom axiomToAdd = new AddAxiom(abox,axiom);
          aboxMgr.applyChange(axiomToAdd);
          //logger.info("To Abox: "+axiom.getClass());
        }else{
          // put it in tbox
          AddAxiom axiomToAdd = new AddAxiom(tbox,axiom);
          tboxMgr.applyChange(axiomToAdd);
          //logger.info("To Tbox: "+axiom.getClass()+" "+axiom.toString());
        }
      }
      tboxMgr.saveOntology(tbox);
View Full Code Here

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

Examples of org.semanticweb.owlapi.model.AddAxiom

                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

Examples of org.semanticweb.owlapi.model.AddAxiom

        }
    }

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

Examples of org.semanticweb.owlapi.model.AddAxiom

                        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

Examples of org.semanticweb.owlapi.model.AddAxiom

        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

Examples of org.semanticweb.owlapi.model.AddAxiom

        // 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

Examples of org.semanticweb.owlapi.model.AddAxiom

    }

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

Examples of org.semanticweb.owlapi.model.AddAxiom

        }
        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

Examples of org.semanticweb.owlapi.model.AddAxiom

        }
        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
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.