The Neo4j Manual V1.4.M06
Total Page:16
File Type:pdf, Size:1020Kb
The Neo4j Manual v1.4.M06 The Neo4j Team neo4j.org <http://neo4j.org/> neotechnology.com <http://neotechnology.com/> The Neo4j Manual v1.4.M06 by The Neo4j Team neo4j.org <http://neo4j.org/> neotechnology.com <http://neotechnology.com/> Copyright © 2011 Neo Technology License: Creative Commons 3.0 This book is presented in open source and licensed through Creative Commons 3.0. You are free to copy, distribute, transmit, and/or adapt the work. This license is based upon the following conditions: Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license. Any of the above conditions can be waived if you get permission from the copyright holder. In no way are any of the following rights affected by the license: • Your fair dealing or fair use rights • The author’s moral rights • Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights Note For any reuse or distribution, you must make clear to the others the license terms of this work. The best way to do this is with a direct link to this page: http://creativecommons.org/licenses/by-sa/3.0/ <http://creativecommons.org/licenses/by-sa/3.0/> Table of Contents Introduction ........................................................................................................................................ viii 1. Who should read this .............................................................................................................. ix 2. Neo4j highlights ........................................................................................................................ x I. Reference Documentation ................................................................................................................. 1 1. Installation & Deployment ....................................................................................................... 2 1.1. Deployment Scenarios ................................................................................................... 3 1.2. System Requirements ..................................................................................................... 4 1.3. Installation ...................................................................................................................... 5 1.4. Upgrading ....................................................................................................................... 7 1.5. Usage Data Collector ..................................................................................................... 9 2. Configuration & Performance ................................................................................................ 11 2.1. Caches in Neo4j ........................................................................................................... 12 2.2. JVM Settings ............................................................................................................... 17 2.3. File system tuning for high IO .................................................................................... 18 2.4. Compressed storage of short strings ............................................................................ 19 3. Transaction management ........................................................................................................ 20 3.1. Interaction cycle ........................................................................................................... 21 3.2. Isolation levels ............................................................................................................. 22 3.3. Default locking behavior ............................................................................................. 23 3.4. Deadlocks ..................................................................................................................... 24 3.5. Delete semantics .......................................................................................................... 25 4. Cypher Query Language ......................................................................................................... 26 4.1. Identifiers ..................................................................................................................... 28 4.2. Start .............................................................................................................................. 29 4.3. Match ........................................................................................................................... 31 4.4. Where ........................................................................................................................... 34 4.5. Return ........................................................................................................................... 36 4.6. Aggregation .................................................................................................................. 38 4.7. Order by ....................................................................................................................... 41 4.8. Skip .............................................................................................................................. 43 4.9. Limit ............................................................................................................................. 44 5. Neo4j Server ........................................................................................................................... 45 5.1. Server Installation ........................................................................................................ 46 5.2. Server Configuration .................................................................................................... 48 5.3. Setup for remote debugging ........................................................................................ 50 5.4. Starting the Neo4j server in high availability mode .................................................... 51 5.5. Using the server with an embedded database .............................................................. 53 5.6. Server Plugins .............................................................................................................. 54 5.7. Tuning the server performance .................................................................................... 57 5.8. Unmanaged Extensions ................................................................................................ 58 6. REST API ............................................................................................................................... 60 6.1. Service root .................................................................................................................. 61 6.2. Nodes ........................................................................................................................... 62 6.3. Relationships ................................................................................................................ 66 6.4. Relationship types ........................................................................................................ 70 6.5. Node properties ............................................................................................................ 71 6.6. Relationship properties ................................................................................................ 74 iii The Neo4j Manual v1.4.M06 6.7. Indexes ......................................................................................................................... 75 6.8. Traversals ..................................................................................................................... 79 6.9. Built-in Graph Algorithms ......................................................................................... 105 6.10. Batch operations ...................................................................................................... 108 6.11. Gremlin Plugin ......................................................................................................... 113 6.12. Cypher Plugin .......................................................................................................... 118 7. Indexing ................................................................................................................................ 119 7.1. Introduction ................................................................................................................ 120 7.2. Create ......................................................................................................................... 121 7.3. Delete ......................................................................................................................... 122 7.4. Add ............................................................................................................................. 123 7.5. Remove ...................................................................................................................... 124 7.6. Update ........................................................................................................................ 125 7.7. Search ........................................................................................................................