diff --git a/README.md b/README.md
index db6206e..4711bea 100644
--- a/README.md
+++ b/README.md
@@ -103,7 +103,14 @@
 There is also a command line version. After installation, simply run
 
     java -jar target/Koral-0.2.jar [query] [queryLanguage]
-    
+   
+## Prerequisites
+
+Java 7 (OpenJDK or Oracle JDK with [JCE] (http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html))
+[Git](http://git-scm.com/),
+At least [Maven 3.2.1](https://maven.apache.org/).
+Further dependencies are resolved by Maven.
+
 ## Authorship
 
 Koral and KoralQuery were developed by Joachim Bingel,
diff --git a/pom.xml b/pom.xml
index 2516d11..453f107 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,246 +1,274 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
 
-  <groupId>de.ids_mannheim.korap</groupId>
-  <artifactId>Koral</artifactId>
-  <version>0.22</version>
-  <packaging>jar</packaging>
-  <name>Koral</name>
-  <url>http://maven.apache.org</url>
+	<groupId>de.ids_mannheim.korap</groupId>
+	<artifactId>Koral</artifactId>
+	<version>0.22</version>
+	<packaging>jar</packaging>
+	<name>Koral</name>
+	<url>http://maven.apache.org</url>
 
-  <organization>
-    <name>IDS Mannheim</name>
-    <url>http://www.ids-mannheim.de/</url>
-  </organization>
+	<organization>
+		<name>IDS Mannheim</name>
+		<url>http://www.ids-mannheim.de/</url>
+	</organization>
 
-  <developers>
-    <developer>
-      <name>Joachim Bingel</name>
-      <email>bingel@ids-mannheim.de</email>
-    </developer>
-    <developer>
-      <name>Nils Diewald</name>
-      <email>diewald@ids-mannheim.de</email>
-      <url>http://nils-diewald.de</url>
-    </developer>
-    <developer>
-      <name>Michael Hanl</name>
-      <email>hanl@ids-mannheim.de</email>
-    </developer>
-    <developer>
-      <name>Eliza Margaretha</name>
-      <email>margaretha@ids-mannheim.de</email>
-    </developer>
-  </developers>
+	<developers>
+		<developer>
+			<name>Joachim Bingel</name>
+			<email>bingel@ids-mannheim.de</email>
+		</developer>
+		<developer>
+			<name>Nils Diewald</name>
+			<email>diewald@ids-mannheim.de</email>
+			<url>http://nils-diewald.de</url>
+		</developer>
+		<developer>
+			<name>Michael Hanl</name>
+			<email>hanl@ids-mannheim.de</email>
+		</developer>
+		<developer>
+			<name>Eliza Margaretha</name>
+			<email>margaretha@ids-mannheim.de</email>
+		</developer>
+	</developers>
 
-  <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-  </properties>
+	<properties>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+	</properties>
 
-  <repositories>
-    <repository>
-      <id>id-maven-repo</id>
-      <url>http://maven.indexdata.com</url>
-    </repository>
-  </repositories>
-  <dependencies>
-    <dependency>
-      <groupId>org.antlr</groupId>
-      <artifactId>antlr4-runtime</artifactId>
-      <version>4.2</version>
-    </dependency>
-    <dependency>
-      <groupId>org.antlr</groupId>
-      <artifactId>antlr4-maven-plugin</artifactId>
-      <version>4.2</version>
-    </dependency>
-    <dependency>
-      <groupId>org.antlr</groupId>
-      <artifactId>antlr-runtime</artifactId>
-      <version>3.5</version>
-      <scope>compile</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-      <version>15.0</version>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-core</artifactId>
-      <version>2.3.3</version>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-annotations</artifactId>
-      <version>2.3.3</version>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-databind</artifactId>
-      <version>2.3.3</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.11</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-      <version>2.6</version>
-    </dependency>
-    <dependency>
-      <groupId>org.z3950.zing</groupId>
-      <artifactId>cql-java</artifactId>
-      <version>1.12</version>
-    </dependency>
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-      <version>1.2.17</version>
-    </dependency>
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>apache-log4j-extras</artifactId>
-      <version>1.2.17</version>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-      <version>1.7.5</version>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-      <version>1.7.5</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <sourceDirectory>${basedir}/src/main/java</sourceDirectory>
-    <outputDirectory>${basedir}/target/classes</outputDirectory>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>3.3</version>
-        <configuration>
-          <compilerVersion>1.7</compilerVersion>
-          <source>1.7</source>
-          <target>1.7</target>
-        </configuration>
-      </plugin>
-      <!--
-	  Formatter plugin for Eclipse based coding conventions
-	  http://maven-java-formatter-plugin.googlecode.com/svn/site/0.4/usage.html
-      -->      
-      <plugin>
-	<groupId>com.googlecode.maven-java-formatter-plugin</groupId>
-	<artifactId>maven-java-formatter-plugin</artifactId>
-	<version>0.4</version>
-	<configuration>
-	  <configFile>${project.basedir}/Format.xml</configFile>
-	  <overrideConfigCompilerVersion>true</overrideConfigCompilerVersion>
-	  <compilerSource>1.7</compilerSource>
-	  <compilerCompliance>1.7</compilerCompliance>
-	  <compilerTargetPlatform>1.7</compilerTargetPlatform>
-	</configuration>
-      </plugin>
-      <plugin>
-	<artifactId>maven-dependency-plugin</artifactId>
-	<executions>
-	  <execution>
-	    <phase>install</phase>
-	    <goals>
-	      <goal>copy-dependencies</goal>
-	    </goals>
-	    <configuration>
-	      <outputDirectory>${project.build.directory}/../lib</outputDirectory>
-	    </configuration>
-	  </execution>
-	</executions>
-      </plugin>
-      <plugin>
-	<groupId>org.apache.maven.plugins</groupId>
-	<artifactId>maven-jar-plugin</artifactId>
-	<version>2.5</version>
-	<configuration>
-	  <archive>
-	    <manifest>
-	      <addClasspath>true</addClasspath>
-	      <classpathPrefix>../lib/</classpathPrefix>
-	      <mainClass>de.ids_mannheim.korap.query.serialize.QuerySerializer</mainClass>
-	    </manifest>
-	  </archive>
-	</configuration>
-      </plugin>
-      <plugin>
-	<!-- This plugin will help to build the ANTLR4 grammar on the fly. The 
-	     recipe is based on http://stackoverflow.com/questions/15310628/ customize-maven-to-automatically-create-antlr4-grammar-java-files-on-build -->
-	<groupId>org.antlr</groupId>
-	<artifactId>antlr4-maven-plugin</artifactId>
-	<version>4.2</version>
-	<executions>
-	  <execution>
-	    <id>poliqarpplus</id>
-	    <goals>
-	      <goal>antlr4</goal>
-	    </goals>
-	    <configuration>
-	      <sourceDirectory>${basedir}/src/main/antlr/poliqarpplus</sourceDirectory>
-	      <outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/poliqarpplus</outputDirectory>
-	      <libDirectory>${basedir}/src/main/antlr/poliqarpplus</libDirectory>
-	    </configuration>
-	    <phase>generate-sources</phase>
-	  </execution>
-	  <execution>
-	    <id>annis</id>
-	    <goals>
-	      <goal>antlr4</goal>
-	    </goals>
-	    <configuration>
-	      <sourceDirectory>${basedir}/src/main/antlr/annis</sourceDirectory>
-	      <outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/annis</outputDirectory>
-	      <libDirectory>${basedir}/src/main/antlr/annis</libDirectory>
-	    </configuration>
-	    <phase>generate-sources</phase>
-	  </execution>
-	  <execution>
-	    <id>collection</id>
-	    <goals>
-	      <goal>antlr4</goal>
-	    </goals>
-	    <configuration>
-	      <sourceDirectory>${basedir}/src/main/antlr/collection</sourceDirectory>
-	      <outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/collection</outputDirectory>
-	      <libDirectory>${basedir}/src/main/antlr/collection</libDirectory>
-	    </configuration>
-	    <phase>generate-sources</phase>
-	  </execution>
-	</executions>
-      </plugin>
-      <plugin>
-	<!-- This plugin will help to build the ANTLR3 grammar on the fly. The 
-	     recipe is based on http://stackoverflow.com/questions/15310628/ customize-maven-to-automatically-create-antlr4-grammar-java-files-on-build -->
-	<groupId>org.antlr</groupId>
-	<artifactId>antlr3-maven-plugin</artifactId>
-	<version>3.5.1</version>
-	<configuration>
-	  <sourceDirectory>${basedir}/src/main/antlr/cosmas</sourceDirectory>
-	  <outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/cosmas</outputDirectory>
-	  <libDirectory>${basedir}/src/main/antlr</libDirectory>
-	</configuration>
-	<executions>
-	  <execution>
-	    <goals>
-	      <goal>antlr</goal>
-	    </goals>
-	    <phase>generate-sources</phase>
-	  </execution>
-	</executions>
-      </plugin>
-    </plugins>
-  </build>
+	<repositories>
+		<repository>
+			<id>id-maven-repo</id>
+			<url>http://maven.indexdata.com</url>
+		</repository>
+		<repository>
+			<id>CLARIN</id>
+			<name>CLARIN Repository</name>
+			<url>https://nexus.clarin.eu/content/repositories/Clarin</url>
+			<snapshots>
+				<enabled>false</enabled>
+			</snapshots>
+		</repository>
+	</repositories>
+	<dependencies>
+		<!-- <dependency> <groupId>org.antlr</groupId> <artifactId>antlr4-runtime</artifactId> 
+			<version>4.2</version> </dependency> -->
+		<dependency>
+			<groupId>org.antlr</groupId>
+			<artifactId>antlr4-runtime</artifactId>
+			<version>4.5.1</version>
+		</dependency>
+		<dependency>
+			<groupId>org.antlr</groupId>
+			<artifactId>antlr4-maven-plugin</artifactId>
+			<version>4.2</version>
+		</dependency>
+		<dependency>
+			<groupId>org.antlr</groupId>
+			<artifactId>antlr-runtime</artifactId>
+			<version>3.5</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.google.guava</groupId>
+			<artifactId>guava</artifactId>
+			<version>15.0</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-core</artifactId>
+			<version>2.3.3</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-annotations</artifactId>
+			<version>2.3.3</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-databind</artifactId>
+			<version>2.3.3</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.11</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>commons-lang</groupId>
+			<artifactId>commons-lang</artifactId>
+			<version>2.6</version>
+		</dependency>
+		<dependency>
+			<groupId>org.z3950.zing</groupId>
+			<artifactId>cql-java</artifactId>
+			<version>1.12</version>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>1.2.17</version>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>apache-log4j-extras</artifactId>
+			<version>1.2.17</version>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-api</artifactId>
+			<version>1.7.5</version>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+			<version>1.7.5</version>
+		</dependency>
+		<dependency>
+			<groupId>eu.clarin.sru.fcs</groupId>
+			<artifactId>fcs-simple-endpoint</artifactId>
+			<version>1.3.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.lucene</groupId>
+			<artifactId>lucene-core</artifactId>
+			<version>5.2.1</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.lucene</groupId>
+			<artifactId>lucene-analyzers-common</artifactId>
+			<version>5.2.1</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.lucene</groupId>
+			<artifactId>lucene-queryparser</artifactId>
+			<version>5.2.1</version>
+		</dependency>
+	</dependencies>
+	<build>
+		<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
+		<outputDirectory>${basedir}/target/classes</outputDirectory>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>3.3</version>
+				<configuration>
+					<compilerVersion>1.7</compilerVersion>
+					<source>1.7</source>
+					<target>1.7</target>
+				</configuration>
+			</plugin>
+			<!-- Formatter plugin for Eclipse based coding conventions http://maven-java-formatter-plugin.googlecode.com/svn/site/0.4/usage.html -->
+			<plugin>
+				<groupId>com.googlecode.maven-java-formatter-plugin</groupId>
+				<artifactId>maven-java-formatter-plugin</artifactId>
+				<version>0.4</version>
+				<configuration>
+					<configFile>${project.basedir}/Format.xml</configFile>
+					<overrideConfigCompilerVersion>true</overrideConfigCompilerVersion>
+					<compilerSource>1.7</compilerSource>
+					<compilerCompliance>1.7</compilerCompliance>
+					<compilerTargetPlatform>1.7</compilerTargetPlatform>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<executions>
+					<execution>
+						<phase>install</phase>
+						<goals>
+							<goal>copy-dependencies</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>${project.build.directory}/../lib</outputDirectory>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<version>2.5</version>
+				<configuration>
+					<archive>
+						<manifest>
+							<addClasspath>true</addClasspath>
+							<classpathPrefix>../lib/</classpathPrefix>
+							<mainClass>de.ids_mannheim.korap.query.serialize.QuerySerializer</mainClass>
+						</manifest>
+					</archive>
+				</configuration>
+			</plugin>
+			<plugin>
+				<!-- This plugin will help to build the ANTLR4 grammar on the fly. The 
+					recipe is based on http://stackoverflow.com/questions/15310628/ customize-maven-to-automatically-create-antlr4-grammar-java-files-on-build -->
+				<groupId>org.antlr</groupId>
+				<artifactId>antlr4-maven-plugin</artifactId>
+				<version>4.2</version>
+				<executions>
+					<execution>
+						<id>poliqarpplus</id>
+						<goals>
+							<goal>antlr4</goal>
+						</goals>
+						<configuration>
+							<sourceDirectory>${basedir}/src/main/antlr/poliqarpplus</sourceDirectory>
+							<outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/poliqarpplus</outputDirectory>
+							<libDirectory>${basedir}/src/main/antlr/poliqarpplus</libDirectory>
+						</configuration>
+						<phase>generate-sources</phase>
+					</execution>
+					<execution>
+						<id>annis</id>
+						<goals>
+							<goal>antlr4</goal>
+						</goals>
+						<configuration>
+							<sourceDirectory>${basedir}/src/main/antlr/annis</sourceDirectory>
+							<outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/annis</outputDirectory>
+							<libDirectory>${basedir}/src/main/antlr/annis</libDirectory>
+						</configuration>
+						<phase>generate-sources</phase>
+					</execution>
+					<execution>
+						<id>collection</id>
+						<goals>
+							<goal>antlr4</goal>
+						</goals>
+						<configuration>
+							<sourceDirectory>${basedir}/src/main/antlr/collection</sourceDirectory>
+							<outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/collection</outputDirectory>
+							<libDirectory>${basedir}/src/main/antlr/collection</libDirectory>
+						</configuration>
+						<phase>generate-sources</phase>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<!-- This plugin will help to build the ANTLR3 grammar on the fly. The 
+					recipe is based on http://stackoverflow.com/questions/15310628/ customize-maven-to-automatically-create-antlr4-grammar-java-files-on-build -->
+				<groupId>org.antlr</groupId>
+				<artifactId>antlr3-maven-plugin</artifactId>
+				<version>3.5.1</version>
+				<configuration>
+					<sourceDirectory>${basedir}/src/main/antlr/cosmas</sourceDirectory>
+					<outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/cosmas</outputDirectory>
+					<libDirectory>${basedir}/src/main/antlr</libDirectory>
+				</configuration>
+				<executions>
+					<execution>
+						<goals>
+							<goal>antlr</goal>
+						</goals>
+						<phase>generate-sources</phase>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
 </project>
diff --git a/src/main/java/de/ids_mannheim/korap/query/object/KoralBoundary.java b/src/main/java/de/ids_mannheim/korap/query/object/KoralBoundary.java
new file mode 100644
index 0000000..0faee0e
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/object/KoralBoundary.java
@@ -0,0 +1,46 @@
+package de.ids_mannheim.korap.query.object;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public class KoralBoundary implements KoralObject {
+
+    private static final KoralType type = KoralType.BOUNDARY;
+
+    private int min;
+    private int max;
+
+    public KoralBoundary (int min, int max) {
+        this.min = min;
+        this.max = max;
+    }
+
+    public int getMin() {
+        return min;
+    }
+
+    public void setMin(int min) {
+        this.min = min;
+    }
+
+    public int getMax() {
+        return max;
+    }
+
+    public void setMax(int max) {
+        this.max = max;
+    }
+
+    @Override
+    public Map<String, Object> buildMap() {
+        Map<String, Object> map = new LinkedHashMap<String, Object>();
+        map.put("@type", type.toString());
+        if (min > -1) {
+            map.put("min", getMin());
+        }
+        if (max > -1) {
+            map.put("max", getMax());
+        }
+        return map;
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/object/KoralContext.java b/src/main/java/de/ids_mannheim/korap/query/object/KoralContext.java
new file mode 100644
index 0000000..abdde0b
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/object/KoralContext.java
@@ -0,0 +1,22 @@
+package de.ids_mannheim.korap.query.object;
+
+/**
+ * @author margaretha
+ * 
+ */
+public enum KoralContext {
+	SENTENCE("s"), PARAGRAPH("p"), TEXT("t");
+	
+	private final String key;
+	public static final String FOUNDRY ="base";
+	public static final String LAYER="s"; // surface
+	
+	KoralContext(String key){
+		this.key = key;
+	}
+
+	public String getKey() {
+		return key;
+	}
+
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/object/KoralDistance.java b/src/main/java/de/ids_mannheim/korap/query/object/KoralDistance.java
new file mode 100644
index 0000000..eb88f58
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/object/KoralDistance.java
@@ -0,0 +1,69 @@
+package de.ids_mannheim.korap.query.object;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public class KoralDistance implements KoralObject {
+
+    private final KoralType type = KoralType.DISTANCE;
+    private String key = "w";
+    private String foundry;
+    private String layer;
+    private KoralBoundary boundary;
+
+    public KoralDistance (KoralBoundary boundary) {
+        this.boundary = boundary;
+    }
+    
+    public KoralDistance (String key, KoralBoundary boundary) {            
+        this(boundary);
+        this.key = key;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getFoundry() {
+        return foundry;
+    }
+
+    public void setFoundry(String foundry) {
+        this.foundry = foundry;
+    }
+
+    public String getLayer() {
+        return layer;
+    }
+
+    public void setLayer(String layer) {
+        this.layer = layer;
+    }
+
+    public KoralBoundary getBoundary() {
+        return boundary;
+    }
+
+    public void setBoundary(KoralBoundary boundary) {
+        this.boundary = boundary;
+    }
+
+    @Override
+    public Map<String, Object> buildMap() {
+        Map<String, Object> distanceMap = new LinkedHashMap<String, Object>();
+        distanceMap.put("@type", type.toString());
+        distanceMap.put("key", key);
+        if (foundry != null){
+            distanceMap.put("foundry", foundry);
+        }
+        if (layer!=null){
+            distanceMap.put("layer", layer);
+        }
+        distanceMap.put("boundary", boundary.buildMap());
+        return distanceMap;
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/object/KoralGroup.java b/src/main/java/de/ids_mannheim/korap/query/object/KoralGroup.java
new file mode 100644
index 0000000..b304f72
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/object/KoralGroup.java
@@ -0,0 +1,124 @@
+package de.ids_mannheim.korap.query.object;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import de.ids_mannheim.korap.query.serialize.MapBuilder;
+import de.ids_mannheim.korap.query.object.KoralObject;
+import de.ids_mannheim.korap.query.object.KoralOperation;
+import de.ids_mannheim.korap.query.object.KoralType;
+
+/**
+ * @author margaretha
+ * 
+ */
+public class KoralGroup implements KoralObject {
+
+    private static final KoralType type = KoralType.GROUP;
+
+    private KoralOperation operation;
+
+    private boolean inOrder = false;
+    private List<KoralObject> operands;
+    private List<KoralDistance> distances;
+    private List<Frame> frames;
+    private KoralBoundary boundary;
+
+    public KoralGroup (KoralOperation operation) {
+        this.operation = operation;
+    }
+
+    public boolean isInOrder() {
+        return inOrder;
+    }
+
+    public void setInOrder(boolean inOrder) {
+        this.inOrder = inOrder;
+    }
+
+    public List<KoralObject> getOperands() {
+		return operands;
+	}
+    
+    public void setOperands(List<KoralObject> operands) {
+		this.operands = operands;
+	}
+
+    public KoralOperation getOperation() {
+        return operation;
+    }
+
+    public void setOperation(KoralOperation operation) {
+        this.operation = operation;
+    }
+
+    public List<KoralDistance> getDistances() {
+        return distances;
+    }
+
+    public void setDistances(List<KoralDistance> distances) {
+        this.distances = distances;
+    }
+    
+    public List<Frame> getFrames() {
+		return frames;
+	}
+
+	public void setFrames(List<Frame> frames) {
+		this.frames = frames;
+	}
+
+    public KoralBoundary getBoundary() {
+        return boundary;
+    }
+
+    public void setBoundary(KoralBoundary boundary) {
+        this.boundary = boundary;
+    }
+
+    @Override
+    public Map<String, Object> buildMap() {
+        Map<String, Object> map = new LinkedHashMap<String, Object>();
+        map.put("@type", type.toString());
+        map.put("operation", operation.toString());
+
+        if (getDistances() != null) {
+            map.put("inOrder", isInOrder());
+            List<Map<String, Object>> distanceList = new ArrayList<Map<String, Object>>();
+            for (KoralDistance d : distances) {
+                distanceList.add(d.buildMap());
+            }
+            map.put("distances", distanceList);
+        }
+
+        List<Map<String, Object>> operandList = new ArrayList<Map<String, Object>>();
+        for (Object o : operands) {
+            operandList.add(MapBuilder.buildQueryMap(o));
+        }
+        map.put("operands", operandList);
+
+        if (boundary != null) {
+            map.put("boundary", boundary.buildMap());
+        }
+        return map;
+    }
+
+    public enum Frame{
+		SUCCEDS("succeeds"), SUCCEDS_DIRECTLY("succeedsDirectly"), OVERLAPS_RIGHT("overlapsRight"), 
+		ALIGNS_RIGHT("alignsRight"), IS_WITHIN("isWithin"), STARTS_WITH("startsWith"), 
+		MATCHES("matches"), ALIGNS_LEFT("alignsLeft"), IS_AROUND("isAround"), ENDS_WITH("endsWith"),
+		OVERLAPS_LEFT("overlapsLeft"), PRECEEDS_DIRECTLY("precedesDirectly"), PRECEDES("precedes");
+		
+		private String value;
+		Frame(String value) {
+			this.value = value;
+		}
+		
+		@Override
+		public String toString() {
+			return "frame:"+value;
+		}
+	}
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/object/KoralMatchOperator.java b/src/main/java/de/ids_mannheim/korap/query/object/KoralMatchOperator.java
new file mode 100644
index 0000000..bd5f6ea
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/object/KoralMatchOperator.java
@@ -0,0 +1,20 @@
+package de.ids_mannheim.korap.query.object;
+
+/**
+ * @author margaretha
+ * 
+ */
+public enum KoralMatchOperator {
+    EQUALS("eq"), NOT_EQUALS("ne");
+
+    String value;
+
+    KoralMatchOperator (String value) {
+        this.value = value;
+    }
+
+    @Override
+    public String toString() {
+        return "match:" + value;
+    };
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/object/KoralObject.java b/src/main/java/de/ids_mannheim/korap/query/object/KoralObject.java
new file mode 100644
index 0000000..21fcf67
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/object/KoralObject.java
@@ -0,0 +1,12 @@
+package de.ids_mannheim.korap.query.object;
+
+import java.util.Map;
+
+/**
+ * @author margaretha
+ * 
+ */
+public interface KoralObject {
+
+    public Map<String, Object> buildMap();
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/object/KoralOperation.java b/src/main/java/de/ids_mannheim/korap/query/object/KoralOperation.java
new file mode 100644
index 0000000..972bfd3
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/object/KoralOperation.java
@@ -0,0 +1,15 @@
+package de.ids_mannheim.korap.query.object;
+
+/**
+ * @author margaretha
+ * 
+ */
+public enum KoralOperation {
+    SEQUENCE, POSITION, DISJUNCTION, REPETITION, CLASS, MERGE, RELATION;
+
+    @Override
+    public String toString() {
+        return "operation:" + super.toString().toLowerCase();
+    }
+
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/object/KoralRelation.java b/src/main/java/de/ids_mannheim/korap/query/object/KoralRelation.java
new file mode 100644
index 0000000..84a1ff8
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/object/KoralRelation.java
@@ -0,0 +1,15 @@
+package de.ids_mannheim.korap.query.object;
+
+/**
+ * @author margaretha
+ * 
+ */
+public enum KoralRelation {
+
+    AND, OR;
+
+    @Override
+    public String toString() {
+        return "relation:" + super.toString().toLowerCase();
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/object/KoralSpan.java b/src/main/java/de/ids_mannheim/korap/query/object/KoralSpan.java
new file mode 100644
index 0000000..4310bb9
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/object/KoralSpan.java
@@ -0,0 +1,62 @@
+package de.ids_mannheim.korap.query.object;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import de.ids_mannheim.korap.query.serialize.util.KoralException;
+import de.ids_mannheim.korap.query.serialize.util.StatusCodes;
+
+/**
+ * @author margaretha
+ *
+ */
+public class KoralSpan implements KoralObject{
+	
+	private static final KoralType type = KoralType.SPAN;
+	private final KoralObject wrappedObject;
+	private KoralObject attribute;
+	
+	public KoralSpan(KoralTerm term) throws KoralException {
+		if (term == null){
+			throw new KoralException(StatusCodes.MALFORMED_QUERY, "KoralSpan must not wrap null.");
+		}
+		this.wrappedObject = term;
+	}
+	
+	public KoralSpan(KoralTermGroup termGroup) throws KoralException {
+		if (termGroup == null){
+			throw new KoralException(StatusCodes.MALFORMED_QUERY,"KoralSpan must not wrap null.");
+		}
+		this.wrappedObject = termGroup;
+	}
+
+	public KoralObject getWrappedObject() {
+		return wrappedObject;
+	}
+	
+	public KoralObject getAttribute() {
+		return attribute;
+	}
+	
+	public void setAttribute(KoralTerm attribute) {
+		this.attribute = attribute;
+	}
+	
+	public void setAttribute(KoralTermGroup attributes) {
+		this.attribute = attributes;
+	}
+	
+	@Override
+	public Map<String, Object> buildMap() {
+		Map<String, Object> map = new LinkedHashMap<String, Object>();
+        map.put("@type", type.toString());
+        if (wrappedObject == null){
+        	throw new NullPointerException("KoralSpan does not have a wrapped object.");
+        }
+        map.put("wrap", wrappedObject.buildMap());
+        if(attribute != null){
+        	map.put("wrap", attribute.buildMap());
+        }
+		return map;
+	}
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/object/KoralTerm.java b/src/main/java/de/ids_mannheim/korap/query/object/KoralTerm.java
new file mode 100644
index 0000000..f9f60cd
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/object/KoralTerm.java
@@ -0,0 +1,138 @@
+package de.ids_mannheim.korap.query.object;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import de.ids_mannheim.korap.query.serialize.util.KoralException;
+import de.ids_mannheim.korap.query.serialize.util.StatusCodes;
+import de.ids_mannheim.korap.query.object.KoralMatchOperator;
+import de.ids_mannheim.korap.query.object.KoralType;
+
+/**
+ * @author margaretha
+ * 
+ */
+public class KoralTerm implements KoralObject {
+
+    private static final KoralType koralType = KoralType.TERM;
+  
+    private final String key;
+    private String value;
+    private String layer;
+    private String foundry;
+    private KoralMatchOperator operator; // match
+    
+    private KoralTermType type;
+    
+    private boolean caseSensitive = true;
+
+    public KoralTerm(String key) throws KoralException {
+    	if (key == null){
+    		throw new KoralException(StatusCodes.MALFORMED_QUERY, 
+    				"KoralTerm key cannot be null.");
+    	}
+    	this.key = key;
+    }
+    
+    public KoralTerm(KoralContext context) throws KoralException {
+    	if (context.getKey() == null){
+    		throw new KoralException(StatusCodes.MALFORMED_QUERY, 
+    				"KoralTerm key cannot be null.");
+    	}
+    	this.key = context.getKey();
+    	this.foundry = KoralContext.FOUNDRY;
+    	this.layer = KoralContext.LAYER;
+	}
+    
+    public String getValue() {
+		return value;
+	}
+    
+    public void setValue(String value) {
+		this.value = value;
+	}
+    
+	public String getLayer() {
+        return layer;
+    }
+
+    public void setLayer(String layer) {
+        this.layer = layer;
+    }
+
+    public String getFoundry() {
+        return foundry;
+    }
+
+    public void setFoundry(String foundry) {
+        this.foundry = foundry;
+    }
+
+    public KoralMatchOperator getOperator() {
+		return operator;
+	}
+    
+    public void setOperator(KoralMatchOperator operator) {
+		this.operator = operator;
+	}
+
+    public String getKey() {
+        return key;
+    }
+
+    public KoralTermType getType() {
+        return type;
+    }
+
+    public void setType(KoralTermType regex) {
+        this.type = regex;
+    }
+
+    public boolean isCaseSensitive() {
+        return caseSensitive;
+    }
+
+    public void setCaseSensitive(boolean isCaseSensitive) {
+        this.caseSensitive = isCaseSensitive;
+    }
+
+    @Override
+    public Map<String, Object> buildMap() {
+        Map<String, Object> map = new LinkedHashMap<String, Object>();
+        map.put("@type", koralType.toString());
+        if (!isCaseSensitive()) {
+            map.put("caseInsensitive", "true");
+        }
+        
+        map.put("key", getKey());
+        if (value != null){
+        	map.put("value", getValue());
+        }
+        map.put("foundry", getFoundry());
+        map.put("layer", getLayer());
+        if (type != null){
+        	map.put("type", getType().toString());
+        }
+		if (operator !=null){
+			map.put("match", getOperator().toString());
+		}
+        return map;
+    }
+
+    public enum KoralTermType {
+        STRING("type:string"), REGEX("type:regex"), WILDCARD("type:wildcard"), PUNCT(
+                "type:punct");
+
+        String value;
+
+        KoralTermType (String value) {
+            this.value = value;
+        }
+
+        @Override
+        public String toString() {
+            return value;
+        }
+    }
+
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/object/KoralTermGroup.java b/src/main/java/de/ids_mannheim/korap/query/object/KoralTermGroup.java
new file mode 100644
index 0000000..eaae803
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/object/KoralTermGroup.java
@@ -0,0 +1,57 @@
+package de.ids_mannheim.korap.query.object;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import de.ids_mannheim.korap.query.serialize.MapBuilder;
+import de.ids_mannheim.korap.query.serialize.util.KoralException;
+
+/**
+ * @author margaretha
+ * 
+ */
+public class KoralTermGroup implements KoralObject {
+
+    private static final KoralType type = KoralType.TERMGROUP;
+
+    private String relation;
+    private List<KoralObject> operands = new ArrayList<KoralObject>();
+
+    public KoralTermGroup (KoralRelation relation, List<KoralObject> operands)
+            throws KoralException {
+        this.relation = relation.toString();
+        this.operands = operands;
+    }
+
+    public String getRelation() {
+        return relation;
+    }
+
+    public void setRelation(String relation) {
+        this.relation = relation;
+    }
+
+    public List<KoralObject> getOperands() {
+        return operands;
+    }
+
+    public void setOperands(List<KoralObject> operands) {
+        this.operands = operands;
+    }
+
+    @Override
+    public Map<String, Object> buildMap() {
+        Map<String, Object> map = new LinkedHashMap<String, Object>();
+        map.put("@type", type.toString());
+        map.put("relation", getRelation());
+
+        List<Map<String, Object>> operandList = new ArrayList<Map<String, Object>>();
+        for (Object o : getOperands()) {
+            operandList.add(MapBuilder.buildQueryMap(o));
+        }
+        map.put("operands", operandList);
+        return map;
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/object/KoralToken.java b/src/main/java/de/ids_mannheim/korap/query/object/KoralToken.java
new file mode 100644
index 0000000..7798566
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/object/KoralToken.java
@@ -0,0 +1,40 @@
+package de.ids_mannheim.korap.query.object;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import de.ids_mannheim.korap.query.object.KoralObject;
+import de.ids_mannheim.korap.query.object.KoralType;
+
+/**
+ * @author margaretha
+ * 
+ */
+public class KoralToken implements KoralObject {
+
+    private final static KoralType type = KoralType.TOKEN;
+    private KoralObject wrappedObject;
+
+    public KoralToken () {}
+    
+    public KoralToken (KoralObject wrappedObject) {
+        this.wrappedObject = wrappedObject;
+    }
+
+    public KoralObject getWrappedObject() {
+		return wrappedObject;
+	}
+    public void setWrappedObject(KoralObject wrappedObject) {
+		this.wrappedObject = wrappedObject;
+	}
+
+    @Override
+    public Map<String, Object> buildMap() {
+        Map<String, Object> map = new LinkedHashMap<String, Object>();
+        map.put("@type", type.toString());
+        if (wrappedObject != null){
+            map.put("wrap", wrappedObject.buildMap());
+        }
+        return map;
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/object/KoralType.java b/src/main/java/de/ids_mannheim/korap/query/object/KoralType.java
new file mode 100644
index 0000000..df7608f
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/object/KoralType.java
@@ -0,0 +1,23 @@
+package de.ids_mannheim.korap.query.object;
+
+/**
+ * @author margaretha
+ * 
+ */
+public enum KoralType {
+    TERMGROUP("koral:termGroup"), TERM("koral:term"), TOKEN("koral:token"), SPAN(
+            "koral:span"), GROUP("koral:group"), BOUNDARY("koral:boundary"), RELATION(
+            "koral:relation"), DISTANCE("koral:distance"), REFERENCE(
+            "koral:reference");
+
+    String value;
+
+    KoralType (String value) {
+        this.value = value;
+    }
+
+    @Override
+    public String toString() {
+        return value;
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/parse/fcsql/ExpressionParser.java b/src/main/java/de/ids_mannheim/korap/query/parse/fcsql/ExpressionParser.java
new file mode 100644
index 0000000..42f5f83
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/parse/fcsql/ExpressionParser.java
@@ -0,0 +1,220 @@
+package de.ids_mannheim.korap.query.parse.fcsql;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import de.ids_mannheim.korap.query.object.KoralMatchOperator;
+import de.ids_mannheim.korap.query.object.KoralObject;
+import de.ids_mannheim.korap.query.object.KoralRelation;
+import de.ids_mannheim.korap.query.object.KoralTerm;
+import de.ids_mannheim.korap.query.object.KoralTerm.KoralTermType;
+import de.ids_mannheim.korap.query.object.KoralTermGroup;
+import de.ids_mannheim.korap.query.object.KoralToken;
+import de.ids_mannheim.korap.query.serialize.util.KoralException;
+import de.ids_mannheim.korap.query.serialize.util.StatusCodes;
+import eu.clarin.sru.server.fcs.parser.Expression;
+import eu.clarin.sru.server.fcs.parser.ExpressionAnd;
+import eu.clarin.sru.server.fcs.parser.ExpressionGroup;
+import eu.clarin.sru.server.fcs.parser.ExpressionNot;
+import eu.clarin.sru.server.fcs.parser.ExpressionOr;
+import eu.clarin.sru.server.fcs.parser.ExpressionWildcard;
+import eu.clarin.sru.server.fcs.parser.Operator;
+import eu.clarin.sru.server.fcs.parser.QueryNode;
+import eu.clarin.sru.server.fcs.parser.RegexFlag;
+
+/**
+ * @author margaretha
+ * 
+ */
+public class ExpressionParser {
+
+    private static final String FOUNDRY_CNX = "cnx";
+    private static final String FOUNDRY_OPENNLP = "opennlp";
+    private static final String FOUNDRY_TT = "tt";
+    private static final String FOUNDRY_MATE = "mate";
+    private static final String FOUNDRY_XIP = "xip";
+
+    private List<String> supportedFoundries = Arrays
+            .asList(new String[] { FOUNDRY_CNX, FOUNDRY_OPENNLP, FOUNDRY_TT,
+                    FOUNDRY_MATE, FOUNDRY_XIP });
+
+    public KoralObject parseExpression(QueryNode queryNode) throws KoralException {
+        return parseExpression(queryNode, false, true);
+    }
+
+    public KoralObject parseExpression(QueryNode queryNode, boolean isNot,
+            boolean isToken) throws KoralException {
+
+        if (queryNode instanceof Expression) {
+            return parseSimpleExpression((Expression) queryNode, isNot, isToken);
+        }
+        else if (queryNode instanceof ExpressionAnd) {
+            List<QueryNode> operands = queryNode.getChildren();
+            if (isNot) {
+                return parseBooleanExpression(operands, KoralRelation.OR);
+            }
+            else {
+                return parseBooleanExpression(operands, KoralRelation.AND);
+            }
+        }
+        else if (queryNode instanceof ExpressionGroup) {
+            // Ignore the group
+            return parseExpression(queryNode.getFirstChild());
+        }
+        else if (queryNode instanceof ExpressionNot) {
+            boolean negation = isNot ? false : true;
+            return parseExpression(queryNode.getChild(0), negation, isToken);
+        }
+        else if (queryNode instanceof ExpressionOr) {
+            List<QueryNode> operands = queryNode.getChildren();
+            if (isNot) {
+                return parseBooleanExpression(operands, KoralRelation.AND);
+            }
+            else {
+                return parseBooleanExpression(operands, KoralRelation.OR);
+            }
+        }
+        else if (queryNode instanceof ExpressionWildcard) {
+            return new KoralToken();
+        }
+        else {
+            throw new KoralException(StatusCodes.QUERY_TOO_COMPLEX,
+                    "FCS diagnostic 11: Query is too complex.");
+        }
+    }
+
+    private KoralToken parseBooleanExpression(List<QueryNode> operands,
+            KoralRelation relation) throws KoralException {
+        List<KoralObject> terms = new ArrayList<>();
+        for (QueryNode node : operands) {
+            terms.add(parseExpression(node, false, false));
+        }
+        KoralTermGroup termGroup = new KoralTermGroup(relation, terms);
+        return new KoralToken(termGroup);
+    }
+
+    private KoralObject parseSimpleExpression(Expression expression, boolean isNot,
+            boolean isToken) throws KoralException {
+        KoralTerm koralTerm = parseTerm(expression, isNot);
+        if (isToken) {
+            return new KoralToken(koralTerm);
+        }
+        else {
+            return koralTerm;
+        }
+    }
+
+    public KoralTerm parseTerm(Expression expression, boolean isNot) throws KoralException {
+    	KoralTerm koralTerm = null;
+    	koralTerm = new KoralTerm(expression.getRegexValue());
+        koralTerm.setType(KoralTermType.REGEX);
+        parseLayerIdentifier(koralTerm, expression.getLayerIdentifier());
+        parseQualifier(koralTerm, expression.getLayerQualifier());
+        parseOperator(koralTerm, expression.getOperator(), isNot);
+        parseRegexFlags(koralTerm, expression.getRegexFlags());
+        return koralTerm;
+    }
+
+    private void parseLayerIdentifier(KoralTerm koralTerm, String identifier) throws KoralException {
+        String layer = null;
+        if (identifier == null) {
+            throw new KoralException(StatusCodes.MALFORMED_QUERY,
+                    "FCS diagnostic 10: Layer identifier is missing.");
+        }
+        else if (identifier.equals("text")) {
+            layer = "orth";
+        }
+        else if (identifier.equals("pos")) {
+            layer = "p";
+        }
+        else if (identifier.equals("lemma")) {
+            layer = "l";
+        }
+        else {
+            throw new KoralException(StatusCodes.UNKNOWN_QUERY_ELEMENT,
+                    "SRU diagnostic 48: Layer " + identifier
+                            + " is unsupported.");
+        }
+
+        koralTerm.setLayer(layer);
+    }
+
+    private void parseQualifier(KoralTerm koralTerm, String qualifier) throws KoralException {
+        String layer = koralTerm.getLayer();
+        if (layer == null) {
+            return;
+        }
+        // Set default foundry
+        if (qualifier == null) {
+            if (layer.equals("orth")) {
+                qualifier = FOUNDRY_OPENNLP;
+            }
+            else {
+                qualifier = FOUNDRY_TT;
+            }
+        }
+        else if (qualifier.equals(FOUNDRY_OPENNLP) && layer.equals("l")) {
+            throw new KoralException(StatusCodes.UNKNOWN_QUERY_ELEMENT,
+                            "SRU diagnostic 48: Layer lemma with qualifier opennlp is unsupported.");
+        }
+        else if (!supportedFoundries.contains(qualifier)) {
+            throw new KoralException(StatusCodes.UNKNOWN_QUERY_ELEMENT,
+                    "SRU diagnostic 48: Qualifier " + qualifier
+                            + " is unsupported.");
+        }
+
+        koralTerm.setFoundry(qualifier);
+    }
+
+    private void parseOperator(KoralTerm koralTerm, Operator operator,
+            boolean isNot) throws KoralException {
+    	KoralMatchOperator matchOperator = null;
+        if (operator == null || operator == Operator.EQUALS) {
+            matchOperator = isNot ? KoralMatchOperator.NOT_EQUALS : KoralMatchOperator.EQUALS;
+        }
+        else if (operator == Operator.NOT_EQUALS) {
+            matchOperator = isNot ? KoralMatchOperator.EQUALS : KoralMatchOperator.NOT_EQUALS;
+        }
+        else {
+        	throw new KoralException(StatusCodes.UNKNOWN_QUERY_ELEMENT,
+                            "SRU diagnostic 37:" + operator.name()
+                                    + " is unsupported.");
+        }
+        koralTerm.setOperator(matchOperator);
+    }
+
+    private void parseRegexFlags(KoralTerm koralTerm, Set<RegexFlag> set) throws KoralException {
+        // default case sensitive
+        if (set == null) return;
+        
+        ArrayList<String> names = new ArrayList<String>();
+        Iterator<RegexFlag> i = set.iterator();
+        while (i.hasNext()) {
+            RegexFlag f = i.next();
+            if (f == RegexFlag.CASE_SENSITVE) {
+                koralTerm.setCaseSensitive(true);
+            }
+            else if (f == RegexFlag.CASE_INSENSITVE) {
+                koralTerm.setCaseSensitive(false);
+            }
+            else {
+                names.add(f.name());
+            }
+        }
+
+        if (names.size() == 1) {
+            throw new KoralException(StatusCodes.UNKNOWN_QUERY_ELEMENT,
+                    "SRU diagnostic 48: Regexflag: " + names.get(0)
+                            + " is unsupported.");
+        }
+        else if (names.size() > 1) {
+            throw new KoralException(StatusCodes.UNKNOWN_QUERY_ELEMENT,
+                    "SRU diagnostic 48: Regexflags: " + names.toString()
+                            + " are unsupported.");
+        }
+    }
+
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/parse/fcsql/FCSSRUQueryParser.java b/src/main/java/de/ids_mannheim/korap/query/parse/fcsql/FCSSRUQueryParser.java
new file mode 100644
index 0000000..92f535c
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/parse/fcsql/FCSSRUQueryParser.java
@@ -0,0 +1,245 @@
+package de.ids_mannheim.korap.query.parse.fcsql;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import de.ids_mannheim.korap.query.object.KoralContext;
+import de.ids_mannheim.korap.query.serialize.util.KoralException;
+import de.ids_mannheim.korap.query.serialize.util.StatusCodes;
+import de.ids_mannheim.korap.query.object.KoralBoundary;
+import de.ids_mannheim.korap.query.object.KoralGroup;
+import de.ids_mannheim.korap.query.object.KoralDistance;
+import de.ids_mannheim.korap.query.object.KoralObject;
+import de.ids_mannheim.korap.query.object.KoralOperation;
+import de.ids_mannheim.korap.query.object.KoralSpan;
+import de.ids_mannheim.korap.query.object.KoralTerm;
+import de.ids_mannheim.korap.query.object.KoralGroup.Frame;
+import eu.clarin.sru.server.fcs.parser.ExpressionWildcard;
+import eu.clarin.sru.server.fcs.parser.QueryDisjunction;
+import eu.clarin.sru.server.fcs.parser.QueryGroup;
+import eu.clarin.sru.server.fcs.parser.QueryNode;
+import eu.clarin.sru.server.fcs.parser.QuerySegment;
+import eu.clarin.sru.server.fcs.parser.QuerySequence;
+import eu.clarin.sru.server.fcs.parser.QueryWithWithin;
+import eu.clarin.sru.server.fcs.parser.SimpleWithin;
+import eu.clarin.sru.server.fcs.parser.SimpleWithin.Scope;
+
+/**
+ * @author margaretha
+ * 
+ */
+public class FCSSRUQueryParser {
+
+    private ExpressionParser expressionParser;
+
+    public FCSSRUQueryParser () {
+        this.expressionParser = new ExpressionParser();
+    }
+
+    public KoralObject parseQueryNode(QueryNode queryNode)
+            throws KoralException {
+
+        if (queryNode instanceof QuerySegment) {
+            return parseQuerySegment((QuerySegment) queryNode);
+        }
+        else if (queryNode instanceof QueryGroup) {
+            return parseQueryNode(queryNode.getChild(0));
+        }
+        else if (queryNode instanceof QuerySequence) {
+            return parseSequenceQuery(queryNode.getChildren());
+        }
+        else if (queryNode instanceof QueryDisjunction) {
+            return parseGroupQuery(queryNode.getChildren(),
+                    KoralOperation.DISJUNCTION);
+        }
+        else if (queryNode instanceof QueryWithWithin) {
+            return parseWithinQuery((QueryWithWithin) queryNode);
+        }
+        else if (queryNode instanceof SimpleWithin) {
+            SimpleWithin withinNode = (SimpleWithin) queryNode;
+            return parseWithinScope(withinNode.getScope());
+        }
+        else {
+            throw new KoralException(StatusCodes.QUERY_TOO_COMPLEX,
+                    "FCS diagnostic 11:" + queryNode.getNodeType().name()
+                            + " is currently unsupported.");
+        }
+    }
+
+    private KoralObject parseWithinQuery(QueryWithWithin queryNode)
+            throws KoralException {
+        KoralGroup koralGroup = new KoralGroup(KoralOperation.POSITION);
+        koralGroup.setFrames(Arrays.asList(Frame.IS_AROUND));
+
+        List<KoralObject> operands = new ArrayList<KoralObject>();
+        operands.add(parseQueryNode(queryNode.getWithin()));
+        operands.add(parseQueryNode(queryNode.getQuery()));
+        koralGroup.setOperands(operands);
+        return koralGroup;
+    }
+
+    private KoralSpan parseWithinScope(Scope scope) throws KoralException {
+        if (scope == null) {
+            throw new KoralException(StatusCodes.MALFORMED_QUERY,
+                    "FCS diagnostic 11: Within context is missing.");
+        }
+
+        KoralContext contextSpan;
+        if (scope == Scope.SENTENCE) {
+            contextSpan = KoralContext.SENTENCE;
+        }
+        else if (scope == Scope.PARAGRAPH) {
+            contextSpan = KoralContext.PARAGRAPH;
+        }
+        else if (scope == Scope.TEXT) {
+            contextSpan = KoralContext.TEXT;
+        }
+        else {
+            throw new KoralException(StatusCodes.QUERY_TOO_COMPLEX,
+                    "FCS diagnostic 11: Within scope " + scope.toString()
+                            + " is currently unsupported.");
+        }
+
+        return new KoralSpan(new KoralTerm(contextSpan));
+    }
+
+    private KoralGroup parseGroupQuery(List<QueryNode> children,
+            KoralOperation operation) throws KoralException {
+        KoralGroup koralGroup = new KoralGroup(operation);
+        List<KoralObject> operands = new ArrayList<KoralObject>();
+        for (QueryNode child : children) {
+            operands.add(parseQueryNode(child));
+        }
+        koralGroup.setOperands(operands);
+        return koralGroup;
+    }
+
+    private KoralGroup parseSequenceQuery(List<QueryNode> children)
+            throws KoralException {
+        KoralGroup koralGroup = new KoralGroup(KoralOperation.SEQUENCE);
+        List<KoralObject> operands = new ArrayList<KoralObject>();
+        KoralObject operand;
+
+        boolean isEmptyTokenFound = false;
+        boolean isLastTokenEmpty = false;
+        int size = children.size();
+
+        for (int i = 0; i < size; i++) {
+            QueryNode child = children.get(i);
+            if (i > 0 && i < size - 1 && findEmptyToken(child)) {
+                QuerySegment qs = (QuerySegment) child;
+                if (isLastTokenEmpty) {
+                    updateBoundary(operands.get(operands.size() - 1), qs);
+                }
+                else {
+                    operands.add(new KoralBoundary(qs.getMinOccurs(), qs
+                            .getMaxOccurs()));
+                    isLastTokenEmpty = true;
+                }
+                isEmptyTokenFound = true;
+                continue;
+            }
+            operand = parseQueryNode(child);
+            operands.add(operand);
+            isLastTokenEmpty = false;
+        }
+
+        if (isEmptyTokenFound) {
+            //operands = updateOperands(operands);
+            operands = createDistance(koralGroup,operands);
+        }
+
+        koralGroup.setOperands(operands);
+        return koralGroup;
+    }
+
+    private boolean findEmptyToken(QueryNode child) {
+        if (child instanceof QuerySegment
+                && ((QuerySegment) child).getExpression() instanceof ExpressionWildcard) {
+            return true;
+        }
+        return false;
+    }
+
+    private void updateBoundary(KoralObject koralObject, QuerySegment qs) {
+        KoralBoundary boundary = (KoralBoundary) koralObject;
+        boundary.setMin(boundary.getMin() + qs.getMinOccurs());
+        boundary.setMax(boundary.getMax() + qs.getMaxOccurs());
+    }
+
+    private List<KoralObject> createDistance(KoralGroup koralGroup, List<KoralObject> operands){
+        boolean isLastOperandUpdated = false;
+        boolean isDistanceSet = false;
+        List<KoralObject> newOperands = new ArrayList<KoralObject>(
+                operands.size());        
+        newOperands.add(operands.get(0));        
+        int operandSize = operands.size();
+        for (int i = 1; i < operandSize - 1; i++) {
+            KoralObject operand = operands.get(i);
+            if (operand instanceof KoralBoundary) {
+                if (isDistanceSet){
+                    
+                }
+                else{
+                    List<KoralDistance> distances = new ArrayList<KoralDistance>(1);
+                    distances.add(new KoralDistance((KoralBoundary) operand));
+                    koralGroup.setDistances(distances);
+                }
+                isLastOperandUpdated = true;
+            }
+            isLastOperandUpdated = false;
+        }
+        if (!isLastOperandUpdated){
+            newOperands.add(operands.get(operandSize-1));
+        }
+        return newOperands;
+    }
+    
+    private List<KoralObject> updateOperands(List<KoralObject> operands) {
+        boolean isLastOperandUpdated = false;
+        List<KoralObject> newOperands = new ArrayList<KoralObject>(
+                operands.size());        
+        newOperands.add(operands.get(0));        
+        int operandSize = operands.size();
+        for (int i = 1; i < operandSize - 1; i++) {
+            KoralObject operand = operands.get(i);
+            if (operand instanceof KoralBoundary) {
+                KoralGroup koralGroup = new KoralGroup(KoralOperation.SEQUENCE);
+                List<KoralDistance> distances = new ArrayList<KoralDistance>(1);
+                distances.add(new KoralDistance((KoralBoundary) operand));
+                koralGroup.setDistances(distances);
+                koralGroup.setOperands(Arrays.asList(newOperands.get(i - 1),
+                        operands.get(i + 1)));
+                newOperands.set(i-1,koralGroup);
+                isLastOperandUpdated = true;
+            }
+            isLastOperandUpdated = false;
+        }
+        if (!isLastOperandUpdated){
+            newOperands.add(operands.get(operandSize-1));
+        }
+        return newOperands;
+    }
+
+    private KoralObject parseQuerySegment(QuerySegment segment)
+            throws KoralException {
+        int minOccurs = segment.getMinOccurs();
+        int maxOccurs = segment.getMaxOccurs();
+
+        if ((minOccurs == 1) && (maxOccurs == 1)) {
+            return expressionParser.parseExpression(segment.getExpression());
+        }
+        else {
+            KoralBoundary boundary = new KoralBoundary(minOccurs, maxOccurs);
+            List<KoralObject> operand = new ArrayList<KoralObject>(1);
+            operand.add(expressionParser.parseExpression(segment
+                    .getExpression()));
+
+            KoralGroup koralGroup = new KoralGroup(KoralOperation.REPETITION);
+            koralGroup.setBoundary(boundary);
+            koralGroup.setOperands(operand);
+            return koralGroup;
+        }
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CqlQueryProcessor.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CqlQueryProcessor.java
index b06731c..2dd8985 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/CqlQueryProcessor.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CqlQueryProcessor.java
@@ -12,7 +12,7 @@
 
 /**
  * @author margaretha
- * @date 09.05.14
+ * @date 30.05.16
  */
 public class CqlQueryProcessor extends AbstractQueryProcessor {
 
@@ -22,51 +22,40 @@
     private static final String INDEX_WORDS = "words";
     private static final String TERM_RELATION_CQL_1_1 = "scr";
     private static final String TERM_RELATION_CQL_1_2 = "=";
-    private static final String SUPPORTED_RELATION_EXACT = "exact"; // not
-                                                                    // in
-                                                                    // the
-                                                                    // doc
+    private static final String SUPPORTED_RELATION_EXACT = "exact"; // not in the doc
     private static final String OPERATION_OR = "operation:or";
     private static final String OPERATION_SEQUENCE = "operation:sequence";
     private static final String OPERATION_POSITION = "operation:position";
-    private static final String KORAP_CONTEXT = "http://ids-mannheim.de/ns/KorAP/json-ld/v0.1/context.jsonld";
 
-    private LinkedHashMap<String, Object> requestMap;
     private String version;
     private boolean isCaseSensitive; // default true
 
-
     public CqlQueryProcessor (String query) {
         this(query, VERSION_1_2, true);
     }
 
-
     public CqlQueryProcessor (String query, String version) {
         this(query, version, true);
     }
 
-
     public CqlQueryProcessor (String query, String version,
-                              boolean isCaseSensitive) {
+            boolean isCaseSensitive) {
+        super();
         this.version = version;
         this.isCaseSensitive = isCaseSensitive;
-        this.requestMap = new LinkedHashMap<>();
-        requestMap.put("@context", KORAP_CONTEXT);
         process(query);
     }
 
-
     @Override
-    public Map<String, Object> getRequestMap () {
+    public Map<String, Object> getRequestMap() {
         return this.requestMap;
     }
 
-
     @Override
-    public void process (String query) {
+    public void process(String query) {
         if ((query == null) || query.isEmpty())
-            addError(StatusCodes.MALFORMED_QUERY,
-                    "SRU diagnostic 27: An empty query is unsupported.");
+            addError(StatusCodes.NO_QUERY,
+                    "SRU diagnostic 27: Empty query is unsupported.");
 
         CQLNode cqlNode = parseQuerytoCQLNode(query);
         Map<String, Object> queryMap = parseCQLNode(cqlNode);
@@ -74,8 +63,7 @@
         // requestMap.put("query", sentenceWrapper(queryMap));
     }
 
-
-    private Map<String, Object> sentenceWrapper (Map<String, Object> m) {
+    private Map<String, Object> sentenceWrapper(Map<String, Object> m) {
         Map<String, Object> map = new LinkedHashMap<String, Object>();
         map.put("@type", "koral:group");
         map.put("operation", OPERATION_POSITION);
@@ -93,8 +81,7 @@
         return map;
     }
 
-
-    private CQLNode parseQuerytoCQLNode (String query) {
+    private CQLNode parseQuerytoCQLNode(String query) {
         try {
             int compat = -1;
             switch (version) {
@@ -113,8 +100,7 @@
         }
     }
 
-
-    private Map<String, Object> parseCQLNode (CQLNode node) {
+    private Map<String, Object> parseCQLNode(CQLNode node) {
 
         if (node instanceof CQLTermNode) {
             return parseTermNode((CQLTermNode) node);
@@ -134,8 +120,7 @@
         }
     }
 
-
-    private Map<String, Object> parseTermNode (CQLTermNode node) {
+    private Map<String, Object> parseTermNode(CQLTermNode node) {
         checkTermNode(node);
         final String term = node.getTerm();
         if ((term == null) || term.isEmpty()) {
@@ -151,8 +136,7 @@
         }
     }
 
-
-    private Map<String, Object> parseAndNode (CQLAndNode node) {
+    private Map<String, Object> parseAndNode(CQLAndNode node) {
         checkBooleanModifier(node);
 
         Map<String, Object> map = new LinkedHashMap<String, Object>();
@@ -177,8 +161,7 @@
         return map;
     }
 
-
-    private Map<String, Object> parseOrNode (CQLOrNode node) {
+    private Map<String, Object> parseOrNode(CQLOrNode node) {
         checkBooleanModifier(node);
 
         Map<String, Object> map = new LinkedHashMap<String, Object>();
@@ -193,8 +176,7 @@
         return map;
     }
 
-
-    private Map<String, Object> writeSequence (String str) {
+    private Map<String, Object> writeSequence(String str) {
         Map<String, Object> sequenceMap = new LinkedHashMap<String, Object>();
         sequenceMap.put("@type", "koral:group");
         sequenceMap.put("operation", OPERATION_SEQUENCE);
@@ -209,8 +191,7 @@
         return sequenceMap;
     }
 
-
-    private Map<String, Object> writeTerm (String term) {
+    private Map<String, Object> writeTerm(String term) {
         Map<String, Object> map = new LinkedHashMap<String, Object>();
         map.put("@type", "koral:term");
         if (!isCaseSensitive) {
@@ -226,8 +207,7 @@
         return tokenMap;
     }
 
-
-    private void checkBooleanModifier (CQLBooleanNode node) {
+    private void checkBooleanModifier(CQLBooleanNode node) {
         List<Modifier> modifiers = node.getModifiers();
         if ((modifiers != null) && !modifiers.isEmpty()) {
             Modifier modifier = modifiers.get(0);
@@ -237,8 +217,7 @@
         }
     }
 
-
-    private void checkTermNode (CQLTermNode node) {
+    private void checkTermNode(CQLTermNode node) {
         // only allow "cql.serverChoice" and "words" index
         if (!(INDEX_CQL_SERVERCHOICE.equals(node.getIndex()) || INDEX_WORDS
                 .equals(node.getIndex()))) {
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/FCSQLQueryProcessor.java b/src/main/java/de/ids_mannheim/korap/query/serialize/FCSQLQueryProcessor.java
new file mode 100644
index 0000000..369e8e3
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/FCSQLQueryProcessor.java
@@ -0,0 +1,109 @@
+package de.ids_mannheim.korap.query.serialize;
+
+import java.util.Map;
+
+import de.ids_mannheim.korap.query.parse.fcsql.FCSSRUQueryParser;
+import de.ids_mannheim.korap.query.serialize.util.KoralException;
+import de.ids_mannheim.korap.query.serialize.util.StatusCodes;
+import eu.clarin.sru.server.SRUQueryBase;
+import eu.clarin.sru.server.fcs.Constants;
+import eu.clarin.sru.server.fcs.parser.QueryNode;
+import eu.clarin.sru.server.fcs.parser.QueryParser;
+import eu.clarin.sru.server.fcs.parser.QueryParserException;
+
+/**
+ * @author margaretha
+ * 
+ */
+public class FCSQLQueryProcessor extends AbstractQueryProcessor {
+
+    public static final class FCSSRUQuery extends SRUQueryBase<QueryNode> {
+
+        private FCSSRUQuery (String rawQuery, QueryNode parsedQuery) {
+            super(rawQuery, parsedQuery);
+        }
+
+        @Override
+        public String getQueryType() {
+            return Constants.FCS_QUERY_TYPE_FCS;
+        }
+    }
+
+    private static final String VERSION_2_0 = "2.0";
+
+    private final QueryParser fcsParser = new QueryParser();
+    private String version;
+
+    public FCSQLQueryProcessor (String query, String version) {
+        super();
+        this.version = version;
+        process(query);
+    }
+
+    @Override
+    public Map<String, Object> getRequestMap() {
+        return this.requestMap;
+    }
+
+    @Override
+    public void process(String query) {
+        if (isVersionValid()) {
+            FCSSRUQuery fcsSruQuery = parseQueryStringtoFCSQuery(query);
+            if (fcsSruQuery != null) {
+                QueryNode fcsQueryNode = fcsSruQuery.getParsedQuery();
+                try {
+					parseFCSQueryToKoralQuery(fcsQueryNode);
+				} catch (KoralException e) {
+					addError(e.getStatusCode(), e.getMessage());
+				}
+            }
+        }
+    }
+
+    private boolean isVersionValid() {
+        if (version == null || version.isEmpty()) {
+            addError(StatusCodes.MISSING_VERSION,
+                    "SRU diagnostic 7: Version number is missing.");
+            return false;
+        }
+        else if (!version.equals(VERSION_2_0)) {
+            addError(StatusCodes.MISSING_VERSION,
+                    "SRU diagnostic 5: Only supports SRU version 2.0.");
+            return false;
+        }
+        return true;
+    }
+
+    private FCSSRUQuery parseQueryStringtoFCSQuery(String query) {
+        if ((query == null) || query.isEmpty())
+            addError(StatusCodes.NO_QUERY,
+                    "SRU diagnostic 1: No query has been passed.");
+        FCSSRUQuery fcsQuery = null;
+        try {
+            QueryNode parsedQuery = fcsParser.parse(query);
+            fcsQuery = new FCSSRUQuery(query, parsedQuery);
+            if (fcsQuery == null) {
+                addError(StatusCodes.UNKNOWN_QUERY_ERROR,
+                        "FCS diagnostic 10: Unexpected error while parsing query.");
+            }
+        }
+        catch (QueryParserException e) {
+            addError(
+                    StatusCodes.UNKNOWN_QUERY_ERROR,
+                    "FCS diagnostic 10: Query cannot be parsed, "
+                            + e.getMessage());
+        }
+        catch (Exception e) {
+            addError(StatusCodes.UNKNOWN_QUERY_ERROR, "FCS diagnostic 10: "
+                    + "Unexpected error while parsing query.");
+        }
+        return fcsQuery;
+    }
+
+    private void parseFCSQueryToKoralQuery(QueryNode queryNode) throws KoralException {
+        FCSSRUQueryParser parser = new FCSSRUQueryParser();
+        Object o = parser.parseQueryNode(queryNode);
+        Map<String, Object> queryMap = MapBuilder.buildQueryMap(o);
+        if (queryMap != null) requestMap.put("query", queryMap);
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/MapBuilder.java b/src/main/java/de/ids_mannheim/korap/query/serialize/MapBuilder.java
new file mode 100644
index 0000000..9d1c2ee
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/MapBuilder.java
@@ -0,0 +1,42 @@
+package de.ids_mannheim.korap.query.serialize;
+
+import java.util.Map;
+
+import de.ids_mannheim.korap.query.object.KoralGroup;
+import de.ids_mannheim.korap.query.object.KoralSpan;
+import de.ids_mannheim.korap.query.object.KoralTerm;
+import de.ids_mannheim.korap.query.object.KoralTermGroup;
+import de.ids_mannheim.korap.query.object.KoralToken;
+
+/**
+ * @author margaretha
+ * 
+ */
+public class MapBuilder {
+
+    public static Map<String, Object> buildQueryMap(Object o) {
+        if (o != null) {
+            if (o instanceof KoralToken) {
+                KoralToken token = (KoralToken) o;
+                return token.buildMap();
+            }
+            else if (o instanceof KoralGroup) {
+                KoralGroup group = (KoralGroup) o;
+                return group.buildMap();
+            }
+            if (o instanceof KoralTerm) {
+                KoralTerm term = (KoralTerm) o;
+                return term.buildMap();
+            }
+            else if (o instanceof KoralTermGroup) {
+                KoralTermGroup termGroup = (KoralTermGroup) o;
+                return termGroup.buildMap();
+            }
+            else if (o instanceof KoralSpan){
+            	KoralSpan span = (KoralSpan) o;
+            	return span.buildMap();
+            }
+        }
+        return null;
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java b/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
index dcf0d3d..d4cb27e 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
@@ -12,11 +12,10 @@
 import java.util.*;
 
 /**
- * Main class for Koral, serializes queries from concrete QLs to
- * KoralQuery
+ * Main class for Koral, serializes queries from concrete QLs to KoralQuery
  * 
- * @author Joachim Bingel (bingel@ids-mannheim.de),
- *         Michael Hanl (hanl@ids-mannheim.de)
+ * @author Joachim Bingel (bingel@ids-mannheim.de), Michael Hanl
+ *         (hanl@ids-mannheim.de), Eliza Margaretha (margaretha@ids-mannheim.de)
  * @version 0.3.0
  * @since 0.1.0
  */
@@ -28,10 +27,11 @@
 
 
 
+
     static {
         qlProcessorAssignment = new HashMap<String, Class<? extends AbstractQueryProcessor>>();
-        qlProcessorAssignment.put("poliqarpplus",
-                PoliqarpPlusQueryProcessor.class);
+		qlProcessorAssignment.put("poliqarpplus",
+				PoliqarpPlusQueryProcessor.class);
         qlProcessorAssignment.put("cosmas2", Cosmas2QueryProcessor.class);
         qlProcessorAssignment.put("annis", AnnisQueryProcessor.class);
         qlProcessorAssignment.put("cql", CqlQueryProcessor.class);
@@ -50,18 +50,16 @@
     private org.slf4j.Logger log = LoggerFactory
             .getLogger(QuerySerializer.class);
 
-
-    public QuerySerializer () {
+	public QuerySerializer() {
         this.errors = new LinkedList<>();
         this.warnings = new LinkedList<>();
         this.messages = new LinkedList<>();
     }
 
-
     /**
      * @param args
      */
-    public static void main (String[] args) {
+	public static void main(String[] args) {
         /*
          * just for testing...
          */
@@ -74,8 +72,7 @@
             System.err
                     .println("Usage: QuerySerializer \"query\" queryLanguage");
             System.exit(1);
-        }
-        else {
+		} else {
             queries = new String[] { args[0] };
             ql = args[1];
         }
@@ -84,141 +81,118 @@
             try {
                 jg.run(q, ql);
                 System.out.println();
-            }
-            catch (NullPointerException npe) {
+			} catch (NullPointerException npe) {
                 npe.printStackTrace();
                 System.out.println("null\n");
-            }
-            catch (IOException e) {
+			} catch (IOException e) {
                 e.printStackTrace();
             }
         }
     }
 
-
     /**
-     * Runs the QuerySerializer by initializing the relevant
-     * AbstractSyntaxTree implementation (depending on specified query
-     * language) and transforms and writes the tree's requestMap to
-     * the specified output file.
-     * 
-     * @param query
-     *            The query string
-     * @param queryLanguage
-     *            The query language. As of 17 Dec 2014, this must be
-     *            one of 'poliqarpplus', 'cosmas2', 'annis' or 'cql'.
-     * @throws IOException
-     */
-    public void run (String query, String queryLanguage) throws IOException {
+	 * Runs the QuerySerializer by initializing the relevant AbstractSyntaxTree
+	 * implementation (depending on specified query language) and transforms and
+	 * writes the tree's requestMap to the specified output file.
+	 * 
+	 * @param query
+	 *            The query string
+	 * @param queryLanguage
+	 *            The query language. As of 17 Dec 2014, this must be one of
+	 *            'poliqarpplus', 'cosmas2', 'annis' or 'cql'.
+	 * @throws IOException
+	 */
+	public void run(String query, String queryLanguage) throws IOException {
         if (queryLanguage.equalsIgnoreCase("poliqarp")) {
             ast = new PoliqarpPlusQueryProcessor(query);
-        }
-        else if (queryLanguage.equalsIgnoreCase("cosmas2")) {
+		} else if (queryLanguage.equalsIgnoreCase("cosmas2")) {
             ast = new Cosmas2QueryProcessor(query);
-        }
-        else if (queryLanguage.equalsIgnoreCase("poliqarpplus")) {
+		} else if (queryLanguage.equalsIgnoreCase("poliqarpplus")) {
             ast = new PoliqarpPlusQueryProcessor(query);
-        }
-        else if (queryLanguage.equalsIgnoreCase("cql")) {
+		} else if (queryLanguage.equalsIgnoreCase("cql")) {
             ast = new CqlQueryProcessor(query);
-        }
-        else if (queryLanguage.equalsIgnoreCase("annis")) {
+		} else if (queryLanguage.equalsIgnoreCase("fcsql")) {
+			ast = new FCSQLQueryProcessor(query, "2.0");
+        }else if (queryLanguage.equalsIgnoreCase("annis")) {
             ast = new AnnisQueryProcessor(query);
-        }
-        else {
-            throw new IllegalArgumentException(queryLanguage
-                    + " is not a supported query language!");
+		} else {
+			throw new IllegalArgumentException(queryLanguage
+					+ " is not a supported query language!");
         }
         toJSON();
     }
 
-
-    public QuerySerializer setQuery (String query, String ql, String version) {
+	public QuerySerializer setQuery(String query, String ql, String version) {
         ast = new DummyQueryProcessor();
         if (query == null || query.isEmpty()) {
             ast.addError(StatusCodes.NO_QUERY, "You did not specify a query!");
-        }
-        else if (ql == null || ql.isEmpty()) {
+		} else if (ql == null || ql.isEmpty()) {
             ast.addError(StatusCodes.NO_QUERY,
                     "You did not specify any query language!");
-        }
-        else if (ql.equalsIgnoreCase("poliqarp")) {
+		} else if (ql.equalsIgnoreCase("poliqarp")) {
             ast = new PoliqarpPlusQueryProcessor(query);
-        }
-        else if (ql.equalsIgnoreCase("cosmas2")) {
+		} else if (ql.equalsIgnoreCase("cosmas2")) {
             ast = new Cosmas2QueryProcessor(query);
-        }
-        else if (ql.equalsIgnoreCase("poliqarpplus")) {
+		} else if (ql.equalsIgnoreCase("poliqarpplus")) {
             ast = new PoliqarpPlusQueryProcessor(query);
-        }
-        else if (ql.equalsIgnoreCase("cql")) {
-            if (version == null)
+        }else if (ql.equalsIgnoreCase("cql")) {
+			if (version == null) {
                 ast = new CqlQueryProcessor(query);
-            else
+			} else {
                 ast = new CqlQueryProcessor(query, version);
-        }
-        else if (ql.equalsIgnoreCase("annis")) {
+			}
+		} else if (ql.equalsIgnoreCase("fcsql")) {
+			if (version == null) {
+				ast.addError(StatusCodes.MISSING_VERSION,
+						"SRU Version is missing!");
+			} else {
+				ast = new FCSQLQueryProcessor(query, version);
+			}
+		} else if (ql.equalsIgnoreCase("annis")) {
             ast = new AnnisQueryProcessor(query);
-        }
-        else {
-            ast.addError(StatusCodes.UNKNOWN_QL, ql
-                    + " is not a supported query language!");
+        }else {
+			ast.addError(StatusCodes.UNKNOWN_QUERY_LANGUAGE,
+                    ql + " is not a supported query language!");
         }
         return this;
     }
 
-
-    public QuerySerializer setQuery (String query, String ql) {
+	public QuerySerializer setQuery(String query, String ql) {
         return setQuery(query, ql, "");
     }
 
-
-    public void setVerbose (boolean verbose) {
+	public void setVerbose(boolean verbose) {
         AbstractQueryProcessor.verbose = verbose;
     }
 
-
-    public final String toJSON () {
+	public final String toJSON() {
         String ser;
         try {
             ser = mapper.writeValueAsString(raw());
             qllogger.info("Serialized query: " + ser);
-        }
-        catch (JsonProcessingException e) {
+		} catch (JsonProcessingException e) {
             return "";
         }
         return ser;
     }
 
-
-    public final Map build () {
+	public final Map build() {
         return raw();
     }
 
-
-    private Map raw () {
+	private Map raw() {
         if (ast != null) {
-            Map<String, Object> requestMap = new HashMap<>(ast.getRequestMap());
+			Map<String, Object> requestMap = ast.getRequestMap();
             Map meta = (Map) requestMap.get("meta");
             Map collection = (Map) requestMap.get("collection");
             List errors = (List) requestMap.get("errors");
             List warnings = (List) requestMap.get("warnings");
             List messages = (List) requestMap.get("messages");
-            collection = mergeCollection(collection, this.collection);
-            requestMap.put("collection", collection);
-            
-            if (meta == null)
-                meta = new HashMap();
-            if (errors == null)
-                errors = new LinkedList();
-            if (warnings == null)
-                warnings = new LinkedList();
-            if (messages == null)
-                messages = new LinkedList();
-
+			this.collection = mergeCollection(collection, this.collection);
+			requestMap.put("collection", this.collection);
             if (this.meta != null) {
-                meta.putAll(this.meta);
-                requestMap.put("meta", meta);
+				this.meta.putAll(meta);
+				requestMap.put("meta", this.meta);
             }
             if (this.errors != null && !this.errors.isEmpty()) {
                 errors.addAll(this.errors);
@@ -232,43 +206,37 @@
                 messages.addAll(this.messages);
                 requestMap.put("messages", messages);
             }
+
             return cleanup(requestMap);
         }
         return new HashMap<>();
     }
 
-
-    private Map<String, Object> cleanup (Map<String, Object> requestMap) {
+	private Map<String, Object> cleanup(Map<String, Object> requestMap) {
         Iterator<Map.Entry<String, Object>> set = requestMap.entrySet()
                 .iterator();
         while (set.hasNext()) {
             Map.Entry<String, Object> entry = set.next();
-            if (entry.getValue() instanceof List
-                    && ((List) entry.getValue()).isEmpty())
+			if (entry.getValue() instanceof List
+					&& ((List) entry.getValue()).isEmpty())
                 set.remove();
-            else if (entry.getValue() instanceof Map
-                    && ((Map) entry.getValue()).isEmpty())
+			else if (entry.getValue() instanceof Map
+					&& ((Map) entry.getValue()).isEmpty())
                 set.remove();
-            else if (entry.getValue() instanceof String
-                    && ((String) entry.getValue()).isEmpty())
+			else if (entry.getValue() instanceof String
+					&& ((String) entry.getValue()).isEmpty())
                 set.remove();
         }
         return requestMap;
     }
 
-
-    private Map<String, Object> mergeCollection (
-            Map<String, Object> collection1, Map<String, Object> collection2) {
+	private Map<String, Object> mergeCollection(
+			Map<String, Object> collection1, Map<String, Object> collection2) {
         if (collection1 == null || collection1.isEmpty()) {
             return collection2;
-        }
-        else if (collection2 == null || collection2.isEmpty()) {
+		} else if (collection2 == null || collection2.isEmpty()) {
             return collection1;
-        }
-        else if (collection1.equals(collection2)) {
-            return collection1;
-        }
-        else {
+		} else {
             LinkedHashMap<String, Object> docGroup = KoralObjectGenerator
                     .makeDocGroup("and");
             ArrayList<Object> operands = (ArrayList<Object>) docGroup
@@ -279,9 +247,8 @@
         }
     }
 
-
     @Deprecated
-    public QuerySerializer addMeta (String cli, String cri, int cls, int crs,
+	public QuerySerializer addMeta(String cli, String cri, int cls, int crs,
             int num, int pageIndex) {
         MetaQueryBuilder meta = new MetaQueryBuilder();
         meta.setSpanContext(cls, cli, crs, cri);
@@ -291,14 +258,17 @@
         return this;
     }
 
-
-    public QuerySerializer setMeta (Map<String, Object> meta) {
+	public QuerySerializer setMeta(Map<String, Object> meta) {
         this.meta = meta;
         return this;
     }
 
+	public QuerySerializer setMeta(MetaQueryBuilder meta) {
+		this.meta = meta.raw();
+		return this;
+	}
 
-    public QuerySerializer setCollection (String collection) {
+	public QuerySerializer setCollection(String collection) {
         CollectionQueryProcessor tree = new CollectionQueryProcessor();
         tree.process(collection);
         Map<String, Object> collectionRequest = tree.getRequestMap();
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralException.java b/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralException.java
new file mode 100644
index 0000000..34d4569
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralException.java
@@ -0,0 +1,30 @@
+package de.ids_mannheim.korap.query.serialize.util;
+
+public class KoralException extends Exception{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 5463242042200109417L;
+	private int statusCode;
+	
+	public KoralException(int code, String message) {
+		super(message);
+		this.statusCode = code;
+	}
+	
+	public KoralException(int code, String message, Throwable cause) {
+        super(message, cause);
+        this.statusCode = code;
+    }
+
+	public int getStatusCode() {
+		return statusCode;
+	}
+
+	public void setStatusCode(int statusCode) {
+		this.statusCode = statusCode;
+	}
+
+	
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/util/StatusCodes.java b/src/main/java/de/ids_mannheim/korap/query/serialize/util/StatusCodes.java
index 10614ea..1f896b3 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/util/StatusCodes.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/util/StatusCodes.java
@@ -7,7 +7,9 @@
     public final static int INVALID_CLASS_REFERENCE = 304;
     public final static int INCOMPATIBLE_OPERATOR_AND_OPERAND = 305;
     public final static int UNKNOWN_QUERY_ELEMENT = 306;
-    public final static int UNKNOWN_QL = 307;
+	public final static int UNKNOWN_QUERY_LANGUAGE = 307;
     public final static int UNBOUND_ANNIS_RELATION = 308;
-    public final static int UNKNOWN_QUERY_ERROR = 399;
-}
+	public final static int MISSING_VERSION = 309;
+	public final static int QUERY_TOO_COMPLEX = 310;
+	public final static int UNKNOWN_QUERY_ERROR = 399;
+}
\ No newline at end of file
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/CqlQueryProcessorTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/CqlQueryProcessorTest.java
index 6f2bdd9..5af4b60 100644
--- a/src/test/java/de/ids_mannheim/korap/query/serialize/CqlQueryProcessorTest.java
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/CqlQueryProcessorTest.java
@@ -3,81 +3,58 @@
 import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
+import java.util.List;
 
 import org.junit.Test;
 import org.z3950.zing.cql.CQLParseException;
 
-import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 
-import de.ids_mannheim.korap.query.serialize.CqlQueryProcessor;
-import de.ids_mannheim.korap.query.serialize.Cosmas2QueryProcessor;
-
-
 public class CqlQueryProcessorTest {
 
     String query;
-    String version = "1.2";
+    String VERSION = "1.2";
     ObjectMapper mapper = new ObjectMapper();
 
-
-    @Test
-    public void testExceptions () throws CQLParseException, IOException {
-        query = "(Kuh) prox (Germ) ";
-        try {
-            CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, version);
-        }
-        catch (Exception e) {
-            int errorCode = Integer.parseInt(e.getMessage().split(":")[0]
-                    .replace("SRU diagnostic ", ""));
-            assertEquals(48, errorCode);
-        }
-
-        query = "(Kuh) or/rel.combine=sum (Germ) ";
-        try {
-            CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, version);
-        }
-        catch (Exception e) {
-            int errorCode = Integer.parseInt(e.getMessage().split(":")[0]
-                    .replace("SRU diagnostic ", ""));
-            assertEquals(20, errorCode);
-        }
-
-        query = "dc.title any Germ ";
-        try {
-            CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, version);
-        }
-        catch (Exception e) {
-            int errorCode = Integer.parseInt(e.getMessage().split(":")[0]
-                    .replace("SRU diagnostic ", ""));
-            assertEquals(16, errorCode);
-        }
-
-        query = "cql.serverChoice any Germ ";
-        try {
-            CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, version);
-        }
-        catch (Exception e) {
-            int errorCode = Integer.parseInt(e.getMessage().split(":")[0]
-                    .replace("SRU diagnostic ", ""));
-            assertEquals(19, errorCode);
-        }
-
-        query = "";
-        try {
-            CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, version);
-        }
-        catch (Exception e) {
-            int errorCode = Integer.parseInt(e.getMessage().split(":")[0]
-                    .replace("SRU diagnostic ", ""));
-            assertEquals(27, errorCode);
-        }
+    private List<Object> getError(CqlQueryProcessor processor) {
+        List<Object> errors = (List<Object>) processor.requestMap.get("errors");
+        return (List<Object>) errors.get(0);
     }
 
+    @Test
+    public void testExceptions() throws CQLParseException, IOException {
+        query = "(Kuh) prox (Germ) ";
+        CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, VERSION);
+        List<Object> error = getError(cqlTree);
+        assertEquals(
+                "SRU diagnostic 48: Only basic search including term-only "
+                        + "and boolean (AND,OR) operator queries are currently supported.",
+                error.get(1));
+
+        query = "(Kuh) or/rel.combine=sum (Germ) ";
+        error = getError(new CqlQueryProcessor(query, VERSION));
+        assertEquals(
+                "SRU diagnostic 20: Relation modifier rel.combine = sum is not supported.",
+                error.get(1));
+
+        query = "dc.title any Germ ";
+        error = getError(new CqlQueryProcessor(query, VERSION));
+        assertEquals("SRU diagnostic 16: Index dc.title is not supported.",
+                error.get(1));
+
+        query = "cql.serverChoice any Germ ";
+        error = getError(new CqlQueryProcessor(query, VERSION));
+        assertEquals("SRU diagnostic 19: Relation any is not supported.",
+                error.get(1));
+
+        query = "";
+        error = getError(new CqlQueryProcessor(query, VERSION));
+        assertEquals("SRU diagnostic 27: Empty query is unsupported.",
+                error.get(1));
+    }
 
     @Test
-    public void testAndQuery () throws CQLParseException, IOException,
-            Exception {
+    public void testAndQuery() throws CQLParseException, IOException, Exception {
         query = "(Sonne) and (scheint)";
         String jsonLd = "{@type : koral:group, operation : operation:sequence, inOrder : false,"
                 + "distances:[ "
@@ -87,19 +64,20 @@
                 + "{@type : koral:token,wrap : {@type : koral:term,key : scheint,layer : orth,match : match:eq}"
                 + "}]}";
 
-        CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, version);
+        CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, VERSION);
         String serializedQuery = mapper.writeValueAsString(cqlTree
                 .getRequestMap().get("query"));
         assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
-        //			/System.out.println(serializedQuery);
-        //CosmasTree ct = new CosmasTree("Sonne und scheint");
-        //serializedQuery = mapper.writeValueAsString(ct.getRequestMap().get("query"));
-        //assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
+        // /System.out.println(serializedQuery);
+        // CosmasTree ct = new CosmasTree("Sonne und scheint");
+        // serializedQuery =
+        // mapper.writeValueAsString(ct.getRequestMap().get("query"));
+        // assertEquals(jsonLd.replace(" ", ""),
+        // serializedQuery.replace("\"", ""));
     }
 
-
     @Test
-    public void testBooleanQuery () throws CQLParseException, IOException,
+    public void testBooleanQuery() throws CQLParseException, IOException,
             Exception {
         query = "((Sonne) or (Mond)) and (scheint)";
         String jsonLd = "{@type:koral:group, operation:operation:sequence, inOrder : false, distances:["
@@ -111,12 +89,11 @@
                 + "]},"
                 + "{@type:koral:token, wrap:{@type:koral:term, key:scheint, layer:orth, match:match:eq}}"
                 + "]}";
-        CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, version);
+        CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, VERSION);
         String serializedQuery = mapper.writeValueAsString(cqlTree
                 .getRequestMap().get("query"));
         assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
 
-
         query = "(scheint) and ((Sonne) or (Mond))";
         jsonLd = "{@type:koral:group, operation:operation:sequence, inOrder : false, distances:["
                 + "{@type:koral:distance, key:s, min:0, max:0}"
@@ -126,23 +103,22 @@
                 + "{@type:koral:token, wrap:{@type:koral:term, key:Sonne, layer:orth, match:match:eq}},"
                 + "{@type:koral:token, wrap:{@type:koral:term, key:Mond, layer:orth, match:match:eq}}"
                 + "]}" + "]}";
-        cqlTree = new CqlQueryProcessor(query, version);
+        cqlTree = new CqlQueryProcessor(query, VERSION);
         serializedQuery = mapper.writeValueAsString(cqlTree.getRequestMap()
                 .get("query"));
         assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
 
     }
 
-
     @Test
-    public void testOrQuery () throws CQLParseException, IOException, Exception {
+    public void testOrQuery() throws CQLParseException, IOException, Exception {
         query = "(Sonne) or (Mond)";
         String jsonLd = "{@type:koral:group, operation:operation:or, operands:["
                 + "{@type:koral:token, wrap:{@type:koral:term, key:Sonne, layer:orth, match:match:eq}},"
                 + "{@type:koral:token, wrap:{@type:koral:term, key:Mond, layer:orth, match:match:eq}}"
                 + "]}";
 
-        CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, version);
+        CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, VERSION);
         String serializedQuery = mapper.writeValueAsString(cqlTree
                 .getRequestMap().get("query"));
         assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
@@ -156,7 +132,7 @@
                 + "{@type:koral:token, wrap:{@type:koral:term, key:Mond, layer:orth, match:match:eq}}"
                 + "]}";
 
-        cqlTree = new CqlQueryProcessor(query, version);
+        cqlTree = new CqlQueryProcessor(query, VERSION);
         serializedQuery = mapper.writeValueAsString(cqlTree.getRequestMap()
                 .get("query"));
         assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
@@ -171,27 +147,25 @@
                 + "{@type:koral:token, wrap:{@type:koral:term, key:Mond, layer:orth, match:match:eq}},"
                 + "{@type:koral:token, wrap:{@type:koral:term, key:scheint, layer:orth, match:match:eq}}"
                 + "]}" + "]}";
-        cqlTree = new CqlQueryProcessor(query, version);
+        cqlTree = new CqlQueryProcessor(query, VERSION);
         serializedQuery = mapper.writeValueAsString(cqlTree.getRequestMap()
                 .get("query"));
         assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
     }
 
-
     @Test
-    public void testTermQuery () throws CQLParseException, IOException,
+    public void testTermQuery() throws CQLParseException, IOException,
             Exception {
         query = "Sonne";
         String jsonLd = "{@type:koral:token, wrap:{@type:koral:term, key:Sonne, layer:orth, match:match:eq}}";
-        CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, version);
+        CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, VERSION);
         String serializedQuery = mapper.writeValueAsString(cqlTree
                 .getRequestMap().get("query"));
         assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
     }
 
-
     @Test
-    public void testPhraseQuery () throws CQLParseException, IOException,
+    public void testPhraseQuery() throws CQLParseException, IOException,
             Exception {
         query = "\"der Mann\"";
         String jsonLd = "{@type:koral:group, operation:operation:sequence, operands:["
@@ -199,12 +173,11 @@
                 + "{@type:koral:token, wrap:{@type:koral:term, key:Mann, layer:orth, match:match:eq}}"
                 + "]}";
 
-        CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, version);
+        CqlQueryProcessor cqlTree = new CqlQueryProcessor(query, VERSION);
         String serializedQuery = mapper.writeValueAsString(cqlTree
                 .getRequestMap().get("query"));
         assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
 
-
         query = "der Mann schläft";
         jsonLd = "{@type:koral:group, operation:operation:sequence, operands:["
                 + "{@type:koral:token, wrap:{@type:koral:term, key:der, layer:orth, match:match:eq}},"
@@ -212,7 +185,7 @@
                 + "{@type:koral:token, wrap:{@type:koral:term, key:schläft, layer:orth, match:match:eq}}"
                 + "]}";
 
-        cqlTree = new CqlQueryProcessor(query, version);
+        cqlTree = new CqlQueryProcessor(query, VERSION);
         serializedQuery = mapper.writeValueAsString(cqlTree.getRequestMap()
                 .get("query"));
         assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/FCSQLComplexTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/FCSQLComplexTest.java
new file mode 100644
index 0000000..2493802
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/FCSQLComplexTest.java
@@ -0,0 +1,286 @@
+package de.ids_mannheim.korap.query.serialize;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+
+/**
+ * @author margaretha
+ * 
+ */
+public class FCSQLComplexTest {
+
+    // -------------------------------------------------------------------------
+    // simple-query ::= '(' main_query ')' /* grouping */
+    // | implicit-query
+    // | segment-query
+    // -------------------------------------------------------------------------
+    // implicit-query ::= flagged-regexp
+    // segment-query ::= "[" expression? "]"
+    // -------------------------------------------------------------------------
+    // simple-query ::= '(' main_query ')' /* grouping */
+    @Test
+    public void testGroupQuery() throws IOException {
+        String query = "(\"blaue\"|\"grüne\")";
+        String jsonLd = "{@type:koral:group,"
+                + "operation:operation:disjunction,"
+                + "operands:["
+                + "{@type:koral:token, wrap:{@type:koral:term,key:blaue,foundry:opennlp,layer:orth,type:type:regex,match:match:eq}},"
+                + "{@type:koral:token, wrap:{@type:koral:term,key:grüne,foundry:opennlp,layer:orth,type:type:regex,match:match:eq}}]}";;
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        // group and disjunction
+        query = "([pos=\"NN\"]|[cnx:pos=\"N\"]|[text=\"Mann\"])";
+        jsonLd = "{@type:koral:token,wrap:{@type:koral:term,key:N,foundry:cnx,layer:p,type:type:regex,match:match:eq}}";
+        FCSQLQueryProcessorTest
+                .validateNode(query, "/query/operands/1", jsonLd);
+
+        // group and sequence
+        query = "([text=\"blaue\"][pos=\"NN\"])";
+        jsonLd = "{@type:koral:group,"
+                + "operation:operation:sequence,"
+                + "operands:["
+                + "{@type:koral:token,wrap:{@type:koral:term,key:blaue,foundry:opennlp,layer:orth,type:type:regex,match:match:eq}},"
+                + "{@type:koral:token,wrap:{@type:koral:term,key:NN,foundry:tt,layer:p,type:type:regex,match:match:eq}}"
+                + "]}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+    }
+
+    // -------------------------------------------------------------------------
+    // main-query ::= simple-query
+    // | simple-query "|" main-query /* or */
+    // | simple-query main-query /* sequence */
+    // | simple-query quantifier /* quatification */
+    // -------------------------------------------------------------------------
+
+    // | simple-query "|" main-query /* or */
+    @Test
+    public void testOrQuery() throws IOException {
+        String query = "\"man\"|\"Mann\"";
+        String jsonLd = "{@type:koral:group,"
+                + "operation:operation:disjunction,"
+                + "operands:["
+                + "{@type:koral:token,wrap:{@type:koral:term,key:man,foundry:opennlp,layer:orth,type:type:regex,match:match:eq}},"
+                + "{@type:koral:token,wrap:{@type:koral:term,key:Mann,foundry:opennlp,layer:orth,type:type:regex,match:match:eq}}]}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        query = "[pos=\"NN\"]|\"Mann\"";
+        jsonLd = "{@type:koral:token,wrap:{@type:koral:term,key:NN,foundry:tt,layer:p,type:type:regex,match:match:eq}}";
+        FCSQLQueryProcessorTest
+                .validateNode(query, "/query/operands/0", jsonLd);
+
+        // group with two segment queries
+        query = "[pos=\"NN\"]|[text=\"Mann\"]";
+        jsonLd = "{@type:koral:group,"
+                + "operation:operation:disjunction,"
+                + "operands:["
+                + "{@type:koral:token, wrap:{@type:koral:term,key:NN,foundry:tt,layer:p,type:type:regex,match:match:eq}},"
+                + "{@type:koral:token, wrap:{@type:koral:term,key:Mann,foundry:opennlp,layer:orth,type:type:regex,match:match:eq}}]}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+    }
+
+    // | simple-query main-query /* sequence */
+    @Test
+    public void testSequenceQuery() throws IOException {
+        String query = "\"blaue|grüne\" [pos = \"NN\"]";
+        String jsonLd = "{@type:koral:group, "
+                + "operation:operation:sequence, "
+                + "operands:["
+                + "{@type:koral:token, wrap:{@type:koral:term, key:blaue|grüne, foundry:opennlp, layer:orth, type:type:regex, match:match:eq}},"
+                + "{@type:koral:token, wrap:{@type:koral:term, key:NN, foundry:tt, layer:p, type:type:regex, match:match:eq}}"
+                + "]}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        query = "[text=\"blaue|grüne\"][pos = \"NN\"]";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        query = "\"blaue\" \"grüne\" [pos = \"NN\"]";
+        jsonLd = "{@type:koral:token, wrap:{@type:koral:term, key:grüne, foundry:opennlp, layer:orth, type:type:regex, match:match:eq}}";
+        FCSQLQueryProcessorTest
+                .validateNode(query, "/query/operands/1", jsonLd);
+
+        // sequence and disjunction
+        query = "([pos=\"NN\"]|[cnx:pos=\"N\"])[text=\"Mann\"]";
+        jsonLd = "{@type:koral:group,"
+                + "operation:operation:sequence,"
+                + "operands:["
+                + "{@type:koral:group,"
+                + "operation:operation:disjunction,"
+                + "operands:[{@type:koral:token,wrap:{@type:koral:term,key:NN,foundry:tt,layer:p,type:type:regex,match:match:eq}},"
+                + "{@type:koral:token,wrap:{@type:koral:term,key:N,foundry:cnx,layer:p,type:type:regex,match:match:eq}}"
+                + "]},"
+                + "{@type:koral:token,wrap:{@type:koral:term,key:Mann,foundry:opennlp,layer:orth,type:type:regex,match:match:eq}}"
+                + "]}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+    }
+
+    // | simple-query quantifier /* quatification */
+    @Test
+    public void testQueryWithQuantifier() throws IOException {
+        // repetition
+        String query = "\"die\"{2}";
+        String jsonLd = "{@type:koral:group,"
+                + "operation:operation:repetition,"
+                + "operands:["
+                + "{@type:koral:token,wrap:{@type:koral:term,key:die,foundry:opennlp,layer:orth,type:type:regex,match:match:eq}}],"
+                + "boundary:{@type:koral:boundary,min:2,max:2}}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        query = "\"die\"{1,2}";
+        jsonLd = "{@type:koral:boundary,min:1,max:2}";
+        FCSQLQueryProcessorTest.validateNode(query, "/query/boundary", jsonLd);
+
+        query = "\"die\"{,2}";
+        jsonLd = "{@type:koral:boundary,min:0,max:2}";
+        FCSQLQueryProcessorTest.validateNode(query, "/query/boundary", jsonLd);
+
+        query = "\"die\"{2,}";
+        jsonLd = "{@type:koral:boundary,min:2}";
+        FCSQLQueryProcessorTest.validateNode(query, "/query/boundary", jsonLd);
+
+        query = "\"die\"+";
+        jsonLd = "{@type:koral:boundary,min:1}";
+        FCSQLQueryProcessorTest.validateNode(query, "/query/boundary", jsonLd);
+
+        query = "\"die\"?";
+        jsonLd = "{@type:koral:boundary,min:0, max:1}";
+        FCSQLQueryProcessorTest.validateNode(query, "/query/boundary", jsonLd);
+
+        query = "\"die\"*";
+        jsonLd = "{@type:koral:boundary,min:0}";
+        FCSQLQueryProcessorTest.validateNode(query, "/query/boundary", jsonLd);
+
+        query = "\"die\"{0}";
+        jsonLd = "{@type:koral:boundary,min:0, max:0}";
+        FCSQLQueryProcessorTest.validateNode(query, "/query/boundary", jsonLd);
+    }
+
+    // wildcards
+    @Test
+    public void testQueryWithEmptyToken() throws IOException {
+        // expansion query
+        String query = "[]{2}\"Hund\"";
+        String jsonLd = "{@type:koral:group, "
+                + "operation:operation:sequence, "
+                + "operands:["
+                + "{@type:koral:group,"
+                + "operation:operation:repetition,"
+                + "operands:["
+                + "{@type:koral:token}],"
+                + "boundary:{@type:koral:boundary,min:2,max:2}},"
+                + "{@type:koral:token, "
+                + "wrap:{@type:koral:term, key:Hund, foundry:opennlp, layer:orth, type:type:regex, match:match:eq}}"
+                + "]}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        query = "\"Hund\"[]{2}";
+        jsonLd = "{@type:koral:group," + "operation:operation:repetition,"
+                + "operands:[" + "{@type:koral:token}],"
+                + "boundary:{@type:koral:boundary,min:2,max:2}}";
+        FCSQLQueryProcessorTest
+                .validateNode(query, "/query/operands/1", jsonLd);
+
+        // arbitrary tokens
+        query = "[]{2}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        // sequence with extension
+        query = "[cnx:pos=\"A\"] \"Hund\"[]{2}";
+        jsonLd = "["
+                + "{@type:koral:token,wrap:{@type:koral:term,key:A,foundry:cnx,layer:p,type:type:regex,match:match:eq}},"
+                + "{@type:koral:token,wrap:{@type:koral:term,key:Hund,foundry:opennlp,layer:orth,type:type:regex,match:match:eq}},"
+                + "{@type:koral:group,operation:operation:repetition,operands:["
+                + "{@type:koral:token}],boundary:{@type:koral:boundary,min:2,max:2}}"
+                + "]";
+        FCSQLQueryProcessorTest.validateNode(query, "/query/operands", jsonLd);
+    }
+
+    @Test
+    public void testQueryWithDistance() throws JsonProcessingException {
+        // distance query
+        String query = "\"Katze\" []{3} \"Hund\"";
+        String jsonLd = "{@type:koral:group,operation:operation:sequence,inOrder:false,"
+                + "distances:["
+                + "{@type:koral:distance,key:w,boundary:{@type:koral:boundary,min:3,max:3}}"
+                + "],"
+                + "operands:["
+                + "{@type:koral:token,wrap:{@type:koral:term,key:Katze,foundry:opennlp,layer:orth,type:type:regex,match:match:eq}},"
+                + "{@type:koral:token,wrap:{@type:koral:term,key:Hund,foundry:opennlp,layer:orth,type:type:regex,match:match:eq}}]}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+    }
+
+    // -------------------------------------------------------------------------
+    // query ::= main-query within-part?
+    // -------------------------------------------------------------------------
+    // within-part ::= simple-within-part
+    // simple-within-part ::= "within" simple-within-scope
+
+    @Test
+    public void testWithinQuery() throws IOException {
+        String query = "[cnx:pos=\"VVFIN\"] within s";
+        String jsonLd = "{@type:koral:group,"
+                + "operation:operation:position,"
+                + "operands:["
+                + "{@type:koral:span,wrap:{@type:koral:term,key:s,foundry:base,layer:s}},"
+                + "{@type:koral:token,wrap:{@type:koral:term,key:VVFIN,foundry:cnx,layer:p,type:type:regex,match:match:eq}}"
+                + "]}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        query = "[cnx:pos=\"VVFIN\"] within sentence";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        query = "[cnx:pos=\"VVFIN\"] within p";
+        jsonLd = "{@type:koral:span,wrap:{@type:koral:term,key:p,foundry:base,layer:s}}";
+        FCSQLQueryProcessorTest
+                .validateNode(query, "/query/operands/0", jsonLd);
+
+        query = "[cnx:pos=\"VVFIN\"] within text";
+        jsonLd = "{@type:koral:span,wrap:{@type:koral:term,key:t,foundry:base,layer:s}}";
+        FCSQLQueryProcessorTest
+                .validateNode(query, "/query/operands/0", jsonLd);
+
+        query = "[cnx:pos=\"VVFIN\"] within u";
+        List<Object> error = FCSQLQueryProcessorTest
+                .getError(new FCSQLQueryProcessor(query, "2.0"));
+        assertEquals(310, error.get(0));
+        assertEquals(
+                "FCS diagnostic 11: Within scope UTTERANCE is currently unsupported.",
+                (String) error.get(1));
+    }
+
+    @Test
+    public void testWrongQuery() throws IOException {
+        String query = "!(mate:lemma=\"sein\" | mate:pos=\"PPOSS\")";
+        List<Object> error = FCSQLQueryProcessorTest
+                .getError(new FCSQLQueryProcessor(query, "2.0"));
+        assertEquals(399, error.get(0));
+        assertEquals(true,
+                error.get(1).toString().startsWith("FCS diagnostic 10"));
+
+        query = "![mate:lemma=\"sein\" | mate:pos=\"PPOSS\"]";
+        error = FCSQLQueryProcessorTest.getError(new FCSQLQueryProcessor(query,
+                "2.0"));
+        assertEquals(true,
+                error.get(1).toString().startsWith("FCS diagnostic 10"));
+
+        query = "(\"blaue\"&\"grüne\")";
+        error = FCSQLQueryProcessorTest.getError(new FCSQLQueryProcessor(query,
+                "2.0"));
+        assertEquals(true,
+                error.get(1).toString().startsWith("FCS diagnostic 10"));
+
+        query = "[pos=\"NN\"]&[text=\"Mann\"]";
+        error = FCSQLQueryProcessorTest.getError(new FCSQLQueryProcessor(query,
+                "2.0"));
+        assertEquals(399, error.get(0));
+        String msg = (String) error.get(1);
+        assertEquals(true, msg.startsWith("FCS diagnostic 10"));
+    }
+}
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/FCSQLQueryProcessorTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/FCSQLQueryProcessorTest.java
new file mode 100644
index 0000000..93a130c
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/FCSQLQueryProcessorTest.java
@@ -0,0 +1,283 @@
+package de.ids_mannheim.korap.query.serialize;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+/**
+ * @author margaretha
+ * 
+ */
+public class FCSQLQueryProcessorTest {
+
+    static QuerySerializer qs = new QuerySerializer();
+    static ObjectMapper mapper = new ObjectMapper();
+    static JsonNode node;
+
+    public static void runAndValidate(String query, String jsonLD)
+            throws JsonProcessingException {
+        FCSQLQueryProcessor processor = new FCSQLQueryProcessor(query, "2.0");
+        String serializedQuery = mapper.writeValueAsString(processor
+                .getRequestMap().get("query"));
+        assertEquals(jsonLD.replace(" ", ""), serializedQuery.replace("\"", ""));
+    }
+
+    public static void validateNode(String query, String path, String jsonLd)
+            throws JsonProcessingException, IOException {
+        qs.setQuery(query, "fcsql", "2.0");
+        node = mapper.readTree(qs.toJSON());
+        String serializedQuery = mapper.writeValueAsString(node.at(path));
+        assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
+    }
+
+    public static List<Object> getError(FCSQLQueryProcessor processor) {
+        List<Object> errors = (List<Object>) processor.requestMap.get("errors");
+        return (List<Object>) errors.get(0);
+    }
+
+    @Test
+    public void testVersion() throws JsonProcessingException {
+        List<Object> error = getError(new FCSQLQueryProcessor("\"Sonne\"",
+                "1.0"));
+        assertEquals(309, error.get(0));
+        assertEquals("SRU diagnostic 5: Only supports SRU version 2.0.",
+                error.get(1));
+
+        error = getError(new FCSQLQueryProcessor("\"Sonne\"", null));
+        assertEquals(309, error.get(0));
+        assertEquals("SRU diagnostic 7: Version number is missing.",
+                error.get(1));
+    }
+
+    // regexp ::= quoted-string
+    @Test
+    public void testTermQuery() throws JsonProcessingException {
+        String query = "\"Sonne\"";
+        String jsonLd = "{@type:koral:token, wrap:{@type:koral:term, key:Sonne, "
+                + "foundry:opennlp, layer:orth, type:type:regex, match:match:eq}}";
+        runAndValidate(query, jsonLd);
+    }
+
+    @Test
+    public void testRegex() throws JsonProcessingException {
+        String query = "[text=\"M(a|ä)nn(er)?\"]";
+        String jsonLd = "{@type:koral:token,wrap:{@type:koral:term,"
+                + "key:M(a|ä)nn(er)?,foundry:opennlp,layer:orth,type:type:regex,match:match:eq}}";
+        runAndValidate(query, jsonLd);
+
+        query = "\".*?Mann.*?\"";
+        jsonLd = "{@type:koral:token,wrap:{@type:koral:term,key:.*?Mann.*?,"
+                + "foundry:opennlp,layer:orth,type:type:regex,match:match:eq}}";
+        runAndValidate(query, jsonLd);
+
+        query = "\"z.B.\"";
+        jsonLd = "{@type:koral:token,wrap:{@type:koral:term,key:z.B.,"
+                + "foundry:opennlp,layer:orth,type:type:regex,match:match:eq}}";
+        runAndValidate(query, jsonLd);
+
+        query = "\"Sonne&scheint\"";
+        jsonLd = "{@type:koral:token,wrap:{@type:koral:term,key:Sonne&scheint,"
+                + "foundry:opennlp,layer:orth,type:type:regex,match:match:eq}}";
+        runAndValidate(query, jsonLd);
+
+        // Not possible
+        // query = "\"a\\.\"";
+    }
+
+    // flagged-regexp ::= regexp
+    // | regexp "/" regexp-flag+
+    @Test
+    public void testTermQueryWithRegexFlag() throws IOException {
+        String query = "\"Fliegen\" /c";
+        String jsonLd = "{@type:koral:token, wrap:{@type:koral:term, caseInsensitive:true, "
+                + "key:Fliegen, foundry:opennlp, layer:orth, type:type:regex, match:match:eq}}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        query = "\"Fliegen\" /i";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        query = "\"Fliegen\" /C";
+        jsonLd = "{@type:koral:term, key:Fliegen, foundry:opennlp, layer:orth, type:type:regex, match:match:eq}";
+        FCSQLQueryProcessorTest.validateNode(query, "/query/wrap", jsonLd);
+
+        query = "\"Fliegen\" /I";
+        FCSQLQueryProcessorTest.validateNode(query, "/query/wrap", jsonLd);
+
+        query = "\"Fliegen\" /l";
+        List<Object> error = FCSQLQueryProcessorTest
+                .getError(new FCSQLQueryProcessor(query, "2.0"));
+        assertEquals(306, error.get(0));
+        String msg = (String) error.get(1);
+        assertEquals(true, msg.startsWith("SRU diagnostic 48: Regexflags"));
+
+        query = "\"Fliegen\" /d";
+        error = FCSQLQueryProcessorTest.getError(new FCSQLQueryProcessor(query,
+                "2.0"));
+        assertEquals(306, error.get(0));
+        assertEquals(
+                "SRU diagnostic 48: Regexflag: IGNORE_DIACRITICS is unsupported.",
+                (String) error.get(1));
+    }
+
+    // operator ::= "=" /* equals */
+    // | "!=" /* non-equals */
+    @Test
+    public void testOperator() throws IOException {
+        String query = "[cnx:pos != \"N\"]";
+        String jsonLd = "{@type:koral:token, wrap:{@type:koral:term, key:N, "
+                + "foundry:cnx, layer:p, type:type:regex, match:match:ne}}";
+        runAndValidate(query, jsonLd);
+    }
+
+
+    // attribute operator flagged-regexp
+    // -------------------------------------------------------------------------
+    // attribute ::= simple-attribute | qualified-attribute
+    // -------------------------------------------------------------------------
+
+    // simple-attribute ::= identifier
+    @Test
+    public void testTermQueryWithSpecificLayer() throws JsonProcessingException {
+        String query = "[text = \"Sonne\"]";
+        String jsonLd = "{@type:koral:token, wrap:{@type:koral:term, key:Sonne, "
+                + "foundry:opennlp, layer:orth, type:type:regex, match:match:eq}}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        query = "[lemma = \"sein\"]";
+        jsonLd = "{@type:koral:token, wrap:{@type:koral:term, key:sein, "
+                + "foundry:tt, layer:l, type:type:regex, match:match:eq}}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        query = "[pos = \"NN\"]";
+        jsonLd = "{@type:koral:token, wrap:{@type:koral:term, key:NN, "
+                + "foundry:tt, layer:p, type:type:regex, match:match:eq}}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+    }
+
+    // qualified-attribute ::= identifier ":" identifier
+    @Test
+    public void testTermQueryWithQualifier() throws JsonProcessingException {
+        String query = "[mate:lemma = \"sein\"]";
+        String jsonLd = "{@type:koral:token, wrap:{@type:koral:term, key:sein, "
+                + "foundry:mate, layer:l, type:type:regex, match:match:eq}}";
+        runAndValidate(query, jsonLd);
+
+        query = "[cnx:pos = \"N\"]";
+        jsonLd = "{@type:koral:token, wrap:{@type:koral:term, key:N, "
+                + "foundry:cnx, layer:p, type:type:regex, match:match:eq}}";
+        runAndValidate(query, jsonLd);
+    }
+
+    @Test
+    public void testTermQueryException() throws JsonProcessingException {
+        String query = "[opennlp:lemma = \"sein\"]";
+        List<Object> error = getError(new FCSQLQueryProcessor(query, "2.0"));
+        assertEquals(306, error.get(0));
+        assertEquals(
+                "SRU diagnostic 48: Layer lemma with qualifier opennlp is unsupported.",
+                error.get(1));
+
+        query = "[malt:lemma = \"sein\"]";
+        error = getError(new FCSQLQueryProcessor(query, "2.0"));
+        assertEquals(306, error.get(0));
+        assertEquals("SRU diagnostic 48: Qualifier malt is unsupported.",
+                error.get(1));
+
+        query = "[cnx:morph = \"heit\"]";
+        error = getError(new FCSQLQueryProcessor(query, "2.0"));
+        assertEquals(306, error.get(0));
+        assertEquals("SRU diagnostic 48: Layer morph is unsupported.",
+                error.get(1));
+
+    }
+
+    // segment-query ::= "[" expression? "]"
+    // -------------------------------------------------------------------------
+    // expression ::= basic-expression
+    // | expression "|" expression /* or */
+    // | expression "&" expression /* and */
+    // -------------------------------------------------------------------------
+
+    // | expression "|" expression /* or */
+    @Test
+    public void testExpressionOr() throws IOException {
+        String query = "[mate:lemma=\"sein\" | mate:pos=\"PPOSS\"]";
+        String jsonLd = "{@type: koral:token,"
+                + " wrap: { @type: koral:termGroup,"
+                + "relation: relation:or,"
+                + " operands:["
+                + "{@type: koral:term, key: sein, foundry: mate, layer: l, type:type:regex, match: match:eq},"
+                + "{@type: koral:term, key: PPOSS, foundry: mate, layer: p, type:type:regex, match: match:eq}]}}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        query = "[cnx:lemma=\"sein\" | mate:lemma=\"sein\" | mate:pos=\"PPOSS\"]";
+        jsonLd = "{@type: koral:term, key: sein, foundry: cnx, layer: l, type:type:regex, match: match:eq}";
+        FCSQLQueryProcessorTest.validateNode(query, "/query/wrap/operands/0",
+                jsonLd);
+
+    }
+
+    // | expression "&" expression /* and */
+    @Test
+    public void testExpressionAnd() throws IOException {
+        String query = "[mate:lemma=\"sein\" & mate:pos=\"PPOSS\"]";
+        String jsonLd = "{@type: koral:token,"
+                + " wrap: { @type: koral:termGroup,"
+                + "relation: relation:and,"
+                + " operands:["
+                + "{@type: koral:term, key: sein, foundry: mate, layer: l, type:type:regex, match: match:eq},"
+                + "{@type: koral:term, key: PPOSS, foundry: mate, layer: p, type:type:regex, match: match:eq}]}}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+    }
+
+    // -------------------------------------------------------------------------
+    // basic-expression ::= '(' expression ')' /* grouping */
+    // | "!" expression /* not */
+    // | attribute operator flagged-regexp
+    // -------------------------------------------------------------------------
+
+    // basic-expression ::= '(' expression ')' /* grouping */
+
+    @Test
+    public void testExpressionGroup() throws JsonProcessingException {
+        String query = "[(text=\"blau\"|pos=\"ADJ\")]";
+        String jsonLd = "{@type: koral:token,"
+                + "wrap: {@type: koral:termGroup,"
+                + "relation: relation:or,"
+                + "operands: ["
+                + "{@type: koral:term, key: blau, foundry: opennlp, layer: orth, type:type:regex,match: match:eq},"
+                + "{@type: koral:term, key: ADJ, foundry: tt, layer: p, type:type:regex, match: match:eq}]}}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+    }
+
+    // "!" expression /* not */
+    @Test
+    public void testExpressionNot() throws IOException {
+        String jsonLd = "{@type:koral:token, wrap:{@type:koral:term, key:NN, "
+                + "foundry:tt, layer:p, type:type:regex, match:match:eq}}";
+        String query = "[!pos != \"NN\"]";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+        query = "[!!pos = \"NN\"]";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+        query = "[!!!pos != \"NN\"]";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+
+        query = "[mate:lemma=\"sein\" & !mate:pos=\"PPOSS\"]";
+        jsonLd = "{@type: koral:token,"
+                + " wrap: { "
+                + "@type: koral:termGroup,"
+                + "relation: relation:and,"
+                + " operands:["
+                + "{@type: koral:term, key: sein, foundry: mate, layer: l, type:type:regex, match: match:eq},"
+                + "{@type: koral:term, key: PPOSS, foundry: mate, layer: p, type:type:regex, match: match:ne}]}}";
+        FCSQLQueryProcessorTest.runAndValidate(query, jsonLd);
+    }
+
+}
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java
index 095cc59..1142ae9 100644
--- a/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java
@@ -726,6 +726,24 @@
         assertEquals("koral: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("koral:token", operands.get(1).at("/@type").asText());
+        assertEquals(true, operands.get(1).at("/key").isMissingNode());
+
+        query = "[base=Mann][]{3}";
+        qs.setQuery(query, "poliqarpplus");
+        res = mapper.readTree(qs.toJSON());
+        operands = Lists.newArrayList(res.at("/query/operands").elements());
+        res = operands.get(1);
+        assertEquals("koral:group", res.at("/@type").asText());
+        assertEquals(true, res.at("/key").isMissingNode());
+        assertEquals("operation:repetition", res.at("/operation").asText());
+        assertEquals(3, res.at("/boundary/min").asInt());
+        assertEquals(3, res.at("/boundary/max").asInt());
+
         query = "startswith(<s>, [][base=Mann])";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
