Package org.semanticweb.owlapi.reasoner

Examples of org.semanticweb.owlapi.reasoner.OWLReasoner


      ReasonerConfiguration reasonerConfig = new ReasonerConfigurationImp();
      reasonerConfig.loadRemoteReasonerConfiguration(new File("reasoner.xml"));
             
      OWLReasonerFactory reasonerFactory = new HeraklesReasonerFactory( reasonerConfig, "de.fzi.herakles.strategy.impl.BasicLoadStrategy", "de.fzi.herakles.strategy.impl.FaultTolerantPStrategy" );
     
      OWLReasoner reasoner = reasonerFactory.createReasoner( ontology );

            // Get SubClasses          
        OWLClass cls = factory.getOWLClass(IRI.create( CLASS_IRI ) );
      NodeSet<OWLClass> subClasses = reasoner.getSubClasses( cls, true );
      System.out.println(subClasses);
     
      System.out.println( "SubClasses of " + CLASS_IRI + ":" );
      for( Node<OWLClass> sc : subClasses )
        for( OWLClass c : sc )
View Full Code Here


         
          // if the current running reasoner is herakles, set the new load strategy
          ModelManager modelManager = workspace.getEditorKit().getModelManager();
          if(modelManager instanceof OWLModelManager){
            OWLModelManager owlModelManager = (OWLModelManager)modelManager;
            OWLReasoner reasoner = owlModelManager.getReasoner();
            if(reasoner instanceof Herakles){
              Herakles herakles = (Herakles)reasoner;
              herakles.setExecutionStrategy(cn);
            }
          }
View Full Code Here

         
          // if the current running reasoner is herakles, set the new load strategy
          ModelManager modelManager = workspace.getEditorKit().getModelManager();
          if(modelManager instanceof OWLModelManager){
            OWLModelManager owlModelManager = (OWLModelManager)modelManager;
            OWLReasoner reasoner = owlModelManager.getReasoner();
            if(reasoner instanceof Herakles){
              Herakles herakles = (Herakles)reasoner;
              herakles.setLoadStrategy(cn);
            }
          }
View Full Code Here

    OWLReasonerFactory reasonerFactory;
    try {
      reasonerFactory = new HeraklesReasonerFactory( registry, loadStrategy, executionStrategy );
//      OWLReasoner reasoner = reasonerFactory.createReasoner( manager  );
      OWLReasoner reasoner = reasonerFactory.createReasoner( ontology  );
      return reasoner;
    } catch( ClassNotFoundException e ) {
      logger.debug("strategy class can't be found!");
      e.printStackTrace();
    }
View Full Code Here

        createDebuggingOntology();
//        RDFXMLRenderer ren = new RDFXMLRenderer();
//        ren.setOWLOntologyManager(owlOntologyManager);
//        ren.render(debuggingOntology, IRI.create("file:/Users/matthewhorridge/Desktop/DebuggingOntology" + ontologyCounter + ".owlapi"));
        ontologyCounter++;
        OWLReasoner reasoner = reasonerFactory.createNonBufferingReasoner(debuggingOntology);
        satTestCount++;
        boolean sat = reasoner.isSatisfiable(currentClass);
        reasoner.dispose();
        return sat;
    }
View Full Code Here

     */
    private boolean isSatisfiable(OWLClassExpression unsatClass) throws OWLException {
        createDebuggingOntology();
        ontologyCounter++;

        OWLReasoner reasoner = getReasonerFactory().createNonBufferingReasoner(debuggingOntology);

        if (OntologyUtils.containsUnreferencedEntity(debuggingOntology, unsatClass)) {
          reasoner.dispose();
            return true;
        }
        satTestCount++;
        boolean sat = reasoner.isSatisfiable(unsatClass);
        reasoner.dispose();
        return sat;
    }
View Full Code Here

  public IRI getIRI() {
    return iri;
  }

  protected boolean isConsistent(OWLOntology o) {
    OWLReasoner reasoner = reasonerFactory.createReasoner( o );
    return reasoner.isConsistent();
  }
View Full Code Here

    OWLReasoner reasoner = reasonerFactory.createReasoner( o );
    return reasoner.isConsistent();
  }

  protected boolean isEntailed(OWLOntology premise, OWLOntology conclusion) {
    OWLReasoner reasoner = reasonerFactory.createReasoner( premise );

    return reasoner.isEntailed( conclusion.getLogicalAxioms() );
  }
View Full Code Here

        }
        System.out.println("owl-api loading: "+(System.currentTimeMillis()-start));
       
        // Create a Snorocket reasoner and classify
        OWLReasonerFactory reasonerFactory = new SnorocketReasonerFactory();
        OWLReasoner reasoner = reasonerFactory.createNonBufferingReasoner(root);
        reasoner.precomputeInferences(InferenceType.CLASS_HIERARCHY);
        reasoner.dispose();
       
        System.out.println(Statistics.INSTANCE.getStatistics());
        System.out.println("Total time: "+Statistics.INSTANCE.getTotalTime());
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.reasoner.OWLReasoner

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.