1
votes

I am receiving an error in both the neo4j webadmin and a javascript app I built. If I create/edit a property label in the webadmin using "+ property" I can have property labels containing blanks. However, if I try to create relationship property labels using cypher queries, in webadmin and my app, if the property label contains a blank, then the error below occurs. How should I form a query so that I can create property labels containing blanks?

Thanks - Jeff

example query:

START n = node(9359), m = node(9360) CREATE n-[r:test_relationship{test prop 1: 'testval1',test_prop_2: 'testval2'}]->m Return n, n.name, r, type(r), m, m.name

error message is:

Invalid query

`:' expected but p' found

Think we should have better error message here? Help us by sending this query to cypher@neo4j.org.

Thank you, the Neo4j Team.

START n = node(9359), m = node(9360) CREATE n-[r:test_relationship{test prop 1: 'testval1',test_prop_2: 'testval2'}]->m Return n, n.name, r, type(r), m, m.name

(there is a caret pointing up at the p in label test prop 1)

1

1 Answers

3
votes

To use blanks in property names you need to use backticks:

START n = node(9359), m = node(9360) 
CREATE n-[r:test_relationship{`test prop 1`: 'testval1',test_prop_2: 'testval2'}]->m
RETURN n, n.name, r, type(r), m, m.name