Package de.fuberlin.wiwiss.d2rq.algebra

Examples of de.fuberlin.wiwiss.d2rq.algebra.Relation.condition()


  public void testAskMatch() {
    NodeRelation nodeRel = translate1("ex:res1 rdf:type ex:Class1", "engine/type-bridge.n3");
    Relation r = nodeRel.baseRelation();
    assertEquals(Collections.singleton(table1), r.tables());
    assertEquals(Collections.EMPTY_SET, r.projections());
    assertEquals(Equality.createAttributeValue(table1id, "1"), r.condition());
    assertEquals(AliasMap.NO_ALIASES, r.aliases());
    assertEquals(Collections.EMPTY_SET, nodeRel.variables());
  }

  public void testFindNoMatch() {
View Full Code Here


  public void testFindFixedMatch() {
    NodeRelation nodeRel = translate1("ex:res1 rdf:type ?type", "engine/type-bridge.n3");
    Relation r = nodeRel.baseRelation();
    assertEquals(Collections.singleton(table1), r.tables());
    assertEquals(Collections.EMPTY_SET, r.projections());
    assertEquals(Equality.createAttributeValue(table1id, "1"), r.condition());
    assertEquals(AliasMap.NO_ALIASES, r.aliases());
    assertEquals(Collections.singleton(type), nodeRel.variables());
    assertEquals("Fixed(<http://example.org/Class1>)",
        nodeRel.nodeMaker(type).toString());
  }
View Full Code Here

  public void testFindMatch() {
    NodeRelation nodeRel = translate1("?x rdf:type ex:Class1", "engine/type-bridge.n3");
    Relation r = nodeRel.baseRelation();
    assertEquals(Collections.singleton(table1), r.tables());
    assertEquals(Collections.singleton(table1id), r.projections());
    assertEquals(Expression.TRUE, r.condition());
    assertEquals(AliasMap.NO_ALIASES, r.aliases());
    assertEquals(Collections.singleton(x), nodeRel.variables());
    assertEquals("URI(Pattern(http://example.org/res@@table1.id@@))",
        nodeRel.nodeMaker(x).toString());
  }
View Full Code Here

 
  public void testConstraintInTripleMatch() {
    NodeRelation nodeRel = translate1("?x rdf:type ?x", "engine/object-uricolumn.n3");
    Relation r = nodeRel.baseRelation();
    assertEquals(Collections.singleton(table1), r.tables());
    assertTrue(r.condition() instanceof Equality)// Too lazy to check both sides
    assertEquals(AliasMap.NO_ALIASES, r.aliases());
    assertEquals(Collections.singleton(x), nodeRel.variables());
  }

  public void testReturnMultipleMatchesForSingleTriplePattern() {
View Full Code Here

    NodeRelation nodeRel = translate1(
        "ex:res1 rdf:type ex:Class1",
        "engine/simple.n3");
    Relation r = nodeRel.baseRelation();
    assertEquals(Collections.EMPTY_SET, r.projections());
    assertEquals(Equality.createAttributeValue(table1id, "1"), r.condition());
  }
 
  public void testAskTwoTriplePatternsNoMatch() {
    assertNull(translate1(
        "ex:res1 rdf:type ex:Class1 . ex:res1 rdf:type ex:Class2",
View Full Code Here

            "AttributeExpr(@@T1_table1.id@@), " +
            "Constant(1@T1_table1.id)), " +
        "Equality(" +
            "AttributeExpr(@@T2_table1.id@@), " +
            "Constant(1@T2_table1.id)))",
        r.condition().toString());
  }
 
  public void testTwoTriplePatternsWithJoinMatch() {
    NodeRelation nodeRel = translate1(
        "?x rdf:type ex:Class1 . ?x ex:foo ?foo",
View Full Code Here

        nodeRel.nodeMaker(foo).toString());
    assertEquals("URI(Pattern(http://example.org/res@@T1_table1.id@@))",
        nodeRel.nodeMaker(x).toString());
    Relation r = nodeRel.baseRelation();
    assertEquals(Equality.createAttributeEquality(t1table1id, t2table1id),
        r.condition());
  }

  private NodeRelation translate1(String pattern, String mappingFile) {
    return translate1(triplesToList(pattern), mappingFile);
  }
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.