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
39586f96
Commit
39586f96
authored
3 years ago
by
Geurtjens,D. (Douwe Geurtjens)
Browse files
Options
Downloads
Patches
Plain Diff
Half tests fixed
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
+41
-41
41 additions, 41 deletions
aql/convertQuery_test.go
with
41 additions
and
41 deletions
aql/convertQuery_test.go
+
41
−
41
View file @
39586f96
...
...
@@ -125,14 +125,14 @@ func TestTwoEntitiesNoFilter(t *testing.T) {
FOR r0 IN member_of
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
,
" "
)
...
...
@@ -218,14 +218,14 @@ func TestTwoEntitiesOneEntityFilter(t *testing.T) {
FILTER e_1.seats < 10
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
,
" "
)
...
...
@@ -318,14 +318,14 @@ func TestTwoEntitiesTwoEntityFilters(t *testing.T) {
FILTER e_1.seats < 10
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
,
" "
)
...
...
@@ -426,17 +426,17 @@ func TestThreeEntitiesNoFilter(t *testing.T) {
FOR r1 IN submits
FILTER r1._from == e_0._id AND r1._to == e_2._id
FILTER length(e_2) != 0 AND length(r1) != 0
RETURN {"nodes":union_distinct([e_2], []), "rel": union_distinct([r1], [])}
RETURN {"nodes":union_distinct([e_2], []), "rel": union_distinct([r1],
[]), "mod": union_distinct([],
[])}
)
FILTER length(e2) != 0 AND length(e_0) != 0 AND length(r0) != 0
RETURN {"nodes":union_distinct(flatten(e2[**].nodes), [e_0]), "rel": union_distinct(flatten(e2[**].rel), [r0])}
RETURN {"nodes":union_distinct(flatten(e2[**].nodes), [e_0]), "rel": union_distinct(flatten(e2[**].rel), [r0])
, "mod": union_distinct(flatten(e2[**].mod), [])
}
)
FILTER length(e0) != 0 AND length(e_1) != 0
RETURN {"nodes":union_distinct(flatten(e0[**].nodes), [e_1]), "rel": union_distinct(flatten(e0[**].rel), [])}
RETURN {"nodes":union_distinct(flatten(e0[**].nodes), [e_1]), "rel": union_distinct(flatten(e0[**].rel),
[]), "mod": union_distinct(flatten(e0[**].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
,
" "
)
...
...
@@ -545,17 +545,17 @@ func TestThreeEntitiesOneEntityFilter(t *testing.T) {
FOR r1 IN submits
FILTER r1._from == e_0._id AND r1._to == e_2._id
FILTER length(e_2) != 0 AND length(r1) != 0
RETURN {"nodes":union_distinct([e_2], []), "rel": union_distinct([r1], [])}
RETURN {"nodes":union_distinct([e_2], []), "rel": union_distinct([r1],
[]), "mod": union_distinct([],
[])}
)
FILTER length(e2) != 0 AND length(e_0) != 0 AND length(r0) != 0
RETURN {"nodes":union_distinct(flatten(e2[**].nodes), [e_0]), "rel": union_distinct(flatten(e2[**].rel), [r0])}
RETURN {"nodes":union_distinct(flatten(e2[**].nodes), [e_0]), "rel": union_distinct(flatten(e2[**].rel), [r0])
, "mod": union_distinct(flatten(e2[**].mod), [])
}
)
FILTER length(e0) != 0 AND length(e_1) != 0
RETURN {"nodes":union_distinct(flatten(e0[**].nodes), [e_1]), "rel": union_distinct(flatten(e0[**].rel), [])}
RETURN {"nodes":union_distinct(flatten(e0[**].nodes), [e_1]), "rel": union_distinct(flatten(e0[**].rel),
[]), "mod": union_distinct(flatten(e0[**].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
,
" "
)
...
...
@@ -672,17 +672,17 @@ func TestThreeEntitiesTwoEntityFilters(t *testing.T) {
FILTER e_2.date LIKE "%mei%"
FILTER r1._from == e_0._id AND r1._to == e_2._id
FILTER length(e_2) != 0 AND length(r1) != 0
RETURN {"nodes":union_distinct([e_2], []), "rel": union_distinct([r1], [])}
RETURN {"nodes":union_distinct([e_2], []), "rel": union_distinct([r1],
[]), "mod": union_distinct([],
[])}
)
FILTER length(e2) != 0 AND length(e_0) != 0 AND length(r0) != 0
RETURN {"nodes":union_distinct(flatten(e2[**].nodes), [e_0]), "rel": union_distinct(flatten(e2[**].rel), [r0])}
RETURN {"nodes":union_distinct(flatten(e2[**].nodes), [e_0]), "rel": union_distinct(flatten(e2[**].rel), [r0])
, "mod": union_distinct(flatten(e2[**].mod), [])
}
)
FILTER length(e0) != 0 AND length(e_1) != 0
RETURN {"nodes":union_distinct(flatten(e0[**].nodes), [e_1]), "rel": union_distinct(flatten(e0[**].rel), [])}
RETURN {"nodes":union_distinct(flatten(e0[**].nodes), [e_1]), "rel": union_distinct(flatten(e0[**].rel),
[]), "mod": union_distinct(flatten(e0[**].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
,
" "
)
...
...
@@ -908,23 +908,23 @@ func TestFiveEntitiesFourEntityFilters(t *testing.T) {
FILTER e_4.name == "Volkspartij voor Vrijheid en Democratie"
FILTER r3._from == e_3._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(e4) != 0 AND length(e_3) != 0 AND length(r2) != 0
RETURN {"nodes":union_distinct(flatten(e4[**].nodes), [e_3]), "rel": union_distinct(flatten(e4[**].rel), [r2])}
RETURN {"nodes":union_distinct(flatten(e4[**].nodes), [e_3]), "rel": union_distinct(flatten(e4[**].rel), [r2])
, "mod": union_distinct(flatten(e4[**].mod), [])
}
)
FILTER length(e3) != 0 AND length(e_2) != 0 AND length(r1) != 0
RETURN {"nodes":union_distinct(flatten(e3[**].nodes), [e_2]), "rel": union_distinct(flatten(e3[**].rel), [r1])}
RETURN {"nodes":union_distinct(flatten(e3[**].nodes), [e_2]), "rel": union_distinct(flatten(e3[**].rel), [r1])
, "mod": union_distinct(flatten(e3[**].mod), [])
}
)
FILTER length(e2) != 0 AND length(e_0) != 0 AND length(r0) != 0
RETURN {"nodes":union_distinct(flatten(e2[**].nodes), [e_0]), "rel": union_distinct(flatten(e2[**].rel), [r0])}
RETURN {"nodes":union_distinct(flatten(e2[**].nodes), [e_0]), "rel": union_distinct(flatten(e2[**].rel), [r0])
, "mod": union_distinct(flatten(e2[**].mod), [])
}
)
FILTER length(e0) != 0 AND length(e_1) != 0
RETURN {"nodes":union_distinct(flatten(e0[**].nodes), [e_1]), "rel": union_distinct(flatten(e0[**].rel), [])}
RETURN {"nodes":union_distinct(flatten(e0[**].nodes), [e_1]), "rel": union_distinct(flatten(e0[**].rel),
[]), "mod": union_distinct(flatten(e0[**].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