Re: [Neo4j] Cypher: relationship between nodes as condition in WHERE
you can have optional checks for properties mobile mail please excuse brevity and typos Am 12.11.2011 um 15:16 schrieb "D. Frej" : > ok, in my scenario it did not work due to a WHERE clause I had also > included in my query (in short: it lead to a SyntaxException as node > where checked for a property that not all nodes have). > > Thanks anyway > > > > Am 11.11.2011 22:43, schrieb Andres Taylor: >> On Fri, Nov 11, 2011 at 8:28 PM, D. Frej wrote: >> >>> Hi, >>> >>> how can I put the condition "relationship between two nodes" in the >>> WHERE clause of a Cypher statement? >>> >>> I have the following Cypher (simplified): >>> >>> START p=... >>> MATCH p-...path...->(d1), p-...differentpath...->(d2) >>> >>> and I only want those d1 and d2 nodes that have a relationship. >>> >>> I tried >>> MATCH p-...path...->(d1), p-...differentpath...->(d2)--(d1) >>> >> Why is this not working? Can you share the real query with us? This >> pseudo-query looks like it should work. >> >> Andrés >> ___ >> Neo4j mailing list >> User@lists.neo4j.org >> https://lists.neo4j.org/mailman/listinfo/user >> > > ___ > Neo4j mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Cypher: relationship between nodes as condition in WHERE
ok, in my scenario it did not work due to a WHERE clause I had also included in my query (in short: it lead to a SyntaxException as node where checked for a property that not all nodes have). Thanks anyway Am 11.11.2011 22:43, schrieb Andres Taylor: > On Fri, Nov 11, 2011 at 8:28 PM, D. Frej wrote: > >> Hi, >> >> how can I put the condition "relationship between two nodes" in the >> WHERE clause of a Cypher statement? >> >> I have the following Cypher (simplified): >> >> START p=... >> MATCH p-...path...->(d1), p-...differentpath...->(d2) >> >> and I only want those d1 and d2 nodes that have a relationship. >> >> I tried >> MATCH p-...path...->(d1), p-...differentpath...->(d2)--(d1) >> > Why is this not working? Can you share the real query with us? This > pseudo-query looks like it should work. > > Andrés > ___ > Neo4j mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user > ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Cypher: relationship between nodes as condition in WHERE
Thanks Peter, that worked just fine for me. Am 11.11.2011 22:24, schrieb Peter Neubauer: > Hi Didi, > is something like > http://docs.neo4j.org/chunked/snapshot/query-where.html#where-filter-on-null-values > something that could help? > > Also, there is an example of this in > http://docs.neo4j.org/chunked/snapshot/cypher-cookbook.html#_find_people_based_on_similar_favorites > > > Cheers, > > /peter neubauer > > GTalk: neubauer.peter > Skype peter.neubauer > Phone +46 704 106975 > LinkedIn http://www.linkedin.com/in/neubauer > Twitter http://twitter.com/peterneubauer > > http://www.neo4j.org - NOSQL for the Enterprise. > http://startupbootcamp.org/- Öresund - Innovation happens HERE. > > > > On Fri, Nov 11, 2011 at 8:28 PM, D. Frej wrote: >> Hi, >> >> how can I put the condition "relationship between two nodes" in the >> WHERE clause of a Cypher statement? >> >> I have the following Cypher (simplified): >> >> START p=... >> MATCH p-...path...->(d1), p-...differentpath...->(d2) >> >> and I only want those d1 and d2 nodes that have a relationship. >> >> I tried >> MATCH p-...path...->(d1), p-...differentpath...->(d2)--(d1) >> >> which is - of course - not working and I could not find anything in the >> documentation. >> >> To be honest I even need to specify the relationship type between d2 and >> d1... >> >> Thanks, >> >> Didi >> ___ >> Neo4j mailing list >> User@lists.neo4j.org >> https://lists.neo4j.org/mailman/listinfo/user >> > ___ > Neo4j mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user > ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Cypher: relationship between nodes as condition in WHERE
On Fri, Nov 11, 2011 at 8:28 PM, D. Frej wrote: > Hi, > > how can I put the condition "relationship between two nodes" in the > WHERE clause of a Cypher statement? > > I have the following Cypher (simplified): > > START p=... > MATCH p-...path...->(d1), p-...differentpath...->(d2) > > and I only want those d1 and d2 nodes that have a relationship. > > I tried > MATCH p-...path...->(d1), p-...differentpath...->(d2)--(d1) > Why is this not working? Can you share the real query with us? This pseudo-query looks like it should work. Andrés ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Cypher: relationship between nodes as condition in WHERE
Hi Didi, is something like http://docs.neo4j.org/chunked/snapshot/query-where.html#where-filter-on-null-values something that could help? Also, there is an example of this in http://docs.neo4j.org/chunked/snapshot/cypher-cookbook.html#_find_people_based_on_similar_favorites Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - NOSQL for the Enterprise. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. On Fri, Nov 11, 2011 at 8:28 PM, D. Frej wrote: > Hi, > > how can I put the condition "relationship between two nodes" in the > WHERE clause of a Cypher statement? > > I have the following Cypher (simplified): > > START p=... > MATCH p-...path...->(d1), p-...differentpath...->(d2) > > and I only want those d1 and d2 nodes that have a relationship. > > I tried > MATCH p-...path...->(d1), p-...differentpath...->(d2)--(d1) > > which is - of course - not working and I could not find anything in the > documentation. > > To be honest I even need to specify the relationship type between d2 and > d1... > > Thanks, > > Didi > ___ > Neo4j mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user > ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Cypher: relationship between nodes as condition in WHERE
Hi, how can I put the condition "relationship between two nodes" in the WHERE clause of a Cypher statement? I have the following Cypher (simplified): START p=... MATCH p-...path...->(d1), p-...differentpath...->(d2) and I only want those d1 and d2 nodes that have a relationship. I tried MATCH p-...path...->(d1), p-...differentpath...->(d2)--(d1) which is - of course - not working and I could not find anything in the documentation. To be honest I even need to specify the relationship type between d2 and d1... Thanks, Didi ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user