Package org.semanticweb.owl.model

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


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

       
        List<OWLAxiomChange> toAdd = new Vector<OWLAxiomChange>();
        for (int i = 0; i < instances; i++) {
          int rnd = m_random.nextInt(classes.size());
          OWLClassAssertionAxiom newAxiom = factory.getOWLClassAssertionAxiom(newIndividual(factory), classes.get(rnd));
          toAdd.add(new AddAxiom(ontology,newAxiom))
          System.out.println((i+1)+"- new axiom: "+newAxiom.toString());
        }       
        manager.applyChanges(toAdd);
        OutputStreamWriter sw = new FileWriter(new File(outputFile));
        OWLOntologyOutputTarget target = new WriterOutputTarget(sw);
View Full Code Here

            OWLDataFactory factory = manager.getOWLDataFactory();
            timers.createTimer("aboxupdate");
            Timer timerAboxUpdate = timers.startTimer("aboxupdate");
            for (OWLIndividual ci : individuals)
            {
              changesToMake.add(new AddAxiom(aboxOntology,
                  factory.getOWLClassAssertionAxiom(ci, cc)));
            }
            timerAboxUpdate.stop();
            aboxUpdateTime += timerAboxUpdate.getTotal();
          }
View Full Code Here

        URI fillerURI = getURIFromValue(value.substring(value.indexOf(' '), value.length()).trim());
        OWLObjectProperty prop = getDataFactory().getOWLObjectProperty(propURI);
        OWLClass filler = getDataFactory().getOWLClass(fillerURI);
        OWLDescription restriction = getDataFactory().getOWLObjectSomeRestriction(prop, filler);
        OWLClass subCls = getDataFactory().getOWLClass(getURIFromValue(id));
        applyChange(new AddAxiom(getOntology(), getDataFactory().getOWLSubClassAxiom(subCls, restriction)));
    }
View Full Code Here

    public void handle(String id, String value) {
        if (Boolean.parseBoolean(value)) {
            OWLObjectProperty prop = getOWLObjectProperty(id);
            OWLAxiom ax = getDataFactory().getOWLReflexiveObjectPropertyAxiom(prop);
            applyChange(new AddAxiom(getOntology(), ax));
        }
        else {
            addAnnotation(id, OBOVocabulary.IS_REFLEXIVE.getName(), getBooleanConstant(false));
        }
    }
View Full Code Here


    public void handle(String id, String value) {
        OWLAxiom ax = getDataFactory().getOWLDisjointClassesAxiom(CollectionFactory.createSet(getCurrentClass(),
                                                                                              getOWLClass(value)));
        applyChange(new AddAxiom(getOntology(), ax));
    }
View Full Code Here

        OWLDescription desc = getDataFactory().getOWLObjectSomeRestriction(prop, getClassFromId(val));
        OWLAxiom ax = getDataFactory().getOWLSubClassAxiom(
                getCurrentClass(),
                desc
        );
        applyChange(new AddAxiom(getOntology(), ax));
    }
View Full Code Here

    public void handle(String id, String value) {
        if(Boolean.parseBoolean(value)) {
            OWLObjectProperty prop = getDataFactory().getOWLObjectProperty(getURIFromValue(id));
            OWLAxiom ax = getDataFactory().getOWLTransitiveObjectPropertyAxiom(prop);
            applyChange(new AddAxiom(getOntology(), ax));
        }
    }
View Full Code Here


    public void handle(String id, String value) {
        if (getConsumer().isTerm()) {
            // We simply add a subclass axiom
            applyChange(new AddAxiom(getOntology(), getDataFactory().getOWLSubClassAxiom(
                    getClassFromId(id),
                    getClassFromId(value))
            ));
        }
        else if(getConsumer().isTypedef()) {
            // We simply add a sub property axiom
            applyChange(new AddAxiom(getOntology(), getDataFactory().getOWLSubObjectPropertyAxiom(
                    getOWLObjectProperty(id),
                    getOWLObjectProperty(value))
            ));
        }
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owl.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.