use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class EdgeQueryFunctionalTest method testComplexQuery2.
@Test
public void testComplexQuery2() throws Exception {
QueryImpl q = configQuery("(SOURCE == 'EARTH' || SOURCE == 'SUN' || SOURCE == 'ASTEROID_BELT') &&" + " (SINK == 'MARS' || SINK == 'MOON' || SINK == 'JUPITER')", 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;mars AdjacentPlanets/FROM-TO:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("asteroid_belt%00;mars AdjacentCelestialBodies/FROM-TO:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("asteroid_belt%00;jupiter AdjacentCelestialBodies/FROM-TO:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("earth STATS/ACTIVITY/Planets/TO:20150713/COSMOS_DATA [B]");
expected.add("sun STATS/ACTIVITY/Stars/TO:20150713/COSMOS_DATA [A]");
compareResults(logic, expected);
}
use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class EdgeQueryFunctionalTest method testORQueryWithPattern.
@Test
public void testORQueryWithPattern() throws Exception {
QueryImpl q = configQuery("(SOURCE =~ 'E.*' || SOURCE == 'PLUTO')", 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%00;moon AdjacentCelestialBodies/FROM-TO:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("pluto%00;charon AdjacentCelestialBodies/FROM-TO:20150713/NEW_HORIZONS-NEW_HORIZONS [C]");
expected.add("pluto STATS/ACTIVITY/DwarfPlanets/TO:20150713/NEW_HORIZONS [D]");
expected.add("pluto%00;neptune AdjacentDwarfPlanets/FROM-TO:20150713/NEW_HORIZONS-NEW_HORIZONS [C]");
expected.add("pluto%00;neptune AdjacentPlanets/TO-FROM:20150713/NEW_HORIZONS-NEW_HORIZONS [C]");
expected.add("earth STATS/ACTIVITY/Planets/TO:20150713/COSMOS_DATA [B]");
expected.add("eris STATS/ACTIVITY/DwarfPlanets/TO:20150713/COSMOS_DATA [D]");
expected.add("eris%00;dysnomia AdjacentCelestialBodies/FROM-TO:20150713/COSMOS_DATA-COSMOS_DATA [B]");
compareResults(logic, expected);
}
use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class EdgeQueryFunctionalTest method testPatternWithNot.
@Test
public void testPatternWithNot() throws Exception {
QueryImpl q = configQuery("SOURCE =~ 'M.*' && SINK != 'CERES'", auths);
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 STATS/ACTIVITY/Planets/TO:20150713/COSMOS_DATA [B]");
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("mercury STATS/ACTIVITY/Planets/TO:20150713/COSMOS_DATA [B]");
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]");
compareResults(logic, expected);
}
use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class EdgeQueryFunctionalTest method testSingleQuery.
@Test
public void testSingleQuery() throws Exception {
QueryImpl q = configQuery("(SOURCE == 'PLUTO')", auths);
EdgeQueryLogic logic = runLogic(q, auths);
List<String> expected = new ArrayList<>();
expected.add("pluto%00;charon AdjacentCelestialBodies/FROM-TO:20150713/NEW_HORIZONS-NEW_HORIZONS [C]");
expected.add("pluto%00;neptune AdjacentDwarfPlanets/FROM-TO:20150713/NEW_HORIZONS-NEW_HORIZONS [C]");
expected.add("pluto%00;neptune AdjacentPlanets/TO-FROM:20150713/NEW_HORIZONS-NEW_HORIZONS [C]");
expected.add("pluto STATS/ACTIVITY/DwarfPlanets/TO:20150713/NEW_HORIZONS [D]");
compareResults(logic, expected);
}
use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class EdgeQueryFunctionalTest method testSourceAndSinkPatterns.
@Test
public void testSourceAndSinkPatterns() throws Exception {
QueryImpl q = configQuery("(SOURCE =~ 'E.*' || SOURCE =~ 'P.*') && (SINK =~ 'M.*' || SINK =~ 'C.*')", 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;moon AdjacentCelestialBodies/FROM-TO:20150713/COSMOS_DATA-COSMOS_DATA [A]");
expected.add("pluto%00;charon AdjacentCelestialBodies/FROM-TO:20150713/NEW_HORIZONS-NEW_HORIZONS [C]");
expected.add("earth STATS/ACTIVITY/Planets/TO:20150713/COSMOS_DATA [B]");
expected.add("pluto STATS/ACTIVITY/DwarfPlanets/TO:20150713/NEW_HORIZONS [D]");
expected.add("eris STATS/ACTIVITY/DwarfPlanets/TO:20150713/COSMOS_DATA [D]");
compareResults(logic, expected);
}
Aggregations