Package com.clarkparsia.pellet.rules.rete

Examples of com.clarkparsia.pellet.rules.rete.Interpreter


    initialize( expressivity );

    //run the RETE once when the rules are not applied
    if( !abox.ranRete && abox.rulesNotApplied ) {
      // initialize and run the rete
      Interpreter interp = new Interpreter( abox );

      RulesToReteTranslator translator = new RulesToReteTranslator( abox );
      RulesToATermTranslator atermTranslator = new RulesToATermTranslator();
      for( Rule rule : abox.getKB().getRules() ) {
        com.clarkparsia.pellet.rules.rete.Rule reteRule =
          translator.translateRule( rule );
       
        if( reteRule != null ) {
          Set<ATermAppl> explain = abox.doExplanation()         
            ? rule.getExplanation( atermTranslator )
            : Collections.<ATermAppl>emptySet();
         
          interp.rete.compile( reteRule, explain );
        }
      }
     
      interp.rete.compileFacts( abox );
      Set<Fact> inferred = interp.run();

      if( log.isLoggable( Level.FINE ) )
        log.fine( inferred.size() + " inferred fact(s)" );
     
      //need to add the inferred facts back to the tableau
View Full Code Here


    initialize( expressivity );

    merging = false;
//    t = timers.startTimer( "rule-buildReteRules" );
    interpreter = new Interpreter( abox );
    for( Entry<Rule,Rule> e : abox.getKB().getNormalizedRules().entrySet() ) {
      Rule rule = e.getKey();
      Rule normalizedRule = e.getValue();
     
      if( normalizedRule == null )
View Full Code Here

  }

  protected MultiValueMap<ATermAppl, ATermAppl> run(
      Collection<ATermAppl> classes) {
    KnowledgeBase reteKB = new KnowledgeBase();
    Interpreter interpreter = new Interpreter(reteKB.getABox());

    for( Rule rule : m_Rules ) {
      interpreter.rete.compile(rule, null)
    }   

    addClasses(interpreter, classes);
    addClasses(interpreter, m_Names.getAllAnons());
    for (Fact fact : m_Facts) {
      interpreter.addFact(fact);
    }
    m_Facts = null;
    m_Names.reset();

    Set<Fact> facts = interpreter.run();

    MultiValueMap<ATermAppl, ATermAppl> subsumers = getSubsumers(facts);
    for (ATermAppl c : classes) {
      subsumers.add(c, c);
      subsumers.add(c, ATermUtils.TOP);
View Full Code Here

   
    AlphaNetwork alphaNet = compiler.getAlphaNet();
    if (abox.doExplanation()) {
      alphaNet.setDoExplanation(true);
    }
    interpreter = new Interpreter(alphaNet);
    partialBindings.clear();
    partialBindings.addAll(unsafeRules);
    rulesApplied.clear();

View Full Code Here

TOP

Related Classes of com.clarkparsia.pellet.rules.rete.Interpreter

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.