diff --git a/Changes b/Changes
index 0d4ef61..0483509 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,11 @@
+0.25 2017-05-10
+	- Altered dominance and relation serialization (margaretha)
+	 
 0.24 2017-05-03
-	- Fixed serialization of regexes for VCs (diewald)
-
+	- Fixed serialization of regexes for VCs (diewald)	
+	- Implemented exclusion in Cosmas2 IN operation (margaretha)
+	- Restructured test suite (margaretha)
+	
 0.23 2016-10-27
 	- Added tests and comments for FCSQL (margaretha)
 	- Added quantifier for FCSQL QueryGroup (margaretha)
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/AnnisQueryProcessor.java b/src/main/java/de/ids_mannheim/korap/query/serialize/AnnisQueryProcessor.java
index 0573fd4..ee56fac 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/AnnisQueryProcessor.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/AnnisQueryProcessor.java
@@ -698,6 +698,7 @@
                 catch (ClassCastException | NullPointerException n) {
                     groupType = "relation";
                 }
+
                 if (groupType.equals("relation")
                 //                        || groupType.equals("treeRelation")
                 ) {
@@ -713,17 +714,44 @@
                     putAllBut(group, operatorGroup, "groupType");
                 }
                 else if (groupType.equals("hierarchy")) {
-                    group = KoralObjectGenerator
-                            .makeGroup(KoralOperation.HIERARCHY);
+                    Map<String, Object> attribute = null;
                     if (operatorGroup.containsKey("edgeValue")) {
                         String edgeValue = (String) operatorGroup
                                 .get("edgeValue");
-                        inheritFoundryAndLayer(edgeValue, operand1, operand2);
+                        attribute = inheritFoundryAndLayer(edgeValue, operand1,
+                                operand2);
                     }
-                    if (operatorGroup.containsKey("boundary")) {
-                        checkBoundary((Map<String, Object>) operatorGroup
-                                .get("boundary"), operand1, operand2);
+
+                    if (operatorGroup.containsKey("edgeType") && !operatorGroup
+                            .get("edgeType").toString().equals("edgetype")) {
+                        group = KoralObjectGenerator
+                                .makeGroup(KoralOperation.RELATION);
+                        Map<String, Object> relation = KoralObjectGenerator
+                                .makeRelation();
+                        // EM: for relations between arbitrary nodes e.g. secedge, rst without a label 
+                        // need layer and foundry rewrite default in Kustvakt 
+                        if (attribute != null) {
+                            relation.put("wrap", attribute);
+                        }
+                        group.put("relType", relation);
                     }
+                    else {
+                        group = KoralObjectGenerator
+                                .makeGroup(KoralOperation.HIERARCHY);
+                        if (!operatorGroup.containsKey("edgeType")) {
+                            group.put("edgeType", "edgetype");
+                        }
+                        if (attribute != null) {
+                            operand1.put("attr", attribute);
+                        }
+                        if (operatorGroup.containsKey("boundary")) {
+                            checkBoundary(
+                                    (Map<String, Object>) operatorGroup
+                                            .get("boundary"),
+                                    operand1, operand2);
+                        }
+                    }
+
                     putAllBut(group, operatorGroup, "groupType", "edgeValue");
                 }
                 else if (groupType.equals("position")) {
@@ -866,10 +894,10 @@
     }
 
 
+    @SuppressWarnings("unchecked")
     private String searchMap (Map<String, Object> operand, String key) {
 
         String type = (String) operand.get("@type");
-        Map<String, Object> child;
         if (type.equals("koral:token") && operand.containsKey("wrap")) {
             return searchMap((Map<String, Object>) operand.get("wrap"), key);
         }
@@ -889,6 +917,7 @@
             }
         }
         else {
+            // EM: (Annis) operand should not be of koral:group
             addError(StatusCodes.MALFORMED_QUERY,
                     "Cannot determine the " + key + ".");
         }
@@ -897,13 +926,12 @@
     }
 
 
-    private void inheritFoundryAndLayer (String edgeValue,
+    private Map<String, Object> inheritFoundryAndLayer (String edgeValue,
             Map<String, Object> operand1, Map<String, Object> operand2) {
 
         Map<String, Object> attribute = KoralObjectGenerator.makeTerm();
         attribute.put("key", edgeValue);
         attribute.put("match", KoralMatchOperator.EQUALS.toString());
-        operand1.put("attr", attribute);
 
         if (operand1.containsKey("layer")) {
             attribute.put("layer", operand1.get("layer"));
@@ -923,6 +951,7 @@
         else if (operand2.containsKey("foundry")) {
             attribute.put("foundry", operand2.get("foundry"));
         }
+        return attribute;
     }
 
 
@@ -962,15 +991,18 @@
             //            relation = KoralObjectGenerator.makeRelation();
             relation = new HashMap<String, Object>();
             relation.put("groupType", "hierarchy");
-            // Ignored
-            // ParseTree edgeType = getFirstChildWithCat(operatorNode, "edgeType");
+            ParseTree edgeType = getFirstChildWithCat(operatorNode, "edgeType");
             ParseTree edgeSpecNode = getFirstChildWithCat(operatorNode,
                     "edgeSpec");
             ParseTree star = getFirstChildWithCat(operatorNode, "*");
             ParseTree rangeSpec = getFirstChildWithCat(operatorNode,
                     "rangeSpec");
 
-            //                term = parseQNameNode(qName);
+            if (edgeType != null) {
+                relation.put("edgeType",
+                        edgeType.getChild(0).toStringTree(parser));
+            }
+
             if (edgeSpecNode != null) {
                 Map<String, Object> edgeSpec = parseEdgeSpec(edgeSpecNode);
                 relation.put("edgeValue", edgeSpec.get("value"));
@@ -985,49 +1017,27 @@
             relation = KoralObjectGenerator.makeRelation();
             relation.put("groupType", "relation");
             ParseTree qName = getFirstChildWithCat(operatorNode, "qName");
-            ParseTree edgeType = getFirstChildWithCat(operatorNode, "edgeType");
             ParseTree edgeSpec = getFirstChildWithCat(operatorNode, "edgeSpec");
             ParseTree star = getFirstChildWithCat(operatorNode, "*");
             ParseTree rangeSpec = getFirstChildWithCat(operatorNode,
                     "rangeSpec");
+
             Map<String, Object> type = KoralObjectGenerator.makeTerm();
             if (qName != null) {
                 type.putAll(parseQNameNode(qName));
             }
-            else if (edgeType != null) {
-                type.putAll(parseEdgeAnno(edgeType, "key"));
-            }
-
-            Map<String, Object> label = KoralObjectGenerator.makeTerm();
             if (edgeSpec != null) {
-                label.putAll(parseEdgeSpec(edgeSpec));
-                relation.put("wrap", label);
+                type.putAll(parseEdgeSpec(edgeSpec));
             }
+            relation.put("wrap", type);
 
-            if (qName != null || edgeType != null) {
-                if (edgeSpec == null) {
-                    relation.put("wrap", type);
-                }
-                else {
-                    Map<String, Object> termgroup = KoralObjectGenerator
-                            .makeTermGroup(KoralTermGroupRelation.AND);
-                    ArrayList<Object> termGroupOperands = (ArrayList<Object>) termgroup
-                            .get("operands");
-                    termGroupOperands.add(type);
-                    termGroupOperands.add(label);
-                    relation.put("wrap", termgroup);
-                }
-            }
-            else if (!label.isEmpty()) {
-                relation.put("wrap", label);
-            }
-
-            if (star != null)
+            if (star != null) {
                 relation.put("boundary",
                         KoralObjectGenerator.makeBoundary(0, null));
-            if (rangeSpec != null)
+            }
+            if (rangeSpec != null) {
                 relation.put("boundary", boundaryFromRangeSpec(rangeSpec));
-
+            }
         }
         else if (operator.equals("precedence")) {
             relation = new HashMap<String, Object>();
@@ -1131,33 +1141,27 @@
     }
 
 
-    private Map<String, Object> parseEdgeAnno (ParseTree edgeAnnoSpec,
-            String name) {
+    private Map<String, Object> parseEdgeAnno (ParseTree edgeAnnoSpec) {
         Map<String, Object> edgeAnno = KoralObjectGenerator.makeTerm();
         ParseTree textSpecNode = getFirstChildWithCat(edgeAnnoSpec, "textSpec");
-        ParseTree keyNode = getFirstChildWithCat(edgeAnnoSpec, "key");
-        ParseTree layerNode = getFirstChildWithCat(edgeAnnoSpec, "layer");
-        ParseTree foundryNode = getFirstChildWithCat(edgeAnnoSpec, "foundry");
+//        ignored
+//        ParseTree keyNode = getFirstChildWithCat(edgeAnnoSpec, "key");
+//        ParseTree layerNode = getFirstChildWithCat(edgeAnnoSpec, "layer");
+//        ParseTree foundryNode = getFirstChildWithCat(edgeAnnoSpec, "foundry");
         ParseTree matchOperatorNode = getFirstChildWithCat(edgeAnnoSpec,
                 "eqOperator");
-        if (foundryNode != null)
-            edgeAnno.put("foundry",
-                    foundryNode.getChild(0).toStringTree(parser));
-        if (layerNode != null)
-            edgeAnno.put("layer", layerNode.getChild(0).toStringTree(parser));
-        if (keyNode != null)
-            edgeAnno.put("key", keyNode.getChild(0).toStringTree(parser));
-        edgeAnno.putAll(parseTextSpec(textSpecNode, name));
+//        if (foundryNode != null)
+//            edgeAnno.put("foundry",
+//                    foundryNode.getChild(0).toStringTree(parser));
+//        if (layerNode != null)
+//            edgeAnno.put("layer", layerNode.getChild(0).toStringTree(parser));
+//        if (keyNode != null)
+//            edgeAnno.put("key", keyNode.getChild(0).toStringTree(parser));
+        edgeAnno.putAll(parseTextSpec(textSpecNode, "key"));
         edgeAnno.put("match", parseMatchOperator(matchOperatorNode));
         return edgeAnno;
     }
 
-
-    private Map<String, Object> parseEdgeAnno (ParseTree edgeAnnoSpec) {
-        return parseEdgeAnno(edgeAnnoSpec, "value");
-    }
-
-
     private Map<String, Object> boundaryFromRangeSpec (ParseTree rangeSpec) {
         return boundaryFromRangeSpec(rangeSpec, true);
     }
diff --git a/src/test/java/de/ids_mannheim/korap/query/test/annis/DominanceTests.java b/src/test/java/de/ids_mannheim/korap/query/test/annis/DominanceTests.java
index 66cbf84..6993424 100644
--- a/src/test/java/de/ids_mannheim/korap/query/test/annis/DominanceTests.java
+++ b/src/test/java/de/ids_mannheim/korap/query/test/annis/DominanceTests.java
@@ -33,6 +33,7 @@
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:hierarchy",
                 res.at("/query/operation").asText());
+        assertEquals("edgetype", res.at("/query/edgeType").asText());
         assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
         assertEquals("koral:span", res.at("/query/operands/1/@type").asText());
     }
@@ -41,13 +42,14 @@
     @Test
     public void testDefaultTypedDominance ()
             throws JsonProcessingException, IOException {
-        query = "node & node & #1 >edgeType #2";
+        query = "node & node & #1 >edgetype #2";
         qs.setQuery(query, "annis");
         res = mapper.readTree(qs.toJSON());
 
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:hierarchy",
                 res.at("/query/operation").asText());
+        assertEquals("edgetype", res.at("/query/edgeType").asText());
         assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
         assertEquals("koral:span", res.at("/query/operands/1/@type").asText());
     }
@@ -61,8 +63,8 @@
         res = mapper.readTree(qs.toJSON());
 
         assertEquals("koral:group", res.at("/query/@type").asText());
-        assertEquals("operation:hierarchy",
-                res.at("/query/operation").asText());
+        assertEquals("operation:relation", res.at("/query/operation").asText());
+        assertEquals("secedge", res.at("/query/edgeType").asText());
         assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
         assertTrue(res.at("/query/operands/0/attr").isMissingNode());
         assertEquals("koral:span", res.at("/query/operands/1/@type").asText());
@@ -78,6 +80,7 @@
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:hierarchy",
                 res.at("/query/operation").asText());
+        assertEquals("edgetype", res.at("/query/edgeType").asText());
         assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
         assertEquals("np", res.at("/query/operands/0/key").asText());
         assertEquals("c", res.at("/query/operands/0/layer").asText());
@@ -95,6 +98,7 @@
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:hierarchy",
                 res.at("/query/operation").asText());
+        assertEquals("edgetype", res.at("/query/edgeType").asText());
         assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
         assertEquals("koral:span", res.at("/query/operands/1/@type").asText());
         assertEquals("np", res.at("/query/operands/1/key").asText());
@@ -113,6 +117,7 @@
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:hierarchy",
                 res.at("/query/operation").asText());
+        assertEquals("edgetype", res.at("/query/edgeType").asText());
         assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
         assertEquals("PP", res.at("/query/operands/0/key").asText());
         assertEquals("c", res.at("/query/operands/0/layer").asText());
@@ -131,6 +136,7 @@
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:hierarchy",
                 res.at("/query/operation").asText());
+        assertEquals("edgetype", res.at("/query/edgeType").asText());
         assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
         assertEquals("NP", res.at("/query/operands/0/key").asText());
         assertEquals("c", res.at("/query/operands/0/layer").asText());
@@ -149,6 +155,7 @@
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:hierarchy",
                 res.at("/query/operation").asText());
+        assertEquals("edgetype", res.at("/query/edgeType").asText());
         assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
         assertEquals("koral:token", res.at("/query/operands/1/@type").asText());
         assertEquals("Mann", res.at("/query/operands/1/wrap/key").asText());
@@ -197,12 +204,12 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals(0, res.at("/query/boundary/min").asInt());
         assertTrue(res.at("/query/boundary/max").isMissingNode());
-        
+
         // same layers
         query = "cat=\"NP\" & cnx/c=\"PP\" & #1 >2,4 #2";
         qs.setQuery(query, "annis");
         res = mapper.readTree(qs.toJSON());
-        
+
         assertEquals("c", res.at("/query/operands/0/layer").asText());
         assertEquals("c", res.at("/query/operands/1/layer").asText());
         assertEquals(2, res.at("/query/boundary/min").asInt());
@@ -234,14 +241,15 @@
         assertEquals("p", res.at("/query/operands/1/wrap/layer").asText());
     }
 
+
     @Test
     public void testIndirectDominanceWithFoundries ()
             throws JsonProcessingException, IOException {
-        
+
         query = "opennlp/c=\"NP\" & cnx/c=\"PP\" & #1 >2,4 #2";
         qs.setQuery(query, "annis");
         res = mapper.readTree(qs.toJSON());
-        
+
         assertEquals(305, res.at("/errors/0/0").asInt());
         assertEquals(
                 "Indirect dominance between operands of different foundries is not possible.",
@@ -268,6 +276,7 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("operation:hierarchy",
                 res.at("/query/operation").asText());
+        assertEquals("edgetype", res.at("/query/edgeType").asText());
         assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
         assertEquals("koral:term",
                 res.at("/query/operands/0/attr/@type").asText());
@@ -291,6 +300,7 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("operation:hierarchy",
                 res.at("/query/operation").asText());
+        assertEquals("edgetype", res.at("/query/edgeType").asText());
         assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
         assertEquals("koral:term",
                 res.at("/query/operands/0/attr/@type").asText());
@@ -305,24 +315,46 @@
 
 
     @Test
-    public void testDominanceWithTypeAndLabel ()
+    public void testDominanceWithEdgetypeAndLabel ()
             throws JsonProcessingException, IOException {
-        query = "node & node & #2 >rst[rst:name=\"evidence\"] #1";
+        query = "node & node & #2 >edgetype[func=\"SBJ\"] #1";
         //coordinates the func=SB term and requires a "c"-layer term (consituency relation/dominance)
         qs.setQuery(query, "annis");
         res = mapper.readTree(qs.toJSON());
         assertEquals("operation:hierarchy",
                 res.at("/query/operation").asText());
+        assertEquals("edgetype", res.at("/query/edgeType").asText());
         assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
         assertEquals("koral:term",
                 res.at("/query/operands/0/attr/@type").asText());
         assertEquals("match:eq",
                 res.at("/query/operands/0/attr/match").asText());
-        assertEquals("evidence", res.at("/query/operands/0/attr/key").asText());
+        assertEquals("SBJ", res.at("/query/operands/0/attr/key").asText());
         assertEquals("koral:span", res.at("/query/operands/1/@type").asText());
     }
 
 
+    @Test
+    public void testDominanceWithTypeAndLabel ()
+            throws JsonProcessingException, IOException {
+        query = "rst & rst & #2 >rst[rst:name=\"evidence\"] #1";
+        //coordinates the func=SB term and requires a "c"-layer term (consituency relation/dominance)
+        qs.setQuery(query, "annis");
+        res = mapper.readTree(qs.toJSON());
+        assertEquals("operation:relation", res.at("/query/operation").asText());
+        assertEquals("rst", res.at("/query/edgeType").asText());
+        assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
+        assertEquals("rst", res.at("/query/operands/0/layer").asText());
+        assertEquals("koral:span", res.at("/query/operands/1/@type").asText());
+        assertEquals("rst", res.at("/query/operands/1/layer").asText());
+
+        assertEquals("koral:term",
+                res.at("/query/relType/wrap/@type").asText());
+        assertEquals("evidence", res.at("/query/relType/wrap/key").asText());
+        assertEquals("rst", res.at("/query/relType/wrap/layer").asText());
+    }
+
+
 
     @Test
     public void testDominanceWithMultipleLabels ()
diff --git a/src/test/java/de/ids_mannheim/korap/query/test/annis/RelationTests.java b/src/test/java/de/ids_mannheim/korap/query/test/annis/RelationTests.java
index fb243d9..6da4f3d 100644
--- a/src/test/java/de/ids_mannheim/korap/query/test/annis/RelationTests.java
+++ b/src/test/java/de/ids_mannheim/korap/query/test/annis/RelationTests.java
@@ -13,6 +13,10 @@
 
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
 
+/**
+ * @author margaretha
+ *
+ */
 public class RelationTests {
     private String query;
 
@@ -24,10 +28,9 @@
     @Test
     public void testTypedRelationWithArbritraryNodes ()
             throws JsonProcessingException, IOException {
-        query = "node & node & #1 ->malt/d=\"PP\" #2";
+        query = "node & node & #1 ->malt/d[func=\"PP\"] #2";
         qs.setQuery(query, "annis");
         res = mapper.readTree(qs.toJSON());
-        //        System.out.println(res.asText());
 
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:relation", res.at("/query/operation").asText());
@@ -44,9 +47,30 @@
         assertTrue(res.at("/query/relType/wrap/value").isMissingNode());
     }
 
-
     @Test
-    public void testFoundryLayerTypedRelationWithArbritraryNodes ()
+    public void testTypedRelationWithLayerInLabel ()
+            throws JsonProcessingException, IOException {
+        query = "node & node & #1 ->malt/d[c:func!=\"PP\"] #2";
+        qs.setQuery(query, "annis");
+        res = mapper.readTree(qs.toJSON());
+
+        assertEquals("koral:group", res.at("/query/@type").asText());
+        assertEquals("operation:relation", res.at("/query/operation").asText());
+        assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
+        assertEquals("koral:span", res.at("/query/operands/1/@type").asText());
+
+        assertEquals("koral:relation", res.at("/query/relType/@type").asText());
+        assertEquals("koral:term",
+                res.at("/query/relType/wrap/@type").asText());
+        assertEquals("malt", res.at("/query/relType/wrap/foundry").asText());
+        assertEquals("d", res.at("/query/relType/wrap/layer").asText());
+        assertEquals("match:ne", res.at("/query/relType/wrap/match").asText());
+        assertEquals("PP", res.at("/query/relType/wrap/key").asText());
+        assertTrue(res.at("/query/relType/wrap/value").isMissingNode());
+    }
+    
+    @Test
+    public void testTypedRelationWithoutLabel ()
             throws JsonProcessingException, IOException {
         query = "node & node & #1 ->malt/d #2";
         qs.setQuery(query, "annis");
@@ -63,12 +87,32 @@
         assertTrue(res.at("/query/relType/wrap/key").isMissingNode());
         assertTrue(res.at("/query/relType/wrap/value").isMissingNode());
     }
+    
+    //EM: needs rewrite default foundry in Kustvakt
+    @Test
+    public void testTypedRelationWithoutFoundry ()
+            throws JsonProcessingException, IOException {
+        query = "node & node & #1 ->d #2";
+        qs.setQuery(query, "annis");
+        res = mapper.readTree(qs.toJSON());
+
+        assertEquals("koral:group", res.at("/query/@type").asText());
+        assertEquals("operation:relation", res.at("/query/operation").asText());
+
+        assertEquals("koral:relation", res.at("/query/relType/@type").asText());
+        assertEquals("koral:term",
+                res.at("/query/relType/wrap/@type").asText());
+        assertEquals("d", res.at("/query/relType/wrap/layer").asText());
+        assertTrue(res.at("/query/relType/wrap/foundry").isMissingNode());
+        assertTrue(res.at("/query/relType/wrap/key").isMissingNode());
+        assertTrue(res.at("/query/relType/wrap/value").isMissingNode());
+    }
 
 
     @Test
-    public void testTypedRelation ()
+    public void testTypedRelationWithAnnotationNodes ()
             throws JsonProcessingException, IOException {
-        query = "corenlp/c=\"VP\" & corenlp/c=\"NP\" & #1 ->malt/d=\"PP\" #2";
+        query = "corenlp/c=\"VP\" & corenlp/c=\"NP\" & #1 ->malt/d[func=\"PP\"] #2";
         qs.setQuery(query, "annis");
         res = mapper.readTree(qs.toJSON());
 
@@ -94,7 +138,7 @@
     @Test
     public void testIndirectTypedRelation ()
             throws JsonProcessingException, IOException {
-        query = "corenlp/c=\"VP\" & corenlp/c=\"NP\" & #1 ->malt/d=\"PP\" * #2";
+        query = "corenlp/c=\"VP\" & corenlp/c=\"NP\" & #1 ->malt/d[func=\"PP\"] * #2";
         qs.setQuery(query, "annis");
         res = mapper.readTree(qs.toJSON());
         
@@ -115,7 +159,7 @@
     @Test
     public void testSpecificIndirectTypedRelation ()
             throws JsonProcessingException, IOException {
-        query = "corenlp/c=\"VP\" & corenlp/c=\"NP\" & #1 ->malt/d=\"PP\" 2,4 #2";
+        query = "corenlp/c=\"VP\" & corenlp/c=\"NP\" & #1 ->malt/d[func=\"PP\"] 2,4 #2";
         qs.setQuery(query, "annis");
         res = mapper.readTree(qs.toJSON());
         
@@ -124,79 +168,15 @@
         assertEquals(4, res.at("/query/relType/boundary/max").asInt());
     }
 
-    @Test
-    public void testTypedRelationWithLabel ()
-            throws JsonProcessingException, IOException {
-        query = "corenlp/c=\"VP\" & corenlp/c=\"NP\" & "
-                + "#1 ->malt/d=\"PP\"[func=\"SBJ\"] #2";
-        qs.setQuery(query, "annis");
-        res = mapper.readTree(qs.toJSON());
-        
-        assertEquals("koral:relation", res.at("/query/relType/@type").asText());
-        assertEquals("koral:termGroup",
-                res.at("/query/relType/wrap/@type").asText());
-        assertEquals("relation:and",
-                res.at("/query/relType/wrap/relation").asText());
-        assertEquals("malt", res.at("/query/relType/wrap/operands/0/foundry").asText());
-        assertEquals("d", res.at("/query/relType/wrap/operands/0/layer").asText());
-        assertEquals("PP", res.at("/query/relType/wrap/operands/0/key").asText());
-        assertTrue(res.at("/query/relType/wrap/operands/0/value").isMissingNode());
-        
-        assertEquals("match:eq", res.at("/query/relType/wrap/operands/1/match").asText());
-        assertTrue(res.at("/query/relType/wrap/operands/1/layer").isMissingNode());
-        assertEquals("func", res.at("/query/relType/wrap/operands/1/key").asText());
-        assertEquals("SBJ", res.at("/query/relType/wrap/operands/1/value").asText());
-    }
+    
 
-    // fix me
     @Test
     public void testTypedRelationWithMultipleLabels ()
             throws JsonProcessingException, IOException {
         query = "corenlp/c=\"VP\" & corenlp/c=\"NP\" & "
-                + "#1 ->malt/d=\"PP\"[func=\"SBJ\" func!=\"ADV\"] #2";
+                + "#1 ->malt/d[func=\"SBJ\" func!=\"ADV\"] #2";
         qs.setQuery(query, "annis");
         res = mapper.readTree(qs.toJSON());
-        
-//        assertEquals("koral:relation", res.at("/query/relType/@type").asText());
-//        assertEquals("koral:termGroup",
-//                res.at("/query/relType/wrap/@type").asText());
-//        assertEquals("relation:and",
-//                res.at("/query/relType/wrap/relation").asText());
-//        assertEquals("malt", res.at("/query/relType/wrap/operands/0/foundry").asText());
-//        assertEquals("d", res.at("/query/relType/wrap/operands/0/layer").asText());
-//        assertEquals("PP", res.at("/query/relType/wrap/operands/0/key").asText());
-//        assertTrue(res.at("/query/relType/wrap/operands/0/value").isMissingNode());
-//        
-//        assertEquals("match:eq", res.at("/query/relType/wrap/operands/1/match").asText());
-//        assertTrue(res.at("/query/relType/wrap/operands/1/layer").isMissingNode());
-//        assertEquals("func", res.at("/query/relType/wrap/operands/1/key").asText());
-//        assertEquals("SBJ", res.at("/query/relType/wrap/operands/1/value").asText());
+        assertEquals(302, res.at("/errors/0/0").asInt());
     }
-    
-    //  
-    //  @Test
-    //  public void testPointingRelations() throws Exception {
-    //      query = "node & node & #2 ->coref[val=\"true\"] #1";
-    //      String dom1 = 
-    //              "{@type=koral:group, operation=operation:relation, operands=[" +
-    //                      "{@type=koral:span}," +
-    //                      "{@type=koral:span}" +
-    //              "], relation={@type=koral:relation, wrap={@type=koral:term, layer=coref, key=true, match=match:eq}}" +
-    //              "}";
-    //      aqlt = new AqlTree(query);
-    //      map = aqlt.getRequestMap().get("query").toString();
-    //      assertEquals(dom1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-    //      
-    //      query = "node & node & #2 ->mate/coref[val=\"true\"] #1";
-    //      String dom2 = 
-    //              "{@type=koral:group, operation=operation:relation, operands=[" +
-    //                      "{@type=koral:span}," +
-    //                      "{@type=koral:span}" +
-    //              "], relation={@type=koral:relation, wrap={@type=koral:term, foundry=mate, layer=coref, key=true, match=match:eq}}" +
-    //              "}";
-    //      aqlt = new AqlTree(query);
-    //      map = aqlt.getRequestMap().get("query").toString();
-    //      assertEquals(dom2.replaceAll(" ", ""), map.replaceAll(" ", ""));
-    //  }
-
 }
