Package com.hp.hpl.jena.reasoner

Examples of com.hp.hpl.jena.reasoner.Reasoner


    if ( rulesSrc == null ) {
      return null;
    }
    log.info("Creating InfModel with rules:\n\t" +rulesSrc.replaceAll("\n", "\n\t"));
    List<Rule> rules = Rule.parseRules(rulesSrc);
    Reasoner reasoner = new GenericRuleReasoner(rules);
    InfModel im = ModelFactory.createInfModel(reasoner, _model);
    return im;
  }
View Full Code Here


    if ( rulesSrc == null ) {
      return;
    }
    log.info("_createInfModel: Creating InfModel with rules:\n\t" +rulesSrc.replaceAll("\n", "\n\t"));
    List<Rule> rules = Rule.parseRules(rulesSrc);
    Reasoner reasoner = new GenericRuleReasoner(rules);
    _infModel = ModelFactory.createInfModel(reasoner, _model);
  }
View Full Code Here

    if (ontology == ONTOLOGY.RDFS) {
      // TODO: consider all default graphs and named graphs!
      model = ModelFactory.createRDFSModel(model);
    } else if (ontology == ONTOLOGY.OWL) {
      final Reasoner owlReasoner = ReasonerRegistry.getOWLReasoner();
      model = ModelFactory.createInfModel(owlReasoner, model);
    }

    return ((new Date()).getTime() - a.getTime());
  }
View Full Code Here

  public InfModel getInferenceModel(InfModel infModel,
      IInferenceEngineConfiguration config, int index, Object init,
      ProgressMonitor monitor) throws InterruptedException {

      // create Pellet reasoner
      Reasoner reasoner = PelletReasonerFactory.theInstance().create();

      // create an inferencing model using Pellet reasoner and provided InfModel
      return ModelFactory.createInfModel( reasoner, infModel );
  }
View Full Code Here

  protected Graph createGraph(ProgressMonitor monitor) throws SMException {
    // Get RDF graph from predecessor modules
    Model inputModel = getRDFInputModel( monitor );
   
    // Wrap this input graph with Pellet
    Reasoner reasoner = PelletReasonerFactory.theInstance().create();
    return ModelFactory.createInfModel( reasoner, inputModel ).getGraph();
  }
View Full Code Here

        // ontology that will be used
        String ont = "http://protege.cim3.net/file/pub/ontologies/koala/koala.owl#";
        String ns = "http://protege.stanford.edu/plugins/owl/owl-library/koala.owl#";
       
        // create Pellet reasoner
        Reasoner reasoner = PelletReasonerFactory.theInstance().create();
       
        // create an empty model
        Model emptyModel = ModelFactory.createDefaultModel( );
       
        // create an inferencing model using Pellet reasoner
View Full Code Here

        // ontology that will be used
        String ont = "http://protege.cim3.net/file/pub/ontologies/koala/koala.owl#";
        String ns = "http://protege.stanford.edu/plugins/owl/owl-library/koala.owl#";
       
        // create Pellet reasoner
        Reasoner reasoner = PelletReasonerFactory.theInstance().create();
       
        // create an empty model
        Model emptyModel = ModelFactory.createDefaultModel( );
       
        // create an inferencing model using Pellet reasoner
View Full Code Here

        }       
    }
   
    private OntModel createJenaOWLModel(ResourceLoader owlSource) throws ResourceNotFoundException {
        KnowledgeResourceTO[] owlsources = null;
        Reasoner reasoner =  PelletReasonerFactory.theInstance().create();
        OntDocumentManager dm = OntDocumentManager.getInstance();
        dm.setProcessImports(false);
        OntModelSpec spec = new OntModelSpec( OntModelSpec.OWL_DL_MEM);
        spec.setDocumentManager(dm);       
        //spec.setReasoner(new OWLMicroReasoner(OWLMicroReasonerFactory.theInstance()));
View Full Code Here

     * additional inference work.
     *
     * @param model the Model containing both instance data and schema assertions to be inferenced over
     */
    public static InfModel createRDFSModel(Model model) {
         Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
         InfGraph graph = reasoner.bind( model.getGraph() );
         return new InfModelImpl( graph );
    }
View Full Code Here

     *
     * @param model a Model containing instance data assertions
     * @param schema a Model containing RDFS schema data
     */
    public static InfModel createRDFSModel( Model schema, Model model ) {
         Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
         InfGraph graph  = reasoner.bindSchema(schema.getGraph()).bind(model.getGraph());
         return new InfModelImpl( graph );
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.reasoner.Reasoner

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.