Search code examples
databasegraphneo4jcypher

Cypher accessing space separated relationship property neo4j


I have a few million nodes large data set imported with https://github.com/jexp/batch-import .

Unfortunately, the script made relationship property names space separated as in "Some Property".

How do I ask for this property in Cypher?

As expected

r.Some Property 

does not work, which is only fair.

I also tried:

r["Some Property"] 

Is there a syntax for such naming?

Should I just redo the import with camel case property names or underscore separated ones?


Solution

  • You can return properties with spaces in the names by using backticks, `, to enclose the property name. Something like this should work in Cypher:

    START r=rel(0) RETURN r.`Some Property`;
    

    This goes for node properties as well.