Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Q
query-service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GraphPolaris
Microservices
query-service
Commits
241c671a
Commit
241c671a
authored
3 years ago
by
thijsheijden
Browse files
Options
Downloads
Patches
Plain Diff
Re-added the incoming JSON format
parent
c367316d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
internal/entity/JSONQuery.go
+60
-0
60 additions, 0 deletions
internal/entity/JSONQuery.go
with
60 additions
and
0 deletions
internal/entity/JSONQuery.go
0 → 100644
+
60
−
0
View file @
241c671a
package
entity
// IncomingQueryJSON describes the query coming into the service in JSON format
type
IncomingQueryJSON
struct
{
DatabaseName
string
Return
QueryReturnStruct
Entities
[]
QueryEntityStruct
Relations
[]
QueryRelationStruct
// 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
//Modifiers []int
}
// QueryEntityStruct encapsulates a single entity with its corresponding constraints
type
QueryEntityStruct
struct
{
Type
string
Constraints
[]
QueryConstraintStruct
}
// QueryRelationStruct encapsulates a single relation with its corresponding constraints
type
QueryRelationStruct
struct
{
Type
string
EntityFrom
int
EntityTo
int
Depth
QuerySearchDepthStruct
Constraints
[]
QueryConstraintStruct
}
// QueryModifierStruct encapsulates a single modifier with its corresponding constraints
type
QueryModifierStruct
struct
{
Type
string
// SUM COUNT AVG
SelectedType
string
// node relation
ID
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
// text MatchTypes: exact/contains/startswith/endswith
// number MatchTypes: GT/LT/EQ
// bool MatchTypes: EQ/NEQ
type
QueryConstraintStruct
struct
{
Attribute
string
Value
string
DataType
string
MatchType
string
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment