use of de.ids_mannheim.korap.KrillCollection in project Krill by KorAP.
the class TestKrillCollectionJSON method nocollectiontypegiven.
@Test
public void nocollectiontypegiven() {
String metaQuery = _getJSONString("multiterm_rewrite_collection.jsonld");
KrillCollection kc = new KrillCollection(metaQuery);
assertEquals(701, kc.getError(0).getCode());
}
use of de.ids_mannheim.korap.KrillCollection in project Krill by KorAP.
the class TestKrillCollectionJSON method collection2.
@Test
public void collection2() {
String metaQuery = _getJSONString("collection_2.jsonld");
KrillCollection kc = new KrillCollection(metaQuery);
assertEquals(kc.toString(), "AndGroup(pubDate:[19900000 TO 99999999] pubDate:[0 TO 20061099])");
}
use of de.ids_mannheim.korap.KrillCollection in project Krill by KorAP.
the class TestKrillCollectionJSON method metaQuery2Legacy.
@Test
public void metaQuery2Legacy() {
String metaQuery = getJsonString(getClass().getResource("/queries/metaquery2.jsonld").getFile());
KrillCollection kc = new KrillCollection(metaQuery);
/*
assertEquals(1, kc.getCount());
assertEquals(
"filter with QueryWrapperFilter(+(+author:Hesse +pubDate:[0 TO 20131205]))",
kc.getFilter(0).toString());
*/
assertEquals("AndGroup(author:Hesse pubDate:[0 TO 20131205])", kc.toString());
}
use of de.ids_mannheim.korap.KrillCollection in project Krill by KorAP.
the class TestKrillCollectionJSON method collection5.
@Test
public void collection5() {
String metaQuery = _getJSONString("collection_5.jsonld");
KrillCollection kc = new KrillCollection(metaQuery);
assertEquals(kc.toString(), "OrGroup(pubDate:[19900000 TO 99999999] title:Mannheim)");
}
use of de.ids_mannheim.korap.KrillCollection in project Krill by KorAP.
the class TestKrillCollectionJSON method metaQuery1Legacy.
// Legacy collections reflect old tests, that were adopted to the new scheme
@Test
public void metaQuery1Legacy() {
String metaQuery = getJsonString(getClass().getResource("/queries/metaquery.jsonld").getFile());
KrillCollection kc = new KrillCollection(metaQuery);
/*
assertEquals("filter with QueryWrapperFilter(+textClass:wissenschaft)",
kc.getFilter(0).toString());
assertEquals(
"filter with QueryWrapperFilter(+(+pubPlace:Erfurt +author:Hesse))",
kc.getFilter(1).toString());
assertEquals(
"extend with QueryWrapperFilter(+(+pubDate:[20110429 TO 20131231] +textClass:freizeit))",
kc.getFilter(2).toString());
assertEquals(3, kc.getCount());
*/
// This will and should fail on optimization
assertEquals("OrGroup(AndGroup(textClass:wissenschaft AndGroup(pubPlace:Erfurt author:Hesse)) AndGroup(AndGroup(pubDate:[20110429 TO 99999999] pubDate:[0 TO 20131231]) textClass:freizeit))", kc.toString());
}
Aggregations