Examples of OWLReasoner


Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

    org.semanticweb.owlapi.model.OWLOntology ont = manager.loadOntologyFromOntologyDocument(IRI.create( PHYSICAL_IRI ));
    OWLlinkHTTPXMLReasonerFactory factory = new OWLlinkHTTPXMLReasonerFactory();
   
    OWLlinkReasonerConfiguration reasonerConfiguration = new OWLlinkReasonerConfiguration(url);
   
    OWLReasoner reasoner = factory.createReasoner(ont, reasonerConfiguration);
   
    // Query Reasoner
   
    OWLClass cls = factory2.getOWLClass(IRI.create( CLASS_IRI ) );
    NodeSet<OWLNamedIndividual> namedIndividuals = reasoner.getInstances(cls, true);
   
    System.out.println(namedIndividuals.getClass());
   
    System.out.println( "Instances of " + CLASS_IRI + ":" );
    for( Node<OWLNamedIndividual> sc : namedIndividuals )
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" );
      //OWLReasonerFactory reasonerFactory = new PelletReasonerFactory();
   
      OWLReasoner reasoner = reasonerFactory.createReasoner( ont );
           
            // We can determine if the pizza ontology is actually consistent.  (If an ontology is
            // inconsistent then owl:Thing is equivalent to owl:Nothing - i.e. there can't be any
            // models of the ontology)
            boolean consistent = reasoner.isConsistent();
            System.out.println("Consistent: " + consistent);
            System.out.println("\n");

            ManchesterOWLSyntaxEditorParser parser = new ManchesterOWLSyntaxEditorParser(manager.getOWLDataFactory(), "Class PotableLiquid" );
            //parser.setOWLEntityChecker(new ManchesterOWLSyntaxEditorParser.DefaultEntityChecker());
View Full Code Here

Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

      OWLlinkReasonerConfiguration reasonerConfiguration = new OWLlinkReasonerConfiguration(progressMonitor, url, IndividualNodeSetPolicy.BY_SAME_AS);
   
      OWLlinkHTTPXMLReasonerFactory reasonerFactory = new OWLlinkHTTPXMLReasonerFactory();
     
      OWLReasoner reasoner = reasonerFactory.createReasoner(ontology, reasonerConfiguration)
           
            // 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

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.BasicPStrategy" );
     
      OWLReasoner reasoner = reasonerFactory.createReasoner( ont );
           
      // We can easily get a list of inconsistent classes.  (A class is inconsistent if it
      // can't possibly have any instances).  Note that the getInconsistentClasses method
      // is really just a convenience method for obtaining the classes that are equivalent
      // to owl:Nothing.
      Node<OWLClass> unsatisfiableClasses = reasoner.getUnsatisfiableClasses();
      if (unsatisfiableClasses.getSize() != 0) {
        System.out.println("The following classes are unsatisfiable: ");
        for( OWLClass cls : unsatisfiableClasses )
          System.out.println("    " + cls );
      }
      else {
        System.out.println("There are no unsatisfiable classes");
      }
      System.out.println("\n");

            Thread.sleep( 5000 );
     
      OWLClass cls = factory.getOWLClass( IRI.create( CLASS_URI ) );
      NodeSet<OWLClass> subClasses = reasoner.getSubClasses(cls, true);
     
      System.out.println( "Subclasses of " + CLASS_URI + ":" );
      for( Node<OWLClass> sc : subClasses.getNodes() )
        for( OWLClass c : sc )
          System.out.println( c );
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.AnalysingLoadStrategy", "de.fzi.herakles.strategy.impl.ABoxTBoxRatioSelectionStrategy" );
           
            // 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.
                                   
            boolean consistent = reasoner.isConsistent();
            System.out.println("Consistent: " + consistent);
            System.out.println("\n");
     
     
    } catch( OWLOntologyCreationException e ) {
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.BenchmarkingStrategy" );
           
            // 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( "Checking consistency ..." );
//            boolean consistent = reasoner.isConsistent();
//            System.out.println("Consistent: " + consistent);
//            System.out.println("\n");

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

Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

        JOptionPane.showMessageDialog(this, "Please wait! The current running Query is not finished!.",
          "Query is running", JOptionPane.WARNING_MESSAGE);
        return;
      }
     
      OWLReasoner reasoner = owlEditorKit.getModelManager().getReasoner();
      // AnytimeReasonerDummy reasoner = new AnytimeReasonerDummy(owlEditorKit.getOWLModelManager().getOWLOntologyManager());
      AnytimeOWLReasoner anytimeReasoner = null;
      try{   
        if(reasoner instanceof NoOpReasoner){
          Thread.currentThread().sleep(2000);
View Full Code Here

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

Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

         
          // 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

Examples of org.semanticweb.owlapi.reasoner.OWLReasoner

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