Implemented relation queries with regex.
Change-Id: I1dafc835f6034d90a350d9688acdcf54bac28124
diff --git a/src/test/resources/queries/relation/indirect-typed-relation-without-key.json b/src/test/resources/queries/relation/indirect-typed-relation-without-key.json
new file mode 100644
index 0000000..f641b8f
--- /dev/null
+++ b/src/test/resources/queries/relation/indirect-typed-relation-without-key.json
@@ -0,0 +1,41 @@
+{
+ "@context": "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld",
+ "query": {
+ "operation": "operation:relation",
+ "operands": [
+ {
+ "wrap": {
+ "@type": "koral:term",
+ "layer": "c",
+ "foundry": "corenlp",
+ "match": "match:eq",
+ "key": "VP"
+ },
+ "@type": "koral:span"
+ },
+ {
+ "wrap": {
+ "@type": "koral:term",
+ "layer": "c",
+ "foundry": "corenlp",
+ "match": "match:eq",
+ "key": "NP"
+ },
+ "@type": "koral:span"
+ }
+ ],
+ "@type": "koral:group",
+ "relType": {
+ "wrap": {
+ "@type": "koral:term",
+ "layer": "d",
+ "foundry": "malt"
+ },
+ "@type": "koral:relation",
+ "boundary": {
+ "min": 0,
+ "@type": "koral:boundary"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/test/resources/queries/relation/indirect-typed-relation.json b/src/test/resources/queries/relation/indirect-typed-relation.json
new file mode 100644
index 0000000..17a92ed
--- /dev/null
+++ b/src/test/resources/queries/relation/indirect-typed-relation.json
@@ -0,0 +1,43 @@
+{
+ "@context": "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld",
+ "query": {
+ "operation": "operation:relation",
+ "operands": [
+ {
+ "wrap": {
+ "@type": "koral:term",
+ "layer": "c",
+ "foundry": "corenlp",
+ "match": "match:eq",
+ "key": "VP"
+ },
+ "@type": "koral:span"
+ },
+ {
+ "wrap": {
+ "@type": "koral:term",
+ "layer": "c",
+ "foundry": "corenlp",
+ "match": "match:eq",
+ "key": "NP"
+ },
+ "@type": "koral:span"
+ }
+ ],
+ "@type": "koral:group",
+ "relType": {
+ "wrap": {
+ "@type": "koral:term",
+ "layer": "d",
+ "foundry": "malt",
+ "match": "match:eq",
+ "key": "DET"
+ },
+ "@type": "koral:relation",
+ "boundary": {
+ "min": 0,
+ "@type": "koral:boundary"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/test/resources/queries/relation/typed-relation-with-key-regex.json b/src/test/resources/queries/relation/typed-relation-with-key-regex.json
new file mode 100644
index 0000000..bee6c78
--- /dev/null
+++ b/src/test/resources/queries/relation/typed-relation-with-key-regex.json
@@ -0,0 +1,40 @@
+{
+ "@context": "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld",
+ "query": {
+ "operation": "operation:relation",
+ "operands": [
+ {
+ "wrap": {
+ "@type": "koral:term",
+ "layer": "c",
+ "foundry": "corenlp",
+ "match": "match:eq",
+ "key": "VP"
+ },
+ "@type": "koral:span"
+ },
+ {
+ "wrap": {
+ "@type": "koral:term",
+ "layer": "c",
+ "foundry": "corenlp",
+ "match": "match:eq",
+ "key": "NP"
+ },
+ "@type": "koral:span"
+ }
+ ],
+ "@type": "koral:group",
+ "relType": {
+ "@type": "koral:relation",
+ "wrap": {
+ "@type": "koral:term",
+ "layer": "d",
+ "foundry": "malt",
+ "match": "match:eq",
+ "type": "type:regex",
+ "key": ".*"
+ }
+ }
+ }
+}
\ No newline at end of file