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
3ea1b8a6
Commit
3ea1b8a6
authored
3 years ago
by
Jonge,J. de (Joes)
Browse files
Options
Downloads
Patches
Plain Diff
Added filters to hiearachy
parent
98cd78b5
No related branches found
No related tags found
1 merge request
!1
Big merge
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aql/convertQuery.go
+1
-1
1 addition, 1 deletion
aql/convertQuery.go
aql/hierarchy.go
+55
-0
55 additions, 0 deletions
aql/hierarchy.go
with
56 additions
and
1 deletion
aql/convertQuery.go
+
1
−
1
View file @
3ea1b8a6
...
...
@@ -49,7 +49,7 @@ func (s *Service) ConvertQuery(JSONQuery *entity.IncomingQueryJSON) (*string, er
return
nil
,
errors
.
New
(
"non-existing relation referenced in return"
)
}
}
//
search(JSONQuery)
search
(
JSONQuery
)
result
:=
createQuery
(
JSONQuery
)
return
result
,
nil
}
...
...
This diff is collapsed.
Click to expand it.
aql/hierarchy.go
+
55
−
0
View file @
3ea1b8a6
...
...
@@ -43,6 +43,8 @@ func search(JSONQuery *entity.IncomingQueryJSON) {
}
fmt
.
Println
(
""
)
}
AddFilters
(
JSONQuery
)
fmt
.
Println
(
listoflists
)
}
...
...
@@ -369,6 +371,59 @@ func FuncToAllRel(JSONQuery *entity.IncomingQueryJSON, function pdict) {
}
}
func
AddFilters
(
JSONQuery
*
entity
.
IncomingQueryJSON
)
{
filterDone
:=
make
([]
bool
,
len
(
JSONQuery
.
Filters
))
for
i
,
filter
:=
range
JSONQuery
.
Filters
{
if
!
filterDone
[
i
]
{
p
:=
pdict
{
typename
:
filter
.
FilteredType
,
pointer
:
filter
.
FilteredID
,
}
f
:=
pdict
{
typename
:
"filter"
,
pointer
:
filter
.
ID
,
}
addOneFilter
(
f
,
JSONQuery
,
p
,
&
filterDone
)
}
}
}
func
addOneFilter
(
filterPDict
pdict
,
JSONQuery
*
entity
.
IncomingQueryJSON
,
p
pdict
,
filterDone
*
[]
bool
)
{
if
p
.
typename
==
"filter"
&&
(
*
filterDone
)[
p
.
pointer
]
{
l
:=
FindCurrentLayer
(
listoflists
,
p
)
k
:=
[
1
]
pdict
{}
if
len
(
listoflists
)
>
l
+
1
&&
listoflists
[
l
+
1
][
0
]
.
typename
==
"filter"
{
listoflists
[
l
+
1
]
=
append
(
listoflists
[
l
+
1
],
filterPDict
)
}
else
{
BelowAppend
(
l
,
k
)
}
(
*
filterDone
)[
filterPDict
.
pointer
]
=
true
}
else
if
p
.
typename
==
"filter"
{
pnew
:=
pdict
{
typename
:
JSONQuery
.
Filters
[
p
.
pointer
]
.
FilteredType
,
pointer
:
JSONQuery
.
Filters
[
p
.
pointer
]
.
FilteredID
,
}
addOneFilter
(
p
,
JSONQuery
,
pnew
,
filterDone
)
l
:=
FindCurrentLayer
(
listoflists
,
p
)
k
:=
[
1
]
pdict
{
filterPDict
}
if
len
(
listoflists
)
>
l
+
1
&&
listoflists
[
l
+
1
][
0
]
.
typename
==
"filter"
{
listoflists
[
l
+
1
]
=
append
(
listoflists
[
l
+
1
],
filterPDict
)
}
else
{
BelowAppend
(
l
,
k
)
}
(
*
filterDone
)[
filterPDict
.
pointer
]
=
true
}
else
{
l
:=
FindCurrentLayer
(
listoflists
,
p
)
k
:=
[
1
]
pdict
{
filterPDict
}
if
len
(
listoflists
)
>
l
+
1
&&
listoflists
[
l
+
1
][
0
]
.
typename
==
"filter"
{
listoflists
[
l
+
1
]
=
append
(
listoflists
[
l
+
1
],
filterPDict
)
}
else
{
BelowAppend
(
l
,
k
)
}
(
*
filterDone
)[
filterPDict
.
pointer
]
=
true
}
}
// TODO
// Write a function that appends 1 level above
func
AboveAppend
()
{
...
...
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