correct handling of dates -> xsd:date
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java
index a33bc2e..5742b1e 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java
@@ -202,6 +202,11 @@
     		String regex = valueNode.getChild(0).getChild(0).toStringTree(parser);
     		map.put("value", regex.substring(1, regex.length()-1));
     		map.put("type", "type:regex");
+    	} else if (getNodeCat(valueNode.getChild(0)).equals("date")) {
+    		LinkedHashMap<String,String> valueMap = new LinkedHashMap<String,String>();
+    		valueMap.put("@type", "xsd:date");
+    		valueMap.put("@value", valueNode.getChild(0).getChild(0).toStringTree(parser));
+    		map.put("value", valueMap);
     	} else {
     		map.put("value", valueNode.getChild(0).toStringTree(parser));
     	}
@@ -399,7 +404,8 @@
         query = "(textClass=wissenschaft & textClass=politik) | textClass=ausland";
         query = "1990<year<2010 & genre=Sport";
         query = "1990<year<2010";
-        query = "year=2010   ";
+        query = "pubDate<2010-09";
+//        query = "foo=b-ar";
         CollectionQueryTree filter = new CollectionQueryTree();
 //    	filter.verbose = true;
         try {
diff --git a/src/test/java/CollectionQueryTreeTest.java b/src/test/java/CollectionQueryTreeTest.java
index 4fe87b1..f71eabb 100644
--- a/src/test/java/CollectionQueryTreeTest.java
+++ b/src/test/java/CollectionQueryTreeTest.java
@@ -43,7 +43,7 @@
 		expected = 
 				"{@type=korap:docGroup, operation=operation:and, operands=[" +
 					"{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," +
-					"{@type=korap:doc, key=year, value=2014, match=match:eq}" +
+					"{@type=korap:doc, key=year, value={@type=xsd:date, @value=2014}, match=match:eq}" +
 				"]}";
 		cqt = new CollectionQueryTree();
 		cqt.process(query);
@@ -58,7 +58,7 @@
 				"{@type=korap:docGroup, operation=operation:and, operands=[" +
 					"{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," +
 					"{@type=korap:docGroup, operation=operation:and, operands=[" +
-						"{@type=korap:doc, key=year, value=2014, match=match:eq}," +
+						"{@type=korap:doc, key=year, value={@type=xsd:date, @value=2014}, match=match:eq}," +
 						"{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}" +
 					"]}" +
 				"]}";
@@ -75,7 +75,7 @@
 		expected = 
 				"{@type=korap:docGroup, operation=operation:or, operands=[" +
 					"{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," +
-					"{@type=korap:doc, key=year, value=2014, match=match:eq}" +
+					"{@type=korap:doc, key=year, value={@type=xsd:date, @value=2014}, match=match:eq}" +
 				"]}";
 		cqt = new CollectionQueryTree();
 		cqt.process(query);
@@ -90,7 +90,7 @@
 				"{@type=korap:docGroup, operation=operation:or, operands=[" +
 					"{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," +
 					"{@type=korap:docGroup, operation=operation:or, operands=[" +
-						"{@type=korap:doc, key=year, value=2014, match=match:eq}," +
+						"{@type=korap:doc, key=year, value={@type=xsd:date, @value=2014}, match=match:eq}," +
 						"{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}" +
 					"]}" +
 				"]}";
@@ -162,7 +162,7 @@
 						"{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}," +
 						"{@type=korap:docGroup, operation=operation:and, operands=[" +
 							"{@type=korap:doc, key=author, value=White, match=match:eq}," +
-							"{@type=korap:doc, key=year, value=2010, match=match:eq}" +
+							"{@type=korap:doc, key=year, value={@type=xsd:date, @value=2010}, match=match:eq}" +
 						"]}" +
 					"]}" +
 				"]}";
@@ -178,8 +178,8 @@
 		query = "1990<pubDate<2010";
 		expected = 
 				"{@type=korap:docGroup, operation=operation:and, operands=[" +
-					"{@type=korap:doc, key=pubDate, value=1990, match=match:gt}," +
-					"{@type=korap:doc, key=pubDate, value=2010, match=match:lt}" +
+					"{@type=korap:doc, key=pubDate, value={@type=xsd:date, @value=1990}, match=match:gt}," +
+					"{@type=korap:doc, key=pubDate, value={@type=xsd:date, @value=2010}, match=match:lt}" +
 				"]}";
 		cqt = new CollectionQueryTree();
 		cqt.process(query);
@@ -188,7 +188,7 @@
 		
 		query = "pubDate>=1990";
 		expected = 
-				"{@type=korap:doc, key=pubDate, value=1990, match=match:geq}";
+				"{@type=korap:doc, key=pubDate, value={@type=xsd:date, @value=1990}, match=match:geq}";
 		cqt = new CollectionQueryTree();
 		cqt.process(query);
 		map = cqt.getRequestMap().toString();
@@ -196,7 +196,7 @@
 		
 		query = "pubDate>=1990-05";
 		expected = 
-				"{@type=korap:doc, key=pubDate, value=1990-05, match=match:geq}";
+				"{@type=korap:doc, key=pubDate, value={@type=xsd:date, @value=1990-05}, match=match:geq}";
 		cqt = new CollectionQueryTree();
 		cqt.process(query);
 		map = cqt.getRequestMap().toString();
@@ -204,7 +204,7 @@
 		
 		query = "pubDate>=1990-05-01";
 		expected = 
-				"{@type=korap:doc, key=pubDate, value=1990-05-01, match=match:geq}";
+				"{@type=korap:doc, key=pubDate, value={@type=xsd:date, @value=1990-05-01}, match=match:geq}";
 		cqt = new CollectionQueryTree();
 		cqt.process(query);
 		map = cqt.getRequestMap().toString();