Package com.clarkparsia.pellet.rules.rete

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


  @Test
  public void testDifferentIndividualsAtom() {
    kb.addIndividual(a);
    DifferentIndividualsAtom atom = new DifferentIndividualsAtom(vx, ca);
    TermTuple triple = new TermTuple(DependencySet.INDEPENDENT, Compiler.DIFF_FROM, vrx, cra);
    assertEquals(triple, ruleTranslator.translateAtom(atom, DependencySet.INDEPENDENT));
  }
View Full Code Here


  @Test
  public void testIndividualPropertyAtom() {
    kb.addObjectProperty(pi);
    kb.addIndividual(a);
    IndividualPropertyAtom atom = new IndividualPropertyAtom(pi, vx, ca);
    TermTuple triple = new TermTuple(DependencySet.INDEPENDENT, pi, vrx, cra);
    assertEquals(triple, ruleTranslator.translateAtom(atom, DependencySet.INDEPENDENT));
  }
View Full Code Here

  @Test
  public void testSameIndividualAtom() {
    kb.addIndividual(a);
    SameIndividualAtom atom = new SameIndividualAtom(vx, ca);
    TermTuple triple = new TermTuple(DependencySet.INDEPENDENT, Compiler.SAME_AS, vrx, cra);
    assertEquals(triple, ruleTranslator.translateAtom(atom, DependencySet.INDEPENDENT));
  }
View Full Code Here

  @Test
  public void testTranslateRule() {
    kb.addObjectProperty(pi);
    kb.addIndividual(a);
    IndividualPropertyAtom bodyAtom = new IndividualPropertyAtom(pi, vx, ca);
    TermTuple bodyTriple = new TermTuple(DependencySet.INDEPENDENT, pi, vrx, cra);
    SameIndividualAtom headAtom = new SameIndividualAtom(vx, ca);
    TermTuple headTriple = new TermTuple(DependencySet.INDEPENDENT, Compiler.SAME_AS, vrx, cra);

    Rule rule = new Rule(Collections.singletonList((RuleAtom) headAtom), Collections
                    .singletonList((RuleAtom) bodyAtom));
    com.clarkparsia.pellet.rules.rete.Rule reteRule = new com.clarkparsia.pellet.rules.rete.Rule(Collections
                    .singletonList(bodyTriple), Collections.singletonList(headTriple));
View Full Code Here

      var[i + 1] = freeVar.next();
      body.add(makeSubOfSomeTuple(var[i], (ATermAppl) chain[i],
          var[i + 1]));
    }

    TermTuple head = makeSubOfSomeTuple(var[0], sup, var[var.length - 1]);

    m_Rules.add(new Rule(body, Collections.singletonList(head)));
  }
View Full Code Here

    ATermAppl var1 = freeVar.next();
    ATermAppl var2 = freeVar.next();
    List<TermTuple> body = CollectionUtils.makeList();
    body.add(makeSubOfSomeTuple(var0, var1, var2));
    body.add(makeSubclassTuple(var2, BOTTOM));
    TermTuple head = makeSubclassTuple(var0, BOTTOM);

    m_Rules.add(new Rule(body, Collections.singletonList(head)));
  }
View Full Code Here

  private Fact makeSubOfSomeFact(ATermAppl t1, ATermAppl t2, ATermAppl t3) {
    return new Fact(DependencySet.INDEPENDENT, PRED_SUB_SOME, t1, t2, t3);
  }

  private TermTuple makeSubclassTuple(ATermAppl t1, ATermAppl t2) {
    return new TermTuple(DependencySet.INDEPENDENT, PRED_SUB, t1, t2);
  }
View Full Code Here

  // private TermTuple makeSubOfSomeTuple(Term t1, ATermAppl p, Term t2) {
  // return makeSubOfSomeTuple( t1, m_Names.get( p ), t2 );
  // }

  private TermTuple makeSubOfSomeTuple(ATermAppl t1, ATermAppl p, ATermAppl t2) {
    return new TermTuple(DependencySet.INDEPENDENT, PRED_SUB_SOME, t1, p,
        t2);
  }
View Full Code Here

TOP

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

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.