Package de.fuberlin.wiwiss.d2rq.values

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


  }

  public void limitValuesToBlankNodeID(BlankNodeID id) {
    if (isEmpty) return;
    if (!blankNodeIDs.isEmpty()) {
      BlankNodeID first = (BlankNodeID) blankNodeIDs.iterator().next();
      if (!first.classMapID().equals(id.classMapID())) {
        limitToEmptySet();
      }
    }
    blankNodeIDs.add(id);
  }
View Full Code Here


        translated.add(Equality.create(first, it.next()));
      }
    }
    if (blankNodeIDs.size() >= 2) {
      Iterator<BlankNodeID> it = blankNodeIDs.iterator();
      BlankNodeID first = it.next();
      while (it.hasNext()) {
        translated.addAll(matchBlankNodeIDs(first, it.next()));
      }
    }
    if (constantValue != null) {
      if (!attributes.isEmpty()) {
        Attribute first = attributes.iterator().next();
        translated.add(Equality.createAttributeValue(first, constantValue));
      }
      if (!blankNodeIDs.isEmpty()) {
        BlankNodeID first = blankNodeIDs.iterator().next();
        translated.add(first.valueExpression(constantValue));
      }
      if (!patterns.isEmpty()) {
        Pattern first = patterns.iterator().next();
        translated.add(first.valueExpression(constantValue));
      }
      if (!expressions.isEmpty()) {
        Expression first = expressions.iterator().next();
        translated.add(Equality.createExpressionValue(first, constantValue));
      }
    } else if (!attributes.isEmpty()) {
      AttributeExpr attribute = new AttributeExpr(attributes.iterator().next());
      if (!blankNodeIDs.isEmpty()) {
        BlankNodeID first = blankNodeIDs.iterator().next();
        translated.add(Equality.create(attribute, first.toExpression()));
      }
      if (!patterns.isEmpty()) {
        Pattern first = patterns.iterator().next();
        translated.add(Equality.create(attribute, first.toExpression()));
        checkUsesColumnFunctions(first);
      }
      if (!expressions.isEmpty()) {
        Expression first = expressions.iterator().next();
        translated.add(Equality.create(attribute, first));
      }
    } else if (!expressions.isEmpty()) {
      Expression expression = expressions.iterator().next();
      if (!blankNodeIDs.isEmpty()) {
        BlankNodeID first = blankNodeIDs.iterator().next();
        translated.add(Equality.create(expression, first.toExpression()));
      }
      if (!patterns.isEmpty()) {
        Pattern first = patterns.iterator().next();
        translated.add(Equality.create(expression, first.toExpression()));
        checkUsesColumnFunctions(first);
      }
    } else if (!patterns.isEmpty() && !blankNodeIDs.isEmpty()) {
      Pattern firstPattern = patterns.iterator().next();
      BlankNodeID firstBNodeID = blankNodeIDs.iterator().next();
      translated.add(Equality.create(firstPattern.toExpression(), firstBNodeID.toExpression()));
      checkUsesColumnFunctions(firstPattern);
    }
    // FIXME: Actually handle this properly, see https://github.com/d2rq/d2rq/issues/22
    if (translators.size() > 1) {
      log.warn("Join involving multiple translators (d2rq:translateWith) is not supported");
View Full Code Here

    return buildNodeMaker(values, unique);
  }
 
  private ValueMaker buildValueSourceBase() {
    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));
    }
View Full Code Here

    assertEquals("Fixed(<http://example.org/>)",
        new FixedNodeMaker(Node.createURI("http://example.org/"), true).toString());
  }
 
  public void testBlankNodeMakerToString() {
    BlankNodeID b = new BlankNodeID("classmap1", Arrays.asList(new Attribute[]{table_col1, table_col2}));
    NodeMaker maker = new TypedNodeMaker(TypedNodeMaker.BLANK, b, true);
    assertEquals("Blank(BlankNodeID(table.col1,table.col2))",
        maker.toString());
  }
View Full Code Here

TOP

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

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.