/** * Implements {@link Value#stringValue()}. */ @Override public String stringValue() { return getValue().stringValue(); }
/** * Implements {@link Value#stringValue()}. */ @Override public String stringValue() { return getValue().stringValue(); }
if (term.stringValue().contains(query)) {
final String s = term.stringValue();
if (term.stringValue().contains(query)) {
final String s = term.stringValue();
/** * Human readable representation includes the term identifier, whether this * is a URI, Literal, Blank node, or Statement identifier and the datatype * URI if one is assigned. This representation is based solely on the flag * bits and the term identifier. * <p> * The cached {@link BigdataValue}, if any, is also rendered. This is done * using {@link BigdataValue#stringValue()} in order to avoid possible * infinite recursion through {@link BigdataValue#toString()} if the latter * were to display the {@link IV}. */ @Override public String toString() { return "TermId(" + termId + String.valueOf(getVTE().getCharCode()) + ")" + (hasValue() ? "[" + getValue().stringValue() + "]" : ""); }
/** * Human readable representation includes the term identifier, whether this * is a URI, Literal, Blank node, or Statement identifier and the datatype * URI if one is assigned. This representation is based solely on the flag * bits and the term identifier. * <p> * The cached {@link BigdataValue}, if any, is also rendered. This is done * using {@link BigdataValue#stringValue()} in order to avoid possible * infinite recursion through {@link BigdataValue#toString()} if the latter * were to display the {@link IV}. */ @Override public String toString() { return "TermId(" + termId + String.valueOf(getVTE().getCharCode()) + ")" + (hasValue() ? "[" + getValue().stringValue() + "]" : ""); }
/** * Asserts that the two {@link BigdataValue}s that are passed in are * {@link BigdataLiteral} of the same type and that the actual values * value, interpreted as numerical value, are identical. * * @param val * @param bigdataLiteral * * @throw {@link AssertionError} in case they are not */ protected void assertSemanticallyIdentical(final BigdataValue x1, final BigdataLiteral x2) { assertTrue(x1 instanceof BigdataLiteral); // assert they're both of the same datatype final BigdataLiteral x1AsLiteral = (BigdataLiteral) x1; assertEquals(x1AsLiteral.getDatatype(), x2.getDatatype()); // compare the component values String[] x1Components = x1.stringValue().split("#"); String[] x2Components = x2.stringValue().split("#"); assertEquals(x1Components.length, x2Components.length); for (int i = 0; i < x1Components.length; i++) { BigDecimal d1i = new BigDecimal(x1Components[i]); BigDecimal d2i = new BigDecimal(x2Components[i]); assertEquals(d1i, d2i); } }
/** * Asserts that the two {@link BigdataValue}s that are passed in are * {@link BigdataLiteral} of the same type and that the actual values * value, interpreted as numerical value, are identical. * * @param val * @param bigdataLiteral * * @throw {@link AssertionError} in case they are not */ protected void assertSemanticallyIdentical(final BigdataValue x1, final BigdataLiteral x2) { assertTrue(x1 instanceof BigdataLiteral); // assert they're both of the same datatype final BigdataLiteral x1AsLiteral = (BigdataLiteral) x1; assertEquals(x1AsLiteral.getDatatype(), x2.getDatatype()); // compare the component values String[] x1Components = x1.stringValue().split("#"); String[] x2Components = x2.stringValue().split("#"); assertEquals(x1Components.length, x2Components.length); for (int i = 0; i < x1Components.length; i++) { BigDecimal d1i = new BigDecimal(x1Components[i]); BigDecimal d2i = new BigDecimal(x2Components[i]); assertEquals(d1i, d2i); } }
/** * TODO additional scalar values (sparql.jjt specifies "separator EQ" as a * constant in the grammar, but we support additional scalar values for * {@link GROUP_CONCAT}. Also, the grammar is permissive and allows * Expression for separator rather than a quoted string (per the W3C draft). */ @Override final public FunctionNode visit(ASTGroupConcat node, Object data) throws VisitorException { Map<String, Object> scalarValues = new LinkedHashMap<String, Object>(); if (node.isDistinct()) { scalarValues.put(AggregateBase.Annotations.DISTINCT, Boolean.TRUE); } if (node.jjtGetNumChildren() > 1) { final ConstantNode separator = (ConstantNode) node.jjtGetChild(1) .jjtAccept(this, data); scalarValues.put(GROUP_CONCAT.Annotations.SEPARATOR, separator .getValue().stringValue()); } return new FunctionNode(FunctionRegistry.GROUP_CONCAT, scalarValues, new ValueExpressionNode[] { left(node) }); }
/** * TODO additional scalar values (sparql.jjt specifies "separator EQ" as a * constant in the grammar, but we support additional scalar values for * {@link GROUP_CONCAT}. Also, the grammar is permissive and allows * Expression for separator rather than a quoted string (per the W3C draft). */ @Override final public FunctionNode visit(ASTGroupConcat node, Object data) throws VisitorException { Map<String, Object> scalarValues = new LinkedHashMap<String, Object>(); if (node.isDistinct()) { scalarValues.put(AggregateBase.Annotations.DISTINCT, Boolean.TRUE); } if (node.jjtGetNumChildren() > 1) { final ConstantNode separator = (ConstantNode) node.jjtGetChild(1) .jjtAccept(this, data); scalarValues.put(GROUP_CONCAT.Annotations.SEPARATOR, separator .getValue().stringValue()); } return new FunctionNode(FunctionRegistry.GROUP_CONCAT, scalarValues, new ValueExpressionNode[] { left(node) }); }
final String queryIdStr = sp.o().getValue().stringValue();
/** * Asserts that the two {@link BigdataValue}s that are passed in are * {@link BigdataLiteral} of the same type and that the actual values * value, interpreted as numerical value, are identical. * * @param val * @param bigdataLiteral * * @throw {@link AssertionError} in case they are not */ protected void assertSemanticallyIdentical(final BigdataValue x1, final BigdataLiteral x2) { assertTrue(x1 instanceof BigdataLiteral); // assert they're both of the same datatype final BigdataLiteral x1AsLiteral = (BigdataLiteral) x1; assertEquals(x1AsLiteral.getDatatype(), x2.getDatatype()); // compare the component values String[] x1Components = x1.stringValue().split("#"); String[] x2Components = x2.stringValue().split("#"); assertEquals(x1Components.length, x2Components.length); for (int i = 0; i < x1Components.length; i++) { BigDecimal d1i = new BigDecimal(x1Components[i]); BigDecimal d2i = new BigDecimal(x2Components[i]); assertEquals(d1i, d2i); } }
final String queryIdStr = sp.o().getValue().stringValue();
return bdVal.stringValue();
return bdVal.stringValue();
assertTrue(((ConstantNode) pattern.p()).getValueExpression() instanceof Constant); assertTrue(((Constant) ((ConstantNode) pattern.p()).getValueExpression()).get() instanceof TermId); assertEquals("http://example/p", ((TermId) ((Constant) ((ConstantNode) pattern.p()).getValueExpression()).get()).getValue().stringValue());
assertTrue(((ConstantNode) pattern.p()).getValueExpression() instanceof Constant); assertTrue(((Constant) ((ConstantNode) pattern.p()).getValueExpression()).get() instanceof TermId); assertEquals("http://example/p", ((TermId) ((Constant) ((ConstantNode) pattern.p()).getValueExpression()).get()).getValue().stringValue());
assertNotNull(v.stringValue(), iv);