GitHub user conker84 opened a pull request:
https://github.com/apache/zeppelin/pull/2478
[ZEPPELIN-2761] - Neo4j Interpreter
### What is this PR for?
This contribution would to introduce Neo4j Cypher intepreter and at the
same time provides base APIs that enable other graph databases (or graph
framworks such as GraphX or Giraph).
### What type of PR is it?
[Feature]
### Todos
* [x] - Provide base APIs to manage graph results (under:
org.apache.zeppelin.interpreter.graph.*)
* [x] - Create the Neo4j intepreter
### What is the Jira issue?
[[ZEPPELIN-2761]](https://issues.apache.org/jira/browse/ZEPPELIN-2761)
### How should this be tested?
Donwload and execute [Neo4j](https://neo4j.com/download/?ref=home) v3.x,
you can also pull a [Docker image](https://neo4j.com/developer/docker/).
In order to execute test cases, if you are running Java 7, you need to also
provide an environment variable telling the tests where to find Java 8, because
Neo4j-the-database needs it to run.
```bash
export NEO4J_JAVA=<path/to/java/home>
```
Use this statement to create a dummy dataset
```bash
%neo4j
UNWIND range(1,100) as id
CREATE (p:Person {id:id, name: "Name " + id, age: id % 3}) WITH collect(p)
as people
UNWIND people as p1
UNWIND range(1,10) as friend
WITH p1, people[(p1.id + friend) % size(people)] as p2
CREATE (p1)-[:KNOWS {years: abs(p2.id - p2.id)}]->(p2)
```
Then you can write some simple queries like:
```bash
%neo4j
MATCH (p:Person)-[r:KNOWS]-(p1:Person)
RETURN p, r, p1
LIMIT 10;
```
```bash
%neo4j
MATCH (p:Person)-[r:KNOWS]-(p1:Person)
RETURN p.id AS ID_A, p.name AS NAME_A, r.years AS YEARS, p1.id AS ID_B,
p1.name AS NAME_B
LIMIT 20;
```
### Video
### Questions:
* Does the licenses files need update? **Yes**
* Is there breaking changes for older versions? **No**
* Does this needs documentation? **Yes**
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/conker84/zeppelin master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zeppelin/pull/2478.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2478
----
commit 62d8725fc59423d1bcbe44130693f045072eec65
Author: conker84 <[email protected]>
Date: 2017-06-24T23:24:09Z
First commit
commit 8d97e9df858871f4a4f1ef643acde8de7258f655
Author: conker84 <[email protected]>
Date: 2017-06-28T16:14:00Z
Create connection manager class
commit 1163df4add3d4fa08670b37582d79ac88b446c19
Author: conker84 <[email protected]>
Date: 2017-06-28T21:19:42Z
Moved business logic to the connection manager
commit ba9ea240a5820e427d6dbb6c96b9af1a9aa794e5
Author: conker84 <[email protected]>
Date: 2017-07-05T15:49:45Z
Final behavior after discussion
commit 144068e52d05e532cf1c115eb948cf716d878627
Author: conker84 <[email protected]>
Date: 2017-06-24T23:24:09Z
First commit
commit 564a396f026e125fe063dbcf4a649486c758c83d
Author: conker84 <[email protected]>
Date: 2017-06-28T16:14:00Z
Create connection manager class
commit a9a8498ebcd57cd2e3befb08c9c05146e5b340fa
Author: conker84 <[email protected]>
Date: 2017-06-28T21:19:42Z
Moved business logic to the connection manager
commit 29912d797abd714fd1fdb6f2f41697acc090632f
Author: conker84 <[email protected]>
Date: 2017-07-05T15:49:45Z
Final behavior after discussion
commit 0878f28095e78bc2e4cfb01d0ca5ef2d1db19235
Author: conker84 <[email protected]>
Date: 2017-07-05T15:55:06Z
Merge branch 'master' of https://github.com/conker84/zeppelin
commit 578b5d905e749c4d5aad5d3c901f1bd3fc9706a4
Author: conker84 <[email protected]>
Date: 2017-07-09T19:09:56Z
Added docs
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---