dosubot[bot] commented on issue #2828:
URL: 
https://github.com/apache/incubator-hugegraph/issues/2828#issuecomment-3051625084

   <!-- Greeting -->
   Hi @hezhangjian! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the 
incubator-hugegraph team.
   
   <!-- Answer -->
   你的 Python 脚本中,顶点相关的 REST API 路径写成了 /graphs/{graph}/vertices,但 HugeGraph 
1.5.0 正确的接口是 /graphs/{graph}/graph/vertices。如果用错路径会直接返回 404 Not 
Found(jakarta.ws.rs.NotFoundException)[参考](https://github.com/apache/incubator-hugegraph/blob/a53af864b31f803780a1db31cb20d3d94d5d34fc/hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/graph/VertexAPI.java)。
   
   请把 add_vertex 和 get_vertices_by_label 里的 URL 改成:
   
   ```python
   f"{BASE}/graph/vertices"
   ```
   
   比如:
   
   ```python
   def add_vertex(label, props):
       return requests.post(
           f"{BASE}/graph/vertices",
           headers=HEADERS,
           json={"label": label, "properties": props},
       ).json()
   
   def get_vertices_by_label(label):
       return requests.get(
           f"{BASE}/graph/vertices?label={label}",
           headers=HEADERS
       ).json()
   ```
   
   另外,建议确保 HugeGraph 服务完全启动后再运行脚本,否则也可能遇到 404。如果还有问题,可以查看容器日志,看看是否有更详细的错误信息。
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/a9337a13-1c47-412d-a077-aa9b769a6057?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/a9337a13-1c47-412d-a077-aa9b769a6057?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/a9337a13-1c47-412d-a077-aa9b769a6057?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/a9337a13-1c47-412d-a077-aa9b769a6057?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/a9337a13-1c47-412d-a077-aa9b769a6057?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/a9337a13-1c47-412d-a077-aa9b769a6057?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/a9337a13-1c47-412d-a077-aa9b769a6057?feedback_type=other)</sup>&nbsp;&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[!
 [Share on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-hugegraph/issues/2828)


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to