首页 > 解决方案 > AWS Neptune - 提交带有空字符串的查询崩溃

问题描述

" "带有(empty space with space) 的脚本可以正常工作,但""空字符串会崩溃。

gremlin> g.addV("Test").property("title", "Test node 1").property("a", "")
{"requestId":"111xxxx-xxx-xxx-xxx-xxx","code":"MalformedQueryException","detailedMessage":"Query parsing failed at line 1, character position at 62, error message : no viable alternative at input 'g.addV(\"Test\").property(\"title\",\"Test node 1\").property(\"a\",\"\"'"}
Type ':help' or ':h' for help.
Display stack trace? [yN]


gremlin> g.addV("Test").property("title", "Test node 1").property("a", " ")
==>v[98b22f0f-6be0-fb11-38cc-066bf7e17051]

这适用于 NEO4J Gremlin,所以我怀疑这是 Gremlin 问题。这是海王星的错误或功能吗?

标签: gremlintinkerpop3amazon-neptune

解决方案


我猜想 Neptune 作为空字符串的问题对于大多数图形系统来说应该是一个可接受的值。作为一种解决方法,您是否尝试将遍历编写为:

g.addV("Test").property("title", "Test node 1").property("a", '')

意思是,使用单引号来表示空字符串而不是双引号?也许这是此查询解析问题的解决方法。


推荐阅读