Cypher-DSL: Composing Queries (WITH Keyword)

280 views
Skip to first unread message

Paul Dubs

unread,
Jul 5, 2012, 7:42:58 AM7/5/12
to ne...@googlegroups.com
Hello Everyone,
I'm trying to create a query using the cypher-dsl component in java. But I just can't find a way to introduce query piping like I can with the WITH keyword. Is there something that I'm missing? Or is it not supported there yet? If not is there any other way to formulate a query like this one? (Traversal? Gremlin?)

START
    a = node(3590,3588,3591),
    d = node(3613, 3597, 3627)
WITH
    collect(a) as good, collect(d) as bad
START
    r = node(1)
MATCH
    r--re-[:CONTAINS]-i
WHERE
    ALL(x in good WHERE re-[:CONTAINS]-x)
    AND
    NONE(x in bad WHERE re-[:CONTAINS]-x)
RETURN
    DISTINCT ID(i),
    i.title,
    count(re)
ORDER BY
    count(re) DESC
LIMIT
    10;


Cheers,
Paul

Andres Taylor

unread,
Jul 5, 2012, 8:05:00 AM7/5/12
to ne...@googlegroups.com
Hi Paul,

Are you using Cypher-DSL for 1.8? Here is an example of how to use WITH.

Does that help?

Andrés
--
The best way to ask for Cypher help: http://console.neo4j.org/usage.html 

Paul Dubs

unread,
Jul 5, 2012, 9:35:33 AM7/5/12
to ne...@googlegroups.com
Hi,
That could be the reason I couldn't find it. Is there a maven repository somewhere that contains cypher-dsl for 1.8?

Paul

Peter Neubauer

unread,
Jul 5, 2012, 11:15:21 AM7/5/12
to ne...@googlegroups.com
No,
there is not I am afraid. Would love to put all that is not part of
the neo4j distribution onto Travis though. Best is to build it off
GIThub, https://github.com/neo4j/cypher-dsl ?

Cheers,

/peter neubauer

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

If you can write, you can code - @coderdojomalmo
If you can sketch, you can use a graph database - @neo4j
Reply all
Reply to author
Forward
0 new messages