Package de.fuberlin.wiwiss.d2rq.values

Examples of de.fuberlin.wiwiss.d2rq.values.Column


        new FixedNodeMaker(FOAF.knows.asNode(), false),
        new TypedNodeMaker(TypedNodeMaker.URI,
            new Pattern("http://test/person@@employees.manager@@"), true));
    this.withURIColumnSubject = new TripleRelation(base,
        new TypedNodeMaker(TypedNodeMaker.URI,
            new Column(new Attribute(null, "employees", "homepage")), false),
        new FixedNodeMaker(RDF.type.asNode(), false),
        new FixedNodeMaker(FOAF.Document.asNode(), false));
    this.withURIPatternSubjectAndURIColumnObject = new TripleRelation(base,
        new TypedNodeMaker(TypedNodeMaker.URI,
            new Pattern("http://test/person@@employees.ID@@"), true),
        new FixedNodeMaker(FOAF.homepage.asNode(), false),
        new TypedNodeMaker(TypedNodeMaker.URI,
            new Column(new Attribute(null, "employees", "homepage")), false));
    this.employeeChecker = new URIMakerRule().createRuleChecker(
        Node.createURI("http://test/person1"));
    this.foobarChecker = new URIMakerRule().createRuleChecker(
        Node.createURI("http://test/foobar"));
  }
View Full Code Here


    if (this.bNodeIdColumns != null) {
      return new BlankNodeID(PrettyPrinter.toString(this.resource()),
          parseColumnList(this.bNodeIdColumns));
    }
    if (this.uriColumn != null) {
      return new Column(SQL.parseAttribute(this.uriColumn));
    }
    if (this.uriPattern != null) {
      Pattern p = new Pattern(this.uriPattern);
      if (!p.literalPartsMatchRegex(MapParser.IRI_CHAR_REGEX)) {
        throw new D2RQException("d2rq:uriPattern '"
            + this.uriPattern + "' contains characters not allowed in URIs",
            D2RQException.RESOURCEMAP_ILLEGAL_URIPATTERN);
      }
      return p;
    }
    if (this.column != null) {
      return new Column(SQL.parseAttribute(this.column));
    }
    if (this.pattern != null) {
      return new Pattern(this.pattern);
    }
    if (this.sqlExpression != null) {
View Full Code Here

        null, aliases, Expression.TRUE, Expression.TRUE,
        Collections.<Join>emptySet(), projections, false, OrderSpec.NONE, Relation.NO_LIMIT, Relation.NO_LIMIT);
    TripleRelation t = new TripleRelation(rel,
        new TypedNodeMaker(TypedNodeMaker.URI, new Pattern("http://example.org/original/@@original.id@@"), true),
        new FixedNodeMaker(Node.createURI("http://example.org/property"), false),
        new TypedNodeMaker(TypedNodeMaker.PLAIN_LITERAL, new Column(new Attribute(alias, "value")), false));
    assertEquals("URI(Pattern(http://example.org/original/@@original.id@@))",
        t.nodeMaker(TripleRelation.SUBJECT).toString());
    assertEquals("Literal(Column(alias.value))",
        t.nodeMaker(TripleRelation.OBJECT).toString());
    assertEquals("AliasMap(original AS alias)",
View Full Code Here

  }
 
  public void testCombineDifferentConditions() {
    Attribute id = SQL.parseAttribute("TABLE.ID");
    db.setNullable(id, false);
    NodeMaker x = new TypedNodeMaker(TypedNodeMaker.PLAIN_LITERAL, new Column(id), true);
    Map<Var,NodeMaker> map = Collections.singletonMap(Var.alloc("x"), x);
    BindingMaker bm = new BindingMaker(map, null);
    RelationBuilder b1 = new RelationBuilder(db);
    RelationBuilder b2 = new RelationBuilder(db);
    b1.addProjection(id);
View Full Code Here

    assertEquals("Blank(BlankNodeID(table.col1,table.col2))",
        maker.toString());
  }
 
  public void testPlainLiteralMakerToString() {
    TypedNodeMaker l = new TypedNodeMaker(TypedNodeMaker.PLAIN_LITERAL, new Column(table_col1), true);
    assertEquals("Literal(Column(table.col1))", l.toString());
  }
View Full Code Here

  }
 
  public void testCombineConditionAndNoCondition() {
    Attribute id = SQL.parseAttribute("TABLE.ID");
    db.setNullable(id, false);
    NodeMaker x = new TypedNodeMaker(TypedNodeMaker.PLAIN_LITERAL, new Column(id), true);
    Map<Var,NodeMaker> map = Collections.singletonMap(Var.alloc("x"), x);
    BindingMaker bm = new BindingMaker(map, null);
    RelationBuilder b1 = new RelationBuilder(db);
    RelationBuilder b2 = new RelationBuilder(db);
    b1.addProjection(id);
View Full Code Here

    TypedNodeMaker l = new TypedNodeMaker(TypedNodeMaker.PLAIN_LITERAL, new Column(table_col1), true);
    assertEquals("Literal(Column(table.col1))", l.toString());
  }
 
  public void testLanguageLiteralMakerToString() {
    TypedNodeMaker l = new TypedNodeMaker(TypedNodeMaker.languageLiteral("en"), new Column(table_col1), true);
    assertEquals("Literal@en(Column(table.col1))", l.toString());
  }
View Full Code Here

    assertEquals("Literal@en(Column(table.col1))", l.toString());
  }
 
  public void testTypedLiteralMakerToString() {
    TypedNodeMaker l = new TypedNodeMaker(TypedNodeMaker.typedLiteral(XSDDatatype.XSDstring),
        new Column(table_col1), true);
    assertEquals("Literal^^xsd:string(Column(table.col1))", l.toString());
  }
View Full Code Here

        new Column(table_col1), true);
    assertEquals("Literal^^xsd:string(Column(table.col1))", l.toString());
  }
 
  public void testURIMakerToString() {
    NodeMaker u = new TypedNodeMaker(TypedNodeMaker.URI, new Column(table_col1), true);
    assertEquals("URI(Column(table.col1))", u.toString());
  }
View Full Code Here

TOP

Related Classes of de.fuberlin.wiwiss.d2rq.values.Column

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.