use of org.openrdf.model.impl.StatementImpl in project incubator-rya by apache.
the class GeoIndexerSfTest method genericStatementWkt.
private static Statement genericStatementWkt(final Geometry geo) {
final ValueFactory vf = new ValueFactoryImpl();
final Resource subject = vf.createURI("uri:" + NAMES.get(geo));
final URI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral(geo.toString(), GeoConstants.XMLSCHEMA_OGC_WKT);
return new StatementImpl(subject, predicate, object);
}
use of org.openrdf.model.impl.StatementImpl in project incubator-rya by apache.
the class MongoGeoTemporalIndexerIT method statement.
private static RyaStatement statement(final TemporalInstant instant) {
final ValueFactory vf = new ValueFactoryImpl();
final Resource subject = vf.createURI("uri:test");
final URI predicate = vf.createURI("Property:atTime");
final Value object = vf.createLiteral(instant.toString());
return RdfToRyaConversions.convertStatement(new StatementImpl(subject, predicate, object));
}
use of org.openrdf.model.impl.StatementImpl in project incubator-rya by apache.
the class MongoIndexerDeleteIT method statement.
private static RyaStatement statement(final Geometry geo) {
final ValueFactory vf = new ValueFactoryImpl();
final Resource subject = vf.createURI("urn:geo");
final URI predicate = GeoConstants.GEO_AS_WKT;
final WKTWriter w = new WKTWriter();
final Value object = vf.createLiteral(w.write(geo), GeoConstants.XMLSCHEMA_OGC_WKT);
return RdfToRyaConversions.convertStatement(new StatementImpl(subject, predicate, object));
}
use of org.openrdf.model.impl.StatementImpl in project incubator-rya by apache.
the class StatementSerializerTest method testSimpleStatementObjectUri.
@Test
public void testSimpleStatementObjectUri() throws Exception {
ValueFactory vf = new ValueFactoryImpl();
Statement s;
s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createURI("foo:object"));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
s = new ContextStatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createURI("foo:object"), vf.createURI("foo:context"));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
}
use of org.openrdf.model.impl.StatementImpl in project incubator-rya by apache.
the class StatementSerializerTest method testObjectLiteralWithDataTypeGarbage.
@Test
public void testObjectLiteralWithDataTypeGarbage() throws Exception {
// test with some garbage in the literal that may throw off the parser
ValueFactory vf = new ValueFactoryImpl();
Statement s;
String str;
str = "Alice ^^<Palace>\"";
s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createLiteral(str));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createLiteral(str, "en"));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createLiteral(str, vf.createURI("xsd:string")));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
}
Aggregations