Examples of OWLReasoner


Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

     *         the oWL exception
     */
    private boolean isSatisfiable(@Nonnull OWLClassExpression unsatClass)
            throws OWLException {
        createDebuggingOntology();
        OWLReasoner reasoner = getReasonerFactory().createNonBufferingReasoner(
                verifyNotNull(debuggingOntology));
        if (OntologyUtils.containsUnreferencedEntity(
                verifyNotNull(debuggingOntology), unsatClass)) {
            reasoner.dispose();
            return true;
        }
        satTestCount++;
        boolean sat = reasoner.isSatisfiable(unsatClass);
        reasoner.dispose();
        return sat;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

        assertEquals("Maximum number of asserted named superclasses",
                new MaximumNumberOfNamedSuperclasses(createOntology).getName());
        assertEquals("Number of classes with asserted multiple inheritance",
                new NumberOfClassesWithMultipleInheritance(createOntology)
                        .getName());
        OWLReasoner mock = mock(OWLReasoner.class);
        when(mock.getRootOntology()).thenReturn(createOntology);
        assertEquals("Unsatisfiable class count",
                new UnsatisfiableClassCountMetric(mock).getName());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

     * @throws OWLException
     *         the oWL exception
     */
    private boolean isSatisfiable() throws OWLException {
        createDebuggingOntology();
        OWLReasoner reasoner = reasonerFactory
                .createNonBufferingReasoner(getDebuggingOntology());
        satTestCount++;
        boolean sat = reasoner.isSatisfiable(verifyNotNull(currentClass));
        reasoner.dispose();
        return sat;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

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

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

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

Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

        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

Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

    System.out.println("*******************");
    System.out.print(query.getTask() + ".....");
   
    double min = Double.MAX_VALUE;
    String reasonerName = "none";
    OWLReasoner reasoner;
    for(int i = 0; i < ReasonerPara.getReasonerCount(); i ++){
     
      try{
        reasoner = reasonerManager.getReasoner(i, ontology);
      }catch(ReasonerInternalException e){
        continue;
      }catch(UnsupportedDatatypeException e){
        continue;
      }
     
      double tmp = runtimeTest(reasoner, query);
      if(tmp < min){
        min = tmp;
        reasonerName = reasoner.getReasonerName();
      }
    }
    Result<Object> result = new Result<Object>();
    result.setReasoner(reasonerName);
   
View Full Code Here

Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

  public Factpp(){
    factory = new FaCTPlusPlusReasonerFactory();
  }
 
  public OWLReasoner getReasoner(OWLOntology ontology){
    OWLReasoner reasoner = factory.createReasoner(ontology);
    return reasoner;
  }
View Full Code Here

Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

        mOutputBlockWriter.write("disjoint");
      } else {
        // same domain ontology
        OWLReasonerFactory reasonerFactory = null;
        reasonerFactory = new Reasoner.ReasonerFactory();
        OWLReasoner reasoner = reasonerFactory
            .createReasoner(ontology1);

        OWLDataFactory fac = manager.getOWLDataFactory();
        OWLClass peOutputClass = fac.getOWLClass(IRI.create(peOutput));
        OWLClass peInputClass = fac.getOWLClass(IRI.create(peInput));
View Full Code Here

Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

        try {
            // Get the manager
            OWLOntologyManager manager = createOWLOntologyManager();

            // Get the reasoner
            OWLReasoner reasoner = getReasoner(input);
            log.info("Running {} reasoner on {} ", reasoner.getClass(), input.getOntologyID());

            // To generate inferred axioms
            InferredOntologyGenerator inferred = new InferredOntologyGenerator(reasoner, generators);

            // We fill an anonymous ontology with the result, the return the
View Full Code Here

Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

      reasonerConfig.loadRemoteReasonerConfiguration(new File("reasoner.xml"));

      OWLReasonerFactory reasonerFactory = new HeraklesReasonerFactory( reasonerConfig, "de.fzi.herakles.strategy.impl.BasicLoadStrategy", "de.fzi.herakles.strategy.impl.BasicPStrategy" );
           
            // We now need to load an ontology into the reasoner. 
      OWLReasoner reasoner = reasonerFactory.createReasoner( ont );
           
            // With the strategies used, Herakles delegates the tasks to all registered reasoners
            // in parallel and returns the results from the fastest one. In the following we perform
            // various reasoning tasks. In between the tasks we wait for a few seconds to ensure
            // every reasoner has finished, since we want every reasoner to be available again for the
            // next task.
                                   
            System.out.println( "Waiting for all remote reasoners to finish ..." );
            try {
        Thread.sleep( 10000 );
      } catch( InterruptedException e ) {
        System.err.println( "WARNING: Could not wait for all reasoners to finish." );
        e.printStackTrace();
      }
           
            boolean consistent = reasoner.isConsistent();
            System.out.println("Consistent: " + consistent);
            System.out.println("\n");
     
    } catch( OWLOntologyCreationException e ) {
      System.err.println( "Ontology object could not be created." );
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.