Package com.clarkparsia.pellet.rules.model

Examples of com.clarkparsia.pellet.rules.model.Rule


  public void applyRuleBindings() {

    int total = 0;

    for( PartialBinding ruleBinding : partialBindings ) {
      Rule rule = ruleBinding.getRule();
      VariableBinding initial = ruleBinding.getBinding();

      for( VariableBinding binding : bindingStrategy.createGenerator( rule, initial ) ) {

        Pair<Rule, VariableBinding> ruleKey = new Pair<Rule, VariableBinding>( rule,
View Full Code Here


    merging = false;
    t = timers.startTimer( "rule-buildReteRules" );
    Compiler compiler = new Compiler(this);
    for (Entry<Rule, Rule> e : abox.getKB().getNormalizedRules().entrySet()) {
      Rule rule = e.getKey();
      Rule normalizedRule = e.getValue();

      if (normalizedRule == null)
        continue;

      Set<ATermAppl> explain = abox.doExplanation() ? rule.getExplanation(atermTranslator) : Collections
View Full Code Here

      return;
    }

    ATermAppl name = JenaUtils.makeATerm( node );
    Rule rule = new Rule( name, head, body );
    kb.addRule( rule );
  }
View Full Code Here

      for( ; !head.isEmpty(); head = head.getNext() )
        consequent.add( convertRuleAtom( (ATermAppl) head.getFirst() ) );

      if( !antecedent.contains( null ) && !consequent.contains( null ) ) {
        ATermAppl name = (ATermAppl) axiom.getArgument( 0 );
        Rule rule = new Rule( name, consequent, antecedent );
        kb.addRule( rule );
      }
    }
    else {
      throw new InternalReasonerException( "Unknown axiom " + axiom );
View Full Code Here

      addUnsupportedAxiom( rule );

      return;
    }
   
    Rule pelletRule = new Rule( head, body );
    kb.addRule( pelletRule );
  }
View Full Code Here

      }
     
      List<RuleAtom> headAtoms  = new ArrayList<RuleAtom>();
      processClass( var, ATermUtils.negate( head ), headAtoms, 1 );
     
      Rule rule = new Rule(headAtoms, bodyAtoms);
      kb.addRule( rule );
     
      if( log.isLoggable( Level.FINE ) )
        log.fine( "Add rule: " + rule );
     
View Full Code Here

    // Then add the class atoms for the two subject variables
    body.add( new ClassAtom( c, x ) );
    body.add( new ClassAtom( c, y ) );
   
    addRule( new Rule( head, body ) );
  }
View Full Code Here

    // prepare the KB
    prepare();   
   
    for( Entry<Rule, Rule> normalizedRule : rules.entrySet() ) {
      if( normalizedRule.getValue() == null ) {
        Rule rule = normalizedRule.getKey();
        String msg = UsableRuleFilter.explainNotUsable( rule );       
        log.warning( "Ignoring rule " + rule + ": " + msg );
      }
    }
View Full Code Here

          atom = new ClassAtom( normC, ca.getArgument() );
      }
      body.add( atom );
    }

    return new Rule( rule.getName(), head, body );
  }
View Full Code Here

      ? null
      : rule.isAnonymous()
        ? ATermUtils.makeBnode( uri.toString() )
        : ATermUtils.makeTermAppl( uri.toString() );

    Rule pelletRule = new Rule( name, head, body );
    kb.addRule( pelletRule );
  }
View Full Code Here

TOP

Related Classes of com.clarkparsia.pellet.rules.model.Rule

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.