Newer
Older
// IncomingQueryJSON describes the query coming into the service in JSON format
type IncomingQueryJSON struct {
DatabaseName string
Return QueryReturnStruct
Entities []QueryEntityStruct
Relations []QueryRelationStruct
Geurtjens,D. (Douwe Geurtjens)
committed
GroupBys []QueryGroupByStruct
Filters []QueryFilterStruct
// Limit is for limiting the amount of paths AQL will return in a relation let statement
Limit int
Modifiers []QueryModifierStruct
}
// QueryReturnStruct holds the indices of the entities and relations that need to be returned
type QueryReturnStruct struct {
Entities []int
Relations []int
Geurtjens,D. (Douwe Geurtjens)
committed
GroupBys []int
//Modifiers []int
}
// QueryEntityStruct encapsulates a single entity with its corresponding constraints
type QueryEntityStruct struct {
Geurtjens,D. (Douwe Geurtjens)
committed
ID int
Name string
}
// QueryRelationStruct encapsulates a single relation with its corresponding constraints
type QueryRelationStruct struct {
Geurtjens,D. (Douwe Geurtjens)
committed
ID int
Name string
FromType string
FromID int
ToType string
ToID int
Depth QuerySearchDepthStruct
Geurtjens,D. (Douwe Geurtjens)
committed
type QueryGroupByStruct struct {
ID int
GroupType string
GroupID int
GroupAttribute string
ByType string
ByID int
ByAttribute string
AppliedModifier string
Geurtjens,D. (Douwe Geurtjens)
committed
RelationID int
Geurtjens,D. (Douwe Geurtjens)
committed
}
type QueryFilterStruct struct {
ID int
FromType string
FromID int
ToType string
ToID int
Attribute string
DataType string
MatchType string
Value string
InType string
InID int
}
// QueryModifierStruct encapsulates a single modifier with its corresponding constraints
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
}
// QuerySearchDepthStruct holds the range of traversals for the relation
type QuerySearchDepthStruct struct {
Min int
Max int
}
// QueryConstraintStruct holds the information of the constraint
// Constraint datatypes
// int MatchTypes: GT/LT/EQ/
// bool MatchTypes: EQ/NEQ