Package org.semanticweb.owlapi.model

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) {
            assert axiom != null;
            // Remove the current axiom from the ontology
            owlOntologyManager.applyChange(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.
            for (Set<OWLAxiom> satPath : satPaths) {
View Full Code Here


        currentClass = setupDebuggingClass(cls);
        generateSOSAxioms();
        for (OWLAxiom ax : temporaryAxioms) {
            assert ax != null;
            owlOntologyManager
                    .applyChange(new RemoveAxiom(getOWLOntology(), ax));
        }
        debuggingAxioms.removeAll(temporaryAxioms);
        return new HashSet<>(debuggingAxioms);
    }
View Full Code Here

     */
    @Nonnull
    public List<OWLOntologyChange> repair() {
        // default fix is to drop the axiom
        if (axiom != null) {
            return list(new RemoveAxiom(ontology, getAxiom()));
        }
        return CollectionFactory.emptyList();
    }
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( ontologyTBox, 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 removeClass(OWLOntology ontology, OWLClass theclass, Boolean andinds, OWLOntologyManager manager) {
    if (andinds) {
      for (OWLIndividual ind : theclass.getIndividuals(ontology)) {
        Set<OWLAxiom> refaxind = ind.asOWLNamedIndividual().getReferencingAxioms(ontology);
        OWLAxiom[] refaxindarray = (OWLAxiom[]) refaxind.toArray(new OWLAxiom[] {});
        for (int i = 0; i < refaxindarray.length; i++) {manager.applyChange(new RemoveAxiom(ontology,refaxindarray[i]));
        }
      }
    }

    Set<OWLAxiom> refax = theclass.getReferencingAxioms(ontology);
    OWLAxiom[] refaxarray = (OWLAxiom[]) refax.toArray(new OWLAxiom[] {});
    for (int i = 0; i < refaxarray.length; i++) {
      manager.applyChange(new RemoveAxiom(ontology, refaxarray[i]));
    }

  }
View Full Code Here

        OWLNamedIndividual annind = factory.getOWLNamedIndividual(IRI.create(keys[i]));
        Set<OWLAnnotation> anns = annind.getAnnotations(ontology, label);
        for (OWLAnnotation ann : anns) {
          OWLAxiom removeax = factory.getOWLAnnotationAssertionAxiom(
              (OWLAnnotationSubject) annind, ann);
          manager.applyChange(new RemoveAxiom(ontology, removeax));
        }
        String[] array = (String[]) urisandvals.get(keys[i]);
        OWLAnnotation newann = factory.getOWLAnnotation(factory
            .getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL
                .getIRI()), factory.getOWLStringLiteral(
View Full Code Here

    Set<OWLAnnotation> anns = annind.getAnnotations(ontology, label);
    for (OWLAnnotation ann : anns) {
      OWLAnnotationSubject annsub = annind.getIRI();
      OWLAxiom removeax = factory.getOWLAnnotationAssertionAxiom(annsub,
          ann);
      manager.applyChange(new RemoveAxiom(ontology, removeax));
    }
    OWLAnnotation newann = factory.getOWLAnnotation(
        factory.getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL
            .getIRI()), factory.getOWLStringLiteral(value, "en"));
    OWLAxiom ax = factory.getOWLAnnotationAssertionAxiom(annind.getIRI(),
View Full Code Here

        .getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL.getIRI());
    Set<OWLAnnotation> anns = ent.getAnnotations(ontology, label);
    for (OWLAnnotation ann : anns) {
      OWLAnnotationSubject annsub = ent.getIRI();
      OWLAxiom removeax = factory.getOWLAnnotationAssertionAxiom(annsub, ann);
      manager.applyChange(new RemoveAxiom(ontology, removeax));
    }
    OWLAnnotation newann = factory.getOWLAnnotation(
        factory.getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL.getIRI()), factory.getOWLStringLiteral(value, "en"));
    OWLAxiom ax = factory.getOWLAnnotationAssertionAxiom(ent.getIRI(), newann);
    manager.applyChange(new AddAxiom(ontology, ax));
View Full Code Here

    }

    private void generateChanges(OWLEntity entity) {
        for (OWLOntology ont : ontologies) {
            for (OWLAxiom ax : ont.getReferencingAxioms(entity)) {
                changes.add(new RemoveAxiom(ont, ax));
            }
            for(OWLAnnotationAssertionAxiom ax : ont.getAnnotationAssertionAxioms(entity.getIRI())) {
                changes.add(new RemoveAxiom(ont, ax));
            }
        }
    }
View Full Code Here

        else if(annotatedTargetLiteral != null) {
            getConsumer().handle(annotatedSource, annotatedProperty, annotatedTargetLiteral);
        }
        if (!annotations.isEmpty()) {
            OWLAxiom ax = getConsumer().getLastAddedAxiom();
            getConsumer().applyChange(new RemoveAxiom(getConsumer().getOntology(), ax.getAxiomWithoutAnnotations()));
        }

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