diff --git a/main/main.go b/main/main.go index 90f0c6ea303cb0d985a6d774a00519b921f61caa..b256d07c8f0aa4e471382388213c9cd723ac3e1a 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 a8d15a4a56a72376eeb2563508d1f19847cb469d..a0a8ca6f562045486b8c4fcbd34dc5f1c63c2969 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 0000000000000000000000000000000000000000..48e9051faf3177dbabcac610eb59bdb9c7275322 --- /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