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
dcf60dc9
Commit
dcf60dc9
authored
3 years ago
by
Kieran van Gaalen
Browse files
Options
Downloads
Patches
Plain Diff
Fixing tests
parent
60cbd81f
No related branches found
No related tags found
1 merge request
!1
Big merge
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aql/convertQuery_test.go
+24
-24
24 additions, 24 deletions
aql/convertQuery_test.go
with
24 additions
and
24 deletions
aql/convertQuery_test.go
+
24
−
24
View file @
dcf60dc9
...
...
@@ -1091,7 +1091,7 @@ func TestSingleJunctionFiveEntitiesThreeEntityFilters(t *testing.T) {
FILTER e_3.seats < 10
FILTER r2._from == e_2._id AND r2._to == e_3._id
FILTER length(e_3) != 0 AND length(r2) != 0
RETURN {"nodes":union_distinct([e_3], []), "rel": union_distinct([r2], [])}
RETURN {"nodes":union_distinct([e_3], []), "rel": union_distinct([r2],
[]), "mod": union_distinct([],
[])}
)
LET e4 = (
FOR e_4 IN resolutions
...
...
@@ -1099,20 +1099,20 @@ func TestSingleJunctionFiveEntitiesThreeEntityFilters(t *testing.T) {
FILTER e_4.date LIKE "%mei%"
FILTER r3._from == e_2._id AND r3._to == e_4._id
FILTER length(e_4) != 0 AND length(r3) != 0
RETURN {"nodes":union_distinct([e_4], []), "rel": union_distinct([r3], [])}
RETURN {"nodes":union_distinct([e_4], []), "rel": union_distinct([r3],
[]), "mod": union_distinct([],
[])}
)
FILTER length(e3) != 0 AND length(e4) != 0 AND length(e_2) != 0 AND length(r1) != 0
RETURN {"nodes":union_distinct(flatten(e3[**].nodes), flatten(e4[**].nodes), [e_2]), "rel": union_distinct(flatten(e3[**].rel), flatten(e4[**].rel), [r1])}
RETURN {"nodes":union_distinct(flatten(e3[**].nodes), flatten(e4[**].nodes), [e_2]), "rel": union_distinct(flatten(e3[**].rel), flatten(e4[**].rel), [r1])
, "mod": union_distinct(flatten(e3[**].mod), flatten(e4[**].mod), [])
}
)
FILTER length(e2) != 0 AND length(e_1) != 0 AND length(r0) != 0
RETURN {"nodes":union_distinct(flatten(e2[**].nodes), [e_1]), "rel": union_distinct(flatten(e2[**].rel), [r0])}
RETURN {"nodes":union_distinct(flatten(e2[**].nodes), [e_1]), "rel": union_distinct(flatten(e2[**].rel), [r0])
, "mod": union_distinct(flatten(e2[**].mod), [])
}
)
FILTER length(e1) != 0 AND length(e_0) != 0
RETURN {"nodes":union_distinct(flatten(e1[**].nodes), [e_0]), "rel": union_distinct(flatten(e1[**].rel), [])}
RETURN {"nodes":union_distinct(flatten(e1[**].nodes), [e_0]), "rel": union_distinct(flatten(e1[**].rel),
[]), "mod": union_distinct(flatten(e1[**].mod),
[])}
)
let
nodes = union_distinct(flatten(result[**].nodes),[])
let
edges = union_distinct(flatten(result[**].rel),[])
return
{"vertices":nodes,"edges":edges}`
)
LET
nodes = union_distinct(flatten(result[**].nodes),[])
LET
edges = union_distinct(flatten(result[**].rel),[])
RETURN
{"vertices":nodes,"edges":edges}`
)
regExCleaner
:=
regexp
.
MustCompile
(
`\s+`
)
correctCleanedResult
:=
regExCleaner
.
ReplaceAllString
(
string
(
correctConvertedResult
),
" "
)
convertedCleanedResult
:=
regExCleaner
.
ReplaceAllString
(
*
convertedResult
,
" "
)
...
...
@@ -1345,7 +1345,7 @@ func TestDoubleJunctionNineEntitiesThreeEntityFilters(t *testing.T) {
FOR r4 IN submits
FILTER r4._from == e_0._id AND r4._to == e_5._id
FILTER length(e_5) != 0 AND length(r4) != 0
RETURN {"nodes":union_distinct([e_5], []), "rel": union_distinct([r4], [])}
RETURN {"nodes":union_distinct([e_5], []), "rel": union_distinct([r4],
[]), "mod": union_distinct([],
[])}
)
LET e6 = (
FOR e_6 IN parties
...
...
@@ -1356,16 +1356,16 @@ func TestDoubleJunctionNineEntitiesThreeEntityFilters(t *testing.T) {
FOR r6 IN member_of
FILTER r6._from == e_7._id AND r6._to == e_6._id
FILTER length(e_7) != 0 AND length(r6) != 0
RETURN {"nodes":union_distinct([e_7], []), "rel": union_distinct([r6], [])}
RETURN {"nodes":union_distinct([e_7], []), "rel": union_distinct([r6],
[]), "mod": union_distinct([],
[])}
)
FILTER length(e7) != 0 AND length(e_6) != 0 AND length(r5) != 0
RETURN {"nodes":union_distinct(flatten(e7[**].nodes), [e_6]), "rel": union_distinct(flatten(e7[**].rel), [r5])}
RETURN {"nodes":union_distinct(flatten(e7[**].nodes), [e_6]), "rel": union_distinct(flatten(e7[**].rel), [r5])
, "mod": union_distinct(flatten(e7[**].mod), [])
}
)
FILTER length(e5) != 0 AND length(e6) != 0 AND length(e_0) != 0 AND length(r0) != 0
RETURN {"nodes":union_distinct(flatten(e5[**].nodes), flatten(e6[**].nodes), [e_0]), "rel": union_distinct(flatten(e5[**].rel), flatten(e6[**].rel), [r0])}
RETURN {"nodes":union_distinct(flatten(e5[**].nodes), flatten(e6[**].nodes), [e_0]), "rel": union_distinct(flatten(e5[**].rel), flatten(e6[**].rel), [r0])
, "mod": union_distinct(flatten(e5[**].mod), flatten(e6[**].mod), [])
}
)
FILTER length(e0) != 0 AND length(e_1) != 0 AND length(r1) != 0
RETURN {"nodes":union_distinct(flatten(e0[**].nodes), [e_1]), "rel": union_distinct(flatten(e0[**].rel), [r1])}
RETURN {"nodes":union_distinct(flatten(e0[**].nodes), [e_1]), "rel": union_distinct(flatten(e0[**].rel), [r1])
, "mod": union_distinct(flatten(e0[**].mod), [])
}
)
LET e4 = (
FOR e_4 IN resolutions
...
...
@@ -1373,17 +1373,17 @@ func TestDoubleJunctionNineEntitiesThreeEntityFilters(t *testing.T) {
FILTER e_4.date LIKE "%mei%"
FILTER r3._from == e_2._id AND r3._to == e_4._id
FILTER length(e_4) != 0 AND length(r3) != 0
RETURN {"nodes":union_distinct([e_4], []), "rel": union_distinct([r3], [])}
RETURN {"nodes":union_distinct([e_4], []), "rel": union_distinct([r3],
[]), "mod": union_distinct([],
[])}
)
FILTER length(e1) != 0 AND length(e4) != 0 AND length(e_2) != 0 AND length(r2) != 0
RETURN {"nodes":union_distinct(flatten(e1[**].nodes), flatten(e4[**].nodes), [e_2]), "rel": union_distinct(flatten(e1[**].rel), flatten(e4[**].rel), [r2])}
RETURN {"nodes":union_distinct(flatten(e1[**].nodes), flatten(e4[**].nodes), [e_2]), "rel": union_distinct(flatten(e1[**].rel), flatten(e4[**].rel), [r2])
, "mod": union_distinct(flatten(e1[**].mod), flatten(e4[**].mod), [])
}
)
FILTER length(e2) != 0 AND length(e_3) != 0
RETURN {"nodes":union_distinct(flatten(e2[**].nodes), [e_3]), "rel": union_distinct(flatten(e2[**].rel), [])}
RETURN {"nodes":union_distinct(flatten(e2[**].nodes), [e_3]), "rel": union_distinct(flatten(e2[**].rel),
[]), "mod": union_distinct(flatten(e2[**].mod),
[])}
)
let
nodes = union_distinct(flatten(result[**].nodes),[])
let
edges = union_distinct(flatten(result[**].rel),[])
return
{"vertices":nodes,"edges":edges}`
)
LET
nodes = union_distinct(flatten(result[**].nodes),[])
LET
edges = union_distinct(flatten(result[**].rel),[])
RETURN
{"vertices":nodes,"edges":edges}`
)
regExCleaner
:=
regexp
.
MustCompile
(
`\s+`
)
correctCleanedResult
:=
regExCleaner
.
ReplaceAllString
(
string
(
correctConvertedResult
),
" "
)
convertedCleanedResult
:=
regExCleaner
.
ReplaceAllString
(
*
convertedResult
,
" "
)
...
...
@@ -1476,14 +1476,14 @@ func TestTwoEntitiesOneEntityFilterOneRelationFilter(t *testing.T) {
FILTER r0.Day == 15
FILTER r0._from == e_0._id AND r0._to == e_1._id
FILTER length(e_1) != 0 AND length(r0) != 0
RETURN {"nodes":union_distinct([e_1], []), "rel": union_distinct([r0], [])}
RETURN {"nodes":union_distinct([e_1], []), "rel": union_distinct([r0],
[]), "mod": union_distinct([],
[])}
)
FILTER length(e1) != 0 AND length(e_0) != 0
RETURN {"nodes":union_distinct(flatten(e1[**].nodes), [e_0]), "rel": union_distinct(flatten(e1[**].rel), [])}
RETURN {"nodes":union_distinct(flatten(e1[**].nodes), [e_0]), "rel": union_distinct(flatten(e1[**].rel),
[]), "mod": union_distinct(flatten(e1[**].mod),
[])}
)
let
nodes = union_distinct(flatten(result[**].nodes),[])
let
edges = union_distinct(flatten(result[**].rel),[])
return
{"vertices":nodes,"edges":edges}`
)
LET
nodes = union_distinct(flatten(result[**].nodes),[])
LET
edges = union_distinct(flatten(result[**].rel),[])
RETURN
{"vertices":nodes,"edges":edges}`
)
regExCleaner
:=
regexp
.
MustCompile
(
`\s+`
)
correctCleanedResult
:=
regExCleaner
.
ReplaceAllString
(
string
(
correctConvertedResult
),
" "
)
convertedCleanedResult
:=
regExCleaner
.
ReplaceAllString
(
*
convertedResult
,
" "
)
...
...
This diff is collapsed.
Click to expand it.
Heijden,T.A.J. van der (Thijs)
@t.a.j.vanderheijden
mentioned in commit
82d6956b
·
3 years ago
mentioned in commit
82d6956b
mentioned in commit 82d6956b25f2a5a9942b9ef3014309c1aefed134
Toggle commit list
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