From 2c65b8ecf6d2a6832534ce6e39a64e26c3a8ce8f Mon Sep 17 00:00:00 2001
From: Kieran van Gaalen <kieran.van.gaalen@casema.nl>
Date: Thu, 4 Nov 2021 14:57:31 +0100
Subject: [PATCH] Added json for demo

---
 main/main.go |  2 +-
 test.json    | 82 ++++++++++++++++++++++++++++++++--------------------
 test2.json   | 58 +++++++++++++++++++++++++++++++++++++
 3 files changed, 109 insertions(+), 33 deletions(-)
 create mode 100644 test2.json

diff --git a/main/main.go b/main/main.go
index 90f0c6e..b256d07 100644
--- a/main/main.go
+++ b/main/main.go
@@ -20,7 +20,7 @@ The main function that calls the appropriate functions
 */
 func main() {
 	queryservice := aql.NewService()
-	jsonFile, err := os.Open("../test.json")
+	jsonFile, err := os.Open("../test2.json")
 	// if we os.Open returns an error then handle it
 	if err != nil {
 		log.Println(err)
diff --git a/test.json b/test.json
index a8d15a4..a0a8ca6 100644
--- a/test.json
+++ b/test.json
@@ -2,65 +2,83 @@
     "return": {
         "entities": [
             0,
-            1
+            1,
+            2
         ],
         "relations": [
-            0
-        ],
-        "groupBys": []
+            0,
+            1
+        ]
     },
     "entities": [
         {
-            "name": "parliament",
-            "ID": 0
+            "ID": 0,
+            "name": "parliament"
+        },
+        {
+            "ID": 1,
+            "name": "commissions"
         },
         {
-            "name": "parties",
-            "ID": 1
+            "ID": 2,
+            "name": "parliament"
         }
     ],
     "relations": [
         {
             "ID": 0,
-            "name": "member_of",
+            "name": "part_of",
             "depth": {
                 "min": 1,
                 "max": 1
             },
             "fromType": "entity",
-            "fromID": 0,
+            "fromId": 0,
             "toType": "entity",
             "toID": 1
+        },
+        {
+            "ID": 1,
+            "name": "part_of",
+            "depth": {
+                "min": 1,
+                "max": 1
+            },
+            "fromType": "entity",
+            "fromID": 2,
+            "toType": "groupBy",
+            "toID": 0
         }
     ],
-    "groupBys": [],
-    "filters": [
+    "groupBys": [
         {
             "ID": 0,
-            "fromType": "entity",
-            "fromID": 0,
-            "toType": "entity",
-            "toID": 0,
-            "attribute": "age",
-            "dataType": "int",
-            "matchType": "NEQ",
-            "value": "40",
-            "inType": "",
-            "inID": 0
-        },
+            "groupType": "entity",
+            "groupID": 0,
+            "groupAttribute": "age",
+            "byType": "entity",
+            "byID": 1,
+            "byAttribute": "name",
+            "appliedModifier": "AVG",
+            "relationID": 0
+        }
+    ],
+    "filters": [
         {
-            "ID": 1,
-            "fromType": "relation",
+            "ID": 0,
+            "fromType": "groupBy",
             "fromID": 0,
             "toType": "relation",
-            "toID": 0,
-            "attribute": "isChairman",
-            "dataType": "bool",
-            "matchType": "exact",
-            "value": "true",
+            "toID": 1,
+            "attribute": "age",
+            "value": "42",
+            "dataType": "number",
+            "matchType": "LT",
             "inType": "",
             "inID": 0
         }
     ],
-    "limit": 5000
-}
+    "limit": 5000,
+    "modifiers": [],
+    "databaseName": "TweedeKamer"
+}
\ No newline at end of file
diff --git a/test2.json b/test2.json
new file mode 100644
index 0000000..48e9051
--- /dev/null
+++ b/test2.json
@@ -0,0 +1,58 @@
+{
+    "return": {
+        "entities": [
+            0,
+            1,
+            2
+        ],
+        "relations": [
+            0,
+            1
+        ]
+    },
+    "entities": [
+        {
+            "ID": 0,
+            "name": "parties"
+        },
+        {
+            "ID": 1,
+            "name": "parliament"
+        },
+        {
+            "ID": 2,
+            "name": "commissions"
+        }
+    ],
+    "relations": [
+        {
+            "ID": 0,
+            "name": "member_of",
+            "depth": {
+                "min": 1,
+                "max": 1
+            },
+            "fromType": "entity",
+            "fromID": 1,
+            "toType": "entity",
+            "toID": 0
+        },
+        {
+            "ID": 1,
+            "name": "part_of",
+            "depth": {
+                "min": 1,
+                "max": 1
+            },
+            "fromType": "entity",
+            "fromID": 1,
+            "toType": "entity",
+            "toID": 2
+        }
+    ],
+    "groupBys": [],
+    "filters": [],
+    "limit": 5000,
+    "modifiers": [],
+    "databaseName": "Tweede Kamer Dataset"
+}
\ No newline at end of file
-- 
GitLab