无法使用冒号查询属性 [英] Can't query properties with colon

查看:90
本文介绍了无法使用冒号查询属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是neo4j的新手,所以我的问题对您来说可能听起来很愚蠢,但无论如何.

I am new to neo4j, so my question may sound stupid to you but anyway.

我将OSM数据集导入了neo4j graph db.因此,目前我正尝试从db查询其他内容,例如:

I have OSM data set imported to neo4j graph db. So curretnly I am trying to query different stuff from db, like:

MATCH (a) WHERE has(a.addr:street) RETURN a.addr:street

,它失败并显示sysntax错误:

and it fails with an sysntax error:

Type mismatch: expected Node but was Boolean, Number, String or Collection<Any> (line 1, column 23)
"MATCH (a) WHERE has(a.addr:street) RETURN a.addr:street"
                       ^

这很奇怪,因为节点具有很多带有冒号(:)的属性.

Which is strange, as the nodes has a lot of properties with colons(:).

有人知道如何查询此类属性吗?

Does anybody know how can I query such properties?

推荐答案

欢迎使用Neo4j!诸如:或空格之类的字符可能会在查询中引入歧义,因为它们在查询语言中可能很重要,从而使解析器产生问题.您仍然可以通过将表达式放在反引号"中来使用这些字符,即

Welcome to Neo4j! Characters like : or whitespace can introduce ambiguity in a query since they may be significant in the query language, which gives the parser hick ups. You can still use these characters by enclosing the expression in "backticks", i.e.

MATCH (a) WHERE has(a.`addr:street`) RETURN a.`addr:street`

您可以在此处看到其他示例.

You can see some other examples here.

这篇关于无法使用冒号查询属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆