use of org.openrdf.model.impl.LiteralImpl in project wikidata-query-rdf by wikimedia.
the class WikibaseDateUnitTest method dateMinusPeriod.
@Test
public void dateMinusPeriod() throws QueryEvaluationException {
TupleQueryResult results = query("SELECT ?now WHERE { BIND( ( \"2016-01-01T00:00:00\"^^xsd:dateTime - \"P7D\"^^xsd:duration ) AS ?now ) . }");
BindingSet result = results.next();
assertThat(result, binds("now", new LiteralImpl("2015-12-25T00:00:00Z", XMLSchema.DATETIME)));
}
use of org.openrdf.model.impl.LiteralImpl in project wikidata-query-rdf by wikimedia.
the class WikibaseDateUnitTest method dateExtension.
@Test
public void dateExtension() {
BigdataStatement statement = roundTrip(Ontology.Time.VALUE, Ontology.Time.VALUE, new LiteralImpl("-0101-01-01T00:00:00", XMLSchema.DATE));
assertThat(statement.getObject().getIV(), instanceOf(LiteralExtensionIV.class));
}
use of org.openrdf.model.impl.LiteralImpl in project wikidata-query-rdf by wikimedia.
the class WikibaseDateUnitTest method dateFunctionQueryYear.
@Test
public void dateFunctionQueryYear() throws QueryEvaluationException {
TupleQueryResult results = query("SELECT * WHERE {BIND ( year(\"-13798000000-01-01T00:00:00\"^^xsd:dateTime) AS ?date)}");
BindingSet result = results.next();
assertThat(result, binds("date", new LiteralImpl("-13798000000", XMLSchema.INTEGER)));
}
use of org.openrdf.model.impl.LiteralImpl in project wikidata-query-rdf by wikimedia.
the class WikibaseDateUnitTest method dateCompare.
// TODO: @Test - does not work yet
public void dateCompare() throws QueryEvaluationException {
TupleQueryResult results = query("SELECT ((\"1990-01-01\"^^xsd:date < now()) as ?answer) WHERE { }");
BindingSet result = results.next();
assertThat(result, binds("answer", new LiteralImpl("true", XMLSchema.BOOLEAN)));
}
use of org.openrdf.model.impl.LiteralImpl in project wikidata-query-rdf by wikimedia.
the class RdfRepositoryIntegrationTest method senseWithStatement.
private void senseWithStatement(List<Statement> statements, String formId, String repr, String statementUri, String propertyId, String value) {
statement(statements, formId, SKOS.DEFINITION, new LiteralImpl(repr));
statements.addAll(expandedStatement(statementUri, formId, propertyId, new LiteralImpl(value), Ontology.NORMAL_RANK));
}
Aggregations