Updated relation key to relType.

Change-Id: Ice39642f5099caac1b6bad3793ef9023dcc9719b
diff --git a/src/main/java/de/ids_mannheim/korap/KrillQuery.java b/src/main/java/de/ids_mannheim/korap/KrillQuery.java
index b55cd43..af1db1d 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillQuery.java
@@ -415,12 +415,20 @@
                 return this._operationRepetitionFromJson(json, operands);
 
             case "operation:relation":
-                if (!json.has("relation")) {
+                // if (!json.has("relType")) {
+                // throw new QueryException(717,
+                // "Missing relation node");
+                // }
+                if (json.has("relType"))
+                    return _operationRelationFromJson(operands,
+                            json.get("relType"));
+                else if (json.has("relation")) {
+                    return _operationRelationFromJson(operands,
+                            json.get("relation"));
+                }
+                else {
                     throw new QueryException(717, "Missing relation node");
                 }
-
-                return _operationRelationFromJson(operands,
-                        json.get("relation"));
                 /*throw new QueryException(765,
                   "Relations are currently not supported");*/
 
@@ -1339,6 +1347,7 @@
             if (rootValue.equals("true") || rootValue.equals("false")) {
 
                 // TODO: Here do not refer to 'tokens'!!!
+                // EM: what should it be? property?
                 return new SpanAttributeQueryWrapper(
                         new SpanSimpleQueryWrapper("tokens", "@root",
                                 Boolean.valueOf(rootValue)));
diff --git a/src/test/resources/queries/reference/bug-multiple-distance.jsonld b/src/test/resources/queries/reference/bug-multiple-distance.jsonld
index de9bee6..dd8c419 100644
--- a/src/test/resources/queries/reference/bug-multiple-distance.jsonld
+++ b/src/test/resources/queries/reference/bug-multiple-distance.jsonld
@@ -83,7 +83,7 @@
         "classRef": [1]
       }
     ],
-    "relation": {
+    "relType": {
       "@type": "koral:relation",
       "wrap": {
         "@type": "koral:term",
diff --git a/src/test/resources/queries/reference/distance-multiple-references.jsonld b/src/test/resources/queries/reference/distance-multiple-references.jsonld
index 31ef098..f3d6c50 100644
--- a/src/test/resources/queries/reference/distance-multiple-references.jsonld
+++ b/src/test/resources/queries/reference/distance-multiple-references.jsonld
@@ -93,7 +93,7 @@
                             "classRef": [2]
                         }
                     ],
-                    "relation": {
+                    "relType": {
                         "@type": "koral:relation",
                         "wrap": {
                             "@type": "koral:term",
@@ -110,7 +110,7 @@
                 "classRef": [3]
             }
         ],
-        "relation": {
+        "relType": {
             "@type": "koral:relation",
             "wrap": {
                 "@type": "koral:term",
diff --git a/src/test/resources/queries/reference/distance-reference.jsonld b/src/test/resources/queries/reference/distance-reference.jsonld
index cf23596..4db7b87 100644
--- a/src/test/resources/queries/reference/distance-reference.jsonld
+++ b/src/test/resources/queries/reference/distance-reference.jsonld
@@ -85,7 +85,7 @@
                 "classRef": [2]
             }
         ],
-        "relation": {
+        "relType": {
             "@type": "koral:relation",
             "wrap": {
                 "@type": "koral:term",
diff --git a/src/test/resources/queries/reference/first-operand-reference.jsonld b/src/test/resources/queries/reference/first-operand-reference.jsonld
index 44792db..d83fa83 100644
--- a/src/test/resources/queries/reference/first-operand-reference.jsonld
+++ b/src/test/resources/queries/reference/first-operand-reference.jsonld
@@ -68,7 +68,7 @@
                             }]
                         }
                     ],
-                    "relation": {
+                    "relType": {
                         "@type": "koral:relation",
                         "wrap": {
                             "@type": "koral:term",
diff --git a/src/test/resources/queries/reference/multiple-references.jsonld b/src/test/resources/queries/reference/multiple-references.jsonld
index f94cfb5..8de4852 100644
--- a/src/test/resources/queries/reference/multiple-references.jsonld
+++ b/src/test/resources/queries/reference/multiple-references.jsonld
@@ -83,7 +83,7 @@
                 "classRef": [1]
             }
         ],
-        "relation": {
+        "relType": {
             "@type": "koral:relation",
             "wrap": {
                 "@type": "koral:term",
diff --git a/src/test/resources/queries/reference/second-operand-reference.jsonld b/src/test/resources/queries/reference/second-operand-reference.jsonld
index 47388cc..0f170eb 100644
--- a/src/test/resources/queries/reference/second-operand-reference.jsonld
+++ b/src/test/resources/queries/reference/second-operand-reference.jsonld
@@ -63,7 +63,7 @@
                             }]
                         }
                     ],
-                    "relation": {
+                    "relType": {
                         "@type": "koral:relation",
                         "wrap": {
                             "@type": "koral:term",
diff --git a/src/test/resources/queries/relation/focus-empty-both.json b/src/test/resources/queries/relation/focus-empty-both.json
index 1e9fa16..fb6aa83 100644
--- a/src/test/resources/queries/relation/focus-empty-both.json
+++ b/src/test/resources/queries/relation/focus-empty-both.json
@@ -24,7 +24,7 @@
                     }]
                 }
             ],
-            "relation": {
+            "relType": {
                 "@type": "koral:relation",
                 "wrap": {
                     "@type": "koral:term",
diff --git a/src/test/resources/queries/relation/focus-empty-target.json b/src/test/resources/queries/relation/focus-empty-target.json
index 78ac125..e2fb447 100644
--- a/src/test/resources/queries/relation/focus-empty-target.json
+++ b/src/test/resources/queries/relation/focus-empty-target.json
@@ -27,7 +27,7 @@
                     }]
                 }
             ],
-            "relation": {
+            "relType": {
                 "@type": "koral:relation",
                 "wrap": {
                     "@type": "koral:term",
diff --git a/src/test/resources/queries/relation/focus-source.json b/src/test/resources/queries/relation/focus-source.json
index 68d5ce4..0055911 100644
--- a/src/test/resources/queries/relation/focus-source.json
+++ b/src/test/resources/queries/relation/focus-source.json
@@ -22,7 +22,7 @@
                     }]
                 }
             ],
-            "relation": {
+            "relType": {
                 "@type": "koral:relation",
                 "wrap": {
                     "@type": "koral:term",
diff --git a/src/test/resources/queries/relation/focus-target.json b/src/test/resources/queries/relation/focus-target.json
index 46282a8..3c36eb0 100644
--- a/src/test/resources/queries/relation/focus-target.json
+++ b/src/test/resources/queries/relation/focus-target.json
@@ -30,7 +30,7 @@
                     }]
                 }
             ],
-            "relation": {
+            "relType": {
                 "@type": "koral:relation",
                 "wrap": {
                     "@type": "koral:term",
diff --git a/src/test/resources/queries/relation/match-source-and-target.json b/src/test/resources/queries/relation/match-source-and-target.json
index 860528f..9be7eb3 100644
--- a/src/test/resources/queries/relation/match-source-and-target.json
+++ b/src/test/resources/queries/relation/match-source-and-target.json
@@ -14,7 +14,7 @@
                 "key": "vp"
             }
         ],
-        "relation": {
+        "relType": {
             "@type": "koral:relation",
             "wrap": {
                 "@type": "koral:term",
diff --git a/src/test/resources/queries/relation/match-source.json b/src/test/resources/queries/relation/match-source.json
index 3ca5686..0f50094 100644
--- a/src/test/resources/queries/relation/match-source.json
+++ b/src/test/resources/queries/relation/match-source.json
@@ -12,7 +12,7 @@
                 "@type": "koral:token"             
             }
         ],
-        "relation": {
+        "relType": {
             "@type": "koral:relation",
             "wrap": {
                 "@type": "koral:term",
diff --git a/src/test/resources/queries/relation/match-target.json b/src/test/resources/queries/relation/match-target.json
index 7fe4ef0..26ea532 100644
--- a/src/test/resources/queries/relation/match-target.json
+++ b/src/test/resources/queries/relation/match-target.json
@@ -10,7 +10,7 @@
                 "key": "vp"                
             }
         ],
-        "relation": {
+        "relType": {
             "@type": "koral:relation",
             "wrap": {
                 "@type": "koral:term",
diff --git a/src/test/resources/queries/relation/operand-with-attribute.json b/src/test/resources/queries/relation/operand-with-attribute.json
index 570031c..a89855e 100644
--- a/src/test/resources/queries/relation/operand-with-attribute.json
+++ b/src/test/resources/queries/relation/operand-with-attribute.json
@@ -21,7 +21,7 @@
                 "key": "vp"
             }
         ],
-        "relation": {
+        "relType": {
             "@type": "koral:relation",
             "wrap": {
                 "@type": "koral:term",
diff --git a/src/test/resources/queries/relation/operand-with-property.json b/src/test/resources/queries/relation/operand-with-property.json
index 407c900..6540ae1 100644
--- a/src/test/resources/queries/relation/operand-with-property.json
+++ b/src/test/resources/queries/relation/operand-with-property.json
@@ -19,7 +19,7 @@
                 "key": "vp"
             }
         ],
-        "relation": {
+        "relType": {
             "@type": "koral:relation",
             "wrap": {
                 "@type": "koral:term",
diff --git a/src/test/resources/queries/relation/relation-only.json b/src/test/resources/queries/relation/relation-only.json
index 8801184..7ada14a 100644
--- a/src/test/resources/queries/relation/relation-only.json
+++ b/src/test/resources/queries/relation/relation-only.json
@@ -6,7 +6,7 @@
             {"@type": "koral:token"},
             {"@type": "koral:token"}
         ],
-        "relation": {
+        "relType": {
             "@type": "koral:relation",
             "wrap": {
                 "@type": "koral:term",