Skip to content
Snippets Groups Projects
Commit 4ad036ac authored by Fjodor's avatar Fjodor
Browse files

added print statement for testing, checked possible queries @Lorenzo

parent ab14486b
No related branches found
No related tags found
No related merge requests found
......@@ -191,16 +191,12 @@ func createQuery(JSONQuery *entity.IncomingQueryJSON) *string {
// Create UNION statements that create unique lists of all the nodes and relations
// Thus removing all duplicates
nodeUnion = "\nLET nodes = first(RETURN UNION_DISTINCT("
for _, relation := range relationsToReturn {
nodeUnion += fmt.Sprintf("flatten(%v[**].vertices), ", relation)
}
nodeUnion = "\nRETURN "
for _, node := range nodesToReturn {
nodeUnion += fmt.Sprintf("%v,", node)
}
nodeUnion += "[],[]))\n"
// RETURN n0, n1, n2, nn, r0, r1, r2, r3, rn
relationUnion = "LET edges = first(RETURN UNION_DISTINCT("
for _, relation := range relationsToReturn {
relationUnion += fmt.Sprintf("flatten(%v[**].edges), ", relation)
......
package main
import(
import (
"encoding/json"
"log"
"git.science.uu.nl/datastrophe/query-conversion/cypher/queryConverter.go"
"git.science.uu.nl/datastrophe/query-conversion/cypher"
"git.science.uu.nl/datastrophe/query-conversion/entity"
)
func main(){
queryservice := new cypher.NewService()
func main() {
queryservice := cypher.NewService()
js = `{
js := []byte(`{
"return": {
"entities": [
0
0
],
"relations": []
},
......@@ -30,9 +33,10 @@ func main(){
],
"relations": [],
"limit": 5000
}`
result, _ := cypher.convertQuery(JSON.marshal(js))
log.Println(result)
}`)
var inc entity.IncomingQueryJSON
json.Unmarshal(js, &inc)
result, _ := queryservice.ConvertQuery(&inc)
log.Println(*result)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment