Examples of RuleAtom


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

        new Object[] { p2a, } );
  }

  public void testVariableUtils1() {
    AtomIVariable var1 = new AtomIVariable( "var1" ), var2 = new AtomIVariable( "var2" );
    RuleAtom atom = new SameIndividualAtom( var1, var2 );
    assertIteratorValues( VariableUtils.getVars( atom ).iterator(), new Object[] { var1, var2 } );
  }
View Full Code Here

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

  }

  public void testVariableUtils2() {
    ATermAppl p = term( "p" );
    AtomIVariable var1 = new AtomIVariable( "var1" ), var2 = new AtomIVariable( "var2" );
    RuleAtom atom = new IndividualPropertyAtom( p, var1, var2 );
    assertIteratorValues( VariableUtils.getVars( atom ).iterator(), new Object[] { var1, var2 } );
  }
View Full Code Here

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

    kb.addPropertyValue( p, x, b );
    kb.addPropertyValue( p, x, c );

    {
      AtomIVariable v = new AtomIVariable( "v" );
      RuleAtom body = new ClassAtom( some( p, or( and( A, B ), or(
          and( A, C ), and( B, C ) ) ) ), v );
      RuleAtom head = new IndividualPropertyAtom( q, v, new AtomIConstant( y ) );
      Rule rule = new Rule( Collections.singleton( head ), Collections.singleton( body ) );
      kb.addRule( rule );
    }

    {
      AtomIVariable v = new AtomIVariable( "v" );
      RuleAtom body = new ClassAtom( G, v );
      RuleAtom head = new IndividualPropertyAtom( p, v, new AtomIConstant( y ) );
      Rule rule = new Rule( Collections.singleton( head ), Collections.singleton( body ) );
      kb.addRule( rule );
    }

    assertTrue( kb.isConsistent() );
View Full Code Here

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

    VariableBinding binding = new VariableBinding(kb.getABox());
    binding.set(x, mary);
    binding.set(y, robert);

    RuleAtom atom = new IndividualPropertyAtom(p, x, y);
    TrivialSatisfactionHelpers tester = new TrivialSatisfactionHelpers(kb.getABox());
    assertTrue(tester.isAtomTrue(atom, binding) != null);
  }
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.RuleAtom

           
            variableMap = new HashMap<String,Integer>();
           
            Iterator<RuleAtom> it = headAtomList.iterator();
            while (it.hasNext()) {
                RuleAtom atom = it.next();
                ClauseEntry clauseEntry = adaptRuleAtomTo(atom, com.hp.hpl.jena.reasoner.rulesys.Rule.class);

                if (clauseEntry instanceof HigherOrderClauseEntry) {
                    List<ClauseEntry> clauseEntries = ((HigherOrderClauseEntry) clauseEntry)
                            .getClauseEntries();

                    for (ClauseEntry ce : clauseEntries) {
                        headClauseEntries.add(ce);
                    }
                } else {
                    headClauseEntries.add(clauseEntry);
                }
            }

            it = bodyAtomList.iterator();
            while (it.hasNext()) {
                RuleAtom atom = it.next();
                ClauseEntry clauseEntry = adaptRuleAtomTo(atom, com.hp.hpl.jena.reasoner.rulesys.Rule.class);

                if (clauseEntry instanceof HigherOrderClauseEntry) {
                    List<ClauseEntry> clauseEntries = ((HigherOrderClauseEntry) clauseEntry)
                            .getClauseEntries();
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.RuleAtom

    }

    @Test
    public void testValidIndividualPropertyAtomWith() {

        RuleAtom ruleAtom = new IndividualPropertyAtom(objectProperty, argument1, argument2);

        execTest(ruleAtom);
    }
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.RuleAtom

    }

    @Test
    public void testValidAtomWithVariableArguments() {

        RuleAtom ruleAtom = new LessThanAtom(variable1, variable2);

        execTest(ruleAtom);

    }
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.RuleAtom

    }

    @Test
    public void testValidAtomWithLiteralArguments() {

        RuleAtom ruleAtom = new LessThanAtom(literal1, literal2);

        execTest(ruleAtom);
    }
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.RuleAtom

    }

    @Test
    public void testValidAtomWithTypedLiteralArguments() {

        RuleAtom ruleAtom = new LessThanAtom(typedLiteral1, typedLiteral2);

        execTest(ruleAtom);
    }
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.RuleAtom

          {if (true) return new AtomList[]{body, head};}
    throw new Error("Missing return statement in function");
  }

  final public AtomList atomList() throws ParseException {
AtomList atomList = new AtomList(); RuleAtom kReSAtom;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case SAME:
    case DIFFERENT:
    case LESSTHAN:
    case GREATERTHAN:
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.