Skip to content
Snippets Groups Projects
Commit 19f5250e authored by LoLo5689's avatar LoLo5689
Browse files

Cypher tests

parent c4fd8401
No related branches found
No related tags found
No related merge requests found
...@@ -171,10 +171,10 @@ func createQuery(JSONQuery *entity.IncomingQueryJSON) *string { ...@@ -171,10 +171,10 @@ func createQuery(JSONQuery *entity.IncomingQueryJSON) *string {
if !nodeSet[entityIndex] { if !nodeSet[entityIndex] {
// If not, return this node // If not, return this node
name := fmt.Sprintf("n%v", entityIndex) name := fmt.Sprintf("n%v", entityIndex)
ret += *createNodeMatch(&JSONQuery.Entities[entityIndex], &name) ret += *createNodeMatch(&JSONQuery.Entities[entityIndex], &name)
// Add this node to the list // Add this node to the list
nodesToReturn = append(nodesToReturn, name) nodesToReturn = append(nodesToReturn, name)
ret += fmt.Sprintf("RETURN %v", name)
} }
} }
......
package cypher
import (
"encoding/json"
"testing"
"git.science.uu.nl/datastrophe/query-conversion/entity"
)
func BenchmarkConvertEmptyQuery(b *testing.B) {
// Setup for test
// Create query conversion service
service := NewService()
query := []byte(`{
"return": {
"entities": [],
"relations": []
},
"entities": [],
"relations": [],
"limit": 5000
}`)
// Unmarshall the incoming message into an IncomingJSONQuery object
var JSONQuery entity.IncomingQueryJSON
json.Unmarshal(query, &JSONQuery)
b.ResetTimer()
for i := 0; i < b.N; i++ {
service.ConvertQuery(&JSONQuery)
}
}
func BenchmarkConvertOneAttributeQuery(b *testing.B) {
// Setup for test
// Create query conversion service
service := NewService()
query := []byte(`{
"return": {
"entities": [
0
],
"relations": []
},
"entities": [
{
"type": "airports",
"constraints": [
{
"attribute": "state",
"value": "HI",
"dataType": "text",
"matchType": "exact"
}
]
}
],
"relations": [],
"limit": 5000
}`)
// Unmarshall the incoming message into an IncomingJSONQuery object
var JSONQuery entity.IncomingQueryJSON
json.Unmarshal(query, &JSONQuery)
b.ResetTimer()
for i := 0; i < b.N; i++ {
service.ConvertQuery(&JSONQuery)
}
}
func BenchmarkConvertTwoRelationQuery(b *testing.B) {
// Setup for test
// Create query conversion service
service := NewService()
query := []byte(`{
"return": {
"entities": [
0,
1,
2
],
"relations": [
0,
1
]
},
"entities": [
{
"type": "airports",
"constraints": [
{
"attribute": "city",
"value": "New York",
"dataType": "text",
"matchType": "exact"
}
]
},
{
"type": "airports",
"constraints": [
{
"attribute": "city",
"value": "San Francisco",
"dataType": "text",
"matchType": "exact"
}
]
},
{
"type": "airports",
"constraints": [
{
"attribute": "state",
"value": "HI",
"dataType": "text",
"matchType": "exact"
}
]
}
],
"relations": [
{
"type": "flights",
"depth": {
"min": 1,
"max": 3
},
"entityFrom": 2,
"entityTo": 1,
"constraints": [
{
"attribute": "Day",
"value": "15",
"dataType": "number",
"matchType": "EQ"
}
]
},
{
"type": "flights",
"depth": {
"min": 1,
"max": 1
},
"entityFrom": 0,
"entityTo": -1,
"constraints": []
}
],
"limit": 5000
}`)
// Unmarshall the incoming message into an IncomingJSONQuery object
var JSONQuery entity.IncomingQueryJSON
json.Unmarshal(query, &JSONQuery)
b.ResetTimer()
for i := 0; i < b.N; i++ {
service.ConvertQuery(&JSONQuery)
}
}
package cypher
import (
"encoding/json"
"errors"
"strings"
"testing"
"git.science.uu.nl/datastrophe/query-conversion/entity"
"github.com/stretchr/testify/assert"
)
func TestEmptyQueryConversion(t *testing.T) {
// Setup for test
// Create query conversion service
service := NewService()
query := []byte(`{
"return": {
"entities": [],
"relations": []
},
"entities": [],
"relations": [],
"limit": 5000
}`)
// Unmarshall the incoming message into an IncomingJSONQuery object
var JSONQuery entity.IncomingQueryJSON
json.Unmarshal(query, &JSONQuery)
convertedResult, err := service.ConvertQuery(&JSONQuery)
// Assert that there is no error
assert.NoError(t, err)
// Assert that the result and the expected result are the same
correctConvertedResult := ``
assert.Equal(t, correctConvertedResult, *convertedResult)
}
func TestEntityOneAttributeQuery(t *testing.T) {
// Setup for test
// Create query conversion service
service := NewService()
query := []byte(`{
"return": {
"entities": [
0
],
"relations": []
},
"entities": [
{
"type": "airports",
"constraints": [
{
"attribute": "state",
"value": "HI",
"dataType": "text",
"matchType": "exact"
}
]
}
],
"relations": [],
"limit": 5000
}`)
// Unmarshall the incoming message into an IncomingJSONQuery object
var JSONQuery entity.IncomingQueryJSON
json.Unmarshal(query, &JSONQuery)
convertedResult, err := service.ConvertQuery(&JSONQuery)
// Assert that there is no error
assert.NoError(t, err)
// Assert that the result and the expected result are the same
correctConvertedResult := `MATCH (n0:airports)WHERE n0.state = "HI" RETURN n0`
cleanedResult := strings.ReplaceAll(*convertedResult, "\n", "")
cleanedResult = strings.ReplaceAll(cleanedResult, "\t", "")
assert.Equal(t, correctConvertedResult, cleanedResult)
}
func TestRelationWithConstraint(t *testing.T) {
// Setup for test
// Create query conversion service
service := NewService()
query := []byte(`{
"return": {
"entities": [
0
],
"relations": [
0
]
},
"entities": [
{
"type": "airports",
"constraints": [
{
"attribute": "state",
"value": "HI",
"dataType": "text",
"matchType": "exact"
}
]
}
],
"relations": [
{
"type": "flights",
"depth": {
"min": 1,
"max": 1
},
"entityFrom": 0,
"entityTo": -1,
"constraints": [
{
"attribute": "Day",
"value": "15",
"dataType": "number",
"matchType": "EQ"
}
]
}
],
"limit": 5000
}`)
// Unmarshall the incoming message into an IncomingJSONQuery object
var JSONQuery entity.IncomingQueryJSON
json.Unmarshal(query, &JSONQuery)
convertedResult, err := service.ConvertQuery(&JSONQuery)
// Assert that there is no error
assert.NoError(t, err)
// Assert that the result and the expected result are the same
correctConvertedResult := `MATCH (n0:airports)WHERE n0.state = "HI" MATCH p0 = (n0)-[r0:flights*1..1]->()WHERE r0.Day = 15 RETURN n0,p0;`
cleanedResult := strings.ReplaceAll(*convertedResult, "\n", "")
cleanedResult = strings.ReplaceAll(cleanedResult, "\t", "")
assert.Equal(t, correctConvertedResult, cleanedResult)
}
// func TestModifierCountEntity(t *testing.T) {
// // Setup for test
// // Create query conversion service
// service := NewService()
// query := []byte(`{
// "return": {
// "entities": [
// 0
// ],
// "relations": []
// },
// "entities": [
// {
// "type": "airports",
// "constraints": [
// {
// "attribute": "state",
// "value": "HI",
// "dataType": "text",
// "matchType": "exact"
// }
// ]
// }
// ],
// "relations": [],
// "limit": 5000,
// "modifiers": [
// {
// "type": "COUNT",
// "selectedType": "entity",
// "id": 0,
// "attributeIndex": -1
// }
// ]
// }`)
// // Unmarshall the incoming message into an IncomingJSONQuery object
// var JSONQuery entity.IncomingQueryJSON
// json.Unmarshal(query, &JSONQuery)
// convertedResult, err := service.ConvertQuery(&JSONQuery)
// // Assert that there is no error
// assert.NoError(t, err)
// // Assert that the result and the expected result are the same
// correctConvertedResult := `LET n0 = (FOR x IN airports FILTER x.state == "HI" RETURN x)RETURN LENGTH (n0)`
// cleanedResult := strings.ReplaceAll(*convertedResult, "\n", "")
// cleanedResult = strings.ReplaceAll(cleanedResult, "\t", "")
// assert.Equal(t, correctConvertedResult, cleanedResult)
// }
// func TestModifierCountEntityAttribute(t *testing.T) {
// // Setup for test
// // Create query conversion service
// service := NewService()
// query := []byte(`{
// "return": {
// "entities": [
// 0
// ],
// "relations": []
// },
// "entities": [
// {
// "type": "airports",
// "constraints": [
// {
// "attribute": "state",
// "value": "HI",
// "dataType": "text",
// "matchType": "exact"
// }
// ]
// }
// ],
// "relations": [],
// "limit": 5000,
// "modifiers": [
// {
// "type": "SUM",
// "selectedType": "entity",
// "id": 0,
// "attributeIndex": 0
// }
// ]
// }`)
// // Unmarshall the incoming message into an IncomingJSONQuery object
// var JSONQuery entity.IncomingQueryJSON
// json.Unmarshal(query, &JSONQuery)
// convertedResult, err := service.ConvertQuery(&JSONQuery)
// // Assert that there is no error
// assert.NoError(t, err)
// // Assert that the result and the expected result are the same
// correctConvertedResult := `LET n0 = (FOR x IN airports FILTER x.state == "HI" RETURN x)RETURN SUM (n0[*].state)`
// cleanedResult := strings.ReplaceAll(*convertedResult, "\n", "")
// cleanedResult = strings.ReplaceAll(cleanedResult, "\t", "")
// assert.Equal(t, correctConvertedResult, cleanedResult)
// }
// func TestModifierCountRelation(t *testing.T) {
// // Setup for test
// // Create query conversion service
// service := NewService()
// query := []byte(`{
// "return": {
// "entities": [
// 0
// ],
// "relations": [
// 0
// ]
// },
// "entities": [
// {
// "type": "airports",
// "constraints": [
// {
// "attribute": "state",
// "value": "HI",
// "dataType": "text",
// "matchType": "exact"
// }
// ]
// }
// ],
// "relations": [
// {
// "type": "flights",
// "depth": {
// "min": 1,
// "max": 1
// },
// "entityFrom": 0,
// "entityTo": -1,
// "constraints": [
// {
// "attribute": "Day",
// "value": "15",
// "dataType": "number",
// "matchType": "EQ"
// }
// ]
// }
// ],
// "limit": 5000,
// "modifiers": [
// {
// "type": "COUNT",
// "selectedType": "relation",
// "id": 0,
// "attributeIndex": -1
// }
// ]
// }`)
// // Unmarshall the incoming message into an IncomingJSONQuery object
// var JSONQuery entity.IncomingQueryJSON
// json.Unmarshal(query, &JSONQuery)
// convertedResult, err := service.ConvertQuery(&JSONQuery)
// // Assert that there is no error
// assert.NoError(t, err)
// // Assert that the result and the expected result are the same
// correctConvertedResult := `LET n0 = (FOR x IN airports FILTER x.state == "HI" RETURN x)LET r0 = (FOR x IN n0 FOR v, e, p IN 1..1 OUTBOUND x flights OPTIONS { uniqueEdges: "path" }FILTER p.edges[*].Day ALL == 15 RETURN DISTINCT p )RETURN LENGTH (unique(r0[*].edges[**]))`
// cleanedResult := strings.ReplaceAll(*convertedResult, "\n", "")
// cleanedResult = strings.ReplaceAll(cleanedResult, "\t", "")
// assert.Equal(t, correctConvertedResult, cleanedResult)
// }
// func TestModifierCountRelationAttribute(t *testing.T) {
// // Setup for test
// // Create query conversion service
// service := NewService()
// query := []byte(`{
// "return": {
// "entities": [
// 0
// ],
// "relations": [
// 0
// ]
// },
// "entities": [
// {
// "type": "airports",
// "constraints": [
// {
// "attribute": "state",
// "value": "HI",
// "dataType": "text",
// "matchType": "exact"
// }
// ]
// }
// ],
// "relations": [
// {
// "type": "flights",
// "depth": {
// "min": 1,
// "max": 1
// },
// "entityFrom": 0,
// "entityTo": -1,
// "constraints": [
// {
// "attribute": "Day",
// "value": "15",
// "dataType": "number",
// "matchType": "EQ"
// }
// ]
// }
// ],
// "limit": 5000,
// "modifiers": [
// {
// "type": "AVG",
// "selectedType": "relation",
// "id": 0,
// "attributeIndex": 0
// }
// ]
// }`)
// // Unmarshall the incoming message into an IncomingJSONQuery object
// var JSONQuery entity.IncomingQueryJSON
// json.Unmarshal(query, &JSONQuery)
// convertedResult, err := service.ConvertQuery(&JSONQuery)
// // Assert that there is no error
// assert.NoError(t, err)
// // Assert that the result and the expected result are the same
// correctConvertedResult := `LET n0 = (FOR x IN airports FILTER x.state == "HI" RETURN x)LET r0 = (FOR x IN n0 FOR v, e, p IN 1..1 OUTBOUND x flights OPTIONS { uniqueEdges: "path" }FILTER p.edges[*].Day ALL == 15 RETURN DISTINCT p )RETURN AVG (r0[*].edges[**].Day)`
// cleanedResult := strings.ReplaceAll(*convertedResult, "\n", "")
// cleanedResult = strings.ReplaceAll(cleanedResult, "\t", "")
// assert.Equal(t, correctConvertedResult, cleanedResult)
// }
func TestRelationWithInOutConstraint(t *testing.T) {
// Setup for test
// Create query conversion service
service := NewService()
query := []byte(`{
"return": {
"entities": [
0,
1
],
"relations": [
0
]
},
"entities": [
{
"type": "airports",
"constraints": [
{
"attribute": "city",
"value": "San Francisco",
"dataType": "text",
"matchType": "exact"
}
]
},
{
"type": "airports",
"constraints": [
{
"attribute": "state",
"value": "HI",
"dataType": "text",
"matchType": "exact"
}
]
}
],
"relations": [
{
"type": "flights",
"depth": {
"min": 1,
"max": 3
},
"entityFrom": 1,
"entityTo": 0,
"constraints": [
{
"attribute": "Day",
"value": "15",
"dataType": "number",
"matchType": "EQ"
}
]
}
],
"limit": 5000
}`)
// Unmarshall the incoming message into an IncomingJSONQuery object
var JSONQuery entity.IncomingQueryJSON
json.Unmarshal(query, &JSONQuery)
convertedResult, err := service.ConvertQuery(&JSONQuery)
// Assert that there is no error
assert.NoError(t, err)
// Assert that the result and the expected result are the same
correctConvertedResult := `MATCH (n1:airports)WHERE n1.state = "HI" MATCH p0 = (n1)-[r0:flights*1..3]->(n0)WHERE r0.Day = 15 RETURN n1,n0,p0;`
cleanedResult := strings.ReplaceAll(*convertedResult, "\n", "")
cleanedResult = strings.ReplaceAll(cleanedResult, "\t", "")
assert.Equal(t, correctConvertedResult, cleanedResult)
}
func TestTwoRelations(t *testing.T) {
// Setup for test
// Create query conversion service
service := NewService()
query := []byte(`{
"return": {
"entities": [
0,
1,
2
],
"relations": [
0,
1
]
},
"entities": [
{
"type": "airports",
"constraints": [
{
"attribute": "city",
"value": "New York",
"dataType": "text",
"matchType": "exact"
}
]
},
{
"type": "airports",
"constraints": [
{
"attribute": "city",
"value": "San Francisco",
"dataType": "text",
"matchType": "exact"
}
]
},
{
"type": "airports",
"constraints": [
{
"attribute": "state",
"value": "HI",
"dataType": "text",
"matchType": "exact"
}
]
}
],
"relations": [
{
"type": "flights",
"depth": {
"min": 1,
"max": 3
},
"entityFrom": 2,
"entityTo": 1,
"constraints": [
{
"attribute": "Day",
"value": "15",
"dataType": "number",
"matchType": "EQ"
}
]
},
{
"type": "flights",
"depth": {
"min": 1,
"max": 1
},
"entityFrom": 0,
"entityTo": -1,
"constraints": []
}
],
"limit": 5000
}`)
// Unmarshall the incoming message into an IncomingJSONQuery object
var JSONQuery entity.IncomingQueryJSON
json.Unmarshal(query, &JSONQuery)
convertedResult, err := service.ConvertQuery(&JSONQuery)
// Assert that there is no error
assert.NoError(t, err)
// Assert that the result and the expected result are the same
correctConvertedResult := `MATCH (n2:airports)WHERE n2.state = "HI" MATCH p0 = (n2)-[r0:flights*1..3]->(n1)WHERE r0.Day = 15 RETURN n2,n1,p0;MATCH (n0:airports)WHERE n0.city = "New York" MATCH p0 = (n0)-[r0:flights*1..1]->()RETURN n0,p0;`
cleanedResult := strings.ReplaceAll(*convertedResult, "\n", "")
cleanedResult = strings.ReplaceAll(cleanedResult, "\t", "")
assert.Equal(t, correctConvertedResult, cleanedResult)
}
func TestRelationWithOnlyToNode(t *testing.T) {
// Setup for test
// Create query conversion service
service := NewService()
query := []byte(`{
"return": {
"entities": [
0
],
"relations": [
0
]
},
"entities": [
{
"type": "airports",
"constraints": [
{
"attribute": "city",
"value": "San Francisco",
"dataType": "text",
"matchType": "exact"
}
]
}
],
"relations": [
{
"type": "flights",
"depth": {
"min": 1,
"max": 1
},
"entityFrom": -1,
"entityTo": 0,
"constraints": []
}
],
"limit": 5000
}`)
// Unmarshall the incoming message into an IncomingJSONQuery object
var JSONQuery entity.IncomingQueryJSON
json.Unmarshal(query, &JSONQuery)
convertedResult, err := service.ConvertQuery(&JSONQuery)
// Assert that there is no error
assert.NoError(t, err)
// Assert that the result and the expected result are the same
correctConvertedResult := `MATCH (n0:airports)WHERE n0.city = "San Francisco" MATCH p0 = (n0)-[r0:flights*1..1]->()RETURN n0,p0;`
cleanedResult := strings.ReplaceAll(*convertedResult, "\n", "")
cleanedResult = strings.ReplaceAll(cleanedResult, "\t", "")
assert.Equal(t, correctConvertedResult, cleanedResult)
}
func TestTooManyReturnEntities(t *testing.T) {
// Setup for test
// Create query conversion service
service := NewService()
query := []byte(`{
"return": {
"entities": [
0,
1,
2
],
"relations": [
0
]
},
"entities": [
{
"type": "airports",
"constraints": [
{
"attribute": "city",
"value": "San Francisco",
"dataType": "text",
"matchType": "exact"
}
]
}
],
"relations": [
{
"type": "flights",
"depth": {
"min": 1,
"max": 1
},
"entityFrom": -1,
"entityTo": 0,
"constraints": []
}
],
"limit": 5000
}`)
// Unmarshall the incoming message into an IncomingJSONQuery object
var JSONQuery entity.IncomingQueryJSON
json.Unmarshal(query, &JSONQuery)
_, err := service.ConvertQuery(&JSONQuery)
// Assert that there is no error
assert.Equal(t, errors.New("non-existing entity referenced in return"), err)
}
func TestTooManyReturnRelations(t *testing.T) {
// Setup for test
// Create query conversion service
service := NewService()
query := []byte(`{
"return": {
"entities": [
0
],
"relations": [
0,
1,
2
]
},
"entities": [
{
"type": "airports",
"constraints": [
{
"attribute": "city",
"value": "San Francisco",
"dataType": "text",
"matchType": "exact"
}
]
}
],
"relations": [
{
"type": "flights",
"depth": {
"min": 1,
"max": 1
},
"entityFrom": -1,
"entityTo": 0,
"constraints": []
}
],
"limit": 5000
}`)
// Unmarshall the incoming message into an IncomingJSONQuery object
var JSONQuery entity.IncomingQueryJSON
json.Unmarshal(query, &JSONQuery)
_, err := service.ConvertQuery(&JSONQuery)
// Assert that there is no error
assert.Equal(t, errors.New("non-existing relation referenced in return"), err)
}
func TestNegativeReturnEntities(t *testing.T) {
// Setup for test
// Create query conversion service
service := NewService()
query := []byte(`{
"return": {
"entities": [
0,
-1
],
"relations": [
0,
1,
2
]
},
"entities": [
{
"type": "airports",
"constraints": [
{
"attribute": "city",
"value": "San Francisco",
"dataType": "text",
"matchType": "exact"
}
]
}
],
"relations": [
{
"type": "flights",
"depth": {
"min": 1,
"max": 1
},
"entityFrom": -1,
"entityTo": 0,
"constraints": []
}
],
"limit": 5000
}`)
// Unmarshall the incoming message into an IncomingJSONQuery object
var JSONQuery entity.IncomingQueryJSON
json.Unmarshal(query, &JSONQuery)
_, err := service.ConvertQuery(&JSONQuery)
// Assert that there is no error
assert.Equal(t, errors.New("non-existing entity referenced in return"), err)
}
func TestNoRelationsField(t *testing.T) {
// Setup for test
// Create query conversion service
service := NewService()
query := []byte(`{
"return": {
"entities": [
0
]
},
"entities": [
{
"type": "airports",
"constraints": [
{
"attribute": "city",
"value": "San Francisco",
"dataType": "text",
"matchType": "exact"
}
]
}
],
"limit": 5000
}`)
// Unmarshall the incoming message into an IncomingJSONQuery object
var JSONQuery entity.IncomingQueryJSON
json.Unmarshal(query, &JSONQuery)
convertedResult, err := service.ConvertQuery(&JSONQuery)
// Assert that there is no error
assert.NoError(t, err)
// Assert that the result and the expected result are the same
correctConvertedResult := `MATCH (n0:airports)WHERE n0.city = "San Francisco" RETURN n0`
cleanedResult := strings.ReplaceAll(*convertedResult, "\n", "")
cleanedResult = strings.ReplaceAll(cleanedResult, "\t", "")
assert.Equal(t, correctConvertedResult, cleanedResult)
}
func TestEntityFromLowerThanNegativeOneInRelation(t *testing.T) {
// Setup for test
// Create query conversion service
service := NewService()
query := []byte(`{
"return": {
"entities": [
0
],
"relations": [
0
]
},
"entities": [
{
"type": "airports",
"constraints": [
{
"attribute": "city",
"value": "San Francisco",
"dataType": "text",
"matchType": "exact"
}
]
}
],
"relations": [
{
"type": "flights",
"depth": {
"min": 1,
"max": 1
},
"entityFrom": -4,
"entityTo": 0,
"constraints": []
}
],
"limit": 5000
}`)
// Unmarshall the incoming message into an IncomingJSONQuery object
var JSONQuery entity.IncomingQueryJSON
json.Unmarshal(query, &JSONQuery)
_, err := service.ConvertQuery(&JSONQuery)
// Assert that there is no error
assert.NoError(t, err)
}
...@@ -14,27 +14,10 @@ func main() { ...@@ -14,27 +14,10 @@ func main() {
js := []byte(`{ js := []byte(`{
"return": { "return": {
"entities": [ "entities": [
0, 0
1,
2
],
"relations": [
0,
1
] ]
}, },
"entities": [ "entities": [
{
"type": "airports",
"constraints": [
{
"attribute": "city",
"value": "New York",
"dataType": "text",
"matchType": "exact"
}
]
},
{ {
"type": "airports", "type": "airports",
"constraints": [ "constraints": [
...@@ -45,51 +28,90 @@ func main() { ...@@ -45,51 +28,90 @@ func main() {
"matchType": "exact" "matchType": "exact"
} }
] ]
},
{
"type": "airports",
"constraints": [
{
"attribute": "state",
"value": "HI",
"dataType": "text",
"matchType": "exact"
}
]
}
],
"relations": [
{
"type": "flights",
"depth": {
"min": 1,
"max": 3
},
"entityFrom": 2,
"entityTo": 1,
"constraints": [
{
"attribute": "Day",
"value": "15",
"dataType": "number",
"matchType": "EQ"
}
]
},
{
"type": "flights",
"depth": {
"min": 1,
"max": 1
},
"entityFrom": 0,
"entityTo": -1,
"constraints": []
} }
], ],
"limit": 5000 "limit": 5000
}`) }`)
// js := []byte(`{
// "return": {
// "entities": [
// 0,
// 1,
// 2
// ],
// "relations": [
// 0,
// 1
// ]
// },
// "entities": [
// {
// "type": "airports",
// "constraints": [
// {
// "attribute": "city",
// "value": "New York",
// "dataType": "text",
// "matchType": "exact"
// }
// ]
// },
// {
// "type": "airports",
// "constraints": [
// {
// "attribute": "city",
// "value": "San Francisco",
// "dataType": "text",
// "matchType": "exact"
// }
// ]
// },
// {
// "type": "airports",
// "constraints": [
// {
// "attribute": "state",
// "value": "HI",
// "dataType": "text",
// "matchType": "exact"
// }
// ]
// }
// ],
// "relations": [
// {
// "type": "flights",
// "depth": {
// "min": 1,
// "max": 3
// },
// "entityFrom": 2,
// "entityTo": 1,
// "constraints": [
// {
// "attribute": "Day",
// "value": "15",
// "dataType": "number",
// "matchType": "EQ"
// }
// ]
// },
// {
// "type": "flights",
// "depth": {
// "min": 1,
// "max": 1
// },
// "entityFrom": 0,
// "entityTo": -1,
// "constraints": []
// }
// ],
// "limit": 5000
// }`)
var inc entity.IncomingQueryJSON var inc entity.IncomingQueryJSON
json.Unmarshal(js, &inc) json.Unmarshal(js, &inc)
result, _ := queryservice.ConvertQuery(&inc) result, _ := queryservice.ConvertQuery(&inc)
......
{
"systemParams": "win32-x64-72",
"modulesFolders": [],
"flags": [],
"linkedModules": [],
"topLevelPatterns": [],
"lockfileEntries": {},
"files": [],
"artifacts": {}
}
\ No newline at end of file
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
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