use of org.apache.rya.indexing.geotemporal.model.EventQueryNode in project incubator-rya by apache.
the class GeoTemporalProviderTest method twoSubjectMultiFilter_test.
@Test
public void twoSubjectMultiFilter_test() throws Exception {
final ValueFactory vf = new ValueFactoryImpl();
final Value geo = vf.createLiteral("Point(0 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
final Value temp = vf.createLiteral(new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0).toString());
final URI tempPred = vf.createURI(URI_PROPERTY_AT_TIME);
final String query = "PREFIX geo: <http://www.opengis.net/ont/geosparql#>" + "PREFIX geos: <http://www.opengis.net/def/function/geosparql/>" + "PREFIX time: <tag:rya-rdf.org,2015:temporal#>" + "SELECT * WHERE { " + "?subj <" + tempPred + "> ?time ." + "?subj <" + GeoConstants.GEO_AS_WKT + "> ?loc . " + " FILTER(geos:sfContains(?loc, " + geo + ")) . " + " FILTER(time:equals(?time, " + temp + ")) . " + " FILTER(geos:sfWithin(?loc, " + geo + ")) . " + " FILTER(time:before(?time, " + temp + ")) . " + "}";
final QuerySegment<EventQueryNode> node = getQueryNode(query);
final List<EventQueryNode> nodes = provider.getExternalSets(node);
assertEquals(1, nodes.size());
}
use of org.apache.rya.indexing.geotemporal.model.EventQueryNode in project incubator-rya by apache.
the class GeoTemporalProviderTest method twoPatternsNoFilter_test.
@Test
public void twoPatternsNoFilter_test() throws Exception {
final ValueFactory vf = new ValueFactoryImpl();
final URI tempPred = vf.createURI(URI_PROPERTY_AT_TIME);
final String query = "PREFIX geo: <http://www.opengis.net/ont/geosparql#>" + "PREFIX geos: <http://www.opengis.net/def/function/geosparql/>" + "PREFIX time: <tag:rya-rdf.org,2015:temporal#>" + "SELECT * WHERE { " + "?subj <" + tempPred + "> ?time ." + "?subj <" + GeoConstants.GEO_AS_WKT + "> ?loc . " + "}";
final QuerySegment<EventQueryNode> node = getQueryNode(query);
final List<EventQueryNode> nodes = provider.getExternalSets(node);
assertEquals(0, nodes.size());
}
use of org.apache.rya.indexing.geotemporal.model.EventQueryNode in project incubator-rya by apache.
the class GeoTemporalProviderTest method onePatternTwoFilters_test.
@Test
public void onePatternTwoFilters_test() throws Exception {
final ValueFactory vf = new ValueFactoryImpl();
final Value geo = vf.createLiteral("Point(0 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
final Value temp = vf.createLiteral(new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0).toString());
final URI tempPred = vf.createURI(URI_PROPERTY_AT_TIME);
final String query = "PREFIX geo: <http://www.opengis.net/ont/geosparql#>" + "PREFIX geos: <http://www.opengis.net/def/function/geosparql/>" + "PREFIX time: <tag:rya-rdf.org,2015:temporal#>" + "SELECT * WHERE { " + "?subj <" + tempPred + "> ?time ." + " FILTER(geos:sfContains(?loc, " + geo + ")) . " + " FILTER(time:equals(?time, " + temp + ")) . " + "}";
final QuerySegment<EventQueryNode> node = getQueryNode(query);
final List<EventQueryNode> nodes = provider.getExternalSets(node);
assertEquals(0, nodes.size());
}
Aggregations