dosubot[bot] commented on issue #668: URL: https://github.com/apache/incubator-hugegraph-toolchain/issues/668#issuecomment-2934067688
<!-- Answer --> HugeGraph Java 客户端的类型化 API(如 VertexAPI)目前不支持通过 P.contains(["xxx"]) 这样的高级谓词进行属性过滤。类型化 API 只支持简单的属性等值过滤,无法表达更复杂的条件。 如果你需要用 P.contains 进行集合属性过滤,可以通过 Gremlin 脚本 API 实现。Java 客户端提供了 GremlinRequest 类,可以提交任意 Gremlin 查询。例如: ```java String gremlin = "g.V().has('yourLabel', 'yourProperty', within('xxx'))"; ResultSet result = new GremlinRequest.Builder(gremlin, gremlinManager).execute(); ``` 你可以将 Gremlin 查询字符串和参数通过 GremlinRequest 提交到 HugeGraph Server,支持所有 Gremlin 的谓词和语法,包括 P.contains、within 等复杂条件。[GremlinRequest 源码参考](https://github.com/apache/incubator-hugegraph-toolchain/blob/50a839469b1ad779115e371d0df378116638e9e1/hugegraph-client/src/main/java/org/apache/hugegraph/api/gremlin/GremlinRequest.java) 如果你希望类型化 API 也支持类似 P.contains 的过滤,欢迎提交 PR 扩展相关功能。如果需要进一步的代码示例或文档指引,也可以继续提问。 <!-- Dosu Comment Footer --> *To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/12c5f427-fa94-4793-8711-4b0dace954a7?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/12c5f427-fa94-4793-8711-4b0dace954a7?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/12c5f427-fa94-4793-8711-4b0dace954a7?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/12c5f427-fa94-4793-8711-4b0dace954a7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/12c5f427-fa94-4793-8711-4b0dace954a7?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/12c5f427-fa94-4793-8711-4b0dace954a7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/12c5f427-fa94-4793-8711-4b0dace954a7?feedback_type=other)</sup> [](https://go.dosu.dev/discord-bot) [! [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-toolchain/issues/668) -- 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: issues-unsubscr...@hugegraph.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@hugegraph.apache.org For additional commands, e-mail: issues-h...@hugegraph.apache.org