Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
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 (12) Chapters Close

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

Importing data from the DEX graph database to Neo4j

There are tons of options available when it comes to graph databases, such as FlockDB, AllegroGraph, InfiniteGraph, OrientDB, and so on. It is important to learn how to migrate data from any one of these to Neo4j, if you are thinking of migrating to Neo4j.

In this recipe, you will learn how to migrate data from the DEX graph database to the Neo4j server.

Getting ready

To get started with this recipe, install Neo4j by using the steps from the earlier recipes of this chapter.

How to do it...

DEX is a highly scalable graph database solution, which is mostly written in Java and C++. The key feature of DEX is that its query performance has been optimized for large graph databases. Also, it's very lightweight, which allows the storage of billions of nodes and relationships at a very low metadata storage cost.

The default exporter can be used to export the DEX graph database to GraphML, which can be easily loaded into Neo4j. This is done by using the following lines of code:

DefaultExport graph = new DefaultExport();
g.export("dex_export.graphml", ExportType.YGraphML, graph);

Gremlin can also be used to solve the problem, as shown here:

gremlin> graph = new DexGraph("neo/data.dex");
gremlin> graph.saveGraphML('graph.xml');
gremlin> graph = new Neo4jGraph('neo/graph.db');
gremlin> graph.loadGraphML('graph.xml');

How it works...

Gremlin is a graph traversal language. Gremlin works over those graph databases/frameworks that implement the Blueprints property graph data model. Fortunately, OrientDB and Neo4j are among them.

See also

To know more about Gremlin, go to http://www.tinkerpop.com/.

You have been reading a chapter from
Neo4j Cookbook
Published in: May 2015
Publisher:
ISBN-13: 9781783287253
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 AU $24.99/month. Cancel anytime