Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Q
query-conversion
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
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
query-conversion
Commits
b2eb1dba
Commit
b2eb1dba
authored
3 years ago
by
Joris
Browse files
Options
Downloads
Patches
Plain Diff
Removed some printstatements
parent
9f6b8e93
No related branches found
No related tags found
1 merge request
!2
Groupby overhaul
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cypher/clustering.go
+0
-1
0 additions, 1 deletion
cypher/clustering.go
cypher/convertQuery.go
+2
-11
2 additions, 11 deletions
cypher/convertQuery.go
unmarshalJSON.go
+0
-2
0 additions, 2 deletions
unmarshalJSON.go
with
2 additions
and
14 deletions
cypher/clustering.go
+
0
−
1
View file @
b2eb1dba
...
...
@@ -34,7 +34,6 @@ func checkForQueryCluster(JSONQuery *entity.IncomingQueryJSON) (*entity.Incoming
gb
:=
fmt
.
Sprintf
(
"g%v"
,
JSONQuery
.
GroupBys
[
0
]
.
ID
)
cluster
[
gb
]
=
true
// TODO: Does not check if the groupby is properly connected
group
:=
fmt
.
Sprintf
(
"%v%v"
,
string
(
JSONQuery
.
GroupBys
[
0
]
.
GroupType
[
0
]),
JSONQuery
.
GroupBys
[
0
]
.
GroupID
)
cluster
[
group
]
=
true
...
...
This diff is collapsed.
Click to expand it.
cypher/convertQuery.go
+
2
−
11
View file @
b2eb1dba
...
...
@@ -15,7 +15,8 @@ func (s *Service) ConvertQuery(totalJSONQuery *entity.IncomingQueryJSON) (*strin
queryJSON
:=
totalJSONQuery
query
,
rest
,
isRest
:=
checkForQueryCluster
(
queryJSON
)
// If you want to query the other cluster as well, remove the underscores
query
,
_
,
_
:=
checkForQueryCluster
(
queryJSON
)
if
query
==
nil
{
return
nil
,
errors
.
New
(
"Invalid query"
)
...
...
@@ -26,13 +27,6 @@ func (s *Service) ConvertQuery(totalJSONQuery *entity.IncomingQueryJSON) (*strin
return
nil
,
err
}
if
isRest
{
fmt
.
Println
(
"Rest:"
)
fmt
.
Println
(
rest
)
// If something needs to be done with other query cluster, then add code here
}
finalCypher
,
err
=
createCypher
(
query
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -50,8 +44,6 @@ func createCypher(JSONQuery *entity.IncomingQueryJSON) (*string, error) {
return
nil
,
err
}
fmt
.
Println
(
hierarchy
)
// translate it to cypher in the right order, using the hierarchy
cypher
,
err
:=
formQuery
(
JSONQuery
,
hierarchy
)
if
err
!=
nil
{
...
...
@@ -216,7 +208,6 @@ func createQueryHierarchy(JSONQuery *entity.IncomingQueryJSON) (entity.Query, er
if
rel
.
FromID
==
rela
.
ToID
&&
rel
.
FromType
==
rela
.
ToType
{
part
:=
parts
.
Find
(
rel
.
ID
,
"relation"
)
part
.
Dependencies
=
append
(
part
.
Dependencies
,
parts
.
Find
(
rela
.
ID
,
"relation"
)
.
PartID
)
log
.
Println
(
"yeet"
)
}
}
...
...
This diff is collapsed.
Click to expand it.
unmarshalJSON.go
+
0
−
2
View file @
b2eb1dba
...
...
@@ -2,7 +2,6 @@ package query
import
(
"encoding/json"
"log"
"git.science.uu.nl/graphpolaris/query-conversion/entity"
)
...
...
@@ -15,6 +14,5 @@ UnmarshalJSON takes an incoming message and unmarshals it
func
UnmarshalJSON
(
msg
*
[]
byte
)
(
*
entity
.
IncomingQueryJSON
,
error
)
{
var
JSONQuery
entity
.
IncomingQueryJSON
err
:=
json
.
Unmarshal
(
*
msg
,
&
JSONQuery
)
log
.
Println
(
JSONQuery
)
return
&
JSONQuery
,
err
}
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