Re: [Neo4j] cypher question - subqueries possible?

2011-12-01 Thread jschweigl
Once I find the time to set up a blog, I'l happily do that. What's still annoying me is that I do not understand the difference between the query pairs 7/8 and 9/10 ... -- View this message in context:

Re: [Neo4j] cypher question - subqueries possible?

2011-12-01 Thread Andres Taylor
On Thu, Dec 1, 2011 at 4:55 PM, jschweigl johann.schwe...@gmail.com wrote: Once I find the time to set up a blog, I'l happily do that. What's still annoying me is that I do not understand the difference between the query pairs 7/8 and 9/10 ... I'll have a go. The difference between 7 and 8

Re: [Neo4j] cypher question - subqueries possible?

2011-11-29 Thread Michael Hunger
Shouldn't rel2 then be an optional relationship? Otherwise IMHO it can never be null. START c=... MATCH c-[rel1:MyRel]-a, c-[rel2?:MyRel]-b WHERE rel2 is null RETURN c Am 29.11.2011 um 13:00 schrieb D. Frej: I would recommend the following START c=... MATCH c-[rel1:MyRel]-a,

Re: [Neo4j] cypher question - subqueries possible?

2011-11-29 Thread D. Frej
you might be right. I only used it the other way around (rel2 IS NOT NULL) to guarante that the relationship is there. So I thought ... ;) However, currently I am quite busy and cannot check easily. That brings me to a feature request for neoclipse: The possibility to type and execute a cypher

Re: [Neo4j] cypher question - subqueries possible?

2011-11-29 Thread D. Frej
you are right: http://docs.neo4j.org/chunked/snapshot/cypher-cookbook.html#_basic_friend_finding_based_on_social_neighborhood states START joe=node:node_auto_index(name = Joe) MATCH joe-[:knows]-friend-[:knows]-friend_of_friend, joe-[r?:knows]-friend_of_friend WHERE r IS NULL Am 29.11.2011

Re: [Neo4j] cypher question - subqueries possible?

2011-11-29 Thread jschweigl
Thanks for all the replies. To explain what I am doing: I'm harvesting information from the software engineering tool some guys here are using: Excel (gawk!). Excel sheets are parsed and converted to graphs, incrementally enriched with properties as I digest subsequent sheets so that at the end I

Re: [Neo4j] cypher question - subqueries possible?

2011-11-29 Thread Peter Neubauer
Very cool Johann. Mind writing this into a short blog post? Would love to see this code and some short illustration on this, even for others to learn from it ... Cheers, /peter neubauer GTalk:      neubauer.peter Skype       peter.neubauer Phone       +46 704 106975 LinkedIn  

Re: [Neo4j] cypher question - subqueries possible?

2011-11-29 Thread Michael Hunger
wow, cool I played once with parsing jaca ast's and putting the in neo4j to answer similar question (also looking at metrics/dependency graphs) please write it up! Michael mobile mail please excuse brevity and typos Am 29.11.2011 um 13:59 schrieb jschweigl johann.schwe...@gmail.com: Thanks

[Neo4j] cypher question - subqueries possible?

2011-11-28 Thread jschweigl
Hi all, I have three kinds of nodes A, B and C. Both type A and B (distinguished by a property) have a relationship of the same type to node type C. I want to find nodes C which have a relationship to A but not to B. The only idea I came up with is to have a query return all A nodes having a

Re: [Neo4j] cypher question - subqueries possible?

2011-11-28 Thread Peter Neubauer
Johan, got a graph picture on this? 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

Re: [Neo4j] cypher question - subqueries possible?

2011-11-28 Thread maxdemarzi
If you were doing this in a single traversal, every time you encountered a node type C, you would have to ask for all it's relationships and dig inside the end node of those relationships to see if any of them have a property type for node B. In two traversals, you'd get an array of all the Cs

Re: [Neo4j] cypher question - subqueries possible?

2011-11-28 Thread KanTube
while not ideal you could do START a=node:node_auto_index(NodeType=A),b=node:node_auto_index(NodeType=B) MATCH a-[:MyRel]-c-[r?:MyRel]-b RETURN c, count(r) and in your code you could filter for count(r) = 0 -- View this message in context:

Re: [Neo4j] Cypher question

2011-11-05 Thread jschweigl
Good point. I'd believe that thinking of a single node as a degenerated path wouldn't be that wrong either. However, even returning just the callee (which is what I wanted anyways) brings no relief, with the relationship direction having no influence: 08:42:33,150 GraphQuery.java 81 INFO -

Re: [Neo4j] Cypher question

2011-11-05 Thread Andres Taylor
Did you try the query I gave you? The problem is not that you are returning p, it's that you ask Cypher to create a path with nulls in it. Just remove the p= in the beginning of the MATCH clause, and you should be good to go. Andrés On Sat, Nov 5, 2011 at 8:45 AM, jschweigl

Re: [Neo4j] Cypher question

2011-11-05 Thread jschweigl
Stupid me. Sorry. I should have copypasted your query. Yes, without the path assignment it works. Thanks a lot! -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Cypher-question-tp3479960p3482176.html Sent from the Neo4j Community Discussions mailing list

[Neo4j] Cypher question

2011-11-04 Thread jschweigl
Hi all, Being a newbie to neo4j/Cypher, didn't come to a solution myself, so I try it here: how can I query for a set of nodes which have no incoming relation of a specific type? Something like START callee=node:node_auto_index('type:*Service') MATCH p=(caller)-[:CALLS]-(callee) RETURN p

Re: [Neo4j] Cypher question

2011-11-04 Thread Andres Taylor
Hi Johann, There's a workaround that works, but it's not as nice as I'd like it to be. What you can do is this: START callee=node:node_auto_index('type:*Service') MATCH p=(caller)-[r?:CALLS]-(callee) WHERE r IS NULL RETURN p It solves your problem with optional relationships. HTH, Andrés On

Re: [Neo4j] Cypher question

2011-11-04 Thread jschweigl
Thanks Andres! I already tried the optional relationship thing, but not the WHERE clause. However, there is a problem which I have with or without the WHERE (I'm using neo4j 1.5M02): START callee=node:node_auto_index('type:*Service') MATCH p=(caller)-[r?:CALLS]-(callee) WHERE r IS NULL RETURN p

Re: [Neo4j] Cypher question

2011-11-04 Thread Andres Taylor
It's a known (and solved) problem. You can either update to snapshot, or just reverse your path description: MATCH p=(callee)-[r?:CALLS]-(caller) Sorry about that... Andrés On Fri, Nov 4, 2011 at 1:42 PM, jschweigl johann.schwe...@gmail.com wrote: Thanks Andres! I already tried the

Re: [Neo4j] Cypher question

2011-11-04 Thread jschweigl
Reversing resulted in the same exception, so I'll try and get the latest snapshot. Thanks a lot for your help! -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Cypher-question-tp3479960p3480016.html Sent from the Neo4j Community Discussions mailing list

Re: [Neo4j] Cypher question

2011-11-04 Thread jschweigl
Downloaded 1.5-SNAPSHOT (two times: the windows community and enterprise flavor). No change, no matter if the relation points back or forth. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Cypher-question-tp3479960p3480184.html Sent from the Neo4j

Re: [Neo4j] Cypher question

2011-11-04 Thread Andres Taylor
On Fri, Nov 4, 2011 at 2:57 PM, jschweigl johann.schwe...@gmail.com wrote: Downloaded 1.5-SNAPSHOT (two times: the windows community and enterprise flavor). No change, no matter if the relation points back or forth. I just realized what the problem is. (It's my fault) You are putting the