Escape syntax for Cypher queries?

921 views
Skip to first unread message

Harald Wellmann

unread,
Jan 25, 2012, 4:10:15 PM1/25/12
to ne...@googlegroups.com
Cypher throws a syntax exception for a query of the following form:

start user=node:com.example.User(id={login}) ...

Apparently it doesn't like the dots in my index name "com.example.User".

What's the escape syntax for special characters in names?

By the way, is the Cypher grammar documented? The Neo4j manual only
seems to contain examples.

Best regards,
Harald

Michael Hunger

unread,
Jan 25, 2012, 8:16:32 PM1/25/12
to ne...@googlegroups.com
You escape with backquotes:

> start user=node:`com.example.User`(id={login}) ...

Michael

Peter Neubauer

unread,
Jan 26, 2012, 5:53:18 AM1/26/12
to ne...@googlegroups.com
Harald,
you mean like a formal grammar specification? I don't think there is,
however we have been wanting to do that since the beginning. How would
you suggest to go about it?

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Neo4j 1.6 released                 - dzone.com/6S4K
The Neo4j Heroku Challenge   - http://neo4j-challenge.herokuapp.com/

Andres Taylor

unread,
Jan 26, 2012, 6:32:32 AM1/26/12
to ne...@googlegroups.com
On Thu, Jan 26, 2012 at 11:53 AM, Peter Neubauer <peter.n...@neotechnology.com> wrote:
Harald,
you mean like a formal grammar specification? I don't think there is,
however we have been wanting to do that since the beginning. How would
you suggest to go about it?

Yeah, I'd love to have it, but I don't know how to describe the ascii-graphic-art part of the language. Any ideas on how to do that would be very interesting!

Andrés

Peter Hunsberger

unread,
Jan 26, 2012, 11:33:57 AM1/26/12
to ne...@googlegroups.com

The "ASCII art" is no different from any other string of chars as far as something like BNF would be concerned.  Consider any language that uses operators such as ":=" or match brackets, quotes, etc. of any kind...

On Jan 26, 2012 5:32 AM, "Andres Taylor" <and...@neotechnology.com> wrote:



On Thu, Jan 26, 2012 at 11:53 AM, Peter Neubauer <peter.n...@neotechnology.com> wrote:
>

> Haral...

Harald Wellmann

unread,
Jan 26, 2012, 11:52:50 AM1/26/12
to ne...@googlegroups.com
Am 26.01.2012 11:53, schrieb Peter Neubauer:
> Harald,
> you mean like a formal grammar specification? I don't think there is,
> however we have been wanting to do that since the beginning. How would
> you suggest to go about it?
>

EBNF and/or railway diagrams are fairly common grammar representations:
http://en.wikipedia.org/wiki/Syntax_diagram

ANTLR also has some visualization tools:
http://www.antlr.org/works/screenshots/interpreter.png

If Scala is so great for building parsers, I'd expect it to be able to
produce some kind of EBNF extract of a given parser grammar. If not, it
shouldn't be too hard to do it by hand.

Cheers,
Harald

Reply all
Reply to author
Forward
0 new messages