Documentation ¶
Index ¶
- Constants
- Variables
- func FixIndices(JSONQuery *IncomingQueryJSON) (map[int]int, map[int]int, map[int]int)
- type GroupByDone
- type IncomingQueryJSON
- type MetaData
- type Query
- type QueryConstraintStruct
- type QueryEntityStruct
- type QueryGenericStruct
- type QueryGroupByStruct
- type QueryMLStruct
- type QueryModifierStruct
- type QueryPart
- type QueryRelationStruct
- type QueryReturnStruct
- type QuerySearchDepthStruct
- type Tree
- type TreeElement
- type TreeList
- type Triple
- type Tuple
- type Validator
Constants ¶
const ENTITYSTRING = "entity"
const GROUPBYSTRING = "groupBy"
const RELATIONSTRING = "relation"
Variables ¶
var AllStreamers = []byte(`{
"return": {
"entities": [
2,
3
],
"relations": [
1,
14
],
"groupBys": [
6,
7,
21
]
},
"entities": [
{
"name": "Streamer",
"ID": 2,
"constraints": []
},
{
"name": "Streamer",
"ID": 3,
"constraints": []
}
],
"relations": [
{
"ID": 1,
"name": "viewerOverlap",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
{
"ID": 14,
"name": "viewerOverlap",
"depth": {
"min": 1,
"max": 1
},
"fromType": "groupBy",
"fromID": 6,
"toType": "groupBy",
"toID": 7,
"constraints": []
}
],
"groupBys": [
{
"ID": 6,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "Count",
"byType": "entity",
"byID": [
3
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 1,
"constraints": []
},
{
"ID": 7,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "Count",
"byType": "entity",
"byID": [
3
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 1,
"constraints": []
},
{
"ID": 21,
"groupType": "groupBy",
"groupID": [
6
],
"groupAttribute": "Count",
"byType": "groupBy",
"byID": [
7
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 14,
"constraints": []
}
],
"machineLearning": [],
"limit": 5000
}
`)
var AllStreamersTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 2,
"name": "Streamer",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 1,
"name": "viewerOverlap",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
"ToNode": {
"id": 3,
"name": "Streamer",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 2,
"name": "Streamer",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": [
{
"id": 6,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "Count",
"byType": "entity",
"byID": [
3
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 1,
"constraints": []
},
{
"id": 7,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "Count",
"byType": "entity",
"byID": [
3
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 1,
"constraints": []
}
],
"AllGroupBys": [
{
"id": 6,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "Count",
"byType": "entity",
"byID": [
3
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 1,
"constraints": []
},
{
"id": 7,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "Count",
"byType": "entity",
"byID": [
3
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 1,
"constraints": []
}
],
"Parents": null
},
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 0,
"name": "",
"constraints": null
},
"FromGroupBy": {
"id": 6,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "Count",
"byType": "entity",
"byID": [
3
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 1,
"constraints": []
},
"Rel": {
"id": 14,
"name": "viewerOverlap",
"depth": {
"min": 1,
"max": 1
},
"fromType": "groupBy",
"fromID": 6,
"toType": "groupBy",
"toID": 7,
"constraints": []
},
"ToNode": {
"id": 0,
"name": "",
"constraints": null
},
"ToGroupBy": {
"id": 7,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "Count",
"byType": "entity",
"byID": [
3
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 1,
"constraints": []
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 0,
"name": "",
"constraints": null
},
"TopGroupBy": {
"id": 6,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "Count",
"byType": "entity",
"byID": [
3
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 1,
"constraints": []
},
"GroupBys": [
{
"id": 21,
"groupType": "groupBy",
"groupID": [
6
],
"groupAttribute": "Count",
"byType": "groupBy",
"byID": [
7
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 14,
"constraints": []
}
],
"AllGroupBys": [
{
"id": 21,
"groupType": "groupBy",
"groupID": [
6
],
"groupAttribute": "Count",
"byType": "groupBy",
"byID": [
7
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 14,
"constraints": []
}
],
"Parents": [
0
]
}
]
}`)
var BoolEqual = []byte(`{
"return": {
"entities": [
8,
9
],
"relations": [
7
],
"groupBys": []
},
"entities": [
{
"name": "parliament",
"ID": 8,
"constraints": []
},
{
"name": "parties",
"ID": 9,
"constraints": []
}
],
"relations": [
{
"ID": 7,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 8,
"toType": "entity",
"toID": 9,
"constraints": [
{
"attribute": "isChairman",
"value": "true",
"dataType": "bool",
"matchType": "EQ"
}
]
}
],
"groupBys": [],
"machineLearning": [],
"limit": 5000
}`)
var BoolEqualTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 8,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 7,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 8,
"toType": "entity",
"toID": 9,
"constraints": [
{
"attribute": "isChairman",
"value": "true",
"dataType": "bool",
"matchType": "EQ",
"inID": 0,
"inType": ""
}
]
},
"ToNode": {
"id": 9,
"name": "parties",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 8,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}`)
var BoolNotEqual = []byte(`{
"return": {
"entities": [
8,
9
],
"relations": [
7
],
"groupBys": []
},
"entities": [
{
"name": "parliament",
"ID": 8,
"constraints": []
},
{
"name": "parties",
"ID": 9,
"constraints": []
}
],
"relations": [
{
"ID": 7,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 8,
"toType": "entity",
"toID": 9,
"constraints": [
{
"attribute": "isChairman",
"value": "true",
"dataType": "bool",
"matchType": "NEQ"
}
]
}
],
"groupBys": [],
"machineLearning": [],
"limit": 5000
}`)
var BoolNotEqualTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 8,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 7,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 8,
"toType": "entity",
"toID": 9,
"constraints": [
{
"attribute": "isChairman",
"value": "true",
"dataType": "bool",
"matchType": "NEQ",
"inID": 0,
"inType": ""
}
]
},
"ToNode": {
"id": 9,
"name": "parties",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 8,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}`)
var DifferentNodesOnGroupBy = []byte(`{
"return": {
"entities": [
2,
3,
11,
12
],
"relations": [
1,
10
],
"groupBys": [
6
]
},
"entities": [
{
"name": "parliament",
"ID": 2,
"constraints": []
},
{
"name": "commissions",
"ID": 3,
"constraints": []
},
{
"name": "parliament",
"ID": 11,
"constraints": []
},
{
"name": "parties",
"ID": 12,
"constraints": []
}
],
"relations": [
{
"ID": 1,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
{
"ID": 10,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 11,
"toType": "entity",
"toID": 12,
"constraints": []
}
],
"groupBys": [
{
"ID": 6,
"groupType": "entity",
"groupID": [
3,
11
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
3,
12
],
"byAttribute": "_id",
"appliedModifier": "avg",
"relationID": 1,
"constraints": []
}
],
"machineLearning": [],
"limit": 5000
}`)
var DoubleJunctionNineEntitiesThreeEntityFilters = []byte(`{
"return": {
"entities": [
0,
1,
2,
3,
4,
5,
6,
7
],
"relations": [
0,
1,
2,
3,
4,
5,
6
]
},
"entities": [
{
"name": "parliament",
"ID": 0,
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "contains"
}
]
},
{
"name": "commissions",
"ID": 1,
"constraints": []
},
{
"name": "parliament",
"ID": 2,
"constraints": []
},
{
"name": "parties",
"ID": 3,
"constraints": [
{
"attribute": "seats",
"value": "10",
"dataType": "int",
"matchType": "LT"
}
]
},
{
"name": "resolutions",
"ID": 4,
"constraints": [
{
"attribute": "date",
"value": "mei",
"dataType": "string",
"matchType": "contains"
}
]
},
{
"name": "resolutions",
"ID": 5,
"constraints": []
},
{
"name": "parties",
"ID": 6,
"constraints": []
}
,
{
"name": "parliament",
"ID": 7,
"constraints": []
}
],
"groupBys": [],
"relations": [
{
"ID": 0,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 0,
"toType": "entity",
"toID": 1,
"constraints": []
},
{
"ID": 1,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 2,
"toType": "entity",
"toID": 1,
"constraints": []
},
{
"ID": 2,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
{
"ID": 3,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 2,
"toType": "entity",
"toID": 4,
"constraints": []
},
{
"ID": 4,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 0,
"toType": "entity",
"toID": 5,
"constraints": []
},
{
"ID": 5,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 0,
"toType": "entity",
"toID": 6,
"constraints": []
}
,
{
"ID": 6,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 7,
"toType": "entity",
"toID": 6,
"constraints": []
}
],
"limit": 5000
}`)
var DoubleJunctionNineEntitiesThreeEntityFiltersTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 2,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 2,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
"ToNode": {
"id": 3,
"name": "parties",
"constraints": [
{
"attribute": "seats",
"value": "10",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": [
1,
6
]
},
{
"Self": {
"FromNode": {
"id": 2,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 1,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 1,
"constraints": []
},
"ToNode": {
"id": 1,
"name": "commissions",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 0,
"Children": [
2
]
},
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 0,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints": []
},
"ToNode": {
"id": 1,
"name": "commissions",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 1,
"Children": [
3,
4
]
},
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 4,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 5,
"constraints": []
},
"ToNode": {
"id": 5,
"name": "resolutions",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 2,
"Children": []
},
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 5,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 6,
"constraints": []
},
"ToNode": {
"id": 6,
"name": "parties",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 2,
"Children": [
5
]
},
{
"Self": {
"FromNode": {
"id": 7,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 6,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 7,
"toType": "entity",
"toID": 6,
"constraints": []
},
"ToNode": {
"id": 6,
"name": "parties",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 4,
"Children": []
},
{
"Self": {
"FromNode": {
"id": 2,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 3,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 4,
"constraints": []
},
"ToNode": {
"id": 4,
"name": "resolutions",
"constraints": [
{
"attribute": "date",
"value": "mei",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 0,
"Children": []
}
],
"TopNode": {
"id": 3,
"name": "parties",
"constraints": [
{
"attribute": "seats",
"value": "10",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}
`)
var FiveEntitiesFourEntityFilters = []byte(`{
"databaseName": "TweedeKamer",
"return": {
"entities": [
0,
1,
2,
3,
4
],
"relations": [
0,
1,
2,
3
]
},
"entities": [
{
"name": "parliament",
"ID": 0,
"constraints": [
{
"attribute": "name",
"value": "A",
"dataType": "string",
"matchType": "contains"
}
]
},
{
"name": "parties",
"ID": 1,
"constraints": [
{
"attribute": "seats",
"value": "10",
"dataType": "int",
"matchType": "LT"
}
]
},
{
"name": "resolutions",
"ID": 2,
"constraints": [
{
"attribute": "date",
"value": "mei",
"dataType": "string",
"matchType": "contains"
}
]
},
{
"name": "parliament",
"ID": 3,
"constraints":[]
},
{
"name": "parties",
"ID": 4,
"constraints": [
{
"attribute": "name",
"value": "Volkspartij voor Vrijheid en Democratie",
"dataType": "string",
"matchType": "=="
}
]
}
],
"relations": [
{
"ID": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints": []
},
{
"ID": 1,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 2,
"constraints": []
},
{
"ID": 2,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 3,
"toType": "entity",
"toID": 2,
"constraints": []
},
{
"ID": 3,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 3,
"toType": "entity",
"toID": 4,
"constraints": []
}
],
"groupBys": [],
"limit": 5000,
"modifiers": []
}`)
var FiveEntitiesFourEntityFiltersTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "A",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints": []
},
"ToNode": {
"id": 1,
"name": "parties",
"constraints": [
{
"attribute": "seats",
"value": "10",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": [
1
]
},
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "A",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 1,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 2,
"constraints": []
},
"ToNode": {
"id": 2,
"name": "resolutions",
"constraints": [
{
"attribute": "date",
"value": "mei",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 0,
"Children": [
2
]
},
{
"Self": {
"FromNode": {
"id": 3,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 2,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 3,
"toType": "entity",
"toID": 2,
"constraints": []
},
"ToNode": {
"id": 2,
"name": "resolutions",
"constraints": [
{
"attribute": "date",
"value": "mei",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 1,
"Children": [
3
]
},
{
"Self": {
"FromNode": {
"id": 3,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 3,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 3,
"toType": "entity",
"toID": 4,
"constraints": []
},
"ToNode": {
"id": 4,
"name": "parties",
"constraints": [
{
"attribute": "name",
"value": "Volkspartij voor Vrijheid en Democratie",
"dataType": "string",
"matchType": "==",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 2,
"Children": []
}
],
"TopNode": {
"id": 1,
"name": "parties",
"constraints": [
{
"attribute": "seats",
"value": "10",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}
`)
var HierarchyBasic = []byte(`{
"return": {
"entities": [
0,
1,
2,
3,
4
],
"relations": [
0,
1,
2,
3
]
},
"entities": [
{
"name": "parliament",
"ID": 0,
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "CONTAINS"
}
]
},
{
"name": "commissions",
"ID": 1,
"constraints": []
},
{
"name": "parliament",
"ID": 2,
"constraints": []
},
{
"name": "parties",
"ID": 3,
"constraints": [
{
"attribute": "seats",
"value": "10",
"dataType": "int",
"matchType": "LT"
}
]
},
{
"name": "resolutions",
"ID": 4,
"constraints": [
{
"attribute": "date",
"value": "mei",
"dataType": "string",
"matchType": "CONTAINS"
}
]
}
],
"groupBys": [],
"relations": [
{
"ID": 0,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 0,
"toType": "entity",
"toID": 1,
"constraints": []
},
{
"ID": 1,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 2,
"toType": "entity",
"toID": 1,
"constraints": []
},
{
"ID": 2,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
{
"ID": 3,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 2,
"toType": "entity",
"toID": 4,
"constraints": []
}
],
"limit": 5000
}
`)
var HierarchyBasicTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "CONTAINS",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 0,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints": []
},
"ToNode": {
"id": 1,
"name": "commissions",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": [
1
]
},
{
"Self": {
"FromNode": {
"id": 2,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 1,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 1,
"constraints": []
},
"ToNode": {
"id": 1,
"name": "commissions",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 0,
"Children": [
2,
3
]
},
{
"Self": {
"FromNode": {
"id": 2,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 2,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
"ToNode": {
"id": 3,
"name": "parties",
"constraints": [
{
"attribute": "seats",
"value": "10",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 1,
"Children": []
},
{
"Self": {
"FromNode": {
"id": 2,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 3,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 4,
"constraints": []
},
"ToNode": {
"id": 4,
"name": "resolutions",
"constraints": [
{
"attribute": "date",
"value": "mei",
"dataType": "string",
"matchType": "CONTAINS",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 1,
"Children": []
}
],
"TopNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "CONTAINS",
"inID": 0,
"inType": ""
}
]
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}`)
var IncorrectGroupByModifier = []byte(`{
"return": {
"entities": [
2,
3
],
"relations": [
1
],
"groupBys": [
6
]
},
"entities": [
{
"name": "parliament",
"ID": 2,
"constraints": []
},
{
"name": "commissions",
"ID": 3,
"constraints": []
}
],
"relations": [
{
"ID": 1,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
}
],
"groupBys": [
{
"ID": 6,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
3
],
"byAttribute": "_id",
"appliedModifier": "wibblywobbly",
"relationID": 1,
"constraints": []
}
],
"machineLearning": [],
"limit": 5000
}`)
var IncorrectRelationFrom = []byte(`{
"databaseName": "TweedeKamer",
"return": {
"entities": [
0,
1
],
"relations": [
0
]
},
"entities": [
{
"name": "parliament",
"ID": 0,
"constraints": []
},
{
"name": "parties",
"ID": 1,
"constraints": []
}
],
"relations": [
{
"ID": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": -4,
"constraints":[]
}
],
"groupBys": [],
"limit": 5000,
"modifiers": []
}`)
var IntNotEquals = []byte(`{
"return": {
"entities": [
2,
3
],
"relations": [
1
],
"groupBys": []
},
"entities": [
{
"name": "parliament",
"ID": 2,
"constraints": [
{
"attribute": "seniority",
"value": "57",
"dataType": "int",
"matchType": "NEQ"
}
]
},
{
"name": "parties",
"ID": 3,
"constraints": []
}
],
"relations": [
{
"ID": 1,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
}
],
"groupBys": [],
"machineLearning": [],
"limit": 5000
}`)
var IntNotEqualsTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 2,
"name": "parliament",
"constraints": [
{
"attribute": "seniority",
"value": "57",
"dataType": "int",
"matchType": "NEQ",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 1,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
"ToNode": {
"id": 3,
"name": "parties",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 2,
"name": "parliament",
"constraints": [
{
"attribute": "seniority",
"value": "57",
"dataType": "int",
"matchType": "NEQ",
"inID": 0,
"inType": ""
}
]
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}`)
var MultipleInputGroupBy = []byte(`{
"return": {
"entities": [43, 44, 48, 49, 73],
"relations": [42, 47, 71],
"groupBys": [31]
},
"entities": [
{
"name": "parliament",
"ID": 43,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "LT"
}
]
},
{
"name": "parties",
"ID": 44,
"constraints": [
{
"attribute": "seats",
"value": "6",
"dataType": "int",
"matchType": "GT"
}
]
},
{
"name": "parliament",
"ID": 48,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET"
}
]
},
{
"name": "parties",
"ID": 49,
"constraints": [
{
"attribute": "seats",
"value": "6",
"dataType": "int",
"matchType": "LET"
}
]
},
{ "name": "parliament", "ID": 73, "constraints": [] }
],
"relations": [
{
"ID": 42,
"name": "member_of",
"depth": { "min": 1, "max": 1 },
"fromType": "entity",
"fromID": 43,
"toType": "entity",
"toID": 44,
"constraints": []
},
{
"ID": 47,
"name": "member_of",
"depth": { "min": 1, "max": 1 },
"fromType": "entity",
"fromID": 48,
"toType": "entity",
"toID": 49,
"constraints": []
},
{
"ID": 71,
"name": "member_of",
"depth": { "min": 1, "max": 1 },
"fromType": "entity",
"fromID": 73,
"toType": "groupBy",
"toID": 31,
"constraints": []
}
],
"groupBys": [
{
"ID": 31,
"groupType": "entity",
"groupID": [43, 48],
"groupAttribute": "age",
"byType": "entity",
"byID": [49, 44],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 47,
"constraints": [
{
"attribute": "age",
"value": "40",
"dataType": "int",
"matchType": "GET"
}
]
}
],
"machineLearning": [],
"limit": 5000
}
`)
var MultipleInputGroupByEndpoint = []byte(`{
"return": {
"entities": [43, 44, 48, 49],
"relations": [42, 47],
"groupBys": [31]
},
"entities": [
{
"name": "parliament",
"ID": 43,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "LT"
}
]
},
{
"name": "parties",
"ID": 44,
"constraints": [
{
"attribute": "seats",
"value": "6",
"dataType": "int",
"matchType": "GT"
}
]
},
{
"name": "parliament",
"ID": 48,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET"
}
]
},
{
"name": "parties",
"ID": 49,
"constraints": [
{
"attribute": "seats",
"value": "6",
"dataType": "int",
"matchType": "LET"
}
]
}
],
"relations": [
{
"ID": 42,
"name": "member_of",
"depth": { "min": 1, "max": 1 },
"fromType": "entity",
"fromID": 43,
"toType": "entity",
"toID": 44,
"constraints": []
},
{
"ID": 47,
"name": "member_of",
"depth": { "min": 1, "max": 1 },
"fromType": "entity",
"fromID": 48,
"toType": "entity",
"toID": 49,
"constraints": []
}
],
"groupBys": [
{
"ID": 31,
"groupType": "entity",
"groupID": [43, 48],
"groupAttribute": "age",
"byType": "entity",
"byID": [49, 44],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 47,
"constraints": [
{
"attribute": "age",
"value": "40",
"dataType": "int",
"matchType": "GET"
}
]
}
],
"machineLearning": [],
"limit": 5000
}
`)
var MultipleInputGroupByEndpointTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 43,
"name": "parliament",
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 42,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 43,
"toType": "entity",
"toID": 44,
"constraints": []
},
"ToNode": {
"id": 44,
"name": "parties",
"constraints": [
{
"attribute": "seats",
"value": "6",
"dataType": "int",
"matchType": "GT",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 43,
"name": "parliament",
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": [
{
"id": 31,
"groupType": "entity",
"groupID": [
43,
48
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
49,
44
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 47,
"constraints": [
{
"attribute": "age",
"value": "40",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
],
"Parents": null
},
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 48,
"name": "parliament",
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 47,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 48,
"toType": "entity",
"toID": 49,
"constraints": []
},
"ToNode": {
"id": 49,
"name": "parties",
"constraints": [
{
"attribute": "seats",
"value": "6",
"dataType": "int",
"matchType": "LET",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 48,
"name": "parliament",
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": [
{
"id": 31,
"groupType": "entity",
"groupID": [
43,
48
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
49,
44
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 47,
"constraints": [
{
"attribute": "age",
"value": "40",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
],
"AllGroupBys": [
{
"id": 31,
"groupType": "entity",
"groupID": [
43,
48
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
49,
44
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 47,
"constraints": [
{
"attribute": "age",
"value": "40",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
],
"Parents": null
}
]
}
`)
var MultipleInputGroupByTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 43,
"name": "parliament",
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 42,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 43,
"toType": "entity",
"toID": 44,
"constraints": []
},
"ToNode": {
"id": 44,
"name": "parties",
"constraints": [
{
"attribute": "seats",
"value": "6",
"dataType": "int",
"matchType": "GT",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 43,
"name": "parliament",
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": [
{
"id": 31,
"groupType": "entity",
"groupID": [
43,
48
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
49,
44
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 47,
"constraints": [
{
"attribute": "age",
"value": "40",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
],
"Parents": null
},
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 48,
"name": "parliament",
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 47,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 48,
"toType": "entity",
"toID": 49,
"constraints": []
},
"ToNode": {
"id": 49,
"name": "parties",
"constraints": [
{
"attribute": "seats",
"value": "6",
"dataType": "int",
"matchType": "LET",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 48,
"name": "parliament",
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": [
{
"id": 31,
"groupType": "entity",
"groupID": [
43,
48
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
49,
44
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 47,
"constraints": [
{
"attribute": "age",
"value": "40",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
],
"AllGroupBys": [
{
"id": 31,
"groupType": "entity",
"groupID": [
43,
48
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
49,
44
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 47,
"constraints": [
{
"attribute": "age",
"value": "40",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
],
"Parents": null
},
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 73,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 71,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 73,
"toType": "groupBy",
"toID": 31,
"constraints": []
},
"ToNode": {
"id": 0,
"name": "",
"constraints": null
},
"ToGroupBy": {
"id": 31,
"groupType": "entity",
"groupID": [
43,
48
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
49,
44
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 47,
"constraints": [
{
"attribute": "age",
"value": "40",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 73,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": [
1
]
}
]
}
`)
var NestedGroupBys2 = []byte(`{
"return": {
"entities": [
9,
10,
25,
52
],
"relations": [
8,
24,
51
],
"groupBys": [
6,
40
]
},
"entities": [
{
"name": "parliament",
"ID": 9,
"constraints": []
},
{
"name": "commissions",
"ID": 10,
"constraints": []
},
{
"name": "parliament",
"ID": 25,
"constraints": []
},
{
"name": "parliament",
"ID": 52,
"constraints": []
}
],
"relations": [
{
"ID": 8,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 9,
"toType": "entity",
"toID": 10,
"constraints": []
},
{
"ID": 24,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 25,
"toType": "groupBy",
"toID": 6,
"constraints": []
},
{
"ID": 51,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 52,
"toType": "groupBy",
"toID": 40,
"constraints": []
}
],
"groupBys": [
{
"ID": 6,
"groupType": "entity",
"groupID": [
9
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
10
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 8,
"constraints": [
{
"attribute": "age",
"value": "41",
"dataType": "int",
"matchType": "LET"
}
]
},
{
"ID": 40,
"groupType": "entity",
"groupID": [
25
],
"groupAttribute": "age",
"byType": "groupBy",
"byID": [
6
],
"byAttribute": "_id",
"appliedModifier": "MAX",
"relationID": 24,
"constraints": []
}
],
"machineLearning": [],
"limit": 5000
}`)
var NestedGroupBys2TreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 9,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 8,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 9,
"toType": "entity",
"toID": 10,
"constraints": []
},
"ToNode": {
"id": 10,
"name": "commissions",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 9,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": [
{
"id": 6,
"groupType": "entity",
"groupID": [
9
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
10
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 8,
"constraints": [
{
"attribute": "age",
"value": "41",
"dataType": "int",
"matchType": "LET",
"inID": 0,
"inType": ""
}
]
}
],
"AllGroupBys": [
{
"id": 6,
"groupType": "entity",
"groupID": [
9
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
10
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 8,
"constraints": [
{
"attribute": "age",
"value": "41",
"dataType": "int",
"matchType": "LET",
"inID": 0,
"inType": ""
}
]
}
],
"Parents": null
},
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 25,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 24,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 25,
"toType": "groupBy",
"toID": 6,
"constraints": []
},
"ToNode": {
"id": 0,
"name": "",
"constraints": null
},
"ToGroupBy": {
"id": 6,
"groupType": "entity",
"groupID": [
9
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
10
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 8,
"constraints": [
{
"attribute": "age",
"value": "41",
"dataType": "int",
"matchType": "LET",
"inID": 0,
"inType": ""
}
]
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 25,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": [
{
"id": 40,
"groupType": "entity",
"groupID": [
25
],
"groupAttribute": "age",
"byType": "groupBy",
"byID": [
6
],
"byAttribute": "_id",
"appliedModifier": "MAX",
"relationID": 24,
"constraints": []
}
],
"AllGroupBys": [
{
"id": 40,
"groupType": "entity",
"groupID": [
25
],
"groupAttribute": "age",
"byType": "groupBy",
"byID": [
6
],
"byAttribute": "_id",
"appliedModifier": "MAX",
"relationID": 24,
"constraints": []
}
],
"Parents": [
0
]
},
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 52,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 51,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 52,
"toType": "groupBy",
"toID": 40,
"constraints": []
},
"ToNode": {
"id": 0,
"name": "",
"constraints": null
},
"ToGroupBy": {
"id": 40,
"groupType": "entity",
"groupID": [
25
],
"groupAttribute": "age",
"byType": "groupBy",
"byID": [
6
],
"byAttribute": "_id",
"appliedModifier": "MAX",
"relationID": 24,
"constraints": []
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 52,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": [
1
]
}
]
}`)
var NoRelationsField = []byte(`{
"databaseName": "TweedeKamer",
"return": {
"entities": [
0,
1
]
},
"entities": [
{
"name": "parliament",
"ID": 0,
"constraints": []
},
{
"name": "parties",
"ID": 1,
"constraints": []
}
],
"groupBys": [],
"limit": 5000,
"modifiers": []
}`)
var SeparatedChainDoubleRelationPerChain = []byte(`{
"databaseName": "TweedeKamer",
"return": {
"entities": [
0,
1,
2,
3,
4,
5
],
"relations": [
0
]
},
"entities": [
{
"name": "parliament",
"ID": 0,
"constraints": []
},
{
"name": "parties",
"ID": 1,
"constraints": []
},
{
"name": "parliament",
"ID": 2,
"constraints": []
},
{
"name": "parties",
"ID": 3,
"constraints": []
},
{
"name": "resolutions",
"ID": 4,
"constraints": []
},
{
"name": "resolutions",
"ID": 5,
"constraints": []
}
],
"relations": [
{
"ID": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints":[]
},
{
"ID": 1,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints":[]
},
{
"ID": 2,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 4,
"constraints":[]
},
{
"ID": 3,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 5,
"constraints":[]
}
],
"groupBys": [],
"limit": 5000,
"modifiers": []
}`)
var SeparatedChainSingleRelationPerChain = []byte(`{
"databaseName": "TweedeKamer",
"return": {
"entities": [
0,
1,
2,
3
],
"relations": [
0
]
},
"entities": [
{
"name": "parliament",
"ID": 0,
"constraints": []
},
{
"name": "parties",
"ID": 1,
"constraints": []
},
{
"name": "parliament",
"ID": 2,
"constraints": []
},
{
"name": "parties",
"ID": 3,
"constraints": []
}
],
"relations": [
{
"ID": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints":[]
},
{
"ID": 1,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints":[]
}
],
"groupBys": [],
"limit": 5000,
"modifiers": []
}`)
var SeperatedChainWithGroupBys = []byte(`{
"return": {
"entities": [
2,
3,
14,
28,
37,
38,
47
],
"relations": [
1,
13,
26,
36,
46
],
"groupBys": [
12,
35
]
},
"entities": [
{
"name": "parliament",
"ID": 2,
"constraints": []
},
{
"name": "parties",
"ID": 3,
"constraints": []
},
{
"name": "parliament",
"ID": 14,
"constraints": []
},
{
"name": "commissions",
"ID": 28,
"constraints": [
{
"attribute": "name",
"value": "f",
"dataType": "string",
"matchType": "contains"
}
]
},
{
"name": "parliament",
"ID": 37,
"constraints": []
},
{
"name": "resolutions",
"ID": 38,
"constraints": []
},
{
"name": "parliament",
"ID": 47,
"constraints": []
}
],
"relations": [
{
"ID": 1,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
{
"ID": 13,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 14,
"toType": "groupBy",
"toID": 12,
"constraints": []
},
{
"ID": 26,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 14,
"toType": "entity",
"toID": 28,
"constraints": []
},
{
"ID": 36,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 37,
"toType": "entity",
"toID": 38,
"constraints": []
},
{
"ID": 46,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 47,
"toType": "groupBy",
"toID": 35,
"constraints": []
}
],
"groupBys": [
{
"ID": 12,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
3
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 1,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET"
}
]
},
{
"ID": 35,
"groupType": "entity",
"groupID": [
37
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
38
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 36,
"constraints": [
{
"attribute": "age",
"value": "45",
"dataType": "int",
"matchType": "GET"
}
]
}
],
"machineLearning": [],
"limit": 5000
}`)
var SingleEndPointGroupBy = []byte(`{
"return": {
"entities": [
2,
3
],
"relations": [
1
],
"groupBys": [
6
]
},
"entities": [
{
"name": "parliament",
"ID": 2,
"constraints": []
},
{
"name": "commissions",
"ID": 3,
"constraints": []
}
],
"relations": [
{
"ID": 1,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
}
],
"groupBys": [
{
"ID": 6,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
3
],
"byAttribute": "name",
"appliedModifier": "AVG",
"relationID": 1,
"constraints": [
{
"attribute": "age",
"value": "45",
"dataType": "int",
"matchType": "GT"
}
]
}
],
"machineLearning": [],
"limit": 5000
}`)
var SingleEndPointGroupByTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 2,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 1,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
"ToNode": {
"id": 3,
"name": "commissions",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 2,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": [
{
"id": 6,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
3
],
"byAttribute": "name",
"appliedModifier": "AVG",
"relationID": 1,
"constraints": [
{
"attribute": "age",
"value": "45",
"dataType": "int",
"matchType": "GT",
"inID": 0,
"inType": ""
}
]
}
],
"AllGroupBys": [
{
"id": 6,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
3
],
"byAttribute": "name",
"appliedModifier": "AVG",
"relationID": 1,
"constraints": [
{
"attribute": "age",
"value": "45",
"dataType": "int",
"matchType": "GT",
"inID": 0,
"inType": ""
}
]
}
],
"Parents": null
}
]
}
`)
var SingleGroupBy = []byte(`{
"return": {
"entities": [
2,
3,
4
],
"relations": [
1,
2
],
"groupBys": [
6
]
},
"entities": [
{
"name": "parliament",
"ID": 2,
"constraints": []
},
{
"name": "commissions",
"ID": 3,
"constraints": []
},
{
"name": "parliament",
"ID": 4,
"constraints": []
}
],
"relations": [
{
"ID": 1,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
{
"ID": 2,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 4,
"toType": "groupBy",
"toID": 6,
"constraints": []
}
],
"groupBys": [
{
"ID": 6,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
3
],
"byAttribute": "name",
"appliedModifier": "avg",
"relationID": 1,
"constraints": [
{
"attribute": "age",
"value": "45",
"dataType": "int",
"matchType": "GT"
}
]
}
],
"machineLearning": [],
"limit": 5000
}
`)
var SingleGroupByTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 2,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 1,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
"ToNode": {
"id": 3,
"name": "commissions",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 2,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": [
{
"id": 6,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
3
],
"byAttribute": "name",
"appliedModifier": "avg",
"relationID": 1,
"constraints": [
{
"attribute": "age",
"value": "45",
"dataType": "int",
"matchType": "GT",
"inID": 0,
"inType": ""
}
]
}
],
"AllGroupBys": [
{
"id": 6,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
3
],
"byAttribute": "name",
"appliedModifier": "avg",
"relationID": 1,
"constraints": [
{
"attribute": "age",
"value": "45",
"dataType": "int",
"matchType": "GT",
"inID": 0,
"inType": ""
}
]
}
],
"Parents": null
},
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 4,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 2,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 4,
"toType": "groupBy",
"toID": 6,
"constraints": []
},
"ToNode": {
"id": 0,
"name": "",
"constraints": null
},
"ToGroupBy": {
"id": 6,
"groupType": "entity",
"groupID": [
2
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
3
],
"byAttribute": "name",
"appliedModifier": "avg",
"relationID": 1,
"constraints": [
{
"attribute": "age",
"value": "45",
"dataType": "int",
"matchType": "GT",
"inID": 0,
"inType": ""
}
]
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 4,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": [
0
]
}
]
}
`)
var SingleJunctionFiveEntitiesThreeEntityFilters = []byte(`{
"return": {
"entities": [
0,
1,
2,
3,
4
],
"relations": [
0,
1,
2,
3
]
},
"entities": [
{
"name": "parliament",
"ID": 0,
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "contains"
}
]
},
{
"name": "commissions",
"ID": 1,
"constraints": []
},
{
"name": "parliament",
"ID": 2,
"constraints": []
},
{
"name": "parties",
"ID": 3,
"constraints": [
{
"attribute": "seats",
"value": "10",
"dataType": "int",
"matchType": "LT"
}
]
},
{
"name": "resolutions",
"ID": 4,
"constraints": [
{
"attribute": "date",
"value": "mei",
"dataType": "string",
"matchType": "contains"
}
]
}
],
"groupBys": [],
"relations": [
{
"ID": 0,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 0,
"toType": "entity",
"toID": 1,
"constraints": []
},
{
"ID": 1,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 2,
"toType": "entity",
"toID": 1,
"constraints": []
},
{
"ID": 2,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
{
"ID": 3,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromId": 2,
"toType": "entity",
"toID": 4,
"constraints": []
}
],
"limit": 5000
}`)
var SingleJunctionFiveEntitiesThreeEntityFiltersTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 0,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints": []
},
"ToNode": {
"id": 1,
"name": "commissions",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": [
1
]
},
{
"Self": {
"FromNode": {
"id": 2,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 1,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 1,
"constraints": []
},
"ToNode": {
"id": 1,
"name": "commissions",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 0,
"Children": [
2,
3
]
},
{
"Self": {
"FromNode": {
"id": 2,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 2,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
"ToNode": {
"id": 3,
"name": "parties",
"constraints": [
{
"attribute": "seats",
"value": "10",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 1,
"Children": []
},
{
"Self": {
"FromNode": {
"id": 2,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 3,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 4,
"constraints": []
},
"ToNode": {
"id": 4,
"name": "resolutions",
"constraints": [
{
"attribute": "date",
"value": "mei",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 1,
"Children": []
}
],
"TopNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}
`)
var StringMatchTypes = []byte(`{
"return": {
"entities": [
2,
3,
8
],
"relations": [
1,
6
],
"groupBys": []
},
"entities": [
{
"name": "parliament",
"ID": 2,
"constraints": [
{
"attribute": "name",
"value": "Geert Wilders",
"dataType": "string",
"matchType": "NEQ"
}
]
},
{
"name": "parties",
"ID": 3,
"constraints": [
{
"attribute": "name",
"value": "v",
"dataType": "string",
"matchType": "excludes"
}
]
},
{
"name": "commissions",
"ID": 8,
"constraints": [
{
"attribute": "name",
"value": "groep",
"dataType": "string",
"matchType": "excludes"
}
]
}
],
"relations": [
{
"ID": 1,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
{
"ID": 6,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 8,
"constraints": []
}
],
"groupBys": [],
"machineLearning": [],
"limit": 5000
}`)
var StringMatchTypesTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 2,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "Geert Wilders",
"dataType": "string",
"matchType": "NEQ",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 1,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 3,
"constraints": []
},
"ToNode": {
"id": 3,
"name": "parties",
"constraints": [
{
"attribute": "name",
"value": "v",
"dataType": "string",
"matchType": "excludes",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": [
1
]
},
{
"Self": {
"FromNode": {
"id": 2,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "Geert Wilders",
"dataType": "string",
"matchType": "NEQ",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 6,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 2,
"toType": "entity",
"toID": 8,
"constraints": []
},
"ToNode": {
"id": 8,
"name": "commissions",
"constraints": [
{
"attribute": "name",
"value": "groep",
"dataType": "string",
"matchType": "excludes",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 0,
"Children": []
}
],
"TopNode": {
"id": 3,
"name": "parties",
"constraints": [
{
"attribute": "name",
"value": "v",
"dataType": "string",
"matchType": "excludes",
"inID": 0,
"inType": ""
}
]
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}`)
var ThreeEntitiesNoFilter = []byte(`{
"databaseName": "TweedeKamer",
"return": {
"entities": [
0,
1,
2
],
"relations": [
0,
1
]
},
"entities": [
{
"name": "parliament",
"ID": 0,
"constraints": []
},
{
"name": "parties",
"ID": 1,
"constraints": []
},
{
"name": "resolutions",
"ID": 2,
"constraints": []
}
],
"relations": [
{
"ID": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints":[]
},
{
"ID": 1,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 2,
"constraints":[]
}
],
"groupBys": [],
"limit": 5000,
"modifiers": []
}`)
var ThreeEntitiesNoFilterTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints": []
},
"ToNode": {
"id": 1,
"name": "parties",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": [
1
]
},
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 1,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 2,
"constraints": []
},
"ToNode": {
"id": 2,
"name": "resolutions",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 0,
"Children": []
}
],
"TopNode": {
"id": 1,
"name": "parties",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}
`)
var ThreeEntitiesOneEntityFilter = []byte(`{
"databaseName": "TweedeKamer",
"return": {
"entities": [
0,
1,
2
],
"relations": [
0,
1
]
},
"entities": [
{
"name": "parliament",
"ID": 0,
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "contains"
}
]
},
{
"name": "parties",
"ID": 1,
"constraints": []
},
{
"name": "resolutions",
"ID": 2,
"constraints": []
}
],
"relations": [
{
"ID": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints":[]
},
{
"ID": 1,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 2,
"constraints":[]
}
],
"groupBys": [],
"limit": 5000,
"modifiers": []
}`)
var ThreeEntitiesOneEntityFilterTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints": []
},
"ToNode": {
"id": 1,
"name": "parties",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": [
1
]
},
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 1,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 2,
"constraints": []
},
"ToNode": {
"id": 2,
"name": "resolutions",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 0,
"Children": []
}
],
"TopNode": {
"id": 1,
"name": "parties",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}
`)
var ThreeEntitiesTwoEntityFilters = []byte(`{
"databaseName": "TweedeKamer",
"return": {
"entities": [
0,
1,
2
],
"relations": [
0,
1
]
},
"entities": [
{
"name": "parliament",
"ID": 0,
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "contains"
}
]
},
{
"name": "parties",
"ID": 1,
"constraints": []
},
{
"name": "resolutions",
"ID": 2,
"constraints": [
{
"attribute": "date",
"value": "mei",
"dataType": "string",
"matchType": "contains"
}
]
}
],
"relations": [
{
"ID": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints":[]
},
{
"ID": 1,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 2,
"constraints":[]
}
],
"groupBys": [],
"limit": 5000,
"modifiers": []
}`)
var ThreeEntitiesTwoEntityFiltersTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints": []
},
"ToNode": {
"id": 1,
"name": "parties",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": [
1
]
},
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "name",
"value": "Geert",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 1,
"name": "submits",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 2,
"constraints": []
},
"ToNode": {
"id": 2,
"name": "resolutions",
"constraints": [
{
"attribute": "date",
"value": "mei",
"dataType": "string",
"matchType": "contains",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": 0,
"Children": []
}
],
"TopNode": {
"id": 1,
"name": "parties",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}
`)
var TopEntityToFromGroupBy = []byte(`{
"return": {
"entities": [
26,
27,
36
],
"relations": [
25,
34
],
"groupBys": [
30
]
},
"entities": [
{
"name": "Streamer",
"ID": 26,
"constraints": []
},
{
"name": "Streamer",
"ID": 27,
"constraints": []
},
{
"name": "Streamer",
"ID": 36,
"constraints": []
}
],
"relations": [
{
"ID": 25,
"name": "viewerOverlap",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 26,
"toType": "entity",
"toID": 27,
"constraints": []
},
{
"ID": 34,
"name": "viewerOverlap",
"depth": {
"min": 1,
"max": 1
},
"fromType": "groupBy",
"fromID": 30,
"toType": "entity",
"toID": 36,
"constraints": []
}
],
"groupBys": [
{
"ID": 30,
"groupType": "entity",
"groupID": [
27
],
"groupAttribute": "Count",
"byType": "entity",
"byID": [
26
],
"byAttribute": "_id",
"appliedModifier": "avg",
"relationID": 25,
"constraints": []
}
],
"machineLearning": [],
"limit": 5000
}`)
var TopEntityToFromGroupByTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 26,
"name": "Streamer",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 25,
"name": "viewerOverlap",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 26,
"toType": "entity",
"toID": 27,
"constraints": []
},
"ToNode": {
"id": 27,
"name": "Streamer",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 26,
"name": "Streamer",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": [
{
"id": 30,
"groupType": "entity",
"groupID": [
27
],
"groupAttribute": "Count",
"byType": "entity",
"byID": [
26
],
"byAttribute": "_id",
"appliedModifier": "avg",
"relationID": 25,
"constraints": []
}
],
"AllGroupBys": [
{
"id": 30,
"groupType": "entity",
"groupID": [
27
],
"groupAttribute": "Count",
"byType": "entity",
"byID": [
26
],
"byAttribute": "_id",
"appliedModifier": "avg",
"relationID": 25,
"constraints": []
}
],
"Parents": null
},
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 0,
"name": "",
"constraints": null
},
"FromGroupBy": {
"id": 30,
"groupType": "entity",
"groupID": [
27
],
"groupAttribute": "Count",
"byType": "entity",
"byID": [
26
],
"byAttribute": "_id",
"appliedModifier": "avg",
"relationID": 25,
"constraints": []
},
"Rel": {
"id": 34,
"name": "viewerOverlap",
"depth": {
"min": 1,
"max": 1
},
"fromType": "groupBy",
"fromID": 30,
"toType": "entity",
"toID": 36,
"constraints": []
},
"ToNode": {
"id": 36,
"name": "Streamer",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 36,
"name": "Streamer",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": [
0
]
}
]
}`)
var TopGroupBy = []byte(`{
"return": {
"entities": [
9,
10,
68,
69
],
"relations": [
8,
67,
76
],
"groupBys": [
13,
72
]
},
"entities": [
{
"name": "parliament",
"ID": 9,
"constraints": []
},
{
"name": "parties",
"ID": 10,
"constraints": []
},
{
"name": "parliament",
"ID": 68,
"constraints": []
},
{
"name": "parties",
"ID": 69,
"constraints": []
}
],
"relations": [
{
"ID": 8,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 9,
"toType": "entity",
"toID": 10,
"constraints": []
},
{
"ID": 67,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 68,
"toType": "entity",
"toID": 69,
"constraints": []
},
{
"ID": 76,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "groupBy",
"fromID": 72,
"toType": "groupBy",
"toID": 13,
"constraints": []
}
],
"groupBys": [
{
"ID": 13,
"groupType": "entity",
"groupID": [
9
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
10
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 8,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET"
}
]
},
{
"ID": 72,
"groupType": "entity",
"groupID": [
69
],
"groupAttribute": "seats",
"byType": "entity",
"byID": [
68
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 67,
"constraints": [
{
"attribute": "seats",
"value": "13",
"dataType": "int",
"matchType": "LT"
}
]
}
],
"machineLearning": [],
"limit": 5000
}
`)
var TopGroupByTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 9,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 8,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 9,
"toType": "entity",
"toID": 10,
"constraints": []
},
"ToNode": {
"id": 10,
"name": "parties",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 9,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": [
{
"id": 13,
"groupType": "entity",
"groupID": [
9
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
10
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 8,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
],
"AllGroupBys": [
{
"id": 13,
"groupType": "entity",
"groupID": [
9
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
10
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 8,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
],
"Parents": null
},
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 68,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 67,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 68,
"toType": "entity",
"toID": 69,
"constraints": []
},
"ToNode": {
"id": 69,
"name": "parties",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 68,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": [
{
"id": 72,
"groupType": "entity",
"groupID": [
69
],
"groupAttribute": "seats",
"byType": "entity",
"byID": [
68
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 67,
"constraints": [
{
"attribute": "seats",
"value": "13",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
}
],
"AllGroupBys": [
{
"id": 72,
"groupType": "entity",
"groupID": [
69
],
"groupAttribute": "seats",
"byType": "entity",
"byID": [
68
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 67,
"constraints": [
{
"attribute": "seats",
"value": "13",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
}
],
"Parents": null
},
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 0,
"name": "",
"constraints": null
},
"FromGroupBy": {
"id": 72,
"groupType": "entity",
"groupID": [
69
],
"groupAttribute": "seats",
"byType": "entity",
"byID": [
68
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 67,
"constraints": [
{
"attribute": "seats",
"value": "13",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
},
"Rel": {
"id": 76,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "groupBy",
"fromID": 72,
"toType": "groupBy",
"toID": 13,
"constraints": []
},
"ToNode": {
"id": 0,
"name": "",
"constraints": null
},
"ToGroupBy": {
"id": 13,
"groupType": "entity",
"groupID": [
9
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
10
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 8,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 0,
"name": "",
"constraints": null
},
"TopGroupBy": {
"id": 13,
"groupType": "entity",
"groupID": [
9
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
10
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 8,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": [
0
]
}
]
}
`)
var TwoEntitiesNoFilter = []byte(`{
"databaseName": "TweedeKamer",
"return": {
"entities": [
0,
1
],
"relations": [
0
]
},
"entities": [
{
"name": "parliament",
"ID": 0,
"constraints": []
},
{
"name": "parties",
"ID": 1,
"constraints": []
}
],
"relations": [
{
"ID": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints":[]
}
],
"groupBys": [],
"limit": 5000,
"modifiers": []
}`)
var TwoEntitiesNoFilterTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints": []
},
"ToNode": {
"id": 1,
"name": "parties",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 0,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}
`)
var TwoEntitiesOneEntityFilter = []byte(`{
"databaseName": "TweedeKamer",
"return": {
"entities": [
0,
1
],
"relations": [
0
]
},
"entities": [
{
"name": "parliament",
"ID": 0,
"constraints": []
},
{
"name": "parties",
"ID": 1,
"constraints": [
{
"attribute": "seats",
"value": "10",
"dataType": "int",
"matchType": "LT"
}
]
}
],
"relations": [
{
"ID": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints":[]
}
],
"groupBys": [],
"limit": 5000,
"modifiers": []
}`)
var TwoEntitiesOneEntityFilterOneRelationFilter = []byte(`{
"return": {
"entities": [
0,
1
],
"relations": [
0
]
},
"entities": [
{
"ID": 0,
"name": "airports",
"constraints": [
{
"attribute": "state",
"value": "HI",
"dataType": "string",
"matchType": "exact"
}
]
},
{
"ID": 1,
"name": "airports",
"constraints":[]
}
],
"relations": [
{
"ID": 0,
"name": "flights",
"depth": {
"min": 1,
"max": 1
},
"FromType": "entity",
"fromID": 0,
"ToType": "entity",
"toID": 1,
"constraints": [
{
"attribute": "Day",
"value": "15",
"dataType": "int",
"matchType": "EQ",
"inType": "",
"inID": -1
}
]
}
],
"groupBys": [],
"limit": 5000
}`)
var TwoEntitiesOneEntityFilterOneRelationFilterTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 0,
"name": "airports",
"constraints": [
{
"attribute": "state",
"value": "HI",
"dataType": "string",
"matchType": "exact",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 0,
"name": "flights",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints": [
{
"attribute": "Day",
"value": "15",
"dataType": "int",
"matchType": "EQ",
"inID": -1,
"inType": ""
}
]
},
"ToNode": {
"id": 1,
"name": "airports",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 0,
"name": "airports",
"constraints": [
{
"attribute": "state",
"value": "HI",
"dataType": "string",
"matchType": "exact",
"inID": 0,
"inType": ""
}
]
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}
`)
var TwoEntitiesOneEntityFilterTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints": []
},
"ToNode": {
"id": 1,
"name": "parties",
"constraints": [
{
"attribute": "seats",
"value": "10",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 0,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}
`)
var TwoEntitiesTwoEntityFilters = []byte(`{
"databaseName": "TweedeKamer",
"return": {
"entities": [
0,
1
],
"relations": [
0
]
},
"entities": [
{
"name": "parliament",
"ID": 0,
"constraints": [
{
"attribute": "age",
"value": "45",
"dataType": "int",
"matchType": "GT"
}
]
},
{
"name": "parties",
"ID": 1,
"constraints": [
{
"attribute": "seats",
"value": "10",
"dataType": "int",
"matchType": "LT"
}
]
}
],
"relations": [
{
"ID": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints":[]
}
],
"groupBys": [],
"limit": 5000,
"modifiers": []
}`)
var TwoEntitiesTwoEntityFiltersTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "age",
"value": "45",
"dataType": "int",
"matchType": "GT",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 0,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 0,
"toType": "entity",
"toID": 1,
"constraints": []
},
"ToNode": {
"id": 1,
"name": "parties",
"constraints": [
{
"attribute": "seats",
"value": "10",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 0,
"name": "parliament",
"constraints": [
{
"attribute": "age",
"value": "45",
"dataType": "int",
"matchType": "GT",
"inID": 0,
"inType": ""
}
]
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": null
}
]
}`)
var WayTooLargeQuery = []byte(`{
"return": {
"entities": [
9,
10,
68,
69,
93,
104,
119,
126,
145
],
"relations": [
8,
67,
76,
92,
98,
118,
124,
144
],
"groupBys": [
13,
72,
106,
138
]
},
"entities": [
{
"name": "parliament",
"ID": 9,
"constraints": []
},
{
"name": "parties",
"ID": 10,
"constraints": []
},
{
"name": "parliament",
"ID": 68,
"constraints": []
},
{
"name": "parties",
"ID": 69,
"constraints": []
},
{
"name": "parliament",
"ID": 93,
"constraints": [
{
"attribute": "age",
"value": "32",
"dataType": "int",
"matchType": "GET"
}
]
},
{
"name": "commissions",
"ID": 104,
"constraints": []
},
{
"name": "parliament",
"ID": 119,
"constraints": [
{
"attribute": "age",
"value": "67",
"dataType": "int",
"matchType": "LET"
}
]
},
{
"name": "parties",
"ID": 126,
"constraints": [
{
"attribute": "seats",
"value": "14",
"dataType": "int",
"matchType": "LET"
}
]
},
{
"name": "parliament",
"ID": 145,
"constraints": []
}
],
"relations": [
{
"ID": 8,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 9,
"toType": "entity",
"toID": 10,
"constraints": []
},
{
"ID": 67,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 68,
"toType": "entity",
"toID": 69,
"constraints": []
},
{
"ID": 76,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "groupBy",
"fromID": 72,
"toType": "groupBy",
"toID": 13,
"constraints": []
},
{
"ID": 92,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 93,
"toType": "groupBy",
"toID": 13,
"constraints": []
},
{
"ID": 98,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 93,
"toType": "entity",
"toID": 104,
"constraints": []
},
{
"ID": 118,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 119,
"toType": "groupBy",
"toID": 106,
"constraints": []
},
{
"ID": 124,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 119,
"toType": "entity",
"toID": 126,
"constraints": []
},
{
"ID": 144,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 145,
"toType": "groupBy",
"toID": 138,
"constraints": []
}
],
"groupBys": [
{
"ID": 13,
"groupType": "entity",
"groupID": [
9
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
10
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 8,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET"
}
]
},
{
"ID": 72,
"groupType": "entity",
"groupID": [
69
],
"groupAttribute": "seats",
"byType": "entity",
"byID": [
68
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 67,
"constraints": [
{
"attribute": "seats",
"value": "13",
"dataType": "int",
"matchType": "LT"
}
]
},
{
"ID": 106,
"groupType": "entity",
"groupID": [
93
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
104
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 98,
"constraints": [
{
"attribute": "age",
"value": "69",
"dataType": "int",
"matchType": "LET"
}
]
},
{
"ID": 138,
"groupType": "entity",
"groupID": [
119
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
126
],
"byAttribute": "_id",
"appliedModifier": "PRODUCT",
"relationID": 124,
"constraints": [
{
"attribute": "age",
"value": "8008",
"dataType": "int",
"matchType": "GET"
}
]
}
],
"machineLearning": [],
"limit": 5000
}
`)
var WayTooLargeQueryTreeList = string(`{
"Trees": [
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 9,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 8,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 9,
"toType": "entity",
"toID": 10,
"constraints": []
},
"ToNode": {
"id": 10,
"name": "parties",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 9,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": [
{
"id": 13,
"groupType": "entity",
"groupID": [
9
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
10
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 8,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
],
"AllGroupBys": [
{
"id": 13,
"groupType": "entity",
"groupID": [
9
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
10
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 8,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
],
"Parents": null
},
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 68,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 67,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 68,
"toType": "entity",
"toID": 69,
"constraints": []
},
"ToNode": {
"id": 69,
"name": "parties",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 68,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": [
{
"id": 72,
"groupType": "entity",
"groupID": [
69
],
"groupAttribute": "seats",
"byType": "entity",
"byID": [
68
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 67,
"constraints": [
{
"attribute": "seats",
"value": "13",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
}
],
"AllGroupBys": [
{
"id": 72,
"groupType": "entity",
"groupID": [
69
],
"groupAttribute": "seats",
"byType": "entity",
"byID": [
68
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 67,
"constraints": [
{
"attribute": "seats",
"value": "13",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
}
],
"Parents": null
},
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 93,
"name": "parliament",
"constraints": [
{
"attribute": "age",
"value": "32",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 98,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 93,
"toType": "entity",
"toID": 104,
"constraints": []
},
"ToNode": {
"id": 104,
"name": "commissions",
"constraints": []
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": [
1
]
},
{
"Self": {
"FromNode": {
"id": 93,
"name": "parliament",
"constraints": [
{
"attribute": "age",
"value": "32",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 92,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 93,
"toType": "groupBy",
"toID": 13,
"constraints": []
},
"ToNode": {
"id": 0,
"name": "",
"constraints": null
},
"ToGroupBy": {
"id": 13,
"groupType": "entity",
"groupID": [
9
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
10
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 8,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
},
"Parent": 0,
"Children": [
2
]
},
{
"Self": {
"FromNode": {
"id": 0,
"name": "",
"constraints": null
},
"FromGroupBy": {
"id": 72,
"groupType": "entity",
"groupID": [
69
],
"groupAttribute": "seats",
"byType": "entity",
"byID": [
68
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 67,
"constraints": [
{
"attribute": "seats",
"value": "13",
"dataType": "int",
"matchType": "LT",
"inID": 0,
"inType": ""
}
]
},
"Rel": {
"id": 76,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "groupBy",
"fromID": 72,
"toType": "groupBy",
"toID": 13,
"constraints": []
},
"ToNode": {
"id": 0,
"name": "",
"constraints": null
},
"ToGroupBy": {
"id": 13,
"groupType": "entity",
"groupID": [
9
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
10
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 8,
"constraints": [
{
"attribute": "age",
"value": "42",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
},
"Parent": 1,
"Children": []
}
],
"TopNode": {
"id": 104,
"name": "commissions",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": [
{
"id": 106,
"groupType": "entity",
"groupID": [
93
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
104
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 98,
"constraints": [
{
"attribute": "age",
"value": "69",
"dataType": "int",
"matchType": "LET",
"inID": 0,
"inType": ""
}
]
}
],
"AllGroupBys": [
{
"id": 106,
"groupType": "entity",
"groupID": [
93
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
104
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 98,
"constraints": [
{
"attribute": "age",
"value": "69",
"dataType": "int",
"matchType": "LET",
"inID": 0,
"inType": ""
}
]
}
],
"Parents": [
0
]
},
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 119,
"name": "parliament",
"constraints": [
{
"attribute": "age",
"value": "67",
"dataType": "int",
"matchType": "LET",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 124,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 119,
"toType": "entity",
"toID": 126,
"constraints": []
},
"ToNode": {
"id": 126,
"name": "parties",
"constraints": [
{
"attribute": "seats",
"value": "14",
"dataType": "int",
"matchType": "LET",
"inID": 0,
"inType": ""
}
]
},
"ToGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
}
},
"Parent": -1,
"Children": [
1
]
},
{
"Self": {
"FromNode": {
"id": 119,
"name": "parliament",
"constraints": [
{
"attribute": "age",
"value": "67",
"dataType": "int",
"matchType": "LET",
"inID": 0,
"inType": ""
}
]
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 118,
"name": "part_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 119,
"toType": "groupBy",
"toID": 106,
"constraints": []
},
"ToNode": {
"id": 0,
"name": "",
"constraints": null
},
"ToGroupBy": {
"id": 106,
"groupType": "entity",
"groupID": [
93
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
104
],
"byAttribute": "_id",
"appliedModifier": "AVG",
"relationID": 98,
"constraints": [
{
"attribute": "age",
"value": "69",
"dataType": "int",
"matchType": "LET",
"inID": 0,
"inType": ""
}
]
}
},
"Parent": 0,
"Children": []
}
],
"TopNode": {
"id": 126,
"name": "parties",
"constraints": [
{
"attribute": "seats",
"value": "14",
"dataType": "int",
"matchType": "LET",
"inID": 0,
"inType": ""
}
]
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": [
{
"id": 138,
"groupType": "entity",
"groupID": [
119
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
126
],
"byAttribute": "_id",
"appliedModifier": "PRODUCT",
"relationID": 124,
"constraints": [
{
"attribute": "age",
"value": "8008",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
],
"AllGroupBys": [
{
"id": 138,
"groupType": "entity",
"groupID": [
119
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
126
],
"byAttribute": "_id",
"appliedModifier": "PRODUCT",
"relationID": 124,
"constraints": [
{
"attribute": "age",
"value": "8008",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
],
"Parents": [
2
]
},
{
"TreeElements": [
{
"Self": {
"FromNode": {
"id": 145,
"name": "parliament",
"constraints": []
},
"FromGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"Rel": {
"id": 144,
"name": "member_of",
"depth": {
"min": 1,
"max": 1
},
"fromType": "entity",
"fromID": 145,
"toType": "groupBy",
"toID": 138,
"constraints": []
},
"ToNode": {
"id": 0,
"name": "",
"constraints": null
},
"ToGroupBy": {
"id": 138,
"groupType": "entity",
"groupID": [
119
],
"groupAttribute": "age",
"byType": "entity",
"byID": [
126
],
"byAttribute": "_id",
"appliedModifier": "PRODUCT",
"relationID": 124,
"constraints": [
{
"attribute": "age",
"value": "8008",
"dataType": "int",
"matchType": "GET",
"inID": 0,
"inType": ""
}
]
}
},
"Parent": -1,
"Children": []
}
],
"TopNode": {
"id": 145,
"name": "parliament",
"constraints": []
},
"TopGroupBy": {
"id": 0,
"groupType": "",
"groupID": null,
"groupAttribute": "",
"byType": "",
"byID": null,
"byAttribute": "",
"appliedModifier": "",
"relationID": 0,
"constraints": null
},
"GroupBys": null,
"AllGroupBys": null,
"Parents": [
3
]
}
]
}
`)
Functions ¶
func FixIndices ¶
FixIndices maps pill IDs to the JSONQuery slice indices
JSONQuery: *IncomingQueryJSON, the converted query JSON for which the maps must be generated Return: (map[int]int, map[int]int, map[int]int), the entity, relation and groupBy conversion maps
Types ¶
type GroupByDone ¶
type IncomingQueryJSON ¶
type IncomingQueryJSON struct { DatabaseName string `json:"databaseName"` Return QueryReturnStruct `json:"return"` Entities []QueryEntityStruct `json:"entities"` Relations []QueryRelationStruct `json:"relations"` GroupBys []QueryGroupByStruct `json:"groupBys"` MachineLearning []QueryMLStruct `json:"machineLearning"` // Limit is for limiting the amount of paths AQL will return in a relation let statement Limit int `json:"limit"` Modifiers []QueryModifierStruct Prefix string }
IncomingQueryJSON describes the query coming into the service in JSON format
func (IncomingQueryJSON) FindE ¶
func (JSONQuery IncomingQueryJSON) FindE(qID int) *QueryEntityStruct
FindE finds the entity with a specified ID in an IncomingQueryJSON struct
func (IncomingQueryJSON) FindG ¶
func (JSONQuery IncomingQueryJSON) FindG(qID int) *QueryGroupByStruct
FindG finds the groupBy with a specified ID in an IncomingQueryJSON struct
func (IncomingQueryJSON) FindR ¶
func (JSONQuery IncomingQueryJSON) FindR(qID int) *QueryRelationStruct
FindR finds the relation with a specified ID in an IncomingQueryJSON struct
func (*IncomingQueryJSON) Validate ¶
func (JSONQuery *IncomingQueryJSON) Validate() []error
type MetaData ¶
Maps a relation (e.g. r1) to the two entities it's connceted to (e.g. e0,e1) This is our neccesary metadata for executing a query and converting the output into our standard format
type Query ¶
type Query []QueryPart
Query is a list of (possibly unordered) queryparts
func (Query) SelectByID ¶
SelectByID retrieves a QueryPart based on its PartID
type QueryConstraintStruct ¶
type QueryConstraintStruct struct { Attribute string `json:"attribute"` Value string `json:"value"` DataType string `json:"dataType"` MatchType string `json:"matchType"` InID int `json:"inID"` InType string `json:"inType"` }
QueryConstraintStruct holds the information of the constraint Constraint datatypes
string MatchTypes: exact/contains/startswith/endswith int MatchTypes: GT/LT/EQ bool MatchTypes: EQ/NEQ
type QueryEntityStruct ¶
type QueryEntityStruct struct { ID int `json:"id"` Name string `json:"name"` Constraints []QueryConstraintStruct `json:"constraints"` }
QueryEntityStruct encapsulates a single entity with its corresponding constraints
type QueryGenericStruct ¶
type QueryGroupByStruct ¶
type QueryGroupByStruct struct { ID int `json:"id"` GroupType string `json:"groupType"` GroupID []int `json:"groupID"` GroupAttribute string `json:"groupAttribute"` ByType string `json:"byType"` ByID []int `json:"byID"` ByAttribute string `json:"byAttribute"` AppliedModifier string `json:"appliedModifier"` RelationID int `json:"relationID"` Constraints []QueryConstraintStruct `json:"constraints"` }
QueryGroupByStruct holds all the info needed to form a group by
type QueryMLStruct ¶
QueryMLStruct holds info for machinelearning
type QueryModifierStruct ¶
type QueryModifierStruct struct { Type string // SUM COUNT AVG SelectedType string // node relation SelectedTypeID int // ID of the enitity or relation AttributeIndex int // = -1 if its the node or relation, = > -1 if an attribute is selected }
QueryModifierStruct encapsulates a single modifier with its corresponding constraints
type QueryPart ¶
type QueryPart struct { QType string // Eg if it is a relation or groupby QID int // ID of said relation/gb PartID int // Custom ID used for dependency Dependencies []int // List of partID's that need to come before }
QueryPart is a struct containing a part of the query and a list of dependencies on which this part of the query depends
type QueryRelationStruct ¶
type QueryRelationStruct struct { ID int `json:"id"` Name string `json:"name"` Depth QuerySearchDepthStruct `json:"depth"` FromType string `json:"fromType"` FromID int `json:"fromID"` ToType string `json:"toType"` ToID int `json:"toID"` Constraints []QueryConstraintStruct `json:"constraints"` }
QueryRelationStruct encapsulates a single relation with its corresponding constraints
type QueryReturnStruct ¶
type QueryReturnStruct struct { Entities []int `json:"entities"` Relations []int `json:"relations"` GroupBys []int `json:"groupBys"` }
QueryReturnStruct holds the indices of the entities and relations that need to be returned
type QuerySearchDepthStruct ¶
QuerySearchDepthStruct holds the range of traversals for the relation
type Tree ¶
type Tree struct { TreeElements []TreeElement TopNode QueryEntityStruct TopGroupBy QueryGroupByStruct GroupBys []QueryGroupByStruct AllGroupBys []QueryGroupByStruct Parents []int }
type TreeElement ¶
type TreeList ¶
type TreeList struct {
Trees []Tree
}
func CreateHierarchy ¶
func CreateHierarchy(JSONQuery *IncomingQueryJSON, entityMap map[int]int, relationMap map[int]int, groupByMap map[int]int) (error, TreeList)
CreateHierarchy creates the hierarchy for a query json
JSONQuery: *IncomingQueryJSON, the converted query JSON for which the hierarchy must be generated entityMap: map[int]int, a map to convert entity IDs to their indices in the JSONQuery.Entities relationMap: map[int]int, a map to convert relation IDs to their indices in the JSONQuery.Relations groupByMap: map[int]int, a map to convert groupby IDs to their indices in the JSONQuery.GroupBys Return: (error, TreeList), and error and a hierarchy in the form of a TreeList
type Triple ¶
type Triple struct { FromNode QueryEntityStruct FromGroupBy QueryGroupByStruct Rel QueryRelationStruct ToNode QueryEntityStruct ToGroupBy QueryGroupByStruct }