Examples of baseRelation()


Examples of de.fuberlin.wiwiss.d2rq.algebra.NodeRelation.baseRelation()

    assertNull(translate1("?subject ?predicate ?object", Collections.<TripleRelation>emptyList()));
  }
 
  public void testEmptyBGP() {
    NodeRelation nodeRel = translate1(Collections.<Triple>emptyList(), "engine/type-bridge.n3");
    assertEquals(Relation.TRUE, nodeRel.baseRelation());
    assertEquals(Collections.EMPTY_SET, nodeRel.variables());
  }
 
  public void testAskNoMatch() {
    assertNull(translate1("ex:res1 rdf:type foaf:Project", "engine/type-bridge.n3"));
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.NodeRelation.baseRelation()

    assertNull(translate1("ex:res1 rdf:type foaf:Project", "engine/type-bridge.n3"));
  }

  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());
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.NodeRelation.baseRelation()

    assertNull(translate1("ex:res1 ex:foo ?foo", "engine/type-bridge.n3"));
  }
 
  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());
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.NodeRelation.baseRelation()

  NodeRelation search(String tableName, String attributeName, NodeRelation[] relation)
  {
    for (int i = 0; i < relation.length; i++) {
      NodeRelation rel = relation[i];
      for (ProjectionSpec p: rel.baseRelation().projections()) {
        Attribute attribute = (Attribute) p;
        if (attribute.tableName().equals(tableName) && attribute.attributeName().equals(attributeName))
          return rel;
      }
    }
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.NodeRelation.baseRelation()

        nodeRel.nodeMaker(type).toString());
  }
 
  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());
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.NodeRelation.baseRelation()

    assertNull(translate1("?x rdf:type ?x", "engine/type-bridge.n3"));
  }
 
  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());
  }
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.NodeRelation.baseRelation()

  public void testMatchOneOfTwoPropertyBridges() {
    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() {
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.NodeRelation.baseRelation()

    NodeRelation nodeRel = translate1(
        "ex:res1 rdf:type ex:Class1 . ex:res1 ex:foo ?foo",
        "engine/simple.n3");
    assertEquals(Collections.singleton(foo), nodeRel.variables());
    assertEquals("Literal(Column(T2_table1.foo))", nodeRel.nodeMaker(foo).toString());
    Relation r = nodeRel.baseRelation();
    assertEquals("Conjunction(" +
        "Equality(" +
            "AttributeExpr(@@T1_table1.id@@), " +
            "Constant(1@T1_table1.id)), " +
        "Equality(" +
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.NodeRelation.baseRelation()

    assertEquals(2, nodeRel.variables().size());
    assertEquals("Literal(Column(T2_table1.foo))",
        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) {
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.TripleRelation.baseRelation()

  public void testParseAlias() {
    Mapping mapping = MappingHelper.readFromTestFile("parser/alias.ttl");
    MappingHelper.connectToDummyDBs(mapping);
    assertEquals(1, mapping.compiledPropertyBridges().size());
    TripleRelation bridge = (TripleRelation) mapping.compiledPropertyBridges().iterator().next();
    assertTrue(bridge.baseRelation().condition().isTrue());
    AliasMap aliases = bridge.baseRelation().aliases();
    AliasMap expected = new AliasMap(Collections.singleton(SQL.parseAlias("People AS Bosses")));
    assertEquals(expected, aliases);
  }
 
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.