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;