Package org.semanticweb.owlapi.reasoner

Examples of org.semanticweb.owlapi.reasoner.OWLReasonerFactory


        // We need to create an instance of OWLReasoner. An OWLReasoner provides
        // the basic query functionality that we need, for example the ability
        // obtain the subclasses of a class etc. To do this we use a reasoner
        // factory.
        // Create a reasoner factory.
        OWLReasonerFactory reasonerFactory = new StructuralReasonerFactory();
        return reasonerFactory.createReasoner(rootOntology);
    }
View Full Code Here


        // sure you get the HermiT library and add it to your class path. You
        // can then instantiate the HermiT reasoner factory: Comment out the
        // first line below and uncomment the second line below to instantiate
        // the HermiT reasoner factory. You'll also need to import the
        // org.semanticweb.HermiT.Reasoner package.
        OWLReasonerFactory reasonerFactory = new StructuralReasonerFactory();
        // OWLReasonerFactory reasonerFactory = new Reasoner.ReasonerFactory();
        // We'll now create an instance of an OWLReasoner (the implementation
        // being provided by HermiT as we're using the HermiT reasoner factory).
        // The are two categories of reasoner, Buffering and NonBuffering. In
        // our case, we'll create the buffering reasoner, which is the default
        // kind of reasoner. We'll also attach a progress monitor to the
        // reasoner. To do this we set up a configuration that knows about a
        // progress monitor. Create a console progress monitor. This will print
        // the reasoner progress out to the console.
        // ConsoleProgressMonitor progressMonitor = new
        // ConsoleProgressMonitor();
        // Specify the progress monitor via a configuration. We could also
        // specify other setup parameters in the configuration, and different
        // reasoners may accept their own defined parameters this way.
        // OWLReasonerConfiguration config = new SimpleConfiguration(
        // progressMonitor);
        // Create a reasoner that will reason over our ontology and its imports
        // closure. Pass in the configuration.
        // OWLReasoner reasoner = reasonerFactory.createReasoner(ont, config);
        OWLReasoner reasoner = reasonerFactory.createReasoner(ont);
        // Ask the reasoner to do all the necessary work now
        reasoner.precomputeInferences();
        // We can determine if the ontology is actually consistent (in this
        // case, it should be).
        boolean consistent = reasoner.isConsistent();
View Full Code Here

        // Create a reasoner factory. In this case, we will use pellet, but we
        // could also use FaCT++ using the FaCTPlusPlusReasonerFactory. Pellet
        // requires the Pellet libraries (pellet.jar, aterm-java-x.x.jar) and
        // the XSD libraries that are bundled with pellet: xsdlib.jar and
        // relaxngDatatype.jar make sure these jars are on the classpath
        OWLReasonerFactory reasonerFactory = new StructuralReasonerFactory();
        // Uncomment the line below reasonerFactory = new
        // PelletReasonerFactory(); Load an example ontology - for the purposes
        // of the example, we will just load the pizza ontology.
        OWLOntologyManager man = OWLManager.createOWLOntologyManager();
        OWLOntology ont = loadPizza(man);
        // Create the reasoner and classify the ontology
        OWLReasoner reasoner = reasonerFactory.createNonBufferingReasoner(ont);
        reasoner.precomputeInferences(InferenceType.CLASS_HIERARCHY);
        // To generate an inferred ontology we use implementations of inferred
        // axiom generators to generate the parts of the ontology we want (e.g.
        // subclass axioms, equivalent classes axioms, class assertion axiom
        // etc. - see the org.semanticweb.owlapi.util package for more
View Full Code Here

        // the local name
        String prefix = ont.getOntologyID().getOntologyIRI().get() + "#";
        // Create a reasoner. We will use Pellet in this case. Make sure that
        // the latest version of the Pellet libraries are on the runtime class
        // path
        OWLReasonerFactory reasonerFactory = new StructuralReasonerFactory();
        // Uncomment the line below reasonerFactory = new
        // PelletReasonerFactory();
        OWLReasoner reasoner = reasonerFactory.createNonBufferingReasoner(ont);
        // Now we can query the reasoner, suppose we want to determine the
        // properties that instances of Marghertia pizza must have
        OWLClass margheritaPizza = man.getOWLDataFactory().getOWLClass(
                IRI.create(prefix + "Quokka"));
        // printProperties(man, ont, reasoner, margheritaPizza);
View Full Code Here

  public void start(ReasonerRegistry registry, String loadStrategy, String executionStrategy) {   
    this.registry = registry;
    this.loadStrategy = loadStrategy;
    this.executionStrategy = executionStrategy;
    try {
      OWLReasonerFactory reasonerFactory = new HeraklesReasonerFactory(this.registry, this.loadStrategy, this.executionStrategy);
      AbstractOWLlinkReasonerConfiguration serverConfiguration = new AbstractOWLlinkReasonerConfiguration();
     
      this.server = new OWLlinkHTTPXMLServer(reasonerFactory, serverConfiguration, this.port);
      this.server.run();
      if(logger.isInfoEnabled()){
View Full Code Here

public class CelServer extends Server {

  @Override
  public void initialServer(int index) {
    OWLReasonerFactory factory = (OWLReasonerFactory) new CelReasonerFacotry();
    OWLReasonerConfiguration reasonerConfiguration = new SimpleConfiguration();
    AbstractOWLlinkReasonerConfiguration serverConfiguration =
      new AbstractOWLlinkReasonerConfiguration(reasonerConfiguration);
    int port = ServerParams.getPort(index);
    server = new OWLlinkHTTPXMLServer(factory, serverConfiguration, port);
View Full Code Here

public class TrowlServer extends Server {

  @Override
  public void initialServer(int index) {
    OWLReasonerFactory factory = new ReasonerFactory();
    OWLReasonerConfiguration reasonerConfiguration = new SimpleConfiguration();
    AbstractOWLlinkReasonerConfiguration serverConfiguration =
      new AbstractOWLlinkReasonerConfiguration(reasonerConfiguration);
    int port = ServerParams.getPort(getServerName());
    server = new OWLlinkHTTPXMLServer(factory, serverConfiguration, port);
View Full Code Here

      if (ontology2 != null) {
        // two different domain ontologies
        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

      OWLOntology ont = manager.loadOntologyFromOntologyDocument( IRI.create( PHYSICAL_URI ) );
     
      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" );
           
            // 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
View Full Code Here

      OWLOntology ont = manager.loadOntologyFromOntologyDocument( IRI.create( PHYSICAL_URI ) );
     
      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" );
      //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();
View Full Code Here

TOP

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

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.