@Override public String stringValue() { return getValue().stringValue(); }
@Override public String stringValue() { return 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); } }
assertEquals(givenStr, lit.stringValue()); assertEquals(expectedStr, lit2.stringValue());
assertEquals(givenStr, lit.stringValue()); assertEquals(expectedStr, lit2.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); } }
assertEquals(givenStr, lit.stringValue()); assertEquals(expectedStr, lit2.stringValue());