You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hugegraph.apache.org by GitBox <gi...@apache.org> on 2022/08/22 09:06:34 UTC

[GitHub] [incubator-hugegraph] choeoe opened a new issue, #1952: [Bug] g.V().bothE('el0').has('el1') throws Exception

choeoe opened a new issue, #1952:
URL: https://github.com/apache/incubator-hugegraph/issues/1952

   ### Bug Type (问题类型)
   
   _No response_
   
   ### Before submit
   
   - [X] 我已经确认现有的 [Issues](https://github.com/hugegraph/hugegraph/issues) 与 [FAQ](https://hugegraph.github.io/hugegraph-doc/guides/faq.html) 中没有相同 / 重复问题
   
   ### Environment (环境信息)
   
   - Server Version: v0.12.0
   - Backend: memory
   - OS: 8 CPUs, 32 G RAM, ubuntu
   - Data Size: 3000 vertices, 5000 edges
   
   ### Expected & Actual behavior (期望与实际表现)
   
   - The query is 
   ```
   g.V().bothE('el0').has('el1')
   ```
   - Expected result
   ```
   []
   ```
   - Actual result
   ```
   Exception in thread "main" java.lang.IllegalStateException: Illegal key 'LABEL' with more than one value
   ```
   
   ### Vertex/Edge example (问题点 / 边数据举例)
   
   ```javascript
   HugeClient hugeclient = HugeClient.builder("http://localhost:8080", "hugegraph").configTimeout(3000).build();
   GraphManager graph = hugeclient.graph();
   Vertex vertex1 = new Vertex("vl0").property("vp0", true);
   Vertex vertex2 = new Vertex("vl0").property("vp0", false);
   Vertex vertex3 = new Vertex("vl0").property("vp0", true);
   graph.addVertices(Arrays.asList(vertex1, vertex2, vertex3));
   
   Edge edge1 = new Edge("el0").source(vertex1).target(vertex2).property("ep0", true);
   Edge edge2 = new Edge("el1").source(vertex1).target(vertex3).property("ep1", false);
   graph.addEdges(Arrays.asList(edge1, edge2));
   ```
   
   
   ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
   
   ```javascript
   HugeClient hugeclient = HugeClient.builder("http://localhost:8080", "hugegraph").configTimeout(3000).build();
   hugeclient.schema().propertyKey("ep0").asBoolean().ifNotExist().create();
   hugeclient.schema().propertyKey("ep1").asBoolean().ifNotExist().create();
   hugeclient.schema().propertyKey("vp0").asBoolean().ifNotExist().create();
   
               // vertex
   hugeclient.schema().vertexLabel("vl0").properties("vp0").nullableKeys("vp0").create();
   hugeclient.schema().indexLabel("vl0Byvp0").onV("vl0").by("vp0").shard().ifNotExist().create();
   
               // edges
   hugeclient.schema().edgeLabel("el0").sourceLabel("vl0").targetLabel("vl0").properties("ep0").ifNotExist().create();
   hugeclient.schema().edgeLabel("el1").sourceLabel("vl0").targetLabel("vl0").properties("ep1").ifNotExist().create();
   hugeclient.schema().indexLabel("el0Byep0").onE("el0").by("ep0").shard().ifNotExist().create();
   hugeclient.schema().indexLabel("el1Byep0").onE("el1").by("ep1").shard().ifNotExist().create();
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] chmx-ustc commented on issue #1952: [Bug] g.V().bothE('el0').has('el1') throws Exception

Posted by GitBox <gi...@apache.org>.
chmx-ustc commented on issue #1952:
URL: https://github.com/apache/incubator-hugegraph/issues/1952#issuecomment-1254941824

   `graph.schema().propertyKey("ep0").asBoolean().ifNotExist().create();
   graph.schema().propertyKey("ep1").asBoolean().ifNotExist().create();
   graph.schema().propertyKey("vp0").asBoolean().ifNotExist().create();
   
   graph.schema().vertexLabel("vl0").properties("vp0").nullableKeys("vp0").create();
   
   graph.schema().edgeLabel("el0").sourceLabel("vl0").targetLabel("vl0").properties("ep0").ifNotExist().create();
   graph.schema().edgeLabel("el1").sourceLabel("vl0").targetLabel("vl0").properties("ep1").ifNotExist().create();
   
   graph.schema().indexLabel("el0Byep0").onE("el0").by("ep0").shard().ifNotExist().create();
   graph.schema().indexLabel("el1Byep0").onE("el1").by("ep1").shard().ifNotExist().create();
   graph.schema().indexLabel("vl0Byvp0").onV("vl0").by("vp0").shard().ifNotExist().create();
   vertex1 = graph.addVertex(T.label, "vl0", "vp0", true);
   vertex2 = graph.addVertex(T.label, "vl0", "vp0", false);
   vertex3 = graph.addVertex(T.label, "vl0", "vp0", true);
   
   vertex1.addEdge("el0", vertex2, "ep0", true);
   vertex1.addEdge("el1", vertex3, "ep1", false);`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] chmx-ustc commented on issue #1952: [Bug] g.V().bothE('el0').has('el1') throws Exception

Posted by GitBox <gi...@apache.org>.
chmx-ustc commented on issue #1952:
URL: https://github.com/apache/incubator-hugegraph/issues/1952#issuecomment-1254959068

   > 我复现了你的数据,在我这并没有出现这个问题,你看是不是你在建立 schema信息的时候 方式不对
   > 
   > # schema 导入
   > 我从hubble导入 <img alt="image" width="1045" src="https://user-images.githubusercontent.com/109569406/191746399-b02b2784-863a-409d-a1de-140baf98b217.png">
   > 
   > ```groovy
   > graph.schema().propertyKey("ep0").asBoolean().ifNotExist().create();
   > graph.schema().propertyKey("ep1").asBoolean().ifNotExist().create();
   > graph.schema().propertyKey("vp0").asBoolean().ifNotExist().create();
   > 
   > graph.schema().vertexLabel("vl0").properties("vp0").nullableKeys("vp0").create();
   > 
   > graph.schema().edgeLabel("el0").sourceLabel("vl0").targetLabel("vl0").properties("ep0").ifNotExist().create();
   > graph.schema().edgeLabel("el1").sourceLabel("vl0").targetLabel("vl0").properties("ep1").ifNotExist().create();
   > 
   > graph.schema().indexLabel("el0Byep0").onE("el0").by("ep0").shard().ifNotExist().create();
   > graph.schema().indexLabel("el1Byep0").onE("el1").by("ep1").shard().ifNotExist().create();
   > graph.schema().indexLabel("vl0Byvp0").onV("vl0").by("vp0").shard().ifNotExist().create();
   > vertex1 = graph.addVertex(T.label, "vl0", "vp0", true);
   > vertex2 = graph.addVertex(T.label, "vl0", "vp0", false);
   > vertex3 = graph.addVertex(T.label, "vl0", "vp0", true);
   > ```
   > 
   > vertex1.addEdge("el0", vertex2, "ep0", true); vertex1.addEdge("el1", vertex3, "ep1", false);`
   > 
   > # 图的详情
   > <img alt="image" width="1104" src="https://user-images.githubusercontent.com/109569406/191746695-5b376dff-47ea-4c02-b48b-02d231917635.png">
   > 
   > # 查询结果
   > <img alt="image" width="1103" src="https://user-images.githubusercontent.com/109569406/191746914-d03faf81-c39f-490d-8b17-6e0d3c9ce8ba.png">
   
   @
   
   > ### Bug Type (问题类型)
   > _No response_
   > 
   > ### Before submit
   > * [x]  我已经确认现有的 [Issues](https://github.com/hugegraph/hugegraph/issues) 与 [FAQ](https://hugegraph.github.io/hugegraph-doc/guides/faq.html) 中没有相同 / 重复问题
   > 
   > ### Environment (环境信息)
   > * Server Version: v0.12.0
   > * Backend: memory
   > * OS: 8 CPUs, 32 G RAM, ubuntu
   > * Data Size: 3000 vertices, 5000 edges
   > 
   > ### Expected & Actual behavior (期望与实际表现)
   > * The query is
   > 
   > ```
   > g.V().bothE('el0').has('el1')
   > ```
   > 
   > * Expected result
   > 
   > ```
   > []
   > ```
   > 
   > * Actual result
   > 
   > ```
   > Exception in thread "main" java.lang.IllegalStateException: Illegal key 'LABEL' with more than one value
   > ```
   > 
   > ### Vertex/Edge example (问题点 / 边数据举例)
   > ```js
   > HugeClient hugeclient = HugeClient.builder("http://localhost:8080", "hugegraph").configTimeout(3000).build();
   > GraphManager graph = hugeclient.graph();
   > Vertex vertex1 = new Vertex("vl0").property("vp0", true);
   > Vertex vertex2 = new Vertex("vl0").property("vp0", false);
   > Vertex vertex3 = new Vertex("vl0").property("vp0", true);
   > graph.addVertices(Arrays.asList(vertex1, vertex2, vertex3));
   > 
   > Edge edge1 = new Edge("el0").source(vertex1).target(vertex2).property("ep0", true);
   > Edge edge2 = new Edge("el1").source(vertex1).target(vertex3).property("ep1", false);
   > graph.addEdges(Arrays.asList(edge1, edge2));
   > ```
   > 
   > ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
   > ```js
   > HugeClient hugeclient = HugeClient.builder("http://localhost:8080", "hugegraph").configTimeout(3000).build();
   > hugeclient.schema().propertyKey("ep0").asBoolean().ifNotExist().create();
   > hugeclient.schema().propertyKey("ep1").asBoolean().ifNotExist().create();
   > hugeclient.schema().propertyKey("vp0").asBoolean().ifNotExist().create();
   > 
   >             // vertex
   > hugeclient.schema().vertexLabel("vl0").properties("vp0").nullableKeys("vp0").create();
   > hugeclient.schema().indexLabel("vl0Byvp0").onV("vl0").by("vp0").shard().ifNotExist().create();
   > 
   >             // edges
   > hugeclient.schema().edgeLabel("el0").sourceLabel("vl0").targetLabel("vl0").properties("ep0").ifNotExist().create();
   > hugeclient.schema().edgeLabel("el1").sourceLabel("vl0").targetLabel("vl0").properties("ep1").ifNotExist().create();
   > hugeclient.schema().indexLabel("el0Byep0").onE("el0").by("ep0").shard().ifNotExist().create();
   > hugeclient.schema().indexLabel("el1Byep0").onE("el1").by("ep1").shard().ifNotExist().create();
   > ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] chmx-ustc commented on issue #1952: [Bug] g.V().bothE('el0').has('el1') throws Exception

Posted by GitBox <gi...@apache.org>.
chmx-ustc commented on issue #1952:
URL: https://github.com/apache/incubator-hugegraph/issues/1952#issuecomment-1254958164

   我复现了你的数据,在我这并没有出现这个问题,你看是不是你在建立 schema信息的时候 方式不对
   # schema 导入
   我从hubble导入
   <img width="1045" alt="image" src="https://user-images.githubusercontent.com/109569406/191746399-b02b2784-863a-409d-a1de-140baf98b217.png">
   
   ```groovy
   graph.schema().propertyKey("ep0").asBoolean().ifNotExist().create();
   graph.schema().propertyKey("ep1").asBoolean().ifNotExist().create();
   graph.schema().propertyKey("vp0").asBoolean().ifNotExist().create();
   
   graph.schema().vertexLabel("vl0").properties("vp0").nullableKeys("vp0").create();
   
   graph.schema().edgeLabel("el0").sourceLabel("vl0").targetLabel("vl0").properties("ep0").ifNotExist().create();
   graph.schema().edgeLabel("el1").sourceLabel("vl0").targetLabel("vl0").properties("ep1").ifNotExist().create();
   
   graph.schema().indexLabel("el0Byep0").onE("el0").by("ep0").shard().ifNotExist().create();
   graph.schema().indexLabel("el1Byep0").onE("el1").by("ep1").shard().ifNotExist().create();
   graph.schema().indexLabel("vl0Byvp0").onV("vl0").by("vp0").shard().ifNotExist().create();
   vertex1 = graph.addVertex(T.label, "vl0", "vp0", true);
   vertex2 = graph.addVertex(T.label, "vl0", "vp0", false);
   vertex3 = graph.addVertex(T.label, "vl0", "vp0", true);
   ```
   vertex1.addEdge("el0", vertex2, "ep0", true);
   vertex1.addEdge("el1", vertex3, "ep1", false);`  
   
   # 图的详情
   <img width="1104" alt="image" src="https://user-images.githubusercontent.com/109569406/191746695-5b376dff-47ea-4c02-b48b-02d231917635.png">
   
   # 查询结果
   <img width="1103" alt="image" src="https://user-images.githubusercontent.com/109569406/191746914-d03faf81-c39f-490d-8b17-6e0d3c9ce8ba.png">
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] choeoe commented on issue #1952: [Bug] g.V().bothE('el0').has('el1') throws Exception

Posted by GitBox <gi...@apache.org>.
choeoe commented on issue #1952:
URL: https://github.com/apache/incubator-hugegraph/issues/1952#issuecomment-1257362663

   Please try to reproduce with the same data and schema using : 
   ```
   g.V().bothE('el0').has('el1', 'ep1', eq(true))
   ```
   Thanks
   @chmx-ustc 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org