Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
This program has been developed by students from the bachelor Computer Science at Utrecht University within the Software Project course.
© Copyright Utrecht University (Department of Information and Computing Sciences)
*/
package entityv2
/*
IncomingQueryJSON describes the query coming into the service in JSON format
*/
type IncomingQueryJSON struct {
DatabaseName string `json:"databaseName"`
Limit int `json:"limit"`
Return []string `json:"return"`
Query []QueryStruct `json:"query"`
// Entities []QueryEntityStruct `json:"entities"`
// Relations []QueryRelationStruct `json:"relations"`
// GroupBys []QueryGroupByStruct `json:"groupBys"`
// MachineLearning []QueryMLStruct `json:"machineLearning"`
// Modifiers []QueryModifierStruct
// Prefix string
}
type QueryStruct struct {
ID string `json:"id"`
Node NodeStruct `json:"node"`
}
type NodeStruct struct {
Label string `json:"label"`
ID string `json:"id"`
Logic []LogicStruct `json:"logic"`
Filter []FilterStruct `json:"filter"`
Relation RelationStruct `json:"relation"`
SubQuery *QueryStruct `json:"subquery"`
Export []ExportNodeStruct `json:"export"`
}
type ExportNodeStruct struct {
ID string `json:"id"`
Attribute string `json:"attribute"`
}
type LogicStruct struct {
Attribute string `json:"attribute"`
Operation string `json:"operation"`
ID string `json:"id"`
}
type FilterStruct struct {
Attribute string `json:"attribute"`
Operation string `json:"operation"`
Value string `json:"value"`
}
type RelationStruct struct {
Label string `json:"label"`
ID string `json:"id"`
Depth QuerySearchDepthStruct `json:"depth"`
Direction string `json:"direction"`
Node *NodeStruct `json:"node"`
}
/*
QuerySearchDepthStruct holds the range of traversals for the relation
*/
type QuerySearchDepthStruct struct {
Min int `json:"min"`
Max int `json:"max"`
}