@Override protected Value evaluate(ValueFactory valueFactory, Value arg1, Value arg2) throws ValueExprEvaluationException { return BooleanLiteral.valueOf(QueryEvaluationUtil.compare(arg1, arg2, CompareOp.EQ)); } }
IRI f = iter.next(); Value abstractValue = Statements.singleValue(f, SPIN.ABSTRACT_PROPERTY, store); if (BooleanLiteral.TRUE.equals(abstractValue)) { iter.remove();
@Override protected Value evaluate(ValueFactory valueFactory, Value arg1, Value arg2) throws ValueExprEvaluationException { return BooleanLiteral.valueOf(QueryEvaluationUtil.compare(arg1, arg2, CompareOp.NE)); } }
@Override protected Value evaluate(ValueFactory valueFactory, Value arg1, Value arg2) throws ValueExprEvaluationException { return BooleanLiteral.valueOf(QueryEvaluationUtil.compare(arg1, arg2, CompareOp.GT)); } }
@Override protected Value evaluate(ValueFactory valueFactory, Value arg) throws ValueExprEvaluationException { return BooleanLiteral.valueOf( !QueryEvaluationUtil.getEffectiveBooleanValue(arg) ); } }
@Override protected Value evaluate(ValueFactory valueFactory, Value arg1, Value arg2) throws ValueExprEvaluationException { return BooleanLiteral.valueOf(QueryEvaluationUtil.compare(arg1, arg2, CompareOp.LE)); } }
@Override protected Value evaluate(ValueFactory valueFactory, Value arg1, Value arg2) throws ValueExprEvaluationException { return BooleanLiteral.valueOf(QueryEvaluationUtil.compare(arg1, arg2, CompareOp.LT)); } }
@Override protected Value evaluate(ValueFactory valueFactory, Value arg1, Value arg2) throws ValueExprEvaluationException { return BooleanLiteral.valueOf(QueryEvaluationUtil.compare(arg1, arg2, CompareOp.GE)); } }
/** * Determines whether the operand (a variable) contains a URI. * * @return <tt>true</tt> if the operand contains a URI, <tt>false</tt> * otherwise. */ public Value evaluate(IsURI node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { Value argValue = evaluate(node.getArg(), bindings); return BooleanLiteral.valueOf(argValue instanceof IRI); }
public Value evaluate(Bound node, BindingSet bindings) throws QueryEvaluationException { try { Value argValue = evaluate(node.getArg(), bindings); return BooleanLiteral.valueOf(argValue != null); } catch (ValueExprEvaluationException e) { return BooleanLiteral.FALSE; } }
/** * Determines whether the operand (a variable) contains a Literal. * * @return <tt>true</tt> if the operand contains a Literal, <tt>false</tt> * otherwise. */ public Value evaluate(IsLiteral node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { Value argValue = evaluate(node.getArg(), bindings); return BooleanLiteral.valueOf(argValue instanceof Literal); }
/** * Determines whether the operand (a variable) contains a Resource. * * @return <tt>true</tt> if the operand contains a Resource, <tt>false</tt> * otherwise. */ public Value evaluate(IsResource node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { Value argValue = evaluate(node.getArg(), bindings); return BooleanLiteral.valueOf(argValue instanceof Resource); }
@Override protected Value evaluate(ValueFactory valueFactory, Value arg1, Value arg2) throws ValueExprEvaluationException { return BooleanLiteral.valueOf( QueryEvaluationUtil.getEffectiveBooleanValue(arg1) || QueryEvaluationUtil.getEffectiveBooleanValue(arg2) ); } }
/** * Determines whether the operand (a variable) contains a BNode. * * @return <tt>true</tt> if the operand contains a BNode, <tt>false</tt> * otherwise. */ public Value evaluate(IsBNode node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { Value argValue = evaluate(node.getArg(), bindings); return BooleanLiteral.valueOf(argValue instanceof BNode); }
@Override protected Value evaluate(ValueFactory valueFactory, Value arg1, Value arg2) throws ValueExprEvaluationException { return BooleanLiteral.valueOf( QueryEvaluationUtil.getEffectiveBooleanValue(arg1) && QueryEvaluationUtil.getEffectiveBooleanValue(arg2) ); } }
public Value evaluate(Not node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { Value argValue = evaluate(node.getArg(), bindings); boolean argBoolean = QueryEvaluationUtil.getEffectiveBooleanValue(argValue); return BooleanLiteral.valueOf(!argBoolean); }
public Value evaluate(SameTerm node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { Value leftVal = evaluate(node.getLeftArg(), bindings); Value rightVal = evaluate(node.getRightArg(), bindings); return BooleanLiteral.valueOf(leftVal != null && leftVal.equals(rightVal)); }
public Value evaluate(LangMatches node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { Value langTagValue = evaluate(node.getLeftArg(), bindings); Value langRangeValue = evaluate(node.getRightArg(), bindings); if (QueryEvaluationUtil.isSimpleLiteral(langTagValue) && QueryEvaluationUtil.isSimpleLiteral(langRangeValue)) { String langTag = ((Literal)langTagValue).getLabel(); String langRange = ((Literal)langRangeValue).getLabel(); boolean result = false; if (langRange.equals("*")) { result = langTag.length() > 0; } else if (langTag.length() == langRange.length()) { result = langTag.equalsIgnoreCase(langRange); } else if (langTag.length() > langRange.length()) { // check if the range is a prefix of the tag String prefix = langTag.substring(0, langRange.length()); result = prefix.equalsIgnoreCase(langRange) && langTag.charAt(langRange.length()) == '-'; } return BooleanLiteral.valueOf(result); } throw new ValueExprEvaluationException(); }
return BooleanLiteral.valueOf(result);
public Value evaluate(Exists node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { CloseableIteration<BindingSet, QueryEvaluationException> iter = evaluate(node.getSubQuery(), bindings); try { return BooleanLiteral.valueOf(iter.hasNext()); } finally { iter.close(); } }