Tommu10ve commented on issue #2788:
URL: 
https://github.com/apache/incubator-hugegraph/issues/2788#issuecomment-2953785668

   > 你的 Gremlin 语法错误是因为 choose() 的 option() 方法括号没有正确闭合,导致后续的 option 被误认为是 
choose 外部的内容。正确写法应该是所有 option 都在 choose() 的括号内,结构如下:
   > 
   > .where(
   >   __.choose(label())
   >     .option("domain", has("tags", CONTAINS, "涉案"))
   >     .option("contact_person", has("text", P.within("吴九","周八")))
   >     .option("ip", has("text", P.within("192.168.12.52","192.168.12.55")))
   >     .option(none, constant(true))
   > )
   > 你的原始写法多了一个右括号,导致 choose() 提前结束,后面的 option 语句语法不对。
   > 
   > 修正后的完整查询应该如下:
   > 
   > g.V("59:bank.example.com")
   >   .emit(loops().is(gt(0)))
   >   .repeat(
   >     
bothE("wll_domain_to_md5","wll_domain_to_ip","wll_domain_to_email","wll_domain_to_phone","wll_domain_to_contact_person")
   >       .otherV()
   >       .where(
   >         __.choose(label())
   >           .option("domain", has("tags", CONTAINS, "涉案"))
   >           .option("contact_person", has("text", P.within("吴九","周八")))
   >           .option("ip", has("text", 
P.within("192.168.12.52","192.168.12.55")))
   >           .option(none, constant(true))
   >       )
   >       .simplePath()
   >   )
   >   .times(2)
   >   .dedup()
   >   .path()
   > CONTAINS 用法本身没问题,语法错误仅因括号位置。CONTAINS 的正确用法和索引要求可参考 
[相关讨论](https://github.com/apache/incubator-hugegraph/issues/2753)。
   > 
   > _To reply, just mention [@dosu](https://go.dosu.dev/dosubot)._
   > 
   > How did I do? 
[Good](https://app.dosu.dev/response-feedback/a118fb1e-302a-4da1-a110-ceca4251af72?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/a118fb1e-302a-4da1-a110-ceca4251af72?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/a118fb1e-302a-4da1-a110-ceca4251af72?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/a118fb1e-302a-4da1-a110-ceca4251af72?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/a118fb1e-302a-4da1-a110-ceca4251af72?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/a118fb1e-302a-4da1-a110-ceca4251af72?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/a118fb1e-302a-4da1-a110-ceca4251af72?feedback_type=other)
  [![Join 
Discord](https://camo.githubusercontent.com/d562c2df5e4567ea41d37f1d91a4da0839d8341037045b103b2da268998de17f/68747470733a2f2f696d672e736869656c64
 
732e696f2f62616467652f6a6f696e2d3538363546323f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465266c6162656c3d)](https://go.dosu.dev/discord-bot)
 [![Share on 
X](https://camo.githubusercontent.com/4649f705e2396d6f328dbc8e800a0509c9c17b3b20253b36706c393df124b93d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f582d73686172652d626c61636b)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-hugegraph/issues/2788)
   
   执行报错 非法的 Gremlin 语句,详细信息: No such property: CONTAINS for class: Script752  
@dosu-bot 回答问题


-- 
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