diff --git a/src/test/java/PoliqarpPlusTreeJSONTest.java b/src/test/java/PoliqarpPlusTreeJSONTest.java
deleted file mode 100644
index 9c84feb..0000000
--- a/src/test/java/PoliqarpPlusTreeJSONTest.java
+++ /dev/null
@@ -1,1528 +0,0 @@
-import static org.junit.Assert.*;
-
-import java.io.IOException;
-import java.util.ArrayList;
-
-import org.junit.Test;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.collect.Lists;
-
-
-import de.ids_mannheim.korap.query.serialize.QuerySerializer;
-import de.ids_mannheim.korap.util.QueryException;
-
-public class PoliqarpPlusTreeJSONTest {
-	
-	String map;
-	String expected;
-	String metaExpected;
-	String metaMap;
-	String query;
-	ArrayList<JsonNode> operands;
-	
-	QuerySerializer qs = new QuerySerializer();
-	ObjectMapper mapper = new ObjectMapper();
-	JsonNode res;
-	
-	@Test
-	public void testContext() throws QueryException, JsonProcessingException, IOException {
-		query = "foo";
-		String contextString = "http://ids-mannheim.de/ns/KorAP/json-ld/v0.2/context.jsonld";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals(contextString, res.get("@context").asText());
-	}
-	
-	
-	
-	@Test
-	public void testSingleTokens() throws QueryException, JsonProcessingException, IOException {
-		query = "[base=Mann]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:token", 		res.at("/query/@type").asText());
-		assertEquals("Mann", 				res.at("/query/wrap/key").asText());
-		assertEquals("lemma", 				res.at("/query/wrap/layer").asText());
-		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
-		
-		query = "[orth!=Frau]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:token", 		res.at("/query/@type").asText());
-		assertEquals("Frau", 				res.at("/query/wrap/key").asText());
-		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
-		assertEquals("match:ne",			res.at("/query/wrap/match").asText());
-		
-		query = "[p!=NN]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:token", 		res.at("/query/@type").asText());
-		assertEquals("NN", 					res.at("/query/wrap/key").asText());
-		assertEquals("p", 					res.at("/query/wrap/layer").asText());
-		assertEquals("match:ne",			res.at("/query/wrap/match").asText());
-		
-		query = "[!p!=NN]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:token", 		res.at("/query/@type").asText());
-		assertEquals("NN", 					res.at("/query/wrap/key").asText());
-		assertEquals("p", 					res.at("/query/wrap/layer").asText());
-		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
-		
-		query = "[base=schland/x]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:token", 		res.at("/query/@type").asText());
-		assertEquals(".*?schland.*?",		res.at("/query/wrap/key").asText());
-		assertEquals("lemma", 				res.at("/query/wrap/layer").asText());
-		assertEquals("type:regex",			res.at("/query/wrap/type").asText());
-		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
-	}
-	
-	@Test
-	public void testValue() throws QueryException, JsonProcessingException, IOException {
-		query = "[mate/m=temp:pres]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:token", 		res.at("/query/@type").asText());
-		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
-		assertEquals("temp",				res.at("/query/wrap/key").asText());
-		assertEquals("pres",				res.at("/query/wrap/value").asText());
-		assertEquals("m",	 				res.at("/query/wrap/layer").asText());
-		assertEquals("mate", 				res.at("/query/wrap/foundry").asText());
-		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
-	}
-	
-	@Test
-	public void testRegex() throws QueryException, JsonProcessingException, IOException {
-		query = "[orth=\"M(a|ä)nn(er)?\"]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:token", 		res.at("/query/@type").asText());
-		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
-		assertEquals("M(a|ä)nn(er)?",		res.at("/query/wrap/key").asText());
-		assertEquals("type:regex",			res.at("/query/wrap/type").asText());
-		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
-		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
-
-		query = "[orth=\"M(a|ä)nn(er)?\"/x]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:token", 		res.at("/query/@type").asText());
-		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
-		assertEquals(".*?M(a|ä)nn(er)?.*?",	res.at("/query/wrap/key").asText());
-		assertEquals("type:regex",			res.at("/query/wrap/type").asText());
-		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
-		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
-		
-		query = "\".*?Mann.*?\"";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:token", 		res.at("/query/@type").asText());
-		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
-		assertEquals(".*?Mann.*?",			res.at("/query/wrap/key").asText());
-		assertEquals("type:regex",			res.at("/query/wrap/type").asText());
-		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
-		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
-		
-		query = "z.B./x";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:token", 		res.at("/query/@type").asText());
-		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
-		assertEquals(".*?z\\.B\\..*?",		res.at("/query/wrap/key").asText());
-		assertEquals("type:regex",			res.at("/query/wrap/type").asText());
-		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
-		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
-	
-	}
-	
-	@Test
-	public void testCaseSensitivityFlag() throws QueryException, JsonProcessingException, IOException {
-		query = "[orth=deutscher/i]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:token", 		res.at("/query/@type").asText());
-		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
-		assertEquals("deutscher",			res.at("/query/wrap/key").asText());
-		assertEquals("true",				res.at("/query/wrap/caseInsensitive").asText());
-		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
-		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
-
-		query = "deutscher/i";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:token", 		res.at("/query/@type").asText());
-		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
-		assertEquals("deutscher",			res.at("/query/wrap/key").asText());
-		assertEquals("true",				res.at("/query/wrap/caseInsensitive").asText());
-		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
-		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
-		
-		query = "deutscher/I";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:token", 		res.at("/query/@type").asText());
-		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
-		assertEquals("deutscher",			res.at("/query/wrap/key").asText());
-		assertEquals("false",				res.at("/query/wrap/caseInsensitive").asText());
-		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
-		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
-		
-		query = "[orth=deutscher/i][orth=Bundestag]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:group", 		res.at("/query/@type").asText());
-		assertEquals("operation:sequence",	res.at("/query/operation").asText());
-		operands = Lists.newArrayList(res.at("/query/operands").elements());
-		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
-		assertEquals("deutscher",			operands.get(0).at("/wrap/key").asText());
-		assertEquals("orth",				operands.get(0).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
-		assertEquals(true,					operands.get(0).at("/wrap/caseInsensitive").asBoolean());
-		assertEquals("korap:token",			operands.get(1).at("/@type").asText());
-		assertEquals("Bundestag",			operands.get(1).at("/wrap/key").asText());
-		assertEquals("orth",				operands.get(1).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(1).at("/wrap/match").asText());
-		assertEquals(true,					operands.get(1).at("/wrap/caseInsensitive").isMissingNode());
-		
-		query = "deutscher/i Bundestag";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:group", 		res.at("/query/@type").asText());
-		assertEquals("operation:sequence",	res.at("/query/operation").asText());
-		operands = Lists.newArrayList(res.at("/query/operands").elements());
-		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
-		assertEquals("deutscher",			operands.get(0).at("/wrap/key").asText());
-		assertEquals("orth",				operands.get(0).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
-		assertEquals(true,					operands.get(0).at("/wrap/caseInsensitive").asBoolean());
-		assertEquals("korap:token",			operands.get(1).at("/@type").asText());
-		assertEquals("Bundestag",			operands.get(1).at("/wrap/key").asText());
-		assertEquals("orth",				operands.get(1).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(1).at("/wrap/match").asText());
-		assertEquals(true,					operands.get(1).at("/wrap/caseInsensitive").isMissingNode());
-	}
-	
-	@Test
-	public void testSpans() throws QueryException, JsonProcessingException, IOException {
-		query = "<s>";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:span", 			res.at("/query/@type").asText());
-		assertEquals("s",					res.at("/query/key").asText());
-		
-		query = "<vp>";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:span", 			res.at("/query/@type").asText());
-		assertEquals("vp",					res.at("/query/key").asText());
-		
-		query = "<cnx/c=vp>";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:span", 			res.at("/query/@type").asText());
-		assertEquals("vp",					res.at("/query/key").asText());
-		assertEquals("cnx",					res.at("/query/foundry").asText());
-		assertEquals("c",					res.at("/query/layer").asText());
-		
-		query = "<cnx/c!=vp>";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:span", 			res.at("/query/@type").asText());
-		assertEquals("vp",					res.at("/query/key").asText());
-		assertEquals("cnx",					res.at("/query/foundry").asText());
-		assertEquals("c",					res.at("/query/layer").asText());
-		assertEquals("match:ne",			res.at("/query/match").asText());
-		
-		query = "<cnx/c!=vp class!=header>";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:span", 			res.at("/query/@type").asText());
-		assertEquals("vp",					res.at("/query/key").asText());
-		assertEquals("cnx",					res.at("/query/foundry").asText());
-		assertEquals("c",					res.at("/query/layer").asText());
-		assertEquals("match:ne",			res.at("/query/match").asText());
-		assertEquals("class",				res.at("/query/attr/key").asText());
-		assertEquals("header",				res.at("/query/attr/value").asText());
-		assertEquals("match:ne",			res.at("/query/attr/match").asText());
-		
-		query = "<cnx/c!=vp !(class!=header)>";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:span", 			res.at("/query/@type").asText());
-		assertEquals("vp",					res.at("/query/key").asText());
-		assertEquals("cnx",					res.at("/query/foundry").asText());
-		assertEquals("c",					res.at("/query/layer").asText());
-		assertEquals("match:ne",			res.at("/query/match").asText());
-		assertEquals("class",				res.at("/query/attr/key").asText());
-		assertEquals("header",				res.at("/query/attr/value").asText());
-		assertEquals("match:eq",			res.at("/query/attr/match").asText());
-		
-		query = "<cnx/c!=vp !(class=header & id=7)>";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:span", 			res.at("/query/@type").asText());
-		assertEquals("vp",					res.at("/query/key").asText());
-		assertEquals("cnx",					res.at("/query/foundry").asText());
-		assertEquals("c",					res.at("/query/layer").asText());
-		assertEquals("match:ne",			res.at("/query/match").asText());
-		assertEquals("korap:termGroup",		res.at("/query/attr/@type").asText());
-		assertEquals("relation:and",		res.at("/query/attr/relation").asText());
-		operands = Lists.newArrayList( res.at("/query/attr/operands").elements());
-		assertEquals("korap:term",			operands.get(0).at("/@type").asText());
-		assertEquals("class",				operands.get(0).at("/key").asText());
-		assertEquals("header",				operands.get(0).at("/value").asText());
-		assertEquals("match:ne",			operands.get(0).at("/match").asText());
-		assertEquals("korap:term",			operands.get(1).at("/@type").asText());
-		assertEquals("id",					operands.get(1).at("/key").asText());
-		assertEquals(7,						operands.get(1).at("/value").asInt());
-		assertEquals("match:ne",			operands.get(1).at("/match").asText());
-	}
-	
-	@Test
-	public void testDistances() throws QueryException, JsonProcessingException, IOException {
-		query = "[base=der][][base=Mann]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:group", 		res.at("/query/@type").asText());
-		assertEquals("operation:sequence",	res.at("/query/operation").asText());
-		assertEquals("true",				res.at("/query/inOrder").asText());
-		assertEquals("korap:distance",		res.at("/query/distances").elements().next().at("/@type").asText());
-		assertEquals("w",					res.at("/query/distances").elements().next().at("/key").asText());
-		assertEquals("korap:boundary",		res.at("/query/distances").elements().next().at("/boundary/@type").asText());
-		assertEquals(2,						res.at("/query/distances").elements().next().at("/boundary/min").asInt());
-		assertEquals(2,						res.at("/query/distances").elements().next().at("/boundary/max").asInt());
-		operands = Lists.newArrayList(res.at("/query/operands").elements());
-		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
-		assertEquals("der",					operands.get(0).at("/wrap/key").asText());
-		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
-		assertEquals("korap:token",			operands.get(1).at("/@type").asText());
-		assertEquals("Mann",				operands.get(1).at("/wrap/key").asText());
-		assertEquals("lemma",				operands.get(1).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(1).at("/wrap/match").asText());
-		
-		query = "[base=der][][][base=Mann]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:group", 		res.at("/query/@type").asText());
-		assertEquals("operation:sequence",	res.at("/query/operation").asText());
-		assertEquals("true",				res.at("/query/inOrder").asText());
-		assertEquals("korap:distance",		res.at("/query/distances").elements().next().at("/@type").asText());
-		assertEquals("w",					res.at("/query/distances").elements().next().at("/key").asText());
-		assertEquals("korap:boundary",		res.at("/query/distances").elements().next().at("/boundary/@type").asText());
-		assertEquals(3,						res.at("/query/distances").elements().next().at("/boundary/min").asInt());
-		assertEquals(3,						res.at("/query/distances").elements().next().at("/boundary/max").asInt());
-		operands = Lists.newArrayList(res.at("/query/operands").elements());
-		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
-		assertEquals("der",					operands.get(0).at("/wrap/key").asText());
-		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
-		assertEquals("korap:token",			operands.get(1).at("/@type").asText());
-		assertEquals("Mann",				operands.get(1).at("/wrap/key").asText());
-		assertEquals("lemma",				operands.get(1).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(1).at("/wrap/match").asText());
-		
-		query = "[base=der][][]?[base=Mann]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:group", 		res.at("/query/@type").asText());
-		assertEquals("operation:sequence",	res.at("/query/operation").asText());
-		assertEquals("true",				res.at("/query/inOrder").asText());
-		assertEquals("korap:distance",		res.at("/query/distances").elements().next().at("/@type").asText());
-		assertEquals("w",					res.at("/query/distances").elements().next().at("/key").asText());
-		assertEquals("korap:boundary",		res.at("/query/distances").elements().next().at("/boundary/@type").asText());
-		assertEquals(2,						res.at("/query/distances").elements().next().at("/boundary/min").asInt());
-		assertEquals(3,						res.at("/query/distances").elements().next().at("/boundary/max").asInt());
-		operands = Lists.newArrayList(res.at("/query/operands").elements());
-		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
-		assertEquals("der",					operands.get(0).at("/wrap/key").asText());
-		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
-		assertEquals("korap:token",			operands.get(1).at("/@type").asText());
-		assertEquals("Mann",				operands.get(1).at("/wrap/key").asText());
-		assertEquals("lemma",				operands.get(1).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(1).at("/wrap/match").asText());
-		
-		query = "[base=der][]+[base=Mann]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:group", 		res.at("/query/@type").asText());
-		assertEquals("operation:sequence",	res.at("/query/operation").asText());
-		assertEquals("true",				res.at("/query/inOrder").asText());
-		assertEquals("korap:distance",		res.at("/query/distances").elements().next().at("/@type").asText());
-		assertEquals("w",					res.at("/query/distances").elements().next().at("/key").asText());
-		assertEquals("korap:boundary",		res.at("/query/distances").elements().next().at("/boundary/@type").asText());
-		assertEquals(2,						res.at("/query/distances").elements().next().at("/boundary/min").asInt());
-		assertEquals(true,					res.at("/query/distances").elements().next().at("/boundary/max").isMissingNode());
-		operands = Lists.newArrayList(res.at("/query/operands").elements());
-		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
-		assertEquals("der",					operands.get(0).at("/wrap/key").asText());
-		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
-		assertEquals("korap:token",			operands.get(1).at("/@type").asText());
-		assertEquals("Mann",				operands.get(1).at("/wrap/key").asText());
-		assertEquals("lemma",				operands.get(1).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(1).at("/wrap/match").asText());
-		
-		query = "[base=der][]*[base=Mann]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:group", 		res.at("/query/@type").asText());
-		assertEquals("operation:sequence",	res.at("/query/operation").asText());
-		assertEquals("true",				res.at("/query/inOrder").asText());
-		assertEquals("korap:distance",		res.at("/query/distances").elements().next().at("/@type").asText());
-		assertEquals("w",					res.at("/query/distances").elements().next().at("/key").asText());
-		assertEquals("korap:boundary",		res.at("/query/distances").elements().next().at("/boundary/@type").asText());
-		assertEquals(1,						res.at("/query/distances").elements().next().at("/boundary/min").asInt());
-		assertEquals(true,					res.at("/query/distances").elements().next().at("/boundary/max").isMissingNode());
-		
-		query = "[base=der][]{2,5}[base=Mann][]?[][base=Frau]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:group", 		res.at("/query/@type").asText());
-		assertEquals("operation:sequence",	res.at("/query/operation").asText());
-		assertEquals("true",				res.at("/query/inOrder").asText());
-		assertEquals("korap:distance",		res.at("/query/distances").elements().next().at("/@type").asText());
-		assertEquals("w",					res.at("/query/distances").elements().next().at("/key").asText());
-		assertEquals("korap:boundary",		res.at("/query/distances").elements().next().at("/boundary/@type").asText());
-		assertEquals(3,						res.at("/query/distances").elements().next().at("/boundary/min").asInt());
-		assertEquals(6,						res.at("/query/distances").elements().next().at("/boundary/max").asInt());
-		operands = Lists.newArrayList(res.at("/query/operands").elements());
-		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
-		assertEquals("der",					operands.get(0).at("/wrap/key").asText());
-		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
-		assertEquals("korap:group",			operands.get(1).at("/@type").asText());
-		assertEquals("operation:sequence",	operands.get(1).at("/operation").asText());
-		assertEquals("korap:distance",		operands.get(1).get("distances").elements().next().at("/@type").asText());
-		assertEquals("w",					operands.get(1).get("distances").elements().next().at("/key").asText());
-		assertEquals("korap:boundary",		operands.get(1).get("distances").elements().next().at("/boundary/@type").asText());
-		assertEquals(2,						operands.get(1).get("distances").elements().next().at("/boundary/min").asInt());
-		assertEquals(3,						operands.get(1).get("distances").elements().next().at("/boundary/max").asInt());
-		operands = Lists.newArrayList(operands.get(1).get("operands").elements());
-		assertEquals("Mann",				operands.get(0).at("/wrap/key").asText());
-		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
-		assertEquals("Frau",				operands.get(1).at("/wrap/key").asText());
-		assertEquals("lemma",				operands.get(1).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(1).at("/wrap/match").asText());
-		
-		query = "[base=geht][base=der][]*contains(<s>,<np>)";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:group", 		res.at("/query/@type").asText());
-		assertEquals("operation:sequence",	res.at("/query/operation").asText());
-		assertEquals(true,					res.at("/query/inOrder").isMissingNode());
-		assertEquals(true,					res.at("/query/distances").isMissingNode());
-		operands = Lists.newArrayList(res.at("/query/operands").elements());
-		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
-		assertEquals("geht",					operands.get(0).at("/wrap/key").asText());
-		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
-		assertEquals("korap:group",			operands.get(1).at("/@type").asText());
-		assertEquals("operation:sequence",	operands.get(1).at("/operation").asText());
-		assertEquals("korap:distance",		operands.get(1).get("distances").elements().next().at("/@type").asText());
-		assertEquals("w",					operands.get(1).get("distances").elements().next().at("/key").asText());
-		assertEquals("korap:boundary",		operands.get(1).get("distances").elements().next().at("/boundary/@type").asText());
-		assertEquals(1,						operands.get(1).get("distances").elements().next().at("/boundary/min").asInt());
-		assertEquals(true,					operands.get(1).get("distances").elements().next().at("/boundary/max").isMissingNode());
-		operands = Lists.newArrayList(operands.get(1).get("operands").elements());
-		assertEquals("der",				operands.get(0).at("/wrap/key").asText());
-		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
-		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
-		assertEquals("korap:group",			operands.get(1).at("/@type").asText());
-		assertEquals("operation:position",	operands.get(1).at("/operation").asText());
-	}
-
-	@Test
-	public void testDistancesWithClass() throws QueryException, JsonProcessingException, IOException {
-		query = "[base=der]{[]}[base=Mann]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		assertEquals("korap:group", 		res.at("/query/@type").asText());
-		assertEquals("operation:sequence",	res.at("/query/operation").asText());
-		assertEquals(true,					res.at("/query/inOrder").isMissingNode());
-		assertEquals(true,					res.at("/query/distances").isMissingNode());
-		operands = Lists.newArrayList(res.at("/query/operands").elements());
-		assertEquals("der",					operands.get(0).at("/wrap/key").asText());
-		assertEquals("Mann",				operands.get(2).at("/wrap/key").asText());
-		assertEquals("korap:group",			operands.get(1).at("/@type").asText());
-		assertEquals("operation:class",		operands.get(1).at("/operation").asText());
-		assertEquals(1,						operands.get(1).at("/classOut").asInt());
-		operands = Lists.newArrayList(operands.get(1).at("/operands").elements());
-		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
-		assertEquals(true,					operands.get(0).at("/wrap").isMissingNode());
-		
-		query = "[base=der]{2:[]}[base=Mann]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		operands = Lists.newArrayList(res.at("/query/operands").elements());
-		assertEquals("operation:class",		operands.get(1).at("/operation").asText());
-		assertEquals(2,						operands.get(1).at("/classOut").asInt());
-		
-		query = "{1:[]}[base=der][base=Mann]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		operands = Lists.newArrayList(res.at("/query/operands").elements());
-		assertEquals("operation:class",		operands.get(0).at("/operation").asText());
-		assertEquals(1,						operands.get(0).at("/classOut").asInt());
-		
-		query = "{1:{2:der} {3:[]} Mann}";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		operands = Lists.newArrayList(res.at("/query/operands").elements());
-		assertEquals(1,	operands.size());  // class operation may only have one operand (the sequence)
-		operands = Lists.newArrayList(operands.get(0).at("/operands").elements());
-		assertEquals(3,	operands.size());  // the sequence has three operands ("der", "[]" and "Mann")
-		
-	}
-	
-	@Test
-	public void testLeadingTrailingEmptyTokens() throws QueryException, JsonProcessingException, IOException {
-		query = "[][base=Mann]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		operands = Lists.newArrayList(res.at("/query/operands").elements());
-		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
-		assertEquals(true,					operands.get(0).at("/key").isMissingNode());
-		
-		query = "[][][base=Mann]";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		operands = Lists.newArrayList(res.at("/query/operands").elements());
-		assertEquals("korap:group",			operands.get(0).at("/@type").asText());
-		assertEquals("operation:repetition",operands.get(0).at("/operation").asText());
-		assertEquals(2,						operands.get(0).at("/boundary/min").asInt());
-		assertEquals(2,						operands.get(0).at("/boundary/max").asInt());
-		operands = Lists.newArrayList(operands.get(0).at("/operands").elements());
-		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
-		assertEquals(true,					operands.get(0).at("/key").isMissingNode());
-		
-		query = "startswith(<s>, [][base=Mann])";
-		qs.setQuery(query, "poliqarpplus");
-		res = mapper.readTree(qs.toJSON());
-		operands = Lists.newArrayList(res.at("/query/operands"));
-		operands = Lists.newArrayList(operands.get(1).at("/operands"));
-		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
-		assertEquals(true,					operands.get(0).at("/key").isMissingNode());
-	}
-	
-
-    @Test
-    public void testGroupRepetition() throws QueryException, JsonProcessingException, IOException {
-      query = "contains(<s>, (der){3})";
-      qs.setQuery(query, "poliqarpplus");
-      res = mapper.readTree(qs.toJSON());
-      assertEquals("korap:group", res.at("/query/@type").asText());
-      assertEquals("operation:position", res.at("/query/operation").asText());
-      assertEquals("korap:span", res.at("/query/operands/0/@type").asText());
-      assertEquals("s", res.at("/query/operands/0/key").asText());
-      assertEquals("korap:group", res.at("/query/operands/1/@type").asText());
-      assertEquals("operation:repetition", res.at("/query/operands/1/operation").asText());
-    };
-
-
-    @Test
-    public void testPositions() throws QueryException, JsonProcessingException, IOException {
-      query = "contains(<s>, der)";
-      qs.setQuery(query, "poliqarpplus");
-      res = mapper.readTree(qs.toJSON());
-      assertEquals("korap:group", res.at("/query/@type").asText());
-      assertEquals("operation:position", res.at("/query/operation").asText());
-      assertEquals("frame:contains", res.at("/query/frame").asText());
-      assertEquals("korap:span", res.at("/query/operands/0/@type").asText());
-      assertEquals("s", res.at("/query/operands/0/key").asText());
-      assertEquals("korap:token", res.at("/query/operands/1/@type").asText());
-      
-      query = "overlaps(<s>, der)";
-      qs.setQuery(query, "poliqarpplus");
-      res = mapper.readTree(qs.toJSON());
-      assertEquals("korap:group", res.at("/query/@type").asText());
-      assertEquals("operation:position", res.at("/query/operation").asText());
-      assertEquals("frame:overlaps", res.at("/query/frame").asText());
-      assertEquals("korap:span", res.at("/query/operands/0/@type").asText());
-      assertEquals("s", res.at("/query/operands/0/key").asText());
-      assertEquals("korap:token", res.at("/query/operands/1/@type").asText());
-    };
-
-	
-//	}
-//	
-//	@Test
-//	public void testCoordinatedFields() throws QueryException {
-//		// [base=Mann&(cas=N|cas=A)]
-//		String cof1 = 
-//			"{@type=korap:token, wrap=" +
-//				"{@type=korap:termGroup, relation=relation:and, operands=[" +
-//					"{@type=korap:term, layer=lemma, key=Mann, match=match:eq}," +
-//					"{@type=korap:termGroup, relation=relation:or, operands=[" +
-//						"{@type=korap:term, layer=cas, key=N, match=match:eq}," +
-//						"{@type=korap:term, layer=cas, key=A, match=match:eq}" +
-//					"]}" +
-//				"]}" +
-//			"}";
-//		ppt = new PoliqarpPlusTree("[base=Mann&(cas=N|cas=A)]");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(cof1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//
-//
-//		assertEquals(
-//		    new PoliqarpPlusTree(" [ base=Mann & ( cas=N | cas=A)] ").getRequestMap().get("query").toString(),
-//		    new PoliqarpPlusTree("[base=Mann &(cas=N|cas=A)]").getRequestMap().get("query").toString()
-//	        );
-//		
-//		// [base=Mann&cas=N&gen=m]
-//		String cof2 = 
-//			"{@type=korap:token, wrap=" +
-//				"{@type=korap:termGroup, relation=relation:and, operands=[" +
-//					"{@type=korap:term, layer=lemma, key=Mann, match=match:eq}," +
-//					"{@type=korap:termGroup, relation=relation:and, operands=[" +
-//						"{@type=korap:term, layer=cas, key=N, match=match:eq}," +
-//						"{@type=korap:term, layer=gen, key=m, match=match:eq}" +
-//					"]}" +
-//				"]}" +
-//			"}";
-//		ppt = new PoliqarpPlusTree("[base=Mann&cas=N&gen=m]");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(cof2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//	}
-//	
-//	@Test
-//	public void testOccurrence() throws QueryException {
-//		// [base=foo]*
-//		String occ1 = "{@type=korap:group, operation=operation:repetition, operands=[" +
-//					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-//					  "], boundary={@type=korap:boundary, min=0}, min=0}"; 
-//		ppt = new PoliqarpPlusTree("[base=foo]*");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(occ1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// [base=foo]*[base=bar]
-//		String occ2 = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:group, operation=operation:repetition, operands=[" +
-//					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-//					"], boundary={@type=korap:boundary, min=0}, min=0 }," +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=bar, match=match:eq}}" +
-//				"]}"; 
-//		ppt = new PoliqarpPlusTree("[base=foo]*[base=bar]");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(occ2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// [base=bar][base=foo]*
-//		String occ3 = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=bar, match=match:eq}}," +
-//					"{@type=korap:group, operation=operation:repetition, operands=[" +
-//					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-//					"], boundary={@type=korap:boundary, min=0}, min=0 }" +
-//				"]}"; 
-//		ppt = new PoliqarpPlusTree("[base=bar][base=foo]*");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(occ3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// ([base=bar][base=foo])*
-//		String occ4 = 
-//				"{@type=korap:group, operation=operation:repetition, operands=[" +	
-//					"{@type=korap:group, operation=operation:sequence, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=bar, match=match:eq}}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-//					"]}" +
-//				"], boundary={@type=korap:boundary, min=0}, min=0}" ;
-//		ppt = new PoliqarpPlusTree("([base=bar][base=foo])*");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(occ4.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// <s>([base=bar][base=foo])*
-//		String occ5 = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:span, key=s}," +
-//					"{@type=korap:group, operation=operation:repetition, operands=[" +	
-//						"{@type=korap:group, operation=operation:sequence, operands=[" +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=bar, match=match:eq}}," +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-//						"]}" +
-//					"], boundary={@type=korap:boundary, min=0}, min=0 }" +
-//				"]}" ;
-//		ppt = new PoliqarpPlusTree("<s>([base=bar][base=foo])*");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(occ5.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// <s><np>([base=bar][base=foo])*
-//		String occ6 = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:span, key=s}," +
-//					"{@type=korap:span, key=np}," +
-//					"{@type=korap:group, operation=operation:repetition, operands=[" +	
-//						"{@type=korap:group, operation=operation:sequence, operands=[" +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=bar, match=match:eq}}," +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-//						"]}" +
-//					"], boundary={@type=korap:boundary, min=0}, min=0 }" +
-//				"]}" ;
-//		ppt = new PoliqarpPlusTree("<s><np>([base=bar][base=foo])*");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(occ6.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// <s><np>([base=bar][base=foo])*[p=NN]
-//		// comment: embedded sequence shouldn't really be here, but does not really hurt, either. (?)
-//		// really hard to get this behaviour out of the PQPlus grammar...
-//		String occ7 = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:span, key=s}," +
-//					"{@type=korap:span, key=np}," +
-//					"{@type=korap:group, operation=operation:repetition, operands=[" +	
-//						"{@type=korap:group, operation=operation:sequence, operands=[" +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=bar, match=match:eq}}," +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-//						"]}" +
-//					"], boundary={@type=korap:boundary, min=0}, min=0 }," +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=p, key=NN, match=match:eq}}" +
-//				"]}" ;
-//		ppt = new PoliqarpPlusTree("<s><np>([base=bar][base=foo])*[p=NN]");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(occ7.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// ([base=bar][base=foo])*[p=NN]
-//		String occ8 = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:group, operation=operation:repetition, operands=[" +	
-//						"{@type=korap:group, operation=operation:sequence, operands=[" +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=bar, match=match:eq}}," +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-//						"]}" +
-//					"], boundary={@type=korap:boundary, min=0}, min=0 }," +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=p, key=NN, match=match:eq}}" +
-//				"]}" ;
-//		ppt = new PoliqarpPlusTree("([base=bar][base=foo])*[p=NN]");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(occ8.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// [base=foo]+
-//		String occ9 = "{@type=korap:group, operation=operation:repetition, operands=[" +
-//					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-//					  "], boundary={@type=korap:boundary, min=1}, min=1}"; 
-//		ppt = new PoliqarpPlusTree("[base=foo]+");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(occ9.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// [base=foo]?
-//		String occ10 = "{@type=korap:group, operation=operation:repetition, operands=[" +
-//					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-//					  "], boundary={@type=korap:boundary, min=0, max=1}, min=0, max=1}"; 
-//		ppt = new PoliqarpPlusTree("[base=foo]?");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(occ10.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// [base=foo]{2,5}
-//		String occ11 = "{@type=korap:group, operation=operation:repetition, operands=[" +
-//					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-//					  "], boundary={@type=korap:boundary, min=2, max=5}, min=2, max=5}"; 
-//		ppt = new PoliqarpPlusTree("[base=foo]{2,5}");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(occ11.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// [base=foo]{2}
-//		String occ12 = "{@type=korap:group, operation=operation:repetition, operands=[" +
-//					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-//					  "], boundary={@type=korap:boundary, min=2, max=2}, min=2, max=2}"; 
-//		ppt = new PoliqarpPlusTree("[base=foo]{2}");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(occ12.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// [base=foo]{2}
-//		String occ13 = "{@type=korap:group, operation=operation:repetition, operands=[" +
-//					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-//					  "], boundary={@type=korap:boundary, min=2}, min=2}"; 
-//		ppt = new PoliqarpPlusTree("[base=foo]{2,}");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(occ13.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// [base=foo]{2}
-//		String occ14 = "{@type=korap:group, operation=operation:repetition, operands=[" +
-//					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-//					  "], boundary={@type=korap:boundary, min=0, max=2}, min=0, max=2}"; 
-//		ppt = new PoliqarpPlusTree("[base=foo]{,2}");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(occ14.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//	}
-//	
-//	@Test
-//	public void testTokenSequence() throws QueryException {
-//		// [base=Mann][orth=Frau]
-//		String seq1 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-//				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}, " +
-//				"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}" +
-//				"]}";
-//		assertTrue(equalsQueryContent(seq1, "[base=Mann][orth=Frau]"));
-//		
-//		// [base=Mann][orth=Frau][p=NN]
-//		String seq2 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-//				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}, " +
-//				"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}, " +
-//				"{@type=korap:token, wrap={@type=korap:term, layer=p, key=NN, match=match:eq}}" +
-//				"]}";
-//		assertTrue(equalsQueryContent(seq2, "[base=Mann][orth=Frau][p=NN]"));
-//	}
-//	
-//	@Test
-//	public void testDisjSegments() throws QueryException {
-//		// ([base=der]|[base=das])[base=Schild]
-//		String disj1 = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:group, operation=operation:or, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=das, match=match:eq}}" +
-//					"]}," +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Schild, match=match:eq}}" +
-//				"]}";
-//		ppt = new PoliqarpPlusTree("([base=der]|[base=das])[base=Schild]");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(disj1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// [base=Schild]([base=der]|[base=das])
-//		String disj2 = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Schild, match=match:eq}}," +
-//					"{@type=korap:group, operation=operation:or, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=das, match=match:eq}}" +
-//					"]}" +
-//				"]}";
-//		ppt = new PoliqarpPlusTree("[base=Schild]([base=der]|[base=das])");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(disj2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// "([orth=der][base=katze])|([orth=eine][base=baum])"
-//		String disj3 = 
-//				"{@type=korap:group, operation=operation:or, operands=[" +
-//					"{@type=korap:group, operation=operation:sequence, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=katze, match=match:eq}}" +
-//					"]}," +
-//					"{@type=korap:group, operation=operation:sequence, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=eine, match=match:eq}}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=baum, match=match:eq}}" +
-//					"]}" +
-//				"]}";
-//		ppt = new PoliqarpPlusTree("([orth=der][base=katze])|([orth=eine][base=baum])");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(disj3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// "[orth=der][base=katze]|[orth=eine][base=baum]"
-//		String disj4 = 
-//				"{@type=korap:group, operation=operation:or, operands=[" +
-//					"{@type=korap:group, operation=operation:sequence, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=katze, match=match:eq}}" +
-//					"]}," +
-//					"{@type=korap:group, operation=operation:sequence, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=eine, match=match:eq}}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=baum, match=match:eq}}" +
-//					"]}" +
-//				"]}";
-//		ppt = new PoliqarpPlusTree("[orth=der][base=katze]|[orth=eine][base=baum]");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(disj4.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		PoliqarpPlusTree ppt1 = new PoliqarpPlusTree("[orth=der][base=katze]|[orth=eine][base=baum]");
-//		PoliqarpPlusTree ppt2 = new PoliqarpPlusTree("([orth=der][base=katze])|([orth=eine][base=baum])");
-//		assertEquals(ppt1.getRequestMap().toString(), ppt2.getRequestMap().toString());
-//		
-//		// "[orth=der][base=katze]|[orth=der][base=hund]|[orth=der][base=baum]"
-//		String disj5 = 
-//				"{@type=korap:group, operation=operation:or, operands=[" +
-//					"{@type=korap:group, operation=operation:sequence, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=katze, match=match:eq}}" +
-//					"]}," +
-//					"{@type=korap:group, operation=operation:sequence, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=hund, match=match:eq}}" +
-//					"]}," +
-//					"{@type=korap:group, operation=operation:sequence, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=baum, match=match:eq}}" +
-//					"]}" +
-//				"]}";
-//		ppt = new PoliqarpPlusTree("[orth=der][base=katze]|[orth=der][base=hund]|[orth=der][base=baum]");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(disj5.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// [orth=der]([base=katze]|[base=hund]|[base=baum])
-//		String disj6 = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-//					"{@type=korap:group, operation=operation:or, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=katze, match=match:eq}}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=hund, match=match:eq}}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=baum, match=match:eq}}" +
-//					"]}" +
-//				"]}";
-//		ppt = new PoliqarpPlusTree("[orth=der]([base=katze]|[base=hund]|[base=baum])");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(disj6.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//	}
-//	
-//	@Test
-//	public void testTokenElemSequence() throws QueryException {
-//		// [base=Mann]<vp>
-//		String seq1 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-//				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}, " +
-//				"{@type=korap:span, key=vp}" +
-//				"]}";
-//		assertTrue(equalsQueryContent(seq1, "[base=Mann]<vp>"));
-//		
-//		// <vp>[base=Mann]
-//		String seq2 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-//				"{@type=korap:span, key=vp}, "+
-//				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}} " +
-//				"]}";
-//		assertTrue(equalsQueryContent(seq2, "<vp>[base=Mann]"));
-//		
-//		// <vp>[base=Mann]<pp>
-//		String seq3 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-//				"{@type=korap:span, key=vp}, "+
-//				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}, " +
-//				"{@type=korap:span, key=pp} "+
-//				"]}";
-//		assertTrue(equalsQueryContent(seq3, "<vp>[base=Mann]<pp>"));
-//	}
-//	
-//	@Test
-//	public void testElemSequence() throws QueryException {
-//		// <np><vp>
-//		String seq1 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-//				"{@type=korap:span, key=np}," +
-//				"{@type=korap:span, key=vp}" +
-//				"]}";
-//		assertTrue(equalsQueryContent(seq1, "<np><vp>"));
-//		
-//		// <np><vp><pp>
-//		String seq2 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-//				"{@type=korap:span, key=np}," +
-//				"{@type=korap:span, key=vp}," +
-//				"{@type=korap:span, key=pp}" +
-//				"]}";
-//		assertTrue(equalsQueryContent(seq2, "<np><vp><pp>"));
-//	}
-//	
-//	@Test 
-//	public void testClasses() throws QueryException {
-//		String query;
-//		// {[base=Mann]}
-//		String cls1 = "{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
-//				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-//				"]}";
-//		ppt = new PoliqarpPlusTree("{[base=Mann]}");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(cls1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// {[base=Mann][orth=Frau]}
-//		query = "{[base=Mann][orth=Frau]}";
-//		String cls2 = "{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
-//				 "{@type=korap:group, operation=operation:sequence, operands=[" +
-//				  "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
-//				  "{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}" +
-//				 "]}" +
-//				"]}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(cls2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// [p=NN]{[base=Mann][orth=Frau]}
-//		String cls3 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=p, key=NN, match=match:eq}}," +
-//						"{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
-//							"{@type=korap:group, operation=operation:sequence, operands=[" +
-//								"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
-//								"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}" +
-//							"]}" +
-//						"]}" +
-//					  "]}";
-//		ppt = new PoliqarpPlusTree("[p=NN]{[base=Mann][orth=Frau]}");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(cls3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// {[base=Mann][orth=Frau]}[p=NN]
-//		String cls4 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-//						"{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
-//						   "{@type=korap:group, operation=operation:sequence, operands=[" +
-//						     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
-//						     "{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}" +
-//						   "]}" +
-//						"]}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=p, key=NN, match=match:eq}}" +
-//					  "]}";
-//		ppt = new PoliqarpPlusTree("{[base=Mann][orth=Frau]}[p=NN]");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(cls4.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//
-//		// {2:{1:[tt/p=ADJA]}[mate/p=NN]}"
-//		String cls5 = "{@type=korap:group, operation=operation:class, class=2, classOut=2, operands=[" +
-//						"{@type=korap:group, operation=operation:sequence, operands=[" +
-//						   "{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-//						     "{@type=korap:token, wrap={@type=korap:term, foundry=tt, layer=p, key=ADJA, match=match:eq}}" +
-//						   "]}," +
-//						   "{@type=korap:token, wrap={@type=korap:term, foundry=mate, layer=p, key=NN, match=match:eq}}" + 
-//						"]}" +
-//					  "]}";
-//		ppt = new PoliqarpPlusTree("{2: {1:[tt/p=ADJA]}[mate/p=NN]}");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(cls5.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//	}
-//	
-//	@Test
-//	public void testPositions() throws QueryException {
-//		// contains(<s>,<np>)
-//		String pos1 = "{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-//				  "{@type=korap:span, key=s}," +
-//				  "{@type=korap:span, key=np}" +
-//				"], frame=frame:contains}";
-//		assertTrue(equalsQueryContent(pos1, "contains(<s>,<np>)"));
-//		
-//		// contains(<s>,[base=Mann])
-//		String pos2 = "{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-//				  "{@type=korap:span, key=s}," +
-//				  "{@type=korap:token, wrap= {@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-//				"], frame=frame:contains}";
-//		assertTrue(equalsQueryContent(pos2, "contains(<s>,[base=Mann])"));
-//		
-//		// contains(<s>,[orth=der][orth=Mann])
-//		String pos3 = "{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-//				  	"{@type=korap:span, key=s}," +
-//				  	"{@type=korap:group, operation=operation:sequence, operands=[" +
-//				  		"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-//				  		"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}" +
-//				  	"]}" +
-//				  "], frame=frame:contains}";
-//		ppt = new PoliqarpPlusTree("contains(<s>,[orth=der][orth=Mann])");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(pos3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// [base=Auto]contains(<s>,[base=Mann])
-//		String pos4 = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Auto, match=match:eq}}," +
-//					"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-//				  		"{@type=korap:span, key=s}," +
-//				  		"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-//				  	"], frame=frame:contains}" +
-//				"]}";
-//		ppt = new PoliqarpPlusTree("[base=Auto]contains(<s>,[base=Mann])");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(pos4.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// contains(<s>,[pos=N]*)
-//		String pos5 = 
-//					"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-//				  		"{@type=korap:span, key=s}," +
-//				  		"{@type=korap:group, operation=operation:repetition, " +
-//				  			"operands=[{@type=korap:token, wrap={@type=korap:term, layer=pos, key=N, match=match:eq}}" +
-//				  			"], boundary={@type=korap:boundary, min=0}, min=0" +
-//				  		"}" +
-//				  	"], frame=frame:contains}";
-//		ppt = new PoliqarpPlusTree("contains(<s>,[pos=N]*)");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(pos5.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// [base=Auto]contains(<s>,[pos=N]*)
-//		String pos6 = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Auto, match=match:eq}}," +
-//					"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-//				  		"{@type=korap:span, key=s}," +
-//				  		"{@type=korap:group, operation=operation:repetition, " +
-//				  			"operands=[{@type=korap:token, wrap={@type=korap:term, layer=pos, key=N, match=match:eq}}" +
-//				  			"], boundary={@type=korap:boundary, min=0}, min=0" +
-//				  		"}" +
-//				  	"], frame=frame:contains}" +
-//				"]}";
-//		ppt = new PoliqarpPlusTree("[base=Auto]contains(<s>,[pos=N]*)");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(pos6.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//	}
-//	
-//	@Test
-//	public void testNestedPositions() throws QueryException {
-//		// contains(<s>,startswith(<np>,[orth=Der]))
-//		String npos1 = 
-//			"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-//				"{@type=korap:span, key=s}," +
-//				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
-//					"{@type=korap:span, key=np}," +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}" +
-//				"], frame=frame:startswith}" +
-//			"], frame=frame:contains}";
-//		ppt = new PoliqarpPlusTree("contains(<s>, startswith(<np>,[orth=Der]))");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(npos1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//	}
-//	
-//	@Test
-//	public void testFocusSplit() throws QueryException {
-//		// focus([orth=Der]{[orth=Mann]})
-//		String shr1 = 
-//			"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}," +
-//					"{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}" +
-//					"]}" +
-//				"]}" +
-//			"]}";
-//		ppt = new PoliqarpPlusTree("focus([orth=Der]{[orth=Mann]})");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(shr1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// focus([orth=Der]{[orth=Mann][orth=geht]})
-//		String shr2 = 
-//			"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}," +
-//					"{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
-//						"{@type=korap:group, operation=operation:sequence, operands=[" +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}," +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=geht, match=match:eq}}" +
-//						"]}" +
-//					"]}" +
-//				"]}" +
-//			"]}";
-//		ppt = new PoliqarpPlusTree("focus([orth=Der]{[orth=Mann][orth=geht]})");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(shr2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// focus(1:[orth=Der]{1:[orth=Mann][orth=geht]})
-//		String shr3 = 
-//			"{@type=korap:reference, operation=operation:focus, classRef=[1], operands=[" +
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}," +
-//					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-//						"{@type=korap:group, operation=operation:sequence, operands=[" +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}," +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=geht, match=match:eq}}" +
-//						"]}" +
-//					"]}" +
-//				"]}" +
-//			"]}";
-//		ppt = new PoliqarpPlusTree("focus(1:[orth=Der]{1:[orth=Mann][orth=geht]})");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(shr3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// focus(1:startswith(<s>,{1:<np>}))
-//		String shr4 = 
-//			"{@type=korap:reference, operation=operation:focus, classRef=[1], operands=[" +
-//				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
-//					"{@type=korap:span, key=s}," +
-//					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-//						"{@type=korap:span, key=np}" +
-//					"]}" +
-//				"], frame=frame:startswith}" +
-//			"]}";
-//		ppt = new PoliqarpPlusTree("focus(1:startswith(<s>,{1:<np>}))");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(shr4.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// focus(3: startswith(<s>, {3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) 
-//		String shr5 = 
-//			"{@type=korap:reference, operation=operation:focus, classRef=[3], operands=[" +
-//				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
-//					"{@type=korap:span, key=s}," +
-//					"{@type=korap:group, operation=operation:class, class=3, classOut=3, operands=[" +
-//						"{@type=korap:group, operation=operation:sequence, operands=[" +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-//							"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-//								"{@type=korap:group, operation=operation:sequence, operands=[" +
-//									"{@type=korap:token, wrap={@type=korap:term, foundry=mate, layer=p, key=ADJA, match=match:eq}}," +
-//									"{@type=korap:group, operation=operation:class, class=2, classOut=2, operands=[" +
-//										"{@type=korap:token, wrap={@type=korap:term, foundry=tt, layer=p, key=NN, match=match:eq}}" +
-//									"]}" + 
-//								"]}" +
-//							"]}" +
-//						"]}" +
-//					"]}" +
-//				"], frame=frame:startswith}" +
-//			"]}";
-//		ppt = new PoliqarpPlusTree("focus(3:startswith(<s>,{3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) ");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(shr5.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// split(3: startswith(<s>, {3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) 
-//		String shr6 = 
-//			"{@type=korap:reference, operation=operation:split, classRef=[3], operands=[" +
-//				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
-//					"{@type=korap:span, key=s}," +
-//					"{@type=korap:group, operation=operation:class, class=3, classOut=3, operands=[" +
-//						"{@type=korap:group, operation=operation:sequence, operands=[" +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-//							"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-//								"{@type=korap:group, operation=operation:sequence, operands=[" +
-//									"{@type=korap:token, wrap={@type=korap:term, foundry=mate, layer=p, key=ADJA, match=match:eq}}," +
-//									"{@type=korap:group, operation=operation:class, class=2, classOut=2, operands=[" +
-//										"{@type=korap:token, wrap={@type=korap:term, foundry=tt, layer=p, key=NN, match=match:eq}}" +
-//									"]}" + 
-//								"]}" +
-//							"]}" +
-//						"]}" +
-//					"]}" +
-//				"], frame=frame:startswith}" +
-//			"]}";
-//		ppt = new PoliqarpPlusTree("split(3:startswith(<s>,{3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) ");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(shr6.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// split(2|3: startswith(<s>, {3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) 
-//		String shr7 = 
-//			"{@type=korap:reference, operation=operation:split, classRef=[2, 3], classRefOp=classRefOp:intersection, operands=[" +
-//				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
-//					"{@type=korap:span, key=s}," +
-//					"{@type=korap:group, operation=operation:class, class=3, classOut=3, operands=[" +
-//						"{@type=korap:group, operation=operation:sequence, operands=[" +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-//							"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-//								"{@type=korap:group, operation=operation:sequence, operands=[" +
-//									"{@type=korap:token, wrap={@type=korap:term, foundry=mate, layer=p, key=ADJA, match=match:eq}}," +
-//									"{@type=korap:group, operation=operation:class, class=2, classOut=2, operands=[" +
-//										"{@type=korap:token, wrap={@type=korap:term, foundry=tt, layer=p, key=NN, match=match:eq}}" +
-//									"]}" + 
-//								"]}" +
-//							"]}" +
-//						"]}" +
-//					"]}" +
-//				"], frame=frame:startswith}" +
-//			"]}";
-//		ppt = new PoliqarpPlusTree("split(2|3:startswith(<s>,{3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) ");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(shr7.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		
-//		String shr8 = 
-//			"{@type=korap:reference, operation=operation:focus, classRef=[1], operands=[" +
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}" +
-//					"]}," +
-//					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=pos, key=ADJA, match=match:eq}}" +
-//					"]}" +
-//				"]}" +
-//			"]}";
-//		ppt = new PoliqarpPlusTree("focus(1:{[base=der]}{1:[pos=ADJA]})");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(shr8.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//	}
-//	
-//	@Test
-//	public void testSubspan() throws QueryException {
-//		query = "submatch(1,:<s>)";
-//		expected = 
-//			"{@type=korap:reference, operation=operation:focus, operands=[" +
-//					"{@type=korap:span, key=s}" +
-//				"], spanRef=[1]" +
-//			"}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//	
-//		query = "submatch(1,4:<s>)";
-//		expected = 
-//			"{@type=korap:reference, operation=operation:focus, operands=[" +
-//					"{@type=korap:span, key=s}" +
-//				"], spanRef=[1,4]" +
-//			"}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		query = "submatch(1,4:contains(<s>,[base=Haus]))";
-//		expected = 
-//			"{@type=korap:reference, operation=operation:focus, operands=[" +
-//				"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-//					"{@type=korap:span, key=s}," +
-//					"{@type=korap:token, wrap= {@type=korap:term, layer=lemma, key=Haus, match=match:eq}}" +
-//				"], frame=frame:contains}" +
-//				"], spanRef=[1,4]" +
-//			"}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//	}
-//	
-//	@Test
-//	public void testRelations() throws QueryException {
-//		query = "relatesTo(<s>,<np>)";
-//		expected = 
-//			"{@type=korap:group, operation=operation:relation, operands=[" +
-//					"{@type=korap:span, key=s}," +
-//					"{@type=korap:span, key=np}" +
-//				"], relation={@type=korap:relation}" +
-//			"}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		query = "relatesTo([base=Baum],<np>)";
-//		expected = 
-//				"{@type=korap:group, operation=operation:relation, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Baum, match=match:eq}}," +
-//						"{@type=korap:span, key=np}" +
-//					"], relation={@type=korap:relation}" +
-//				"}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		query = "dominates(<np>,[base=Baum])";
-//		expected = 
-//				"{@type=korap:group, operation=operation:relation, operands=[" +
-//						"{@type=korap:span, key=np}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Baum, match=match:eq}}" +
-//					"], relation={@type=korap:relation, layer=c}" +
-//				"}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		query = "dominates(cnx/c:<np>,[base=Baum])";
-//		expected = 
-//				"{@type=korap:group, operation=operation:relation, operands=[" +
-//						"{@type=korap:span, key=np}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Baum, match=match:eq}}" +
-//					"], relation={@type=korap:relation, layer=c, foundry=cnx}" +
-//				"}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		query = "dominates(cnx/c*:<np>,[base=Baum])";
-//		expected = 
-//				"{@type=korap:group, operation=operation:relation, operands=[" +
-//						"{@type=korap:span, key=np}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Baum, match=match:eq}}" +
-//					"], relation={@type=korap:relation, layer=c, foundry=cnx, boundary={@type=korap:boundary, min=0}}" +
-//				"}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		query = "dominates(cnx/c{1,5}:<np>,[base=Baum])";
-//		expected = 
-//				"{@type=korap:group, operation=operation:relation, operands=[" +
-//						"{@type=korap:span, key=np}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Baum, match=match:eq}}" +
-//					"], relation={@type=korap:relation, layer=c, foundry=cnx, boundary={@type=korap:boundary, min=1, max=5}}" +
-//				"}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		query = "relatesTo(mate/d=HEAD:<np>,[base=Baum])";
-//		expected = 
-//				"{@type=korap:group, operation=operation:relation, operands=[" +
-//						"{@type=korap:span, key=np}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Baum, match=match:eq}}" +
-//					"], relation={@type=korap:relation, foundry=mate, layer=d, key=HEAD}" +
-//				"}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//	}
-//	
-//	
-//	
-//	@Test
-//	public void testFoundries() throws QueryException {
-//		// [tt/base=Mann]
-//		String layer1 = "{@type=korap:token, wrap={@type=korap:term, foundry=tt, layer=lemma, key=Mann, match=match:eq}}";
-//		ppt = new PoliqarpPlusTree("[tt/base=Mann]");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(layer1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//	}
-//	
-//	@Test
-//	public void testAlign() throws QueryException {
-//		// [orth=der]^[orth=Mann]
-//		query = "[orth=der]^[orth=Mann]";
-//		expected = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-//					"{@type=korap:group, operation=operation:class, class=1025, classOut=1025, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}" +
-//					"]}" +
-//				"]}";
-//		metaExpected = 
-//				"{alignment=1025}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		metaMap = ppt.getRequestMap().get("meta").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
-//		
-//		// [orth=der]^[orth=große][orth=Mann]
-//		query = "[orth=der]^[orth=große][orth=Mann]";
-//		String expected = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-//					"{@type=korap:group, operation=operation:class, class=1025, classOut=1025, operands=[" +
-//						"{@type=korap:group, operation=operation:sequence, operands=[" +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=große, match=match:eq}}," +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}" +
-//						"]}" +
-//					"]}" +
-//				"]}";
-//		metaExpected = 
-//				"{alignment=1025}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		metaMap = ppt.getRequestMap().get("meta").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
-//		
-//		query = "([base=a]^[base=b])|[base=c]";
-//		expected = 
-//				"{@type=korap:group, operation=operation:or, operands=[" +
-//						"{@type=korap:group, operation=operation:sequence, operands=[" +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=a, match=match:eq}}," +
-//							"{@type=korap:group, operation=operation:class, class=1025, classOut=1025, operands=[" +
-//								"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=b, match=match:eq}}" +
-//							"]}" +
-//						"]}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=c, match=match:eq}}" +
-//				"]}";
-//		metaExpected = 
-//				"{alignment=1025}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		metaMap = ppt.getRequestMap().get("meta").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
-//		
-//		query = "([base=a]^[base=b][base=c])|[base=d]";
-//		expected = 
-//				"{@type=korap:group, operation=operation:or, operands=[" +
-//						"{@type=korap:group, operation=operation:sequence, operands=[" +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=a, match=match:eq}}," +
-//							"{@type=korap:group, operation=operation:class, class=1025, classOut=1025, operands=[" +
-//								"{@type=korap:group, operation=operation:sequence, operands=[" +
-//									"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=b, match=match:eq}}," +
-//									"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=c, match=match:eq}}" +
-//								"]}" +
-//							"]}" +
-//						"]}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=d, match=match:eq}}" +
-//				"]}";
-//		metaExpected = 
-//				"{alignment=1025}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		metaMap = ppt.getRequestMap().get("meta").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
-//		
-//		query = "([base=a]^[base=b]^[base=c])|[base=d]";
-//		expected = 
-//				"{@type=korap:group, operation=operation:or, operands=[" +
-//						"{@type=korap:group, operation=operation:sequence, operands=[" +
-//							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=a, match=match:eq}}," +
-//							"{@type=korap:group, operation=operation:class, class=1025, classOut=1025, operands=[" +
-//								"{@type=korap:group, operation=operation:sequence, operands=[" +
-//									"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=b, match=match:eq}}," +
-//									"{@type=korap:group, operation=operation:class, class=1026, classOut=1026, operands=[" +
-//										"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=c, match=match:eq}}" +
-//									"]}" +
-//								"]}" +
-//							"]}" +
-//						"]}," +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=d, match=match:eq}}" +
-//				"]}";
-//		metaExpected = 
-//				"{alignment=[1025,1026]}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		metaMap = ppt.getRequestMap().get("meta").toString();
-//		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
-//		
-//		
-//	}
-//	
-//	@Test
-//	public void testSimpleQueries() throws QueryException {
-//		// Baum
-//		String simple1 = 
-//				"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Baum, match=match:eq}}";
-//		ppt = new PoliqarpPlusTree("Baum");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(simple1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//
-//		// Baum/i
-//		String simple1b = 
-//				"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Baum, match=match:eq, caseInsensitive=true}}";
-//		ppt = new PoliqarpPlusTree("Baum/i");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(simple1b.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// Der Baum
-//		String simple2 = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}, " +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Baum, match=match:eq}}" +
-//				"]}";
-//		ppt = new PoliqarpPlusTree("Der Baum");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(simple2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// Der Baum/i
-//		String simple2b = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}, " +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Baum, match=match:eq, caseInsensitive=true}}" +
-//				"]}";
-//		ppt = new PoliqarpPlusTree("Der Baum/i");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(simple2b.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// Der große Baum
-//		String simple3 = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}, " +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=große, match=match:eq}}, " +						
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Baum, match=match:eq}}" +
-//				"]}";
-//		ppt = new PoliqarpPlusTree("Der große Baum");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(simple3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
-//		// Baum | Stein
-//		String simple4 = 
-//				"{@type=korap:group, operation=operation:or, operands=[" +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Baum, match=match:eq}}, " +						
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Stein, match=match:eq}}" +
-//				"]}";
-//		ppt = new PoliqarpPlusTree("Baum | Stein");
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(simple4.replaceAll(" ", ""), map.replaceAll(" ", ""));		
-//		
-//		// Baum | Stein Haus
-//		String query = "(Baum | Stein) Haus";
-//		String simple5 = 
-//				"{@type=korap:group, operation=operation:sequence, operands=[" +
-//					"{@type=korap:group, operation=operation:or, operands=[" +
-//						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Baum, match=match:eq}}, " +						
-//						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Stein, match=match:eq}}" +
-//					"]}," +
-//					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Haus, match=match:eq}} " +			
-//				"]}";
-//		ppt = new PoliqarpPlusTree(query);
-//		map = ppt.getRequestMap().get("query").toString();
-//		assertEquals(simple5.replaceAll(" ", ""), map.replaceAll(" ", ""));		
-//	}
-}
diff --git a/src/test/java/PoliqarpPlusTreeTest.java b/src/test/java/PoliqarpPlusTreeTest.java
index fa9fda0..1388dcd 100644
--- a/src/test/java/PoliqarpPlusTreeTest.java
+++ b/src/test/java/PoliqarpPlusTreeTest.java
@@ -1,1546 +1,1225 @@
 import static org.junit.Assert.*;
 
+import java.io.IOException;
+import java.util.ArrayList;
+
 import org.junit.Test;
 
-import de.ids_mannheim.korap.query.serialize.PoliqarpPlusTree;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.collect.Lists;
+
+
+import de.ids_mannheim.korap.query.serialize.QuerySerializer;
 import de.ids_mannheim.korap.util.QueryException;
 
+/**
+ * Tests for JSON-LD serialization of PoliqarpPlus queries. 
+ * @author Joachim Bingel (bingel@ids-mannheim.de)
+ * @version 1.0
+ */
 public class PoliqarpPlusTreeTest {
-	
-	PoliqarpPlusTree ppt;
+
 	String map;
 	String expected;
 	String metaExpected;
 	String metaMap;
 	String query;
-	
-	private boolean equalsQueryContent(String res, String query) throws QueryException {
-		res = res.replaceAll(" ", "");
-		ppt = new PoliqarpPlusTree(query);
-		String queryMap = ppt.getRequestMap().get("query").toString().replaceAll(" ", "");
-		return res.equals(queryMap);
-	}
-	
+	ArrayList<JsonNode> operands;
+
+	QuerySerializer qs = new QuerySerializer();
+	ObjectMapper mapper = new ObjectMapper();
+	JsonNode res;
+
 	@Test
-	public void testContext() throws QueryException {
+	public void testContext() throws QueryException, JsonProcessingException, IOException {
+		query = "foo";
 		String contextString = "http://ids-mannheim.de/ns/KorAP/json-ld/v0.2/context.jsonld";
-		ppt = new PoliqarpPlusTree("Test");
-		assertEquals(contextString.replaceAll(" ", ""), ppt.getRequestMap().get("@context").toString().replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(contextString, res.get("@context").asText());
 	}
-	
+
 	@Test
-	public void testSingleTokens() throws QueryException {
-		// [base=Mann]
-		String token1 = "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}";
-		assertTrue(equalsQueryContent(token1, "[base=Mann]"));
-		
-		// [orth!=Frau]
-		String token2 = "{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:ne}}";
-		assertTrue(equalsQueryContent(token2, "[orth!=Frau]"));
-		
-		// [!p=NN]
-		query = "[!p=NN]";
-		String token3 = "{@type=korap:token, wrap={@type=korap:term, layer=p, key=NN, match=match:ne}}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(token3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [!p!=NN]
+	public void testSingleTokens() throws QueryException, JsonProcessingException, IOException {
+		query = "[base=Mann]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("Mann", 				res.at("/query/wrap/key").asText());
+		assertEquals("lemma", 				res.at("/query/wrap/layer").asText());
+		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
+
+		query = "[orth!=Frau]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("Frau", 				res.at("/query/wrap/key").asText());
+		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
+		assertEquals("match:ne",			res.at("/query/wrap/match").asText());
+
+		query = "[p!=NN]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("NN", 					res.at("/query/wrap/key").asText());
+		assertEquals("p", 					res.at("/query/wrap/layer").asText());
+		assertEquals("match:ne",			res.at("/query/wrap/match").asText());
+
 		query = "[!p!=NN]";
-		String token4 = "{@type=korap:token, wrap={@type=korap:term, layer=p, key=NN, match=match:eq}}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(token4.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("NN", 					res.at("/query/wrap/key").asText());
+		assertEquals("p", 					res.at("/query/wrap/layer").asText());
+		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
+
 		query = "[base=schland/x]";
-		String token5 = "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=.*?schland.*?, match=match:eq, type=type:regex}}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(token5.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals(".*?schland.*?",		res.at("/query/wrap/key").asText());
+		assertEquals("lemma", 				res.at("/query/wrap/layer").asText());
+		assertEquals("type:regex",			res.at("/query/wrap/type").asText());
+		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
 	}
-	
+
 	@Test
-	public void testValue() throws QueryException {
+	public void testValue() throws QueryException, JsonProcessingException, IOException {
 		query = "[mate/m=temp:pres]";
-		String value1 = "{@type=korap:token, wrap={@type=korap:term, foundry=mate, layer=m, key=temp, value=pres, match=match:eq}}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(value1.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
+		assertEquals("temp",				res.at("/query/wrap/key").asText());
+		assertEquals("pres",				res.at("/query/wrap/value").asText());
+		assertEquals("m",	 				res.at("/query/wrap/layer").asText());
+		assertEquals("mate", 				res.at("/query/wrap/foundry").asText());
+		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
 	}
-	
+
 	@Test
-	public void testRegex() throws QueryException {
+	public void testRegex() throws QueryException, JsonProcessingException, IOException {
 		query = "[orth=\"M(a|ä)nn(er)?\"]";
-		String re1 = "{@type=korap:token, wrap={@type=korap:term, layer=orth, type=type:regex, key=M(a|ä)nn(er)?, match=match:eq}}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(re1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
+		assertEquals("M(a|ä)nn(er)?",		res.at("/query/wrap/key").asText());
+		assertEquals("type:regex",			res.at("/query/wrap/type").asText());
+		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
+		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
+
 		query = "[orth=\"M(a|ä)nn(er)?\"/x]";
-		String re2 = "{@type=korap:token, wrap={@type=korap:term, layer=orth, type=type:regex, key=.*?M(a|ä)nn(er)?.*?, match=match:eq}}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(re2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "\"M(a|ä)nn(er)?\"/x";
-		String re3 = "{@type=korap:token, wrap={@type=korap:term, type=type:regex, layer=orth, key=.*?M(a|ä)nn(er)?.*?, match=match:eq}}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(re3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "schland/x";
-		String re4 = "{@type=korap:token, wrap={@type=korap:term, layer=orth, key=.*?schland.*?, match=match:eq, type=type:regex}}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(re4.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
+		assertEquals(".*?M(a|ä)nn(er)?.*?",	res.at("/query/wrap/key").asText());
+		assertEquals("type:regex",			res.at("/query/wrap/type").asText());
+		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
+		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
+
 		query = "\".*?Mann.*?\"";
-		String re5 = "{@type=korap:token, wrap={@type=korap:term, type=type:regex, layer=orth, key=.*?Mann.*?, match=match:eq}}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(re5.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
+		assertEquals(".*?Mann.*?",			res.at("/query/wrap/key").asText());
+		assertEquals("type:regex",			res.at("/query/wrap/type").asText());
+		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
+		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
+
 		query = "z.B./x";
-		String re6 = "{@type=korap:token, wrap={@type=korap:term, layer=orth, key=.*?z\\.B\\..*?, match=match:eq, type=type:regex}}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(re6.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
+		assertEquals(".*?z\\.B\\..*?",		res.at("/query/wrap/key").asText());
+		assertEquals("type:regex",			res.at("/query/wrap/type").asText());
+		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
+		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
+
 	}
-	
+
 	@Test
-	public void testCaseSensitivityFlag() throws QueryException {
-		query="[orth=deutscher/i]";
-		String cs1 = 
-				"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=deutscher, match=match:eq, caseInsensitive=true}}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(cs1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query="[orth=deutscher/i][orth=Bundestag]";
-		String cs2 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=deutscher, match=match:eq, caseInsensitive=true}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Bundestag, match=match:eq}}" +
-					"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(cs2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query="deutscher/i";
-		String cs3 = 
-				"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=deutscher, match=match:eq, caseInsensitive=true}}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(cs3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query="deutscher/i Bundestag";
-		String cs4 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=deutscher, match=match:eq, caseInsensitive=true}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Bundestag, match=match:eq}}" +
-					"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(cs4.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query="deutscher Bundestag/i";
-		String cs5 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=deutscher, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Bundestag, match=match:eq, caseInsensitive=true}}" +
-					"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(cs5.replaceAll(" ", ""), map.replaceAll(" ", ""));
+	public void testCaseSensitivityFlag() throws QueryException, JsonProcessingException, IOException {
+		query = "[orth=deutscher/i]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
+		assertEquals("deutscher",			res.at("/query/wrap/key").asText());
+		assertEquals("true",				res.at("/query/wrap/caseInsensitive").asText());
+		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
+		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
+
+		query = "deutscher/i";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
+		assertEquals("deutscher",			res.at("/query/wrap/key").asText());
+		assertEquals("true",				res.at("/query/wrap/caseInsensitive").asText());
+		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
+		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
+
+		query = "deutscher/I";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
+		assertEquals("deutscher",			res.at("/query/wrap/key").asText());
+		assertEquals("false",				res.at("/query/wrap/caseInsensitive").asText());
+		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
+		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
+
+		query = "[orth=deutscher/i][orth=Bundestag]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence",	res.at("/query/operation").asText());
+		operands = Lists.newArrayList(res.at("/query/operands").elements());
+		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
+		assertEquals("deutscher",			operands.get(0).at("/wrap/key").asText());
+		assertEquals("orth",				operands.get(0).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
+		assertEquals(true,					operands.get(0).at("/wrap/caseInsensitive").asBoolean());
+		assertEquals("korap:token",			operands.get(1).at("/@type").asText());
+		assertEquals("Bundestag",			operands.get(1).at("/wrap/key").asText());
+		assertEquals("orth",				operands.get(1).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(1).at("/wrap/match").asText());
+		assertEquals(true,					operands.get(1).at("/wrap/caseInsensitive").isMissingNode());
+
+		query = "deutscher/i Bundestag";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence",	res.at("/query/operation").asText());
+		operands = Lists.newArrayList(res.at("/query/operands").elements());
+		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
+		assertEquals("deutscher",			operands.get(0).at("/wrap/key").asText());
+		assertEquals("orth",				operands.get(0).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
+		assertEquals(true,					operands.get(0).at("/wrap/caseInsensitive").asBoolean());
+		assertEquals("korap:token",			operands.get(1).at("/@type").asText());
+		assertEquals("Bundestag",			operands.get(1).at("/wrap/key").asText());
+		assertEquals("orth",				operands.get(1).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(1).at("/wrap/match").asText());
+		assertEquals(true,					operands.get(1).at("/wrap/caseInsensitive").isMissingNode());
 	}
-	
+
 	@Test
-	public void testSpans() throws QueryException {
-		// <s>
-		String elem1 = "{@type=korap:span, key=s}";
-		assertTrue(equalsQueryContent(elem1, "<s>"));
-		
-		// <vp>
-		String elem2 = "{@type=korap:span, key=vp}";
-		assertTrue(equalsQueryContent(elem2, "<vp>"));
-		
-		// <cnx/c=vp>
-		query = "<c=vp>";
-		String span3 = "{@type=korap:span, layer=c, key=vp}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(span3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// <cnx/c=vp>
+	public void testSpans() throws QueryException, JsonProcessingException, IOException {
+		query = "<s>";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:span", 			res.at("/query/@type").asText());
+		assertEquals("s",					res.at("/query/key").asText());
+
+		query = "<vp>";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:span", 			res.at("/query/@type").asText());
+		assertEquals("vp",					res.at("/query/key").asText());
+
 		query = "<cnx/c=vp>";
-		String span4 = "{@type=korap:span, foundry=cnx, layer=c, key=vp}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(span4.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// span negation
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:span", 			res.at("/query/@type").asText());
+		assertEquals("vp",					res.at("/query/key").asText());
+		assertEquals("cnx",					res.at("/query/foundry").asText());
+		assertEquals("c",					res.at("/query/layer").asText());
+
 		query = "<cnx/c!=vp>";
-		expected = "{@type=korap:span, foundry=cnx, layer=c, key=vp, match=match:ne}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// span negation
-		query = "<cnx/c!=vp>";
-		expected = "{@type=korap:span, foundry=cnx, layer=c, key=vp, match=match:ne}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "<cnx/c=vp class!=header>";
-		expected = "{@type=korap:span, foundry=cnx, layer=c, key=vp, attr={@type=korap:term, key=class, value=header, match=match:ne}}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "<cnx/c=vp !(class=header&id=7)>";
-		expected = 
-			"{@type=korap:span, foundry=cnx, layer=c, key=vp, attr=" +
-				"{@type=korap:termGroup, relation=relation:and, operands=[" +
-					"{@type=korap:term, key=class, value=header, match=match:ne}," +
-					"{@type=korap:term, key=id, value=7, match=match:ne}" +
-				"]}" +
-			"}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "<cnx/c!=vp (class=header&id=7)>";
-		expected = 
-			"{@type=korap:span, foundry=cnx, layer=c, key=vp, match=match:ne, attr=" +
-				"{@type=korap:termGroup, relation=relation:and, operands=[" +
-					"{@type=korap:term, key=class, value=header, match=match:eq}," +
-					"{@type=korap:term, key=id, value=7, match=match:eq}" +
-				"]}" +
-			"}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "<cnx/c=vp !!class=header>";
-		expected = "{@type=korap:span, foundry=cnx, layer=c, key=vp, attr={@type=korap:term, key=class, value=header, match=match:eq}}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "<cnx/c!=vp (foundry/class=header&id=7)>";
-		expected = 
-			"{@type=korap:span, foundry=cnx, layer=c, key=vp, match=match:ne, attr=" +
-				"{@type=korap:termGroup, relation=relation:and, operands=[" +
-					"{@type=korap:term, foundry=foundry, key=class, value=header, match=match:eq}," +
-					"{@type=korap:term, key=id, value=7, match=match:eq}" +
-				"]}" +
-			"}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:span", 			res.at("/query/@type").asText());
+		assertEquals("vp",					res.at("/query/key").asText());
+		assertEquals("cnx",					res.at("/query/foundry").asText());
+		assertEquals("c",					res.at("/query/layer").asText());
+		assertEquals("match:ne",			res.at("/query/match").asText());
+
+		query = "<cnx/c!=vp class!=header>";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:span", 			res.at("/query/@type").asText());
+		assertEquals("vp",					res.at("/query/key").asText());
+		assertEquals("cnx",					res.at("/query/foundry").asText());
+		assertEquals("c",					res.at("/query/layer").asText());
+		assertEquals("match:ne",			res.at("/query/match").asText());
+		assertEquals("class",				res.at("/query/attr/key").asText());
+		assertEquals("header",				res.at("/query/attr/value").asText());
+		assertEquals("match:ne",			res.at("/query/attr/match").asText());
+
+		query = "<cnx/c!=vp !(class!=header)>";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:span", 			res.at("/query/@type").asText());
+		assertEquals("vp",					res.at("/query/key").asText());
+		assertEquals("cnx",					res.at("/query/foundry").asText());
+		assertEquals("c",					res.at("/query/layer").asText());
+		assertEquals("match:ne",			res.at("/query/match").asText());
+		assertEquals("class",				res.at("/query/attr/key").asText());
+		assertEquals("header",				res.at("/query/attr/value").asText());
+		assertEquals("match:eq",			res.at("/query/attr/match").asText());
+
+		query = "<cnx/c!=vp !(class=header & id=7)>";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:span", 			res.at("/query/@type").asText());
+		assertEquals("vp",					res.at("/query/key").asText());
+		assertEquals("cnx",					res.at("/query/foundry").asText());
+		assertEquals("c",					res.at("/query/layer").asText());
+		assertEquals("match:ne",			res.at("/query/match").asText());
+		assertEquals("korap:termGroup",		res.at("/query/attr/@type").asText());
+		assertEquals("relation:and",		res.at("/query/attr/relation").asText());
+		operands = Lists.newArrayList( res.at("/query/attr/operands").elements());
+		assertEquals("korap:term",			operands.get(0).at("/@type").asText());
+		assertEquals("class",				operands.get(0).at("/key").asText());
+		assertEquals("header",				operands.get(0).at("/value").asText());
+		assertEquals("match:ne",			operands.get(0).at("/match").asText());
+		assertEquals("korap:term",			operands.get(1).at("/@type").asText());
+		assertEquals("id",					operands.get(1).at("/key").asText());
+		assertEquals(7,						operands.get(1).at("/value").asInt());
+		assertEquals("match:ne",			operands.get(1).at("/match").asText());
 	}
-	
+
 	@Test
-	public void testDistances() throws QueryException {
-		// [base=der][][base=Mann]
-		String et1 = 
-			"{@type=korap:group, operation=operation:sequence, " +
-			"operands=[" +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-			"], inOrder=true, distances=[" +
-				"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=2, max=2}, min=2, max=2}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("[base=der][][base=Mann]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(et1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=der][][][base=Mann]
-		String et2 = 
-			"{@type=korap:group, operation=operation:sequence, " +
-			"operands=[" +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-			"], inOrder=true, distances=[" +
-				"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=3, max=3}, min=3, max=3}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("[base=der][][][base=Mann]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(et2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=der][][]?[base=Mann]
-		String et3 = 
-			"{@type=korap:group, operation=operation:sequence, " +
-			"operands=[" +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-			"], inOrder=true, distances=[" +
-				"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=2, max=3}, min=2, max=3}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("[base=der][][]?[base=Mann]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(et3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		
-		
-		
-		// [base=der][]{2,5}[base=Mann][]?[][base=Frau]   nested distances=
-		String et5 = 
-				"{@type=korap:group, operation=operation:sequence," +
-				"operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:sequence, " +
-					"operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Frau, match=match:eq}}" +
-					"], inOrder=true, distances=[" +
-						"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=2, max=3}, min=2, max=3}" +
-					"]}" +
-				"], inOrder=true, distances=[" +
-					"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=3, max=6}, min=3, max=6}" +
-				"]}";
-		ppt = new PoliqarpPlusTree("[base=der][]{2,5}[base=Mann][]?[][base=Frau]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(et5.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=der][]*[base=Mann]
-		String et6 = 
-			"{@type=korap:group, operation=operation:sequence, " +
-			"operands=[" +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-			"], inOrder=true, distances=[" +
-				"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=1}, min=1}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("[base=der][]*[base=Mann]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(et6.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=der][]+[base=Mann]
-		String et7 = 
-			"{@type=korap:group, operation=operation:sequence, " +
-			"operands=[" +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-			"], inOrder=true, distances=[" +
-				"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=2}, min=2}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("[base=der][]+[base=Mann]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(et7.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=der][]+[base=Mann]
-		String et8 = 
-			"{@type=korap:group, operation=operation:sequence, " +
-			"operands=[" +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-			"], inOrder=true, distances=[" +
-				"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=2, max=103}, min=2, max=103}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("[base=der][]{1,102}[base=Mann]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(et8.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=geht][base=der][]*[base=Mann]
-		String et9 = 
-			"{@type=korap:group, operation=operation:sequence, operands=[" +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=geht, match=match:eq}}," +
-				"{@type=korap:group, operation=operation:sequence, " +
-				"operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-				"], inOrder=true, distances=[" +
-					"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=1}, min=1}" +
-				"]}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("[base=geht][base=der][]*[base=Mann]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(et9.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "[base=geht][base=der][]*[base=Mann][base=da]";
-		expected = 
-			"{@type=korap:group, operation=operation:sequence, operands=[" +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=geht, match=match:eq}}," +
-				"{@type=korap:group, operation=operation:sequence, " +
-				"operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=da, match=match:eq}}" +
-					"]}" +
-				"], inOrder=true, distances=[" +
-					"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=1}, min=1}" +
-				"]}" +
-			"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
+	public void testDistances() throws QueryException, JsonProcessingException, IOException {
+		query = "[base=der][][base=Mann]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence",	res.at("/query/operation").asText());
+		assertEquals("true",				res.at("/query/inOrder").asText());
+		assertEquals("korap:distance",		res.at("/query/distances").elements().next().at("/@type").asText());
+		assertEquals("w",					res.at("/query/distances").elements().next().at("/key").asText());
+		assertEquals("korap:boundary",		res.at("/query/distances").elements().next().at("/boundary/@type").asText());
+		assertEquals(2,						res.at("/query/distances").elements().next().at("/boundary/min").asInt());
+		assertEquals(2,						res.at("/query/distances").elements().next().at("/boundary/max").asInt());
+		operands = Lists.newArrayList(res.at("/query/operands").elements());
+		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
+		assertEquals("der",					operands.get(0).at("/wrap/key").asText());
+		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
+		assertEquals("korap:token",			operands.get(1).at("/@type").asText());
+		assertEquals("Mann",				operands.get(1).at("/wrap/key").asText());
+		assertEquals("lemma",				operands.get(1).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(1).at("/wrap/match").asText());
+
+		query = "[base=der][][][base=Mann]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence",	res.at("/query/operation").asText());
+		assertEquals("true",				res.at("/query/inOrder").asText());
+		assertEquals("korap:distance",		res.at("/query/distances").elements().next().at("/@type").asText());
+		assertEquals("w",					res.at("/query/distances").elements().next().at("/key").asText());
+		assertEquals("korap:boundary",		res.at("/query/distances").elements().next().at("/boundary/@type").asText());
+		assertEquals(3,						res.at("/query/distances").elements().next().at("/boundary/min").asInt());
+		assertEquals(3,						res.at("/query/distances").elements().next().at("/boundary/max").asInt());
+		operands = Lists.newArrayList(res.at("/query/operands").elements());
+		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
+		assertEquals("der",					operands.get(0).at("/wrap/key").asText());
+		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
+		assertEquals("korap:token",			operands.get(1).at("/@type").asText());
+		assertEquals("Mann",				operands.get(1).at("/wrap/key").asText());
+		assertEquals("lemma",				operands.get(1).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(1).at("/wrap/match").asText());
+
+		query = "[base=der][][]?[base=Mann]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence",	res.at("/query/operation").asText());
+		assertEquals("true",				res.at("/query/inOrder").asText());
+		assertEquals("korap:distance",		res.at("/query/distances").elements().next().at("/@type").asText());
+		assertEquals("w",					res.at("/query/distances").elements().next().at("/key").asText());
+		assertEquals("korap:boundary",		res.at("/query/distances").elements().next().at("/boundary/@type").asText());
+		assertEquals(2,						res.at("/query/distances").elements().next().at("/boundary/min").asInt());
+		assertEquals(3,						res.at("/query/distances").elements().next().at("/boundary/max").asInt());
+		operands = Lists.newArrayList(res.at("/query/operands").elements());
+		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
+		assertEquals("der",					operands.get(0).at("/wrap/key").asText());
+		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
+		assertEquals("korap:token",			operands.get(1).at("/@type").asText());
+		assertEquals("Mann",				operands.get(1).at("/wrap/key").asText());
+		assertEquals("lemma",				operands.get(1).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(1).at("/wrap/match").asText());
+
+		query = "[base=der][]+[base=Mann]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence",	res.at("/query/operation").asText());
+		assertEquals("true",				res.at("/query/inOrder").asText());
+		assertEquals("korap:distance",		res.at("/query/distances").elements().next().at("/@type").asText());
+		assertEquals("w",					res.at("/query/distances").elements().next().at("/key").asText());
+		assertEquals("korap:boundary",		res.at("/query/distances").elements().next().at("/boundary/@type").asText());
+		assertEquals(2,						res.at("/query/distances").elements().next().at("/boundary/min").asInt());
+		assertEquals(true,					res.at("/query/distances").elements().next().at("/boundary/max").isMissingNode());
+		operands = Lists.newArrayList(res.at("/query/operands").elements());
+		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
+		assertEquals("der",					operands.get(0).at("/wrap/key").asText());
+		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
+		assertEquals("korap:token",			operands.get(1).at("/@type").asText());
+		assertEquals("Mann",				operands.get(1).at("/wrap/key").asText());
+		assertEquals("lemma",				operands.get(1).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(1).at("/wrap/match").asText());
+
+		query = "[base=der][]*[base=Mann]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence",	res.at("/query/operation").asText());
+		assertEquals("true",				res.at("/query/inOrder").asText());
+		assertEquals("korap:distance",		res.at("/query/distances").elements().next().at("/@type").asText());
+		assertEquals("w",					res.at("/query/distances").elements().next().at("/key").asText());
+		assertEquals("korap:boundary",		res.at("/query/distances").elements().next().at("/boundary/@type").asText());
+		assertEquals(1,						res.at("/query/distances").elements().next().at("/boundary/min").asInt());
+		assertEquals(true,					res.at("/query/distances").elements().next().at("/boundary/max").isMissingNode());
+
+		query = "[base=der][]{2,5}[base=Mann][]?[][base=Frau]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence",	res.at("/query/operation").asText());
+		assertEquals("true",				res.at("/query/inOrder").asText());
+		assertEquals("korap:distance",		res.at("/query/distances").elements().next().at("/@type").asText());
+		assertEquals("w",					res.at("/query/distances").elements().next().at("/key").asText());
+		assertEquals("korap:boundary",		res.at("/query/distances").elements().next().at("/boundary/@type").asText());
+		assertEquals(3,						res.at("/query/distances").elements().next().at("/boundary/min").asInt());
+		assertEquals(6,						res.at("/query/distances").elements().next().at("/boundary/max").asInt());
+		operands = Lists.newArrayList(res.at("/query/operands").elements());
+		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
+		assertEquals("der",					operands.get(0).at("/wrap/key").asText());
+		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
+		assertEquals("korap:group",			operands.get(1).at("/@type").asText());
+		assertEquals("operation:sequence",	operands.get(1).at("/operation").asText());
+		assertEquals("korap:distance",		operands.get(1).get("distances").elements().next().at("/@type").asText());
+		assertEquals("w",					operands.get(1).get("distances").elements().next().at("/key").asText());
+		assertEquals("korap:boundary",		operands.get(1).get("distances").elements().next().at("/boundary/@type").asText());
+		assertEquals(2,						operands.get(1).get("distances").elements().next().at("/boundary/min").asInt());
+		assertEquals(3,						operands.get(1).get("distances").elements().next().at("/boundary/max").asInt());
+		operands = Lists.newArrayList(operands.get(1).get("operands").elements());
+		assertEquals("Mann",				operands.get(0).at("/wrap/key").asText());
+		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
+		assertEquals("Frau",				operands.get(1).at("/wrap/key").asText());
+		assertEquals("lemma",				operands.get(1).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(1).at("/wrap/match").asText());
+
 		query = "[base=geht][base=der][]*contains(<s>,<np>)";
-		expected = 
-			"{@type=korap:group, operation=operation:sequence, operands=[" +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=geht, match=match:eq}}," +
-				"{@type=korap:group, operation=operation:sequence, " +
-				"operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-					  "{@type=korap:span, key=s}," +
-					  "{@type=korap:span, key=np}" +
-					"], frame=frame:contains}" +
-				"], inOrder=true, distances=[" +
-					"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=1}, min=1}" +
-				"]}" +
-			"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence",	res.at("/query/operation").asText());
+		assertEquals(true,					res.at("/query/inOrder").isMissingNode());
+		assertEquals(true,					res.at("/query/distances").isMissingNode());
+		operands = Lists.newArrayList(res.at("/query/operands").elements());
+		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
+		assertEquals("geht",				operands.get(0).at("/wrap/key").asText());
+		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
+		assertEquals("korap:group",			operands.get(1).at("/@type").asText());
+		assertEquals("operation:sequence",	operands.get(1).at("/operation").asText());
+		assertEquals("korap:distance",		operands.get(1).get("distances").elements().next().at("/@type").asText());
+		assertEquals("w",					operands.get(1).get("distances").elements().next().at("/key").asText());
+		assertEquals("korap:boundary",		operands.get(1).get("distances").elements().next().at("/boundary/@type").asText());
+		assertEquals(1,						operands.get(1).get("distances").elements().next().at("/boundary/min").asInt());
+		assertEquals(true,					operands.get(1).get("distances").elements().next().at("/boundary/max").isMissingNode());
+		operands = Lists.newArrayList(operands.get(1).get("operands").elements());
+		assertEquals("der",					operands.get(0).at("/wrap/key").asText());
+		assertEquals("lemma",				operands.get(0).at("/wrap/layer").asText());
+		assertEquals("match:eq",			operands.get(0).at("/wrap/match").asText());
+		assertEquals("korap:group",			operands.get(1).at("/@type").asText());
+		assertEquals("operation:position",	operands.get(1).at("/operation").asText());
 	}
 
 	@Test
-	public void testDistancesWithClass() throws QueryException {
-		query = "[base=der]{1:[]}[base=Mann]";
-		expected = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-						"{@type=korap:token}" +
-					"]}," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-				"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
+	public void testDistancesWithClass() throws QueryException, JsonProcessingException, IOException {
+		query = "[base=der]{[]}[base=Mann]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence",	res.at("/query/operation").asText());
+		assertEquals(true,					res.at("/query/inOrder").isMissingNode());
+		assertEquals(true,					res.at("/query/distances").isMissingNode());
+		operands = Lists.newArrayList(res.at("/query/operands").elements());
+		assertEquals("der",					operands.get(0).at("/wrap/key").asText());
+		assertEquals("Mann",				operands.get(2).at("/wrap/key").asText());
+		assertEquals("korap:group",			operands.get(1).at("/@type").asText());
+		assertEquals("operation:class",		operands.get(1).at("/operation").asText());
+		assertEquals(1,						operands.get(1).at("/classOut").asInt());
+		operands = Lists.newArrayList(operands.get(1).at("/operands").elements());
+		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
+		assertEquals(true,					operands.get(0).at("/wrap").isMissingNode());
+
+		query = "[base=der]{2:[]}[base=Mann]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		operands = Lists.newArrayList(res.at("/query/operands").elements());
+		assertEquals("operation:class",		operands.get(1).at("/operation").asText());
+		assertEquals(2,						operands.get(1).at("/classOut").asInt());
+
 		query = "{1:[]}[base=der][base=Mann]";
-		expected = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-						"{@type=korap:token}" +
-					"]}," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-				"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		operands = Lists.newArrayList(res.at("/query/operands").elements());
+		assertEquals("operation:class",		operands.get(0).at("/operation").asText());
+		assertEquals(1,						operands.get(0).at("/classOut").asInt());
+
+		query = "{1:{2:der} {3:[]} Mann}";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		operands = Lists.newArrayList(res.at("/query/operands").elements());
+		assertEquals(1,	operands.size());  // class operation may only have one operand (the sequence)
+		operands = Lists.newArrayList(operands.get(0).at("/operands").elements());
+		assertEquals(3,	operands.size());  // the sequence has three operands ("der", "[]" and "Mann")
+
 	}
-	
+
 	@Test
-	public void testLeadingTrailingEmptyTokens() throws QueryException {
-		// startswith(<s>, [][base=Mann]
-		String et1 = 
-			"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +	
-				"{@type=korap:span, key=s}," +
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token}," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-				"]}" +
-			"], frame=frame:startswith}";
-		ppt = new PoliqarpPlusTree("startswith(<s>, [][base=Mann])");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(et1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
+	public void testLeadingTrailingEmptyTokens() throws QueryException, JsonProcessingException, IOException {
 		query = "[][base=Mann]";
-		expected = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token}," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-				"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "{[]}[base=Mann]";
-		expected = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-						"{@type=korap:token}" +
-					"]}," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-				"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		operands = Lists.newArrayList(res.at("/query/operands").elements());
+		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
+		assertEquals(true,					operands.get(0).at("/key").isMissingNode());
+
 		query = "[][][base=Mann]";
-		expected = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:group, operation=operation:repetition, operands=[" +
-						"{@type=korap:token}" +
-					"], boundary={@type=korap:boundary, min=2, max=2}, min=2, max=2}," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-				"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "[][]*[base=Mann]";
-		expected = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:group, operation=operation:repetition, operands=[" +
-						"{@type=korap:token}" +
-					"], boundary={@type=korap:boundary, min=1}, min=1}," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-				"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "[][]*[base=Mann][][]";
-		expected = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:group, operation=operation:repetition, operands=[" +
-						"{@type=korap:token}" +
-					"], boundary={@type=korap:boundary, min=1}, min=1}," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:repetition, operands=[" +
-						"{@type=korap:token}" +
-					"], boundary={@type=korap:boundary, min=2, max=2}, min=2, max=2}" +
-				"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "[][]*contains(<s>, <np>)[][]";
-		expected = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:group, operation=operation:repetition, operands=[" +
-						"{@type=korap:token}" +
-					"], boundary={@type=korap:boundary, min=1}, min=1}," +
-					"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-					  "{@type=korap:span, key=s}," +
-					  "{@type=korap:span, key=np}" +
-					"], frame=frame:contains}," +
-					"{@type=korap:group, operation=operation:repetition, operands=[" +
-						"{@type=korap:token}" +
-					"], boundary={@type=korap:boundary, min=2, max=2}, min=2, max=2}" +
-				"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "[base=Mann][]{2}";
-		expected = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:repetition, operands=[" +
-						"{@type=korap:token}" +
-					"], boundary={@type=korap:boundary, min=2, max=2}, min=2, max=2}" +
-				"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-	}
-	
-	@Test
-	public void testCoordinatedFields() throws QueryException {
-		// [base=Mann&(cas=N|cas=A)]
-		String cof1 = 
-			"{@type=korap:token, wrap=" +
-				"{@type=korap:termGroup, relation=relation:and, operands=[" +
-					"{@type=korap:term, layer=lemma, key=Mann, match=match:eq}," +
-					"{@type=korap:termGroup, relation=relation:or, operands=[" +
-						"{@type=korap:term, layer=cas, key=N, match=match:eq}," +
-						"{@type=korap:term, layer=cas, key=A, match=match:eq}" +
-					"]}" +
-				"]}" +
-			"}";
-		ppt = new PoliqarpPlusTree("[base=Mann&(cas=N|cas=A)]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(cof1.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		operands = Lists.newArrayList(res.at("/query/operands").elements());
+		assertEquals("korap:group",			operands.get(0).at("/@type").asText());
+		assertEquals("operation:repetition",operands.get(0).at("/operation").asText());
+		assertEquals(2,						operands.get(0).at("/boundary/min").asInt());
+		assertEquals(2,						operands.get(0).at("/boundary/max").asInt());
+		operands = Lists.newArrayList(operands.get(0).at("/operands").elements());
+		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
+		assertEquals(true,					operands.get(0).at("/key").isMissingNode());
 
+		query = "startswith(<s>, [][base=Mann])";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		operands = Lists.newArrayList(res.at("/query/operands"));
+		operands = Lists.newArrayList(operands.get(1).at("/operands"));
+		assertEquals("korap:token",			operands.get(0).at("/@type").asText());
+		assertEquals(true,					operands.get(0).at("/key").isMissingNode());
+	}
 
-		assertEquals(
-		    new PoliqarpPlusTree(" [ base=Mann & ( cas=N | cas=A)] ").getRequestMap().get("query").toString(),
-		    new PoliqarpPlusTree("[base=Mann &(cas=N|cas=A)]").getRequestMap().get("query").toString()
-	        );
-		
-		// [base=Mann&cas=N&gen=m]
-		String cof2 = 
-			"{@type=korap:token, wrap=" +
-				"{@type=korap:termGroup, relation=relation:and, operands=[" +
-					"{@type=korap:term, layer=lemma, key=Mann, match=match:eq}," +
-					"{@type=korap:termGroup, relation=relation:and, operands=[" +
-						"{@type=korap:term, layer=cas, key=N, match=match:eq}," +
-						"{@type=korap:term, layer=gen, key=m, match=match:eq}" +
-					"]}" +
-				"]}" +
-			"}";
-		ppt = new PoliqarpPlusTree("[base=Mann&cas=N&gen=m]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(cof2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-	}
-	
 	@Test
-	public void testOccurrence() throws QueryException {
-		// [base=foo]*
-		String occ1 = "{@type=korap:group, operation=operation:repetition, operands=[" +
-					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-					  "], boundary={@type=korap:boundary, min=0}, min=0}"; 
-		ppt = new PoliqarpPlusTree("[base=foo]*");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(occ1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=foo]*[base=bar]
-		String occ2 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:group, operation=operation:repetition, operands=[" +
-					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-					"], boundary={@type=korap:boundary, min=0}, min=0 }," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=bar, match=match:eq}}" +
-				"]}"; 
-		ppt = new PoliqarpPlusTree("[base=foo]*[base=bar]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(occ2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=bar][base=foo]*
-		String occ3 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=bar, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:repetition, operands=[" +
-					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-					"], boundary={@type=korap:boundary, min=0}, min=0 }" +
-				"]}"; 
-		ppt = new PoliqarpPlusTree("[base=bar][base=foo]*");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(occ3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// ([base=bar][base=foo])*
-		String occ4 = 
-				"{@type=korap:group, operation=operation:repetition, operands=[" +	
-					"{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=bar, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-					"]}" +
-				"], boundary={@type=korap:boundary, min=0}, min=0}" ;
-		ppt = new PoliqarpPlusTree("([base=bar][base=foo])*");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(occ4.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// <s>([base=bar][base=foo])*
-		String occ5 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:span, key=s}," +
-					"{@type=korap:group, operation=operation:repetition, operands=[" +	
-						"{@type=korap:group, operation=operation:sequence, operands=[" +
-							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=bar, match=match:eq}}," +
-							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-						"]}" +
-					"], boundary={@type=korap:boundary, min=0}, min=0 }" +
-				"]}" ;
-		ppt = new PoliqarpPlusTree("<s>([base=bar][base=foo])*");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(occ5.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// <s><np>([base=bar][base=foo])*
-		String occ6 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:span, key=s}," +
-					"{@type=korap:span, key=np}," +
-					"{@type=korap:group, operation=operation:repetition, operands=[" +	
-						"{@type=korap:group, operation=operation:sequence, operands=[" +
-							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=bar, match=match:eq}}," +
-							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-						"]}" +
-					"], boundary={@type=korap:boundary, min=0}, min=0 }" +
-				"]}" ;
-		ppt = new PoliqarpPlusTree("<s><np>([base=bar][base=foo])*");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(occ6.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// <s><np>([base=bar][base=foo])*[p=NN]
-		// comment: embedded sequence shouldn't really be here, but does not really hurt, either. (?)
-		// really hard to get this behaviour out of the PQPlus grammar...
-		String occ7 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:span, key=s}," +
-					"{@type=korap:span, key=np}," +
-					"{@type=korap:group, operation=operation:repetition, operands=[" +	
-						"{@type=korap:group, operation=operation:sequence, operands=[" +
-							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=bar, match=match:eq}}," +
-							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-						"]}" +
-					"], boundary={@type=korap:boundary, min=0}, min=0 }," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=p, key=NN, match=match:eq}}" +
-				"]}" ;
-		ppt = new PoliqarpPlusTree("<s><np>([base=bar][base=foo])*[p=NN]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(occ7.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// ([base=bar][base=foo])*[p=NN]
-		String occ8 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:group, operation=operation:repetition, operands=[" +	
-						"{@type=korap:group, operation=operation:sequence, operands=[" +
-							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=bar, match=match:eq}}," +
-							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-						"]}" +
-					"], boundary={@type=korap:boundary, min=0}, min=0 }," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=p, key=NN, match=match:eq}}" +
-				"]}" ;
-		ppt = new PoliqarpPlusTree("([base=bar][base=foo])*[p=NN]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(occ8.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=foo]+
-		String occ9 = "{@type=korap:group, operation=operation:repetition, operands=[" +
-					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-					  "], boundary={@type=korap:boundary, min=1}, min=1}"; 
-		ppt = new PoliqarpPlusTree("[base=foo]+");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(occ9.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=foo]?
-		String occ10 = "{@type=korap:group, operation=operation:repetition, operands=[" +
-					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-					  "], boundary={@type=korap:boundary, min=0, max=1}, min=0, max=1}"; 
-		ppt = new PoliqarpPlusTree("[base=foo]?");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(occ10.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=foo]{2,5}
-		String occ11 = "{@type=korap:group, operation=operation:repetition, operands=[" +
-					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-					  "], boundary={@type=korap:boundary, min=2, max=5}, min=2, max=5}"; 
-		ppt = new PoliqarpPlusTree("[base=foo]{2,5}");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(occ11.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=foo]{2}
-		String occ12 = "{@type=korap:group, operation=operation:repetition, operands=[" +
-					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-					  "], boundary={@type=korap:boundary, min=2, max=2}, min=2, max=2}"; 
-		ppt = new PoliqarpPlusTree("[base=foo]{2}");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(occ12.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=foo]{2}
-		String occ13 = "{@type=korap:group, operation=operation:repetition, operands=[" +
-					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-					  "], boundary={@type=korap:boundary, min=2}, min=2}"; 
-		ppt = new PoliqarpPlusTree("[base=foo]{2,}");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(occ13.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=foo]{2}
-		String occ14 = "{@type=korap:group, operation=operation:repetition, operands=[" +
-					     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=foo, match=match:eq}}" +
-					  "], boundary={@type=korap:boundary, min=0, max=2}, min=0, max=2}"; 
-		ppt = new PoliqarpPlusTree("[base=foo]{,2}");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(occ14.replaceAll(" ", ""), map.replaceAll(" ", ""));
-	}
-	
+	public void testRepetition() throws QueryException, JsonProcessingException, IOException {
+		query = "der{3}";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 			res.at("/query/@type").asText());
+		assertEquals("operation:repetition", 	res.at("/query/operation").asText());
+		assertEquals("der", 					res.at("/query/operands/0/wrap/key").asText());
+		assertEquals(3, 						res.at("/query/boundary/min").asInt());
+		assertEquals(3, 						res.at("/query/boundary/max").asInt());
+
+		query = "der{,3}";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(0,			res.at("/query/boundary/min").asInt());
+		assertEquals(3, 		res.at("/query/boundary/max").asInt());
+
+		query = "der{3,}";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(3, 		res.at("/query/boundary/min").asInt());
+		assertEquals(true, 		res.at("/query/boundary/max").isMissingNode());
+
+		query = "der{3,7}";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(3, 		res.at("/query/boundary/min").asInt());
+		assertEquals(7, 		res.at("/query/boundary/max").asInt());
+
+		query = "der*";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(0, 		res.at("/query/boundary/min").asInt());
+		assertEquals(true, 		res.at("/query/boundary/max").isMissingNode());
+
+		query = "der+";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(1, 		res.at("/query/boundary/min").asInt());
+		assertEquals(true, 		res.at("/query/boundary/max").isMissingNode());
+	};
+
 	@Test
-	public void testTokenSequence() throws QueryException {
-		// [base=Mann][orth=Frau]
-		String seq1 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}, " +
-				"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}" +
-				"]}";
-		assertTrue(equalsQueryContent(seq1, "[base=Mann][orth=Frau]"));
-		
-		// [base=Mann][orth=Frau][p=NN]
-		String seq2 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}, " +
-				"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}, " +
-				"{@type=korap:token, wrap={@type=korap:term, layer=p, key=NN, match=match:eq}}" +
-				"]}";
-		assertTrue(equalsQueryContent(seq2, "[base=Mann][orth=Frau][p=NN]"));
-	}
-	
+	public void testGroupRepetition() throws QueryException, JsonProcessingException, IOException {
+		query = "contains(<s>, (der){3})";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:position", 	res.at("/query/operation").asText());
+		assertEquals("korap:span", 			res.at("/query/operands/0/@type").asText());
+		assertEquals("s", 					res.at("/query/operands/0/key").asText());
+		assertEquals("korap:group", 		res.at("/query/operands/1/@type").asText());
+		assertEquals("operation:repetition",res.at("/query/operands/1/operation").asText());
+
+		query = "contains(<s>, (der){3,})";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(3, 			res.at("/query/operands/1/boundary/min").asInt());
+		assertEquals(true, 			res.at("/query/operands/1/boundary/max").isMissingNode());
+
+		query = "contains(<s>, (der){,3})";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(0, 			res.at("/query/operands/1/boundary/min").asInt());
+		assertEquals(3, 			res.at("/query/operands/1/boundary/max").asInt());
+
+		query = "contains(<s>, (der){3,7})";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(3, 			res.at("/query/operands/1/boundary/min").asInt());
+		assertEquals(7, 			res.at("/query/operands/1/boundary/max").asInt());
+
+		query = "contains(<s>, (der)*)";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(0, 			res.at("/query/operands/1/boundary/min").asInt());
+		assertEquals(true, 			res.at("/query/operands/1/boundary/max").isMissingNode());
+	};
+
 	@Test
-	public void testDisjSegments() throws QueryException {
-		// ([base=der]|[base=das])[base=Schild]
-		String disj1 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:group, operation=operation:or, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=das, match=match:eq}}" +
-					"]}," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Schild, match=match:eq}}" +
-				"]}";
-		ppt = new PoliqarpPlusTree("([base=der]|[base=das])[base=Schild]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(disj1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=Schild]([base=der]|[base=das])
-		String disj2 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Schild, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:or, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=das, match=match:eq}}" +
-					"]}" +
-				"]}";
-		ppt = new PoliqarpPlusTree("[base=Schild]([base=der]|[base=das])");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(disj2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// "([orth=der][base=katze])|([orth=eine][base=baum])"
-		String disj3 = 
-				"{@type=korap:group, operation=operation:or, operands=[" +
-					"{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=katze, match=match:eq}}" +
-					"]}," +
-					"{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=eine, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=baum, match=match:eq}}" +
-					"]}" +
-				"]}";
-		ppt = new PoliqarpPlusTree("([orth=der][base=katze])|([orth=eine][base=baum])");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(disj3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// "[orth=der][base=katze]|[orth=eine][base=baum]"
-		String disj4 = 
-				"{@type=korap:group, operation=operation:or, operands=[" +
-					"{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=katze, match=match:eq}}" +
-					"]}," +
-					"{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=eine, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=baum, match=match:eq}}" +
-					"]}" +
-				"]}";
-		ppt = new PoliqarpPlusTree("[orth=der][base=katze]|[orth=eine][base=baum]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(disj4.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		PoliqarpPlusTree ppt1 = new PoliqarpPlusTree("[orth=der][base=katze]|[orth=eine][base=baum]");
-		PoliqarpPlusTree ppt2 = new PoliqarpPlusTree("([orth=der][base=katze])|([orth=eine][base=baum])");
-		assertEquals(ppt1.getRequestMap().toString(), ppt2.getRequestMap().toString());
-		
-		// "[orth=der][base=katze]|[orth=der][base=hund]|[orth=der][base=baum]"
-		String disj5 = 
-				"{@type=korap:group, operation=operation:or, operands=[" +
-					"{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=katze, match=match:eq}}" +
-					"]}," +
-					"{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=hund, match=match:eq}}" +
-					"]}," +
-					"{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=baum, match=match:eq}}" +
-					"]}" +
-				"]}";
-		ppt = new PoliqarpPlusTree("[orth=der][base=katze]|[orth=der][base=hund]|[orth=der][base=baum]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(disj5.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [orth=der]([base=katze]|[base=hund]|[base=baum])
-		String disj6 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:or, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=katze, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=hund, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=baum, match=match:eq}}" +
-					"]}" +
-				"]}";
-		ppt = new PoliqarpPlusTree("[orth=der]([base=katze]|[base=hund]|[base=baum])");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(disj6.replaceAll(" ", ""), map.replaceAll(" ", ""));
-	}
-	
+	public void testPositions() throws QueryException, JsonProcessingException, IOException {
+		query = "contains(<s>, der)";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:position", 	res.at("/query/operation").asText());
+		assertEquals("frames:contains",		res.at("/query/frames/0").asText());
+		assertEquals(true, 					res.at("/query/frames/1").isMissingNode());
+		assertEquals("korap:span", 			res.at("/query/operands/0/@type").asText());
+		assertEquals("s", 					res.at("/query/operands/0/key").asText());
+		assertEquals("korap:token", 		res.at("/query/operands/1/@type").asText());
+
+		query = "contains(<s>,<np>)";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("s", 		res.at("/query/operands/0/key").asText());
+		assertEquals("np", 		res.at("/query/operands/1/key").asText());
+
+		query = "contains(<s>,[orth=der][orth=Mann])";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 			res.at("/query/@type").asText());
+		assertEquals("operation:position", 		res.at("/query/operation").asText());
+		assertEquals("frames:contains", 		res.at("/query/frames/0").asText());
+		assertEquals("s", 						res.at("/query/operands/0/key").asText());
+		assertEquals("korap:group", 			res.at("/query/operands/1/@type").asText());
+		assertEquals("operation:sequence", 		res.at("/query/operands/1/operation").asText());
+		assertEquals("der", 					res.at("/query/operands/1/operands/0/wrap/key").asText());
+		assertEquals("Mann", 					res.at("/query/operands/1/operands/1/wrap/key").asText());
+
+		query = "contains(<s>,[orth=der][orth=Mann]*)";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 			res.at("/query/@type").asText());
+		assertEquals("operation:position", 		res.at("/query/operation").asText());
+		assertEquals("frames:contains", 		res.at("/query/frames/0").asText());
+		assertEquals("s", 						res.at("/query/operands/0/key").asText());
+		assertEquals("korap:group", 			res.at("/query/operands/1/@type").asText());
+		assertEquals("operation:sequence", 		res.at("/query/operands/1/operation").asText());
+		assertEquals("der", 					res.at("/query/operands/1/operands/0/wrap/key").asText());
+		assertEquals("operation:repetition", 	res.at("/query/operands/1/operands/1/operation").asText());
+		assertEquals(0, 						res.at("/query/operands/1/operands/1/boundary/min").asInt());
+		assertEquals(true, 						res.at("/query/operands/1/operands/1/boundary/max").isMissingNode());
+		assertEquals("Mann", 					res.at("/query/operands/1/operands/1/operands/0/wrap/key").asText());
+
+		query = "contains(<s>,startswith(<np>,<pp>))";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("s", 						res.at("/query/operands/0/key").asText());
+		assertEquals("korap:group", 			res.at("/query/operands/1/@type").asText());
+		assertEquals("frames:startswith", 		res.at("/query/operands/1/frames/0").asText());
+		assertEquals("operation:position", 		res.at("/query/operands/1/operation").asText());
+		assertEquals("np", 						res.at("/query/operands/1/operands/0/key").asText());
+		assertEquals("pp", 						res.at("/query/operands/1/operands/1/key").asText());
+
+		query = "[base=Auto]overlaps(<s>, der)";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 			res.at("/query/@type").asText());
+		assertEquals("operation:sequence", 		res.at("/query/operation").asText());
+		assertEquals("korap:group", 			res.at("/query/operands/1/@type").asText());
+		assertEquals("operation:position", 		res.at("/query/operands/1/operation").asText());
+		assertEquals("frames:overlapsLeft", 	res.at("/query/operands/1/frames/0").asText());
+		assertEquals("frames:overlapsRight", 	res.at("/query/operands/1/frames/1").asText());
+		assertEquals("korap:span", 				res.at("/query/operands/1/operands/0/@type").asText());
+		assertEquals("s", 						res.at("/query/operands/1/operands/0/key").asText());
+		assertEquals("korap:token", 			res.at("/query/operands/1/operands/1/@type").asText());
+
+		query = "[base=Auto]            overlaps(<s>, der)";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 			res.at("/query/@type").asText());
+		assertEquals("operation:sequence", 		res.at("/query/operation").asText());
+		assertEquals("korap:group", 			res.at("/query/operands/1/@type").asText());
+		assertEquals("operation:position", 		res.at("/query/operands/1/operation").asText());
+		assertEquals("frames:overlapsLeft", 	res.at("/query/operands/1/frames/0").asText());
+		assertEquals("frames:overlapsRight", 	res.at("/query/operands/1/frames/1").asText());
+		assertEquals("korap:span", 				res.at("/query/operands/1/operands/0/@type").asText());
+		assertEquals("s", 						res.at("/query/operands/1/operands/0/key").asText());
+		assertEquals("korap:token", 			res.at("/query/operands/1/operands/1/@type").asText());
+	};
+
 	@Test
-	public void testTokenElemSequence() throws QueryException {
-		// [base=Mann]<vp>
-		String seq1 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}, " +
-				"{@type=korap:span, key=vp}" +
-				"]}";
-		assertTrue(equalsQueryContent(seq1, "[base=Mann]<vp>"));
-		
-		// <vp>[base=Mann]
-		String seq2 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-				"{@type=korap:span, key=vp}, "+
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}} " +
-				"]}";
-		assertTrue(equalsQueryContent(seq2, "<vp>[base=Mann]"));
-		
-		// <vp>[base=Mann]<pp>
-		String seq3 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-				"{@type=korap:span, key=vp}, "+
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}, " +
-				"{@type=korap:span, key=pp} "+
-				"]}";
-		assertTrue(equalsQueryContent(seq3, "<vp>[base=Mann]<pp>"));
+	public void testCoordinatedFields() throws QueryException, JsonProcessingException, IOException {
+		query = "[base=Mann&(cas=N|cas=A)]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("relation:and", 		res.at("/query/wrap/relation").asText());
+		assertEquals("Mann", 				res.at("/query/wrap/operands/0/key").asText());
+		assertEquals("lemma", 				res.at("/query/wrap/operands/0/layer").asText());
+		assertEquals("korap:termGroup", 	res.at("/query/wrap/operands/1/@type").asText());
+		assertEquals("relation:or", 		res.at("/query/wrap/operands/1/relation").asText());
+		assertEquals("N", 					res.at("/query/wrap/operands/1/operands/0/key").asText());
+		assertEquals("cas", 				res.at("/query/wrap/operands/1/operands/0/layer").asText());
+		assertEquals("A", 					res.at("/query/wrap/operands/1/operands/1/key").asText());
+		assertEquals("cas", 				res.at("/query/wrap/operands/1/operands/1/layer").asText());
+
+		query = "[base=Mann&cas=N&gen=m]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("relation:and", 		res.at("/query/wrap/relation").asText());
+		assertEquals("Mann", 				res.at("/query/wrap/operands/0/key").asText());
+		assertEquals("lemma", 				res.at("/query/wrap/operands/0/layer").asText());
+		assertEquals("korap:termGroup", 	res.at("/query/wrap/operands/1/@type").asText());
+		assertEquals("relation:and", 		res.at("/query/wrap/operands/1/relation").asText());
+		assertEquals("N", 					res.at("/query/wrap/operands/1/operands/0/key").asText());
+		assertEquals("cas", 				res.at("/query/wrap/operands/1/operands/0/layer").asText());
+		assertEquals("m", 					res.at("/query/wrap/operands/1/operands/1/key").asText());
+		assertEquals("gen", 				res.at("/query/wrap/operands/1/operands/1/layer").asText());
 	}
-	
+
 	@Test
-	public void testElemSequence() throws QueryException {
-		// <np><vp>
-		String seq1 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-				"{@type=korap:span, key=np}," +
-				"{@type=korap:span, key=vp}" +
-				"]}";
-		assertTrue(equalsQueryContent(seq1, "<np><vp>"));
-		
-		// <np><vp><pp>
-		String seq2 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-				"{@type=korap:span, key=np}," +
-				"{@type=korap:span, key=vp}," +
-				"{@type=korap:span, key=pp}" +
-				"]}";
-		assertTrue(equalsQueryContent(seq2, "<np><vp><pp>"));
+	public void testTokenSequence() throws QueryException, JsonProcessingException, IOException {
+		query = "[base=Mann][orth=Frau]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence", 	res.at("/query/operation").asText());
+		assertEquals("Mann", 				res.at("/query/operands/0/wrap/key").asText());
+		assertEquals("lemma", 				res.at("/query/operands/0/wrap/layer").asText());
+		assertEquals("Frau", 				res.at("/query/operands/1/wrap/key").asText());
+		assertEquals("orth", 				res.at("/query/operands/1/wrap/layer").asText());
+
+		query = "[base=Mann][orth=Frau][p=NN]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("NN", 					res.at("/query/operands/2/wrap/key").asText());
+		assertEquals("p", 					res.at("/query/operands/2/wrap/layer").asText());
+
+		query = "[base=Mann][orth=Frau][p=NN][foo=bar]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("bar", 				res.at("/query/operands/3/wrap/key").asText());
+		assertEquals("foo", 				res.at("/query/operands/3/wrap/layer").asText());
 	}
-	
+
+	@Test
+	public void testDisjSegments() throws QueryException, JsonProcessingException, IOException {
+		query = "[base=der]|[base=das]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:or", 		res.at("/query/operation").asText());
+		assertEquals("korap:token", 		res.at("/query/operands/0/@type").asText());
+		assertEquals("korap:token", 		res.at("/query/operands/1/@type").asText());
+		assertEquals("der", 				res.at("/query/operands/0/wrap/key").asText());
+		assertEquals("lemma", 				res.at("/query/operands/0/wrap/layer").asText());
+		assertEquals("das", 				res.at("/query/operands/1/wrap/key").asText());
+		assertEquals("lemma", 				res.at("/query/operands/1/wrap/layer").asText());
+
+		query = "([base=der]|[base=das])[base=Schild]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence", 	res.at("/query/operation").asText());
+		assertEquals("Schild", 				res.at("/query/operands/1/wrap/key").asText());
+		assertEquals("korap:group", 		res.at("/query/operands/0/@type").asText());
+		assertEquals("operation:or", 		res.at("/query/operands/0/operation").asText());
+
+		query = "[base=Schild]([base=der]|[base=das])";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("Schild", 				res.at("/query/operands/0/wrap/key").asText());
+		assertEquals("korap:group", 		res.at("/query/operands/1/@type").asText());
+		assertEquals("operation:or", 		res.at("/query/operands/1/operation").asText());
+
+		query = "([orth=der][base=katze])|([orth=eine][base=baum])";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:or", 		res.at("/query/operation").asText());
+		assertEquals("korap:group", 		res.at("/query/operands/0/@type").asText());
+		assertEquals("operation:sequence", 	res.at("/query/operands/0/operation").asText());
+		assertEquals("korap:token", 		res.at("/query/operands/0/operands/0/@type").asText());
+		assertEquals("der", 				res.at("/query/operands/0/operands/0/wrap/key").asText());
+		assertEquals("katze",				res.at("/query/operands/0/operands/1/wrap/key").asText());
+		assertEquals("eine", 				res.at("/query/operands/1/operands/0/wrap/key").asText());
+		assertEquals("baum", 				res.at("/query/operands/1/operands/1/wrap/key").asText());
+
+		query = "[orth=der][base=katze]|[orth=eine][base=baum]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:or", 		res.at("/query/operation").asText());
+		assertEquals("korap:group", 		res.at("/query/operands/0/@type").asText());
+		assertEquals("operation:sequence", 	res.at("/query/operands/0/operation").asText());
+		assertEquals("korap:token", 		res.at("/query/operands/0/operands/0/@type").asText());
+		assertEquals("der", 				res.at("/query/operands/0/operands/0/wrap/key").asText());
+		assertEquals("katze", 				res.at("/query/operands/0/operands/1/wrap/key").asText());
+		assertEquals("eine", 				res.at("/query/operands/1/operands/0/wrap/key").asText());
+		assertEquals("baum", 				res.at("/query/operands/1/operands/1/wrap/key").asText());
+
+		query = "[orth=der]([base=katze]|[orth=eine])[base=baum]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence", 	res.at("/query/operation").asText());
+		assertEquals("korap:group", 		res.at("/query/operands/1/@type").asText());
+		assertEquals("operation:or", 		res.at("/query/operands/1/operation").asText());
+		assertEquals("korap:token", 		res.at("/query/operands/0/@type").asText());
+		assertEquals("korap:token", 		res.at("/query/operands/2/@type").asText());
+		assertEquals("der", 				res.at("/query/operands/0/wrap/key").asText());
+		assertEquals("katze", 				res.at("/query/operands/1/operands/0/wrap/key").asText());
+		assertEquals("eine", 				res.at("/query/operands/1/operands/1/wrap/key").asText());
+		assertEquals("baum", 				res.at("/query/operands/2/wrap/key").asText());
+
+		query = "[orth=der][base=katze]|[orth=der][base=hund]|[orth=der][base=baum]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("der", 				res.at("/query/operands/2/operands/0/wrap/key").asText());
+		assertEquals("baum", 				res.at("/query/operands/2/operands/1/wrap/key").asText());
+
+		query = "[orth=der]([base=katze]|[base=hund]|[base=baum])";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence", 	res.at("/query/operation").asText());
+		assertEquals("korap:group", 		res.at("/query/operands/1/@type").asText());
+		assertEquals("operation:or", 		res.at("/query/operands/1/operation").asText());
+		assertEquals("korap:token", 		res.at("/query/operands/0/@type").asText());
+		assertEquals("korap:token", 		res.at("/query/operands/1/operands/0/@type").asText());
+		assertEquals("korap:token", 		res.at("/query/operands/1/operands/1/@type").asText());
+		assertEquals("korap:token", 		res.at("/query/operands/1/operands/2/@type").asText());
+		assertEquals("katze", 				res.at("/query/operands/1/operands/0/wrap/key").asText());
+		assertEquals("hund", 				res.at("/query/operands/1/operands/1/wrap/key").asText());
+		assertEquals("baum", 				res.at("/query/operands/1/operands/2/wrap/key").asText());
+	}
+
+	@Test
+	public void testTokenSpanSequence() throws QueryException, JsonProcessingException, IOException {
+		query = "[base=Mann]<vp>";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence", 	res.at("/query/operation").asText());
+		assertEquals("korap:token", 		res.at("/query/operands/0/@type").asText());
+		assertEquals("Mann", 				res.at("/query/operands/0/wrap/key").asText());
+		assertEquals("korap:span", 			res.at("/query/operands/1/@type").asText());
+		assertEquals("vp", 					res.at("/query/operands/1/key").asText());
+
+		query = "<vp>[base=Mann]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence", 	res.at("/query/operation").asText());
+		assertEquals("korap:span", 			res.at("/query/operands/0/@type").asText());
+		assertEquals("vp", 					res.at("/query/operands/0/key").asText());
+		assertEquals("korap:token", 		res.at("/query/operands/1/@type").asText());
+		assertEquals("Mann", 				res.at("/query/operands/1/wrap/key").asText());
+
+		query = "<vp>[base=Mann]<pp>";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:span", 			res.at("/query/operands/2/@type").asText());
+		assertEquals("pp", 					res.at("/query/operands/2/key").asText());
+
+		query = "<vp>[base=Mann]<pp><np>";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("pp", 					res.at("/query/operands/2/key").asText());
+		assertEquals("np", 					res.at("/query/operands/3/key").asText());
+	}
+
 	@Test 
-	public void testClasses() throws QueryException {
-		String query;
-		// {[base=Mann]}
-		String cls1 = "{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-				"]}";
-		ppt = new PoliqarpPlusTree("{[base=Mann]}");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(cls1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// {[base=Mann][orth=Frau]}
-		query = "{[base=Mann][orth=Frau]}";
-		String cls2 = "{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-				 "{@type=korap:group, operation=operation:sequence, operands=[" +
-				  "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
-				  "{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}" +
-				 "]}" +
-				"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(cls2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [p=NN]{[base=Mann][orth=Frau]}
-		String cls3 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=p, key=NN, match=match:eq}}," +
-						"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-							"{@type=korap:group, operation=operation:sequence, operands=[" +
-								"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
-								"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}" +
-							"]}" +
-						"]}" +
-					  "]}";
-		ppt = new PoliqarpPlusTree("[p=NN]{[base=Mann][orth=Frau]}");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(cls3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// {[base=Mann][orth=Frau]}[p=NN]
-		String cls4 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-						   "{@type=korap:group, operation=operation:sequence, operands=[" +
-						     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
-						     "{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}" +
-						   "]}" +
-						"]}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=p, key=NN, match=match:eq}}" +
-					  "]}";
-		ppt = new PoliqarpPlusTree("{[base=Mann][orth=Frau]}[p=NN]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(cls4.replaceAll(" ", ""), map.replaceAll(" ", ""));
+	public void testClasses() throws QueryException, JsonProcessingException, IOException {
+		query = "{[base=Mann]}";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:class", 	res.at("/query/operation").asText());
+		assertEquals(1, 					res.at("/query/classOut").asInt());
+		assertEquals(true, 					res.at("/query/classIn").isMissingNode());
+		assertEquals("Mann", 				res.at("/query/operands/0/wrap/key").asText());
 
-		// {2:{1:[tt/p=ADJA]}[mate/p=NN]}"
-		String cls5 = "{@type=korap:group, operation=operation:class, class=2, classOut=2, operands=[" +
-						"{@type=korap:group, operation=operation:sequence, operands=[" +
-						   "{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-						     "{@type=korap:token, wrap={@type=korap:term, foundry=tt, layer=p, key=ADJA, match=match:eq}}" +
-						   "]}," +
-						   "{@type=korap:token, wrap={@type=korap:term, foundry=mate, layer=p, key=NN, match=match:eq}}" + 
-						"]}" +
-					  "]}";
-		ppt = new PoliqarpPlusTree("{2: {1:[tt/p=ADJA]}[mate/p=NN]}");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(cls5.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		query = "{[base=Mann][orth=Frau]}";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:class", 	res.at("/query/operation").asText());
+		assertEquals(1, 					res.at("/query/classOut").asInt());
+		assertEquals(true, 					res.at("/query/classIn").isMissingNode());
+		assertEquals("Mann", 				res.at("/query/operands/0/operands/0/wrap/key").asText());
+		assertEquals("Frau", 				res.at("/query/operands/0/operands/1/wrap/key").asText());
+
+		query = "[p=NN]{[base=Mann][orth=Frau]}";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence", 	res.at("/query/operation").asText());
+		assertEquals("korap:group", 		res.at("/query/operands/1/@type").asText());
+		assertEquals("operation:class", 	res.at("/query/operands/1/operation").asText());
+		assertEquals(1, 					res.at("/query/operands/1/classOut").asInt());
+		assertEquals(true, 					res.at("/query/operands/1/classIn").isMissingNode());
+		assertEquals("Mann", 				res.at("/query/operands/1/operands/0/operands/0/wrap/key").asText());
+		assertEquals("Frau", 				res.at("/query/operands/1/operands/0/operands/1/wrap/key").asText());
+
+		query = "{[base=Mann][orth=Frau]}[p=NN]";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence", 	res.at("/query/operation").asText());
+		assertEquals("korap:group", 		res.at("/query/operands/0/@type").asText());
+		assertEquals("operation:class", 	res.at("/query/operands/0/operation").asText());
+		assertEquals(1, 					res.at("/query/operands/0/classOut").asInt());
+		assertEquals(true, 					res.at("/query/operands/0/classIn").isMissingNode());
+		assertEquals("Mann", 				res.at("/query/operands/0/operands/0/operands/0/wrap/key").asText());
+		assertEquals("Frau", 				res.at("/query/operands/0/operands/0/operands/1/wrap/key").asText());
+
+		query = "{2:{1:[tt/p=ADJA]}[mate/p=NN]}";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:class", 	res.at("/query/operation").asText());
+		assertEquals("operation:sequence", 	res.at("/query/operands/0/operation").asText());
+		assertEquals(2, 					res.at("/query/classOut").asInt());
+		assertEquals(1, 					res.at("/query/operands/0/operands/0/classOut").asInt());
+	}
+
+	@Test
+	public void testFocusSplit() throws QueryException, JsonProcessingException, IOException {
+		query = "focus([orth=Der]{[orth=Mann]})";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:reference", 	res.at("/query/@type").asText());
+		assertEquals("operation:focus", 	res.at("/query/operation").asText());
+		assertEquals(1, 					res.at("/query/classRef/0").asInt());
+		assertEquals("operation:sequence", 	res.at("/query/operands/0/operation").asText());
+		assertEquals("operation:class", 	res.at("/query/operands/0/operands/1/operation").asText());
+		assertEquals(1, 					res.at("/query/operands/0/operands/1/classOut").asInt());
+		assertEquals("Mann", 				res.at("/query/operands/0/operands/1/operands/0/wrap/key").asText());
+		
+		query = "focus([orth=Der]{[orth=Mann][orth=geht]})";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("operation:sequence", 	res.at("/query/operands/0/operands/1/operands/0/operation").asText());
+		assertEquals("Mann", 				res.at("/query/operands/0/operands/1/operands/0/operands/0/wrap/key").asText());
+		assertEquals("geht", 				res.at("/query/operands/0/operands/1/operands/0/operands/1/wrap/key").asText());
+		
+		query = "focus(2:[orth=Der]{2:[orth=Mann][orth=geht]})";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(2, 					res.at("/query/classRef/0").asInt());
+		assertEquals(2, 					res.at("/query/operands/0/operands/1/classOut").asInt());
+		
+		query = "focus(3:startswith(<s>,{3:<np>}))";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(3, 					res.at("/query/classRef/0").asInt());
+		assertEquals("korap:reference", 	res.at("/query/@type").asText());
+		assertEquals("operation:focus", 	res.at("/query/operation").asText());
+		assertEquals("operation:position", 	res.at("/query/operands/0/operation").asText());
+		assertEquals("operation:class", 	res.at("/query/operands/0/operands/1/operation").asText());
+		assertEquals(3, 					res.at("/query/operands/0/operands/1/classOut").asInt());
+		assertEquals("frames:startswith", 	res.at("/query/operands/0/frames/0").asText());
+		
+		query = "focus(1000:startswith(<s>,{1000:<np>}))";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(127, 					res.at("/query/classRef/0").asInt());
+		assertEquals(127, 					res.at("/query/operands/0/operands/1/classOut").asInt());
+		
+		query = "focus(3: startswith(<s>, {3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}}))";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(3, 					res.at("/query/classRef/0").asInt());
+		assertEquals("korap:reference", 	res.at("/query/@type").asText());
+		assertEquals("operation:focus", 	res.at("/query/operation").asText());
+		assertEquals("operation:position", 	res.at("/query/operands/0/operation").asText());
+		assertEquals("frames:startswith", 	res.at("/query/operands/0/frames/0").asText());
+		assertEquals("operation:class", 	res.at("/query/operands/0/operands/1/operation").asText());
+		assertEquals(3, 					res.at("/query/operands/0/operands/1/classOut").asInt());
+		assertEquals("operation:sequence", 	res.at("/query/operands/0/operands/1/operands/0/operation").asText());
+		assertEquals("operation:class", 	res.at("/query/operands/0/operands/1/operands/0/operands/1/operation").asText());
+		assertEquals(1, 					res.at("/query/operands/0/operands/1/operands/0/operands/1/classOut").asInt());
+		assertEquals("operation:sequence", 	res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/0/operation").asText());
+		assertEquals("operation:class", 	res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/0/operands/1/operation").asText());
+		assertEquals(2, 					res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/0/operands/1/classOut").asInt());
+		
+		query = "split(3: startswith(<s>, {3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}}))";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(3, 					res.at("/query/classRef/0").asInt());
+		assertEquals(true, 					res.at("/query/classRef/1").isMissingNode());
+		assertEquals("korap:reference", 	res.at("/query/@type").asText());
+		assertEquals("operation:split", 	res.at("/query/operation").asText());
+		
+		query = "split(2|3: startswith(<s>, {3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}}))";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(2, 						res.at("/query/classRef/0").asInt());
+		assertEquals(3, 						res.at("/query/classRef/1").asInt());
+		assertEquals("classRefOp:intersection", res.at("/query/classRefOp").asText());
+		assertEquals("korap:reference", 		res.at("/query/@type").asText());
+		assertEquals("operation:split", 		res.at("/query/operation").asText());
+		
+		query = "focus(1:{[base=der]}{1:[pos=ADJA]})";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(1, 					res.at("/query/classRef/0").asInt());
+		assertEquals(1, 					res.at("/query/operands/0/operands/0/classOut").asInt());
+		assertEquals(1, 					res.at("/query/operands/0/operands/1/classOut").asInt());
 	}
 	
 	@Test
-	public void testPositions() throws QueryException {
-		// contains(<s>,<np>)
-		String pos1 = "{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-				  "{@type=korap:span, key=s}," +
-				  "{@type=korap:span, key=np}" +
-				"], frame=frame:contains}";
-		assertTrue(equalsQueryContent(pos1, "contains(<s>,<np>)"));
-		
-		// contains(<s>,[base=Mann])
-		String pos2 = "{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-				  "{@type=korap:span, key=s}," +
-				  "{@type=korap:token, wrap= {@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-				"], frame=frame:contains}";
-		assertTrue(equalsQueryContent(pos2, "contains(<s>,[base=Mann])"));
-		
-		// contains(<s>,[orth=der][orth=Mann])
-		String pos3 = "{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-				  	"{@type=korap:span, key=s}," +
-				  	"{@type=korap:group, operation=operation:sequence, operands=[" +
-				  		"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-				  		"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}" +
-				  	"]}" +
-				  "], frame=frame:contains}";
-		ppt = new PoliqarpPlusTree("contains(<s>,[orth=der][orth=Mann])");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(pos3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=Auto]contains(<s>,[base=Mann])
-		String pos4 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Auto, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-				  		"{@type=korap:span, key=s}," +
-				  		"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
-				  	"], frame=frame:contains}" +
-				"]}";
-		ppt = new PoliqarpPlusTree("[base=Auto]contains(<s>,[base=Mann])");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(pos4.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// contains(<s>,[pos=N]*)
-		String pos5 = 
-					"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-				  		"{@type=korap:span, key=s}," +
-				  		"{@type=korap:group, operation=operation:repetition, " +
-				  			"operands=[{@type=korap:token, wrap={@type=korap:term, layer=pos, key=N, match=match:eq}}" +
-				  			"], boundary={@type=korap:boundary, min=0}, min=0" +
-				  		"}" +
-				  	"], frame=frame:contains}";
-		ppt = new PoliqarpPlusTree("contains(<s>,[pos=N]*)");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(pos5.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// [base=Auto]contains(<s>,[pos=N]*)
-		String pos6 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Auto, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-				  		"{@type=korap:span, key=s}," +
-				  		"{@type=korap:group, operation=operation:repetition, " +
-				  			"operands=[{@type=korap:token, wrap={@type=korap:term, layer=pos, key=N, match=match:eq}}" +
-				  			"], boundary={@type=korap:boundary, min=0}, min=0" +
-				  		"}" +
-				  	"], frame=frame:contains}" +
-				"]}";
-		ppt = new PoliqarpPlusTree("[base=Auto]contains(<s>,[pos=N]*)");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(pos6.replaceAll(" ", ""), map.replaceAll(" ", ""));
-	}
-	
-	@Test
-	public void testNestedPositions() throws QueryException {
-		// contains(<s>,startswith(<np>,[orth=Der]))
-		String npos1 = 
-			"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-				"{@type=korap:span, key=s}," +
-				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
-					"{@type=korap:span, key=np}," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}" +
-				"], frame=frame:startswith}" +
-			"], frame=frame:contains}";
-		ppt = new PoliqarpPlusTree("contains(<s>, startswith(<np>,[orth=Der]))");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(npos1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-	}
-	
-	@Test
-	public void testFocusSplit() throws QueryException {
-		// focus([orth=Der]{[orth=Mann]})
-		String shr1 = 
-			"{@type=korap:reference, operation=operation:focus, classRef=[1], operands=[" +
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}" +
-					"]}" +
-				"]}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("focus([orth=Der]{[orth=Mann]})");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(shr1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// focus([orth=Der]{[orth=Mann][orth=geht]})
-		String shr2 = 
-			"{@type=korap:reference, operation=operation:focus, classRef=[1], operands=[" +
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-						"{@type=korap:group, operation=operation:sequence, operands=[" +
-							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}," +
-							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=geht, match=match:eq}}" +
-						"]}" +
-					"]}" +
-				"]}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("focus([orth=Der]{[orth=Mann][orth=geht]})");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(shr2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// focus(1:[orth=Der]{1:[orth=Mann][orth=geht]})
-		String shr3 = 
-			"{@type=korap:reference, operation=operation:focus, classRef=[1], operands=[" +
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-						"{@type=korap:group, operation=operation:sequence, operands=[" +
-							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}," +
-							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=geht, match=match:eq}}" +
-						"]}" +
-					"]}" +
-				"]}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("focus(1:[orth=Der]{1:[orth=Mann][orth=geht]})");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(shr3.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// focus(1:startswith(<s>,{1:<np>}))
-		String shr4 = 
-			"{@type=korap:reference, operation=operation:focus, classRef=[1], operands=[" +
-				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
-					"{@type=korap:span, key=s}," +
-					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-						"{@type=korap:span, key=np}" +
-					"]}" +
-				"], frame=frame:startswith}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("focus(1:startswith(<s>,{1:<np>}))");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(shr4.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// focus(3: startswith(<s>, {3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) 
-		String shr5 = 
-			"{@type=korap:reference, operation=operation:focus, classRef=[3], operands=[" +
-				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
-					"{@type=korap:span, key=s}," +
-					"{@type=korap:group, operation=operation:class, class=3, classOut=3, operands=[" +
-						"{@type=korap:group, operation=operation:sequence, operands=[" +
-							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-							"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-								"{@type=korap:group, operation=operation:sequence, operands=[" +
-									"{@type=korap:token, wrap={@type=korap:term, foundry=mate, layer=p, key=ADJA, match=match:eq}}," +
-									"{@type=korap:group, operation=operation:class, class=2, classOut=2, operands=[" +
-										"{@type=korap:token, wrap={@type=korap:term, foundry=tt, layer=p, key=NN, match=match:eq}}" +
-									"]}" + 
-								"]}" +
-							"]}" +
-						"]}" +
-					"]}" +
-				"], frame=frame:startswith}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("focus(3:startswith(<s>,{3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) ");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(shr5.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// split(3: startswith(<s>, {3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) 
-		String shr6 = 
-			"{@type=korap:reference, operation=operation:split, classRef=[3], operands=[" +
-				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
-					"{@type=korap:span, key=s}," +
-					"{@type=korap:group, operation=operation:class, class=3, classOut=3, operands=[" +
-						"{@type=korap:group, operation=operation:sequence, operands=[" +
-							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-							"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-								"{@type=korap:group, operation=operation:sequence, operands=[" +
-									"{@type=korap:token, wrap={@type=korap:term, foundry=mate, layer=p, key=ADJA, match=match:eq}}," +
-									"{@type=korap:group, operation=operation:class, class=2, classOut=2, operands=[" +
-										"{@type=korap:token, wrap={@type=korap:term, foundry=tt, layer=p, key=NN, match=match:eq}}" +
-									"]}" + 
-								"]}" +
-							"]}" +
-						"]}" +
-					"]}" +
-				"], frame=frame:startswith}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("split(3:startswith(<s>,{3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) ");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(shr6.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		// split(2|3: startswith(<s>, {3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) 
-		String shr7 = 
-			"{@type=korap:reference, operation=operation:split, classRef=[2, 3], classRefOp=classRefOp:intersection, operands=[" +
-				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
-					"{@type=korap:span, key=s}," +
-					"{@type=korap:group, operation=operation:class, class=3, classOut=3, operands=[" +
-						"{@type=korap:group, operation=operation:sequence, operands=[" +
-							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-							"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-								"{@type=korap:group, operation=operation:sequence, operands=[" +
-									"{@type=korap:token, wrap={@type=korap:term, foundry=mate, layer=p, key=ADJA, match=match:eq}}," +
-									"{@type=korap:group, operation=operation:class, class=2, classOut=2, operands=[" +
-										"{@type=korap:token, wrap={@type=korap:term, foundry=tt, layer=p, key=NN, match=match:eq}}" +
-									"]}" + 
-								"]}" +
-							"]}" +
-						"]}" +
-					"]}" +
-				"], frame=frame:startswith}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("split(2|3:startswith(<s>,{3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) ");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(shr7.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		
-		String shr8 = 
-			"{@type=korap:reference, operation=operation:focus, classRef=[1], operands=[" +
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}" +
-					"]}," +
-					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=pos, key=ADJA, match=match:eq}}" +
-					"]}" +
-				"]}" +
-			"]}";
-		ppt = new PoliqarpPlusTree("focus(1:{[base=der]}{1:[pos=ADJA]})");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(shr8.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-	}
-	
-	@Test
-	public void testSubspan() throws QueryException {
+	public void testSubmatch() throws QueryException, JsonProcessingException, IOException {
 		query = "submatch(1,:<s>)";
-		expected = 
-			"{@type=korap:reference, operation=operation:focus, operands=[" +
-					"{@type=korap:span, key=s}" +
-				"], spanRef=[1]" +
-			"}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-	
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:reference", 	res.at("/query/@type").asText());
+		assertEquals("operation:focus", 	res.at("/query/operation").asText());
+		assertEquals(1, 					res.at("/query/spanRef/0").asInt());
+		assertEquals(true, 					res.at("/query/spanRef/1").isMissingNode());
+		assertEquals("s", 					res.at("/query/operands/0/key").asText());
+		
 		query = "submatch(1,4:<s>)";
-		expected = 
-			"{@type=korap:reference, operation=operation:focus, operands=[" +
-					"{@type=korap:span, key=s}" +
-				"], spanRef=[1,4]" +
-			"}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:reference", 	res.at("/query/@type").asText());
+		assertEquals("operation:focus", 	res.at("/query/operation").asText());
+		assertEquals(1, 					res.at("/query/spanRef/0").asInt());
+		assertEquals(4, 					res.at("/query/spanRef/1").asInt());
 		
 		query = "submatch(1,4:contains(<s>,[base=Haus]))";
-		expected = 
-			"{@type=korap:reference, operation=operation:focus, operands=[" +
-				"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
-					"{@type=korap:span, key=s}," +
-					"{@type=korap:token, wrap= {@type=korap:term, layer=lemma, key=Haus, match=match:eq}}" +
-				"], frame=frame:contains}" +
-				"], spanRef=[1,4]" +
-			"}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:reference", 	res.at("/query/@type").asText());
+		assertEquals("operation:focus", 	res.at("/query/operation").asText());
+		assertEquals(1, 					res.at("/query/spanRef/0").asInt());
+		assertEquals(4, 					res.at("/query/spanRef/1").asInt());
+		assertEquals("frames:contains", 	res.at("/query/operands/0/frames/0").asText());
+		assertEquals("s", 					res.at("/query/operands/0/operands/0/key").asText());
+		assertEquals("Haus", 				res.at("/query/operands/0/operands/1/wrap/key").asText());
 	}
-	
 	@Test
-	public void testRelations() throws QueryException {
+	public void testRelations() throws QueryException, JsonProcessingException, IOException {
 		query = "relatesTo(<s>,<np>)";
-		expected = 
-			"{@type=korap:group, operation=operation:relation, operands=[" +
-					"{@type=korap:span, key=s}," +
-					"{@type=korap:span, key=np}" +
-				"], relation={@type=korap:relation}" +
-			"}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:relation", 	res.at("/query/operation").asText());
+		assertEquals("korap:relation", 		res.at("/query/relation/@type").asText());
+		assertEquals("s", 					res.at("/query/operands/0/key").asText());
+		assertEquals("np", 					res.at("/query/operands/1/key").asText());
 		
 		query = "relatesTo([base=Baum],<np>)";
-		expected = 
-				"{@type=korap:group, operation=operation:relation, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Baum, match=match:eq}}," +
-						"{@type=korap:span, key=np}" +
-					"], relation={@type=korap:relation}" +
-				"}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:relation", 	res.at("/query/operation").asText());
+		assertEquals("korap:relation", 		res.at("/query/relation/@type").asText());
+		assertEquals("Baum", 				res.at("/query/operands/0/wrap/key").asText());
+		assertEquals("np", 					res.at("/query/operands/1/key").asText());
 		
-		query = "dominates(<np>,[base=Baum])";
-		expected = 
-				"{@type=korap:group, operation=operation:relation, operands=[" +
-						"{@type=korap:span, key=np}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Baum, match=match:eq}}" +
-					"], relation={@type=korap:relation, layer=c}" +
-				"}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "dominates(cnx/c:<np>,[base=Baum])";
-		expected = 
-				"{@type=korap:group, operation=operation:relation, operands=[" +
-						"{@type=korap:span, key=np}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Baum, match=match:eq}}" +
-					"], relation={@type=korap:relation, layer=c, foundry=cnx}" +
-				"}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "dominates(cnx/c*:<np>,[base=Baum])";
-		expected = 
-				"{@type=korap:group, operation=operation:relation, operands=[" +
-						"{@type=korap:span, key=np}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Baum, match=match:eq}}" +
-					"], relation={@type=korap:relation, layer=c, foundry=cnx, boundary={@type=korap:boundary, min=0}}" +
-				"}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "dominates(cnx/c{1,5}:<np>,[base=Baum])";
-		expected = 
-				"{@type=korap:group, operation=operation:relation, operands=[" +
-						"{@type=korap:span, key=np}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Baum, match=match:eq}}" +
-					"], relation={@type=korap:relation, layer=c, foundry=cnx, boundary={@type=korap:boundary, min=1, max=5}}" +
-				"}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		query = "relatesTo(Baum,<np>)";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("orth", 				res.at("/query/operands/0/wrap/layer").asText());
+		assertEquals("Baum", 				res.at("/query/operands/0/wrap/key").asText());
 		
 		query = "relatesTo(mate/d=HEAD:<np>,[base=Baum])";
-		expected = 
-				"{@type=korap:group, operation=operation:relation, operands=[" +
-						"{@type=korap:span, key=np}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Baum, match=match:eq}}" +
-					"], relation={@type=korap:relation, foundry=mate, layer=d, key=HEAD}" +
-				"}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("lemma", 				res.at("/query/operands/1/wrap/layer").asText());
+		assertEquals("Baum", 				res.at("/query/operands/1/wrap/key").asText());
+		assertEquals("korap:relation", 		res.at("/query/relation/@type").asText());
+		assertEquals("mate", 				res.at("/query/relation/foundry").asText());
+		assertEquals("d", 					res.at("/query/relation/layer").asText());
+		assertEquals("HEAD", 				res.at("/query/relation/key").asText());
 		
-	}
-	
-	
-	
-	@Test
-	public void testFoundries() throws QueryException {
-		// [tt/base=Mann]
-		String layer1 = "{@type=korap:token, wrap={@type=korap:term, foundry=tt, layer=lemma, key=Mann, match=match:eq}}";
-		ppt = new PoliqarpPlusTree("[tt/base=Mann]");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(layer1.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		query = "dominates(Baum,<np>)";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("orth", 				res.at("/query/operands/0/wrap/layer").asText());
+		assertEquals("Baum", 				res.at("/query/operands/0/wrap/key").asText());
+		assertEquals("korap:relation", 		res.at("/query/relation/@type").asText());
+		assertEquals("c", 					res.at("/query/relation/layer").asText());
 		
+		query = "dominates(cnx/c:<vp>,<np>)";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("cnx", 				res.at("/query/relation/foundry").asText());
+		assertEquals("c", 					res.at("/query/relation/layer").asText());
+		
+		query = "dominates(cnx/c*:<vp>,<np>)";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("cnx", 				res.at("/query/relation/foundry").asText());
+		assertEquals("c", 					res.at("/query/relation/layer").asText());
+		assertEquals(0, 					res.at("/query/relation/boundary/min").asInt());
+		assertEquals(true, 					res.at("/query/relation/boundary/max").isMissingNode());
+		
+		query = "dominates(cnx/c{1,5}:<vp>,<np>)";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(1, 					res.at("/query/relation/boundary/min").asInt());
+		assertEquals(5, 					res.at("/query/relation/boundary/max").asInt());
+		
+		query = "dominates(cnx/c{,5}:<vp>,<np>)";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(0, 					res.at("/query/relation/boundary/min").asInt());
+		assertEquals(5, 					res.at("/query/relation/boundary/max").asInt());
+		
+		query = "dominates(cnx/c{5}:<vp>,<np>)";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(5, 					res.at("/query/relation/boundary/min").asInt());
+		assertEquals(5, 					res.at("/query/relation/boundary/max").asInt());
 	}
 	
 	@Test
-	public void testAlign() throws QueryException {
-		// [orth=der]^[orth=Mann]
+	public void testAlign() throws QueryException, JsonProcessingException, IOException {
 		query = "[orth=der]^[orth=Mann]";
-		expected = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:class, class=129, classOut=129, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}" +
-					"]}" +
-				"]}";
-		metaExpected = 
-				"{alignment=129}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		metaMap = ppt.getRequestMap().get("meta").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("operation:sequence", 	res.at("/query/operation").asText());
+		assertEquals("der", 				res.at("/query/operands/0/wrap/key").asText());
+		assertEquals("operation:class", 	res.at("/query/operands/1/operation").asText());
+		assertEquals(129, 					res.at("/query/operands/1/classOut").asInt());
+		assertEquals(129, 					res.at("/meta/alignment").asInt());
 		
-		// [orth=der]^[orth=große][orth=Mann]
 		query = "[orth=der]^[orth=große][orth=Mann]";
-		String expected = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:class, class=129, classOut=129, operands=[" +
-						"{@type=korap:group, operation=operation:sequence, operands=[" +
-							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=große, match=match:eq}}," +
-							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}" +
-						"]}" +
-					"]}" +
-				"]}";
-		metaExpected = 
-				"{alignment=129}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		metaMap = ppt.getRequestMap().get("meta").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("operation:sequence", 	res.at("/query/operation").asText());
+		assertEquals("operation:class", 	res.at("/query/operands/1/operation").asText());
+		assertEquals("operation:sequence", 	res.at("/query/operands/1/operands/0/operation").asText());
+		assertEquals("große", 				res.at("/query/operands/1/operands/0/operands/0/wrap/key").asText());
+		assertEquals("Mann", 				res.at("/query/operands/1/operands/0/operands/1/wrap/key").asText());
+		assertEquals(129, 					res.at("/query/operands/1/classOut").asInt());
+		assertEquals(129, 					res.at("/meta/alignment").asInt());
 		
 		query = "([base=a]^[base=b])|[base=c]";
-		expected = 
-				"{@type=korap:group, operation=operation:or, operands=[" +
-						"{@type=korap:group, operation=operation:sequence, operands=[" +
-							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=a, match=match:eq}}," +
-							"{@type=korap:group, operation=operation:class, class=129, classOut=129, operands=[" +
-								"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=b, match=match:eq}}" +
-							"]}" +
-						"]}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=c, match=match:eq}}" +
-				"]}";
-		metaExpected = 
-				"{alignment=129}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		metaMap = ppt.getRequestMap().get("meta").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("operation:or", 		res.at("/query/operation").asText());
+		assertEquals("operation:sequence", 	res.at("/query/operands/0/operation").asText());
+		assertEquals("operation:class", 	res.at("/query/operands/0/operands/1/operation").asText());
+		assertEquals("a", 					res.at("/query/operands/0/operands/0/wrap/key").asText());
+		assertEquals("b", 					res.at("/query/operands/0/operands/1/operands/0/wrap/key").asText());
+		assertEquals("c", 					res.at("/query/operands/1/wrap/key").asText());
+		assertEquals(129, 					res.at("/query/operands/0/operands/1/classOut").asInt());
+		assertEquals(129, 					res.at("/meta/alignment").asInt());
 		
 		query = "([base=a]^[base=b][base=c])|[base=d]";
-		expected = 
-				"{@type=korap:group, operation=operation:or, operands=[" +
-						"{@type=korap:group, operation=operation:sequence, operands=[" +
-							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=a, match=match:eq}}," +
-							"{@type=korap:group, operation=operation:class, class=129, classOut=129, operands=[" +
-								"{@type=korap:group, operation=operation:sequence, operands=[" +
-									"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=b, match=match:eq}}," +
-									"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=c, match=match:eq}}" +
-								"]}" +
-							"]}" +
-						"]}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=d, match=match:eq}}" +
-				"]}";
-		metaExpected = 
-				"{alignment=129}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		metaMap = ppt.getRequestMap().get("meta").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("operation:sequence", 	res.at("/query/operands/0/operands/1/operands/0/operation").asText());
+		assertEquals("b", 					res.at("/query/operands/0/operands/1/operands/0/operands/0/wrap/key").asText());
+		assertEquals("c", 					res.at("/query/operands/0/operands/1/operands/0/operands/1/wrap/key").asText());
+		assertEquals("d", 					res.at("/query/operands/1/wrap/key").asText());
 		
 		query = "([base=a]^[base=b]^[base=c])|[base=d]";
-		expected = 
-				"{@type=korap:group, operation=operation:or, operands=[" +
-						"{@type=korap:group, operation=operation:sequence, operands=[" +
-							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=a, match=match:eq}}," +
-							"{@type=korap:group, operation=operation:class, class=129, classOut=129, operands=[" +
-								"{@type=korap:group, operation=operation:sequence, operands=[" +
-									"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=b, match=match:eq}}," +
-									"{@type=korap:group, operation=operation:class, class=130, classOut=130, operands=[" +
-										"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=c, match=match:eq}}" +
-									"]}" +
-								"]}" +
-							"]}" +
-						"]}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=d, match=match:eq}}" +
-				"]}";
-		metaExpected = 
-				"{alignment=[129,130]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		metaMap = ppt.getRequestMap().get("meta").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
-		
-		
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("operation:sequence", 	res.at("/query/operands/0/operands/1/operands/0/operation").asText());
+		assertEquals("b", 					res.at("/query/operands/0/operands/1/operands/0/operands/0/wrap/key").asText());
+		assertEquals("c", 					res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/0/wrap/key").asText());
+		assertEquals("d", 					res.at("/query/operands/1/wrap/key").asText());
+		assertEquals(129, 					res.at("/meta/alignment/0").asInt());
+		assertEquals(130, 					res.at("/meta/alignment/1").asInt());
 	}
 	
 	@Test
-	public void testSimpleQueries() throws QueryException {
-		// Baum
-		String simple1 = 
-				"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Baum, match=match:eq}}";
-		ppt = new PoliqarpPlusTree("Baum");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(simple1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-
-		// Baum/i
-		String simple1b = 
-				"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Baum, match=match:eq, caseInsensitive=true}}";
-		ppt = new PoliqarpPlusTree("Baum/i");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(simple1b.replaceAll(" ", ""), map.replaceAll(" ", ""));
+	public void testSimpleQueries() throws QueryException, JsonProcessingException, IOException {
+		query = "Baum";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:token", 		res.at("/query/@type").asText());
+		assertEquals("korap:term",			res.at("/query/wrap/@type").asText());
+		assertEquals("Baum",				res.at("/query/wrap/key").asText());
+		assertEquals("orth", 				res.at("/query/wrap/layer").asText());
+		assertEquals("match:eq",			res.at("/query/wrap/match").asText());
 		
-		// Der Baum
-		String simple2 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}, " +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Baum, match=match:eq}}" +
-				"]}";
-		ppt = new PoliqarpPlusTree("Der Baum");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(simple2.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		query = "Der Baum";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:group", 		res.at("/query/@type").asText());
+		assertEquals("operation:sequence",	res.at("/query/operation").asText());
+		assertEquals("korap:token",			res.at("/query/operands/0/@type").asText());
+		assertEquals("korap:term",			res.at("/query/operands/0/wrap/@type").asText());
+		assertEquals("Der",					res.at("/query/operands/0/wrap/key").asText());
+		assertEquals("Baum",				res.at("/query/operands/1/wrap/key").asText());
+		assertEquals("orth", 				res.at("/query/operands/0/wrap/layer").asText());
+		assertEquals("match:eq",			res.at("/query/operands/0/wrap/match").asText());
+		assertEquals("orth", 				res.at("/query/operands/1/wrap/layer").asText());
+		assertEquals("match:eq",			res.at("/query/operands/1/wrap/match").asText());
 		
-		// Der Baum/i
-		String simple2b = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}, " +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Baum, match=match:eq, caseInsensitive=true}}" +
-				"]}";
-		ppt = new PoliqarpPlusTree("Der Baum/i");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(simple2b.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		query = "Der große Baum";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("Der",					res.at("/query/operands/0/wrap/key").asText());
+		assertEquals("große",				res.at("/query/operands/1/wrap/key").asText());
+		assertEquals("Baum",				res.at("/query/operands/2/wrap/key").asText());
 		
-		// Der große Baum
-		String simple3 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}, " +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=große, match=match:eq}}, " +						
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Baum, match=match:eq}}" +
-				"]}";
-		ppt = new PoliqarpPlusTree("Der große Baum");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(simple3.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		query = "Der (große|kleine) Baum";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("Der",					res.at("/query/operands/0/wrap/key").asText());
+		assertEquals("operation:or",		res.at("/query/operands/1/operation").asText());
+		assertEquals("große",				res.at("/query/operands/1/operands/0/wrap/key").asText());
+		assertEquals("kleine",				res.at("/query/operands/1/operands/1/wrap/key").asText());
+		assertEquals("Baum",				res.at("/query/operands/2/wrap/key").asText());
 		
-		// Baum | Stein
-		String simple4 = 
-				"{@type=korap:group, operation=operation:or, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Baum, match=match:eq}}, " +						
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Stein, match=match:eq}}" +
-				"]}";
-		ppt = new PoliqarpPlusTree("Baum | Stein");
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(simple4.replaceAll(" ", ""), map.replaceAll(" ", ""));		
+		query = "der große Baum | der kleine Baum";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("operation:or",		res.at("/query/operation").asText());
+		assertEquals("der",					res.at("/query/operands/0/operands/0/wrap/key").asText());
+		assertEquals("große",				res.at("/query/operands/0/operands/1/wrap/key").asText());
+		assertEquals("Baum",				res.at("/query/operands/0/operands/2/wrap/key").asText());
+		assertEquals("der",					res.at("/query/operands/1/operands/0/wrap/key").asText());
+		assertEquals("kleine",				res.at("/query/operands/1/operands/1/wrap/key").asText());
+		assertEquals("Baum",				res.at("/query/operands/1/operands/2/wrap/key").asText());
 		
-		// Baum | Stein Haus
-		String query = "(Baum | Stein) Haus";
-		String simple5 = 
-				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:group, operation=operation:or, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Baum, match=match:eq}}, " +						
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Stein, match=match:eq}}" +
-					"]}," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Haus, match=match:eq}} " +			
-				"]}";
-		ppt = new PoliqarpPlusTree(query);
-		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(simple5.replaceAll(" ", ""), map.replaceAll(" ", ""));		
-	}
-	
-	@Test
-	public void testUnnecessaryParantheses() throws QueryException {
-		String query1, query2;
-		PoliqarpPlusTree tree1, tree2;
-		
-		query1 = "Test";
-		query2 = "(Test)";
-		tree1 = new PoliqarpPlusTree(query1);
-		tree2 = new PoliqarpPlusTree(query2);
-		assertEquals(tree1.getRequestMap(), tree2.getRequestMap());
-		
-		query1 = "pass|fail";
-		query2 = "(pass|fail)";
-		tree1 = new PoliqarpPlusTree(query1);
-		tree2 = new PoliqarpPlusTree(query2);
-		assertEquals(tree1.getRequestMap(), tree2.getRequestMap());
-		
-		query1 = "pass|fail";
-		query2 = "pass|(fail)";
-		tree1 = new PoliqarpPlusTree(query1);
-		tree2 = new PoliqarpPlusTree(query2);
-		assertEquals(tree1.getRequestMap(), tree2.getRequestMap());
-		
-		query1 = "pass|fail";
-		query2 = "(pass|(fail))";
-		tree1 = new PoliqarpPlusTree(query1);
-		tree2 = new PoliqarpPlusTree(query2);
-		assertEquals(tree1.getRequestMap(), tree2.getRequestMap());
-		
-		query1 = "contains(<s>,Mann)";
-		query2 = "contains((<s>),Mann)";
-		tree1 = new PoliqarpPlusTree(query1);
-		tree2 = new PoliqarpPlusTree(query2);
-		assertEquals(tree1.getRequestMap(), tree2.getRequestMap());
+		query = "Der [p=ADJA] Baum";
+		qs.setQuery(query, "poliqarpplus");
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("Der",					res.at("/query/operands/0/wrap/key").asText());
+		assertEquals("ADJA",				res.at("/query/operands/1/wrap/key").asText());
+		assertEquals("p",					res.at("/query/operands/1/wrap/layer").asText());
+		assertEquals("Baum",				res.at("/query/operands/2/wrap/key").asText());
 	}
 }
 
+
