Package org.semanticweb.owlapi.model

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


                           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

    }

    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

     * @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

    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

   
    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

  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

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

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

    return modifiedOnts;
  }
View Full Code Here

      referencedEntities.addAll( ontology.getIndividualsInSignature() );

      List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>();
      for( OWLAxiom axiom : ontology.getAxioms() ) {
        if( !axiom.isLogicalAxiom() ) {
          changes.add( new RemoveAxiom( ontology, axiom ) );
        }
      }

      manager.applyChanges( changes );
View Full Code Here

    for( OWLAxiom axiom : additions ) {
      changes.add( new AddAxiom( initialOnt, axiom ) );
    }

    for( OWLAxiom axiom : deletions ) {
      changes.add( new RemoveAxiom( initialOnt, axiom ) );
    }

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