-
Jan 30th, 2012, 03:57 PM
#1
Good Tutorial on writing traversal queries (language ref)
I have to start writing some traversal queries and the Neo4J docs haven't helped. It is my fault that I don't understand the query language, so I was hoping someone might know a really good tutorial out there that fully explains the query language. All types of neo4j queries would be great, but mostly traversals.
Thanks
Mark
-
Feb 3rd, 2012, 05:52 AM
#2
Do you mean the Spring Data Neo4j docs or the Neo4j docs?
There is the Cypher Cookbook, the illustrated syntax docs and Alistair recorded a great introduction screencast on Cypher.
Hope those help.
I thought the SDN docs referred to those sources.
-
Feb 3rd, 2012, 10:25 AM
#3
I had already looked at the docs, except the Cypher cookbook (Really cool it has hypervertex queries which I need), but the screencast is really good and helpful. So those queries as written work exactly in Spring Data Neo4J? I think I see differences between the Neo4j docs and the Spring Data Neo4j docs.
Thanks for the links
Mark
Last edited by bytor99999; Feb 3rd, 2012 at 10:26 AM.
Reason: add
-
Feb 5th, 2012, 03:17 AM
#4
Which differences have you seen? Except that SDN converts method parameters to indexed parameters in the query and adds the {self} parameter for computed fields, there should be no difference.
-
Feb 5th, 2012, 11:21 AM
#5
One difference I see has to do with parenthesis, needing them or not in the match clause.
So in the Neo4J docs I see something along the lines of (I shortened it on purpose)
start user:node(blah)
match (user)-->(address)…..
Whereas in the Spring Data Neo4J docs it would have something along the lines of
@Query("start user:node(blah) match user-->address
That confused me, now I think I see that both work, but it wasn't documented anywhere that both work. At least that I found.
I think the Spring Data Neo4J docs need to show more examples of those method parameters to indexed parameters in action.
So if I pass an id or I pass a Node, how do I know what to put in the "start" portion
If I pass the Node into the repo, I use "start startNode:node({0})"
But what if I pass the id instead, I don't think "start startNode:node({0})" would work. Or does the first automatically go into the Node object and get the nodeId and pass that in for {0}? If it does, I think that statement needs to be in the documentation.
Other examples of how to get method parameters into the Match or where or orderby clauses too. I just can't amke any assumptions on how it works or I will spend hours and days trying to figure out what works and doesn't.
I definitely can spend days maybe weeks trying to get all variations figured out and post a blog entry and update the docs myself, but I know you know this stuff down cold.
Maybe you don't have the time and I should spend days and weeks figuring it out to help out.
Thanks
Mark
-
Feb 7th, 2012, 06:48 AM
#6
The parentheses are optional, just for readability. Only for empty identifiers you need them
Can you create a docs issue or comment if there was an existing one, listing the types of examples for SDN that would be needed? (Keeping in mind that there are the other Neo4j based resources - docs, cookbook and screencast out there and we don't want to duplicate their content).
Michael
-
Feb 7th, 2012, 01:47 PM
#7
Done
https://jira.springsource.org/browse/DATAGRAPH-194
Thanks Michael.
I will probably write them myself and do a pull request.
Mark
-
Feb 7th, 2012, 05:11 PM
#8
That would be awesome, thanks a lot!
Michael
-
Feb 7th, 2012, 05:47 PM
#9
The pull request is in.
I am pretty sure I did the xml correct. Mostly looked at what was already there and copy pasted/mimicked it.
I ran the .sh script but not sure if it put any docs anywhere where I could check to see that it looked right.
I might do a couple of other corrections in the docs, like a few spelling errors in code.
Thanks
Mark
-
Feb 7th, 2012, 06:08 PM
#10
Has been built (http://spring.neo4j.org/nightly) already, can you check if it is correctly in there: http://spring.neo4j.org/docs
Thanks for the offer.
Michael
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules