use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class EdgeQueryFunctionalTest method testANDQuery.
@Test
public void testANDQuery() throws Exception {
QueryImpl q = configQuery("(SOURCE == 'EARTH') && (SINK == 'MOON')", auths);
EdgeQueryLogic logic = runLogic(q, auths);
List<String> expected = new ArrayList<>();
expected.add("earth%00;moon AdjacentCelestialBodies/FROM-TO:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("earth STATS/ACTIVITY/Planets/TO:20150713/COSMOS_DATA [B]");
compareResults(logic, expected);
}
use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class EdgeQueryFunctionalTest method testPatternWithTypeAndRelation.
@Test
public void testPatternWithTypeAndRelation() throws Exception {
QueryImpl q = configQuery("(SOURCE =~ 'M.*') && TYPE == 'AdjacentPlanets' && RELATION == 'TO-FROM' ", auths);
EdgeQueryLogic logic = runLogic(q, auths);
List<String> expected = new ArrayList<>();
expected.add("mars%00;earth AdjacentPlanets/TO-FROM:20150713/COSMOS_DATA-COSMOS_DATA [A]");
compareResults(logic, expected);
}
use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class EdgeQueryFunctionalTest method testSinglePatternQuery.
@Test
public void testSinglePatternQuery() throws Exception {
QueryImpl q = configQuery("(SOURCE =~ 'E.*')", auths);
EdgeQueryLogic logic = runLogic(q, auths);
List<String> expected = new ArrayList<>();
expected.add("earth%00;moon AdjacentCelestialBodies/FROM-TO:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("earth%00;venus AdjacentPlanets/TO-FROM:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("eris%00;dysnomia AdjacentCelestialBodies/FROM-TO:20150713/COSMOS_DATA-COSMOS_DATA [B]");
expected.add("earth%00;mars AdjacentPlanets/FROM-TO:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("earth STATS/ACTIVITY/Planets/TO:20150713/COSMOS_DATA [B]");
expected.add("eris STATS/ACTIVITY/DwarfPlanets/TO:20150713/COSMOS_DATA [D]");
compareResults(logic, expected);
}
use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class EdgeQueryFunctionalTest method testRegExQueryStatsOff.
@Test
public void testRegExQueryStatsOff() throws Exception {
QueryImpl q = configQuery("(SOURCE =~ 'M.*')", auths);
q.addParameter("stats", "false");
EdgeQueryLogic logic = runLogic(q, auths);
List<String> expected = new ArrayList<>();
expected.add("mars%00;jupiter AdjacentPlanets/FROM-TO:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("mars%00;earth AdjacentPlanets/TO-FROM:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("mars%00;asteroid_belt AdjacentCelestialBodies/TO-FROM:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("mercury%00;sun AdjacentCelestialBodies/TO-FROM:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("moon%00;earth AdjacentCelestialBodies/TO-FROM:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("mercury%00;venus AdjacentPlanets/FROM-TO:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("mars%00;ceres AdjacentCelestialBodies/FROM-TO:20150713/COSMOS_DATA-COSMOS_DATA [B]");
expected.add("mars%00;ceres AdjacentDwarfPlanets/TO-FROM:20150713/COSMOS_DATA-COSMOS_DATA [B]");
compareResults(logic, expected);
}
use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class EdgeQueryFunctionalTest method testANDQueryWithPatterns.
@Test
public void testANDQueryWithPatterns() throws Exception {
QueryImpl q = configQuery("(SOURCE =~ 'E.*') && (SINK =~ '.*S' )", auths);
EdgeQueryLogic logic = runLogic(q, auths);
List<String> expected = new ArrayList<>();
expected.add("earth%00;mars AdjacentPlanets/FROM-TO:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("earth%00;venus AdjacentPlanets/TO-FROM:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("earth STATS/ACTIVITY/Planets/TO:20150713/COSMOS_DATA [B]");
expected.add("eris STATS/ACTIVITY/DwarfPlanets/TO:20150713/COSMOS_DATA [D]");
compareResults(logic, expected);
}
Aggregations