-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] gremlin查询结果不符合预期 #1900
Labels
bug
Something isn't working
Comments
感谢提供信息, 有试过用 kneighbor 接口 (POST 版, 可带 path) 尝试查询2度路径, 看看是否也有同样问题么? 另外版本是最新的 0.12-release 么 |
使用的是0.11.2版本, 有试过用 kneighbor 接口 (POST 版, 可带 path) 这个接口指的是使用restAPI进行查询的接口么 |
是的, 可以用 rest-api 里的对比一下, 可以更快排除和定位问题 (当然基于最新server是更好) |
请使用规范的Gremlin语句查询: // 注意是 `inE().count().is(0)`,而非 `inE().is(0)`
g.V(3).repeat(inE('child').outV().simplePath())
.until(or(inE().count().is(0),loops().is(eq(2))))
.path() 整理了一下示例数据: schema=graph.schema();
schema.vertexLabel('node').useCustomizeNumberId().create();
schema.edgeLabel('child').sourceLabel('node').targetLabel('node').create();
g.addV('node').property(id, 1).as('1')
.addV('node').property(id, 2).as('2')
.addV('node').property(id, 3).as('3')
.addV('node').property(id, 4).as('4')
.addE('child').from('1').to('2')
.addE('child').from('2').to('3')
.addE('child').from('4').to('3') |
我这边使用 {
"requestId": "32f89c6f-a8cf-4717-baed-0a8631684adf",
"status": {
"message": "",
"code": 200,
"attributes": {
}
},
"result": {
"data": [
{
"labels": [],
"objects": [
{
"id": 3,
"label": "node",
"type": "vertex",
"properties": {
}
},
{
"id": "L4>1>>L3",
"label": "child",
"type": "edge",
"outV": 4,
"outVLabel": "node",
"inV": 3,
"inVLabel": "node",
"properties": {
}
},
{
"id": 4,
"label": "node",
"type": "vertex",
"properties": {
}
}
]
},
{
"labels": [],
"objects": [
{
"id": 3,
"label": "node",
"type": "vertex",
"properties": {
}
},
{
"id": "L2>1>>L3",
"label": "child",
"type": "edge",
"outV": 2,
"outVLabel": "node",
"inV": 3,
"inVLabel": "node",
"properties": {
}
},
{
"id": 2,
"label": "node",
"type": "vertex",
"properties": {
}
},
{
"id": "L1>1>>L2",
"label": "child",
"type": "edge",
"outV": 1,
"outVLabel": "node",
"inV": 2,
"inVLabel": "node",
"properties": {
}
},
{
"id": 1,
"label": "node",
"type": "vertex",
"properties": {
}
}
]
}
],
"meta": {
}
}
}
|
感谢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Type (问题类型)
gremlin (结果不合预期)
Before submit
Environment (环境信息)
Expected & Actual behavior (期望与实际表现)
实际上在一度查询时正常,二度查询时只能查出来单条路径:
使用数据 huge中构造的点边数据如下:
二度查询时,只能查询出来第二条路径:
一度查询时,可以查询出来路径一和路径二
期望可以正常查询出2条路径
实际上通过gremliny验证gremlin语句时:
一度查询:
二度查询 两条结果正常查询出来:
gremliny地址:
https://gremlify.com/ida02brvl5/1
gremliny 构造数据:
g.addV('Vertex').as('1').
addV('Vertex').as('2').
addV('Vertex').as('3').
addV('Vertex').as('4').
addE('child').from('1').to('2').addE('child').
from('2').to('3').addE('child').from('4').
to('3')
查询语句:
g.V(2853).repeat(inE("child").outV().simplePath()).until(or(inE().count().is(0),loops().is(eq(2)))).path()
任意类似的点边关系在huge中查询结果一致,二度查询时均会缺失只有一度结果那条路径
Vertex/Edge example (问题点 / 边数据举例)
No response
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
No response
The text was updated successfully, but these errors were encountered: