Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Neo4j Cookbook

You're reading from   Neo4j Cookbook Harness the power of Neo4j to perform complex data analysis over the course of 75 easy-to-follow recipes

Arrow left icon
Product type Paperback
Published in May 2015
Publisher
ISBN-13 9781783287253
Length 226 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ankur Goel Ankur Goel
Author Profile Icon Ankur Goel
Ankur Goel
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Neo4j Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with Neo4j FREE CHAPTER 2. Connecting to Neo4j 3. The Cypher Query Language 4. Data Modeling and Leveraging with Neo4j 5. Mining the Social Treasure 6. Developing Location-based Services with Neo4j 7. Visualization of Graphs 8. Industry Usages of Neo4j 9. Neo4j Administration and Maintenance 10. Scaling Neo4j Index

Accessing Neo4j from Scala


Scala is a general purpose language, which is being increasingly used for high-performance applications, as it has been implemented over JVM, which makes interoperability easier with the existing Java libraries.

In this recipe, we will learn how to access the Neo4j graph database using Scala.

How to do it...

There are multiple solutions for this problem, although there is no standard module that can be considered as the de facto standard with Scala. The solution is listed in the following steps:

  1. Java JAR files works with Scala due to interoperability, so the first way is to import Neo4j JAR files, which can be found under the lib directory, under the Scala project.

  2. There are many REST clients available in Scala, such as Lift, Scalatra, and Akka with Spray, so it is easy to write your own code on the top of any of these libraries. One such example is being shown here:

    import dispatch._
    val http_client = new Http
    val json = http_client(:/("localhost:7474/data/db/) /  ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images