Examples of RemoveAxiom


Examples of org.semanticweb.owlapi.model.RemoveAxiom

            }

            for (OWLOntology ont : ontologies) {
                for (OWLDataPropertyAssertionAxiom ax : ont.getDataPropertyAssertionAxioms(ind)) {
                    if (!ax.getProperty().isAnonymous()) {
                        changes.add(new RemoveAxiom(ont, ax));
                        OWLDataFactory df = getDataFactory();
                        OWLAnnotation anno = df.getOWLAnnotation(df.getOWLAnnotationProperty(ax.getProperty().asOWLDataProperty().getIRI()),
                                ax.getObject());
                        OWLAnnotationAssertionAxiom annoAx = df.getOWLAnnotationAssertionAxiom(ind.getIRI(), anno);
                        changes.add(new AddAxiom(ont, annoAx));
                        convertedDataProperties.add((OWLDataProperty) ax.getProperty());
                    }
                }
            }
            for (OWLOntology ont : ontologies) {
                for (OWLAxiom ax : ont.getDeclarationAxioms(ind)) {
                    changes.add(new RemoveAxiom(ont, ax));
                }
                for (OWLClassAssertionAxiom ax : ont.getClassAssertionAxioms(ind)) {
                    changes.add(new RemoveAxiom(ont, ax));
                }
            }
        }
        for (OWLDataProperty prop : convertedDataProperties) {
            for (OWLOntology ont : ontologies) {
                for (OWLAxiom ax : ont.getDeclarationAxioms(prop)) {
                    changes.add(new RemoveAxiom(ont, ax));
                }
                for (OWLAxiom ax : ont.getAxioms(prop)) {
                    changes.add(new RemoveAxiom(ont, ax));
                }
            }
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.RemoveAxiom

        // We go through the current mups, axiom by axiom, and extend the tree
        // with edges for each axiom
        for (OWLAxiom axiom : mups) {
            // Remove the current axiom from the ontology
            owlOntologyManager.applyChanges(Arrays.asList(new RemoveAxiom(ontology, axiom)));
            currentPathContents.add(axiom);

            boolean earlyTermination = false;
            // Early path termination.  If our path contents are the superset of
            // the contents of a path then we can terminate here.
View Full Code Here

Examples of org.semanticweb.owlapi.model.RemoveAxiom

            for (OWLClass cls : ont.getClassesInSignature()) {
                Set<OWLSubClassOfAxiom> axioms = ont.getSubClassAxiomsForSubClass(cls);
                if (axioms.size() > 1) {
                    Set<OWLClassExpression> superClasses = new HashSet<OWLClassExpression>();
                    for (OWLSubClassOfAxiom ax : axioms) {
                        changes.add(new RemoveAxiom(ont, ax));
                        superClasses.add(ax.getSuperClass());
                    }
                    OWLClassExpression combinedSuperClass = getDataFactory().getOWLObjectIntersectionOf(superClasses);
                    changes.add(new AddAxiom(ont, getDataFactory().getOWLSubClassOfAxiom(cls, combinedSuperClass)));
                }
View Full Code Here

Examples of org.semanticweb.owlapi.model.RemoveAxiom

                           add(ent);
                       }
                   }
                }
                else if(chg instanceof RemoveAxiom) {
                   RemoveAxiom remAx = (RemoveAxiom) chg;
                   for(OWLEntity ent : remAx.getEntities()) {
                       if(!processed.contains(ent)) {
                           processed.add(ent);
                           boolean stillRef = false;
                           for(OWLOntology ont : ontologies) {
                               if(ont.containsEntityInSignature(ent)) {
View Full Code Here

Examples of org.semanticweb.owlapi.model.RemoveAxiom

    }

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

Examples of org.semanticweb.owlapi.model.RemoveAxiom

     * @param ont The ontology to which the changed should be applied
     * @param duplicator The duplicator that will do the duplicating
     */
    private static void fillListWithTransformChanges(List<OWLOntologyChange> changes, Set<OWLAxiom> axioms, OWLOntology ont, OWLObjectDuplicator duplicator) {
        for (OWLAxiom ax : axioms) {
            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.RemoveAxiom

    public List<OWLOntologyChange> generateChanges(Set<OntologyAxiomPair> fromPairs, Set<OntologyAxiomPair> toPairs) {
        List<OWLOntologyChange> result = Lists.newArrayList();
        for(OntologyAxiomPair fromPair : fromPairs) {
            if(!toPairs.contains(fromPair)) {
                result.add(new RemoveAxiom(checkNotNull(fromPair.getOntology()), fromPair.getAxiom()));
            }
        }
        for(OntologyAxiomPair toPair : toPairs) {
            if(!fromPairs.contains(toPair)) {
                result.add(new AddAxiom(checkNotNull(toPair.getOntology()), toPair.getAxiom()));
View Full Code Here

Examples of org.semanticweb.owlapi.model.RemoveAxiom

   
    System.out.println( "\nClassification time: " + t.getTotal() + "ms");
    System.out.println( "Subclasses of " + pain + ": " + classifier.getSubClasses( pain, true ).getFlattened() + "\n");

    // Remove the axiom from the ontology, which creates a change event
    OWL.manager.applyChange( new RemoveAxiom( ontology, axiom ) );

    // Now we create a third timer to keep track of the performance of the
    // third classification
    timers.startTimer( "Third classification" );
    classifier.classify();
View Full Code Here

Examples of org.semanticweb.owlapi.model.RemoveAxiom

  public static void updateOntology(OWLOntology ontology, Collection<? extends OWLAxiom> axioms, boolean add) {
    List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>();
    for( OWLAxiom axiom : axioms ) {
      OWLOntologyChange change = add
        ? new AddAxiom( ontology, axiom )
        : new RemoveAxiom( ontology, axiom );
      changes.add( change );
    }
    manager.applyChanges( changes );
  }
View Full Code Here

Examples of org.semanticweb.owlapi.model.RemoveAxiom

    for( OWLOntology ont : ontologies ) {
      if( ont.getAxioms().contains( axiom ) ) {
        modifiedOnts.add( ont );

        manager.applyChange( new RemoveAxiom( ont, axiom ) );
      }
    }

    return modifiedOnts;
  }
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.