Search in sources :

Example 1 with IteratingTupleQueryResult

use of org.eclipse.rdf4j.query.impl.IteratingTupleQueryResult in project rdf4j by eclipse.

the class SPARQLTSVCustomTest method testSES2126QuotedLiteralIntegerAsStringExplicitType.

/**
 * Only Literals with the XML Schema numeric types should be simplified.
 * <p>
 * NOTE: This will fail when using RDF-1.1, as the datatype {@link XMLSchema#STRING} is implied and hence
 * is not generally represented.
 *
 * @throws Exception
 */
@Ignore("This test does not work with RDF-1.1")
@Test
public void testSES2126QuotedLiteralIntegerAsStringExplicitType() throws Exception {
    List<String> bindingNames = Arrays.asList("test");
    TupleQueryResult tqr = new IteratingTupleQueryResult(bindingNames, Arrays.asList(new ListBindingSet(bindingNames, SimpleValueFactory.getInstance().createLiteral("1", XMLSchema.STRING))));
    String result = writeTupleResult(tqr);
    assertEquals("?test\n\"1\"^^<http://www.w3.org/2001/XMLSchema#string>\n", result);
}
Also used : ListBindingSet(org.eclipse.rdf4j.query.impl.ListBindingSet) IteratingTupleQueryResult(org.eclipse.rdf4j.query.impl.IteratingTupleQueryResult) IteratingTupleQueryResult(org.eclipse.rdf4j.query.impl.IteratingTupleQueryResult) TupleQueryResult(org.eclipse.rdf4j.query.TupleQueryResult) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 2 with IteratingTupleQueryResult

use of org.eclipse.rdf4j.query.impl.IteratingTupleQueryResult in project rdf4j by eclipse.

the class SPARQLTSVCustomTest method testSES2126QuotedLiteralIntegerAsStringImplicitType.

/**
 * Only Literals with the XML Schema numeric types should be simplified.
 *
 * @throws Exception
 */
@Test
public void testSES2126QuotedLiteralIntegerAsStringImplicitType() throws Exception {
    List<String> bindingNames = Arrays.asList("test");
    TupleQueryResult tqr = new IteratingTupleQueryResult(bindingNames, Arrays.asList(new ListBindingSet(bindingNames, SimpleValueFactory.getInstance().createLiteral("1"))));
    String result = writeTupleResult(tqr);
    assertEquals("?test\n\"1\"\n", result);
}
Also used : ListBindingSet(org.eclipse.rdf4j.query.impl.ListBindingSet) IteratingTupleQueryResult(org.eclipse.rdf4j.query.impl.IteratingTupleQueryResult) IteratingTupleQueryResult(org.eclipse.rdf4j.query.impl.IteratingTupleQueryResult) TupleQueryResult(org.eclipse.rdf4j.query.TupleQueryResult) Test(org.junit.Test)

Aggregations

TupleQueryResult (org.eclipse.rdf4j.query.TupleQueryResult)2 IteratingTupleQueryResult (org.eclipse.rdf4j.query.impl.IteratingTupleQueryResult)2 ListBindingSet (org.eclipse.rdf4j.query.impl.ListBindingSet)2 Test (org.junit.Test)2 Ignore (org.junit.Ignore)1