relation quantification expressed by boundaries instead of distances
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/AqlTree.java b/src/main/java/de/ids_mannheim/korap/query/serialize/AqlTree.java
index c9f0386..f84c789 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/AqlTree.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/AqlTree.java
@@ -390,7 +390,7 @@
LinkedHashMap<String,Object> innerGroup = makeGroup("relation");
LinkedHashMap<String,Object> treeRelation = makeTreeRelation("dominance");
// commonancestor is an indirect commonparent relation
- if (reltype.equals("commonancestor")) treeRelation.put("distance", makeDistance("r", 1, MAXIMUM_DISTANCE));
+ if (reltype.equals("commonancestor")) treeRelation.put("boundary", makeBoundary(1, MAXIMUM_DISTANCE));
group.put("relation", treeRelation);
innerGroup.put("relation", treeRelation);
// Get operands list before possible re-assignment of 'group' (see following 'if')
@@ -523,8 +523,8 @@
if (rightChildSpec != null) relation.put("index", -1);
if (qName != null) relation.putAll(parseQNameNode(qName));
if (edgeSpec != null) relation.put("wrap", parseEdgeSpec(edgeSpec)) ;
- if (star != null) relation.put("distance", makeDistance("r", 0, 100));
- if (rangeSpec != null) relation.put("distance", distanceFromRangeSpec("r", rangeSpec));
+ if (star != null) relation.put("distance", makeBoundary(0, 100));
+ if (rangeSpec != null) relation.put("boundary", boundaryFromRangeSpec(rangeSpec));
}
else if (operator.equals("pointing")) {
@@ -538,8 +538,8 @@
// if (qName != null) relation.putAll(parseQNameNode(qName));
if (qName != null) relation.put("reltype", qName.getText());
if (edgeSpec != null) relation.put("wrap", parseEdgeSpec(edgeSpec)) ;
- if (star != null) relation.put("distance", makeDistance("r", 0, 100));
- if (rangeSpec != null) relation.put("distance", distanceFromRangeSpec("r", rangeSpec));
+ if (star != null) relation.put("distance", makeBoundary(0, 100));
+ if (rangeSpec != null) relation.put("boundary", boundaryFromRangeSpec(rangeSpec));
}
else if (operator.equals("precedence")) {
diff --git a/src/test/java/AqlTreeTest.java b/src/test/java/AqlTreeTest.java
index 1fd636f..faa1cd1 100644
--- a/src/test/java/AqlTreeTest.java
+++ b/src/test/java/AqlTreeTest.java
@@ -169,7 +169,7 @@
"{@type=korap:span}," +
"{@type=korap:token, wrap={@type=korap:term, key=Mann, match=match:eq}}" +
"], relation={@type=korap:treeRelation, reltype=dominance, " +
- "distance={@type=korap:distance, key=r, min=2, max=4}}" +
+ "boundary={@type=korap:boundary, min=2, max=4}}" +
"}";
aqlt = new AqlTree(query);
map = aqlt.getRequestMap().get("query").toString();