Package de.fuberlin.wiwiss.d2rq.values

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


      logger.debug("isEqual(" + variable + ", " + constant + ")");
     
      NodeMaker nm = variable.getNodeMaker();
     
      if (nm instanceof TypedNodeMaker) {
        ValueMaker vm = ((TypedNodeMaker) nm).valueMaker();
        Node node = constant.getNode();
        logger.debug("checking " + node + " with " + nm);
       
        if (XSD.isNumeric(node)) {
          DetermineNodeType filter = new DetermineNodeType();
          nm.describeSelf(filter);
          RDFDatatype datatype = filter.getDatatype();
          if (datatype != null && XSD.isNumeric(datatype)) {
            RDFDatatype numericType = XSD.getNumericType(datatype, node.getLiteralDatatype());
            nm = cast(nm, numericType);
            node = XSD.cast(node, numericType);
          }
        }
       
        boolean empty = nm.selectNode(node, RelationalOperators.DUMMY).equals(NodeMaker.EMPTY);
        logger.debug("result " + new Boolean(empty));
        if (!empty) {
          if (node.isURI())
            expression.push(vm.valueExpression(node.getURI()));
          else if (node.isLiteral()) {
            if (XSD.isSupported(node.getLiteralDatatype()))
              expression.push(vm.valueExpression(constant.value()));
            else
              conversionFailed("cannot compare values of type " + node.getLiteralDatatypeURI(), expr);
          } else
            conversionFailed(expr); // TODO blank nodes?
          return;
View Full Code Here


      logger.debug("isNotEqual(" + variable + ", " + constant + ")");
     
      NodeMaker nm = variable.getNodeMaker();
     
      if (nm instanceof TypedNodeMaker) {
        ValueMaker vm = ((TypedNodeMaker) nm).valueMaker();
        Node node = constant.getNode();
        logger.debug("checking " + node + " with " + nm);
        if (XSD.isNumeric(node)) {
          DetermineNodeType filter = new DetermineNodeType();
          nm.describeSelf(filter);
          RDFDatatype datatype = filter.getDatatype();
          if (datatype != null && XSD.isNumeric(datatype)) {
            RDFDatatype numericType = XSD.getNumericType(datatype, node.getLiteralDatatype());
            nm = cast(nm, numericType);
            node = XSD.cast(node, numericType);
          }
        }
        boolean empty = nm.selectNode(node, RelationalOperators.DUMMY).equals(NodeMaker.EMPTY);
        logger.debug("result " + new Boolean(empty));
        if (!empty) {
          if (node.isURI())
            expression.push(new Negation(vm.valueExpression(node.getURI())));
          else if (node.isLiteral()) {
            if (XSD.isSupported(node.getLiteralDatatype()))
              expression.push(new Negation(vm.valueExpression(constant.value())));
            else // type = boolean or an unknown type
              conversionFailed("cannot compare values of type " + node.getLiteralDatatypeURI(), expr);
          } else
            conversionFailed(expr); // TODO blank nodes?
          return;
View Full Code Here

      logger.debug("isEqual(" + variable + ", " + constant + ")");
     
      NodeMaker nm = variable.getNodeMaker();
     
      if (nm instanceof TypedNodeMaker) {
        ValueMaker vm = ((TypedNodeMaker) nm).valueMaker();
        Node node = constant.getNode();
        logger.debug("checking " + node + " with " + nm);
               
        boolean empty = nm.selectNode(node, RelationalOperators.DUMMY).equals(NodeMaker.EMPTY);
        logger.debug("result " + new Boolean(empty));
        if (!empty) {
          if (node.isURI())
            expression.push(vm.valueExpression(node.getURI()));
          else if (node.isLiteral())
            expression.push(vm.valueExpression(constant.value()));
          else
            conversionFailed(expr); // TODO blank nodes?
          return;
        } else {
          expression.push(Expression.FALSE);
View Full Code Here

    }
    return this.refersToClassMap.buildAliasedNodeMaker(new AliasMap(aliases()), !this.containsDuplicates);
  }

  public NodeMaker buildAliasedNodeMaker(AliasMap aliases, boolean unique) {
    ValueMaker values = wrapValueSource(buildValueSourceBase()).renameAttributes(aliases);
    return buildNodeMaker(values, unique);
  }
View Full Code Here

TOP

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

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.