Book Image

Building web applications with Python and Neo4j

By : Sumit Gupta
Book Image

Building web applications with Python and Neo4j

By: Sumit Gupta

Overview of this book

Table of Contents (14 chapters)
Building Web Applications with Python and Neo4j
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Batch imports


Py2neo.batch provides the Batch API, which is a wrapper around the Neo4j REST Batch API (http://neo4j.com/docs/stable/rest-api-batch-ops.html).

The Batch API in py2neo or in Neo4j is designed to wrap multiple and varied types of read, write, update, and delete REST requests in a single transaction. Though it seems to be a good choice to use batch operations, it is not recommended for new use cases that are built for Neo4j 2.0+. For example, schemas, and labels are not supported by the Batch API.

Neo4j 2.0 introduces a new Cypher HTTP Transactional endpoint that executes multiple Cypher statements into a single request and that too in a transaction (http://neo4j.com/docs/milestone/rest-api-transactional.html). It is strongly recommended to use this new API for all use cases developed on Neo4j 2.0 and above. We have seen an example of this while we were discussing the Cypher API in the Exploring py2neo APIs section.

The following is the code snippet for working with the Batch API...