-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-1604] Add Neo4j interpreter and Network visualization #1582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4e685cc
acc4307
72f1203
bd1b0f2
251fba0
bf68eb6
c8249b6
d599777
9aefddf
793f729
96853e1
f68ab8e
6e92dbb
d57133d
964404b
39d0fa2
956a537
c5b57f7
96d79a5
4a6e690
14fddac
00acf1e
59a85f8
62ed113
144224d
44c924d
3221fa5
a86ed54
b2aaa1c
cbd6e64
5e4cf76
bfe2f89
0ea90d9
837822e
3345891
c80c6ba
04347db
a35b1dc
d8134a6
79a633a
e41ab79
f0bb882
1ce44d2
64ccd69
c591800
75088c9
a8ccfd5
924be0f
e921979
f728d68
2574a02
c2e647e
59b397e
ae35a76
a773e7b
c0e5391
a99908e
af4aea1
1565303
7c8da73
3728806
a6547aa
82629e4
b6ef13d
00e900e
fcd2cef
d70d893
e42a3c1
0cc4f1e
7298667
4bc02a3
838d95a
dacf33c
b25bd54
a04b8cb
6876cf2
54d5461
95eb486
830d79c
0b4d17f
bfcad46
de768e7
bf0ba70
eee12c7
22b782b
090c544
f18cdd7
a45eab1
c771de8
ea28b42
000e662
3a428b7
d779093
6123c05
d38c18e
ad6b9d5
457391b
6a6b85e
b08f7c3
afc19c8
0d792e1
d2b0839
471cd91
1da6c91
c45f9c0
e576f21
82d02be
e9b50de
934b15a
f614d10
b5d702b
553aa0f
1259ffb
f290036
9273fcd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| --- | ||
| layout: page | ||
| title: "Neo4j Interpreter for Apache Zeppelin" | ||
| description: "Neo4j is a highly scalable, native graph database purpose-built to leverage not only data but also its relationships." | ||
| group: interpreter | ||
| --- | ||
| <!-- | ||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
| {% include JB/setup %} | ||
|
|
||
| # Neo4j Interpreter for Apache Zeppelin | ||
|
|
||
| <div id="toc"></div> | ||
|
|
||
| ## Overview | ||
| [Neo4j](https://neo4j.com/) is a highly scalable, native graph database purpose-built to leverage not only data but also its relationships. | ||
| Neo4j's native graph storage and processing engine deliver constant, real-time performance, helping enterprises build intelligent applications to meet today’s evolving data challenges. | ||
|
|
||
| <table class="table-configuration"> | ||
| <tr> | ||
| <th>Name</th> | ||
| <th>Class</th> | ||
| <th>Description</th> | ||
| </tr> | ||
| <tr> | ||
| <td>%neo4j</td> | ||
| <td>Neo4jCypherInterpreter</td> | ||
| <td>Enable the Neo4j intepreter</td> | ||
| </tr> | ||
| </table> | ||
|
|
||
| ## Configuration | ||
| The Neo4j interpreter can be configured with properties provided by Zeppelin. | ||
| <table class="table-configuration"> | ||
| <tr> | ||
| <th>Property</th> | ||
| <th>Default</th> | ||
| <th>Description</th> | ||
| </tr> | ||
| <tr> | ||
| <td>neo4j.url</td> | ||
| <td>bolt://localhost:7687</td> | ||
| <td>The Neo4j's BOLT url.</td> | ||
| </tr> | ||
| <tr> | ||
| <td>neo4j.user</td> | ||
| <td>neo4j</td> | ||
| <td>The Neo4j user name.</td> | ||
| </tr> | ||
| <tr> | ||
| <td>neo4j.password</td> | ||
| <td>neo4j</td> | ||
| <td>The Neo4j user password.</td> | ||
| </tr> | ||
| <tr> | ||
| <td>neo4j.max.concurrency</td> | ||
| <td>50</td> | ||
| <td>Max concurrency call to Neo4j server.</td> | ||
| </tr> | ||
| </table> | ||
|
|
||
| ## Enabling the Neo4j Interpreter | ||
| In a notebook, to enable the **Neo4j** interpreter, click the **Gear** icon and select **neo4j**. | ||
|
|
||
| ## Using the Neo4j Interpreter | ||
| In a paragraph, use `%neo4j` to select the Neo4j interpreter and then write your cypher query. | ||
|
|
||
| ```cypher | ||
| MATCH (u:User)-[p:POSTS]->(t:Tweet) RETURN u, p, t; | ||
| ``` | ||
|
|
||
| The default visualization show the query result as a table. In the tabular result if nodes and relationships are return from the query, they will show together as rows | ||
|  | ||
|
|
||
| If the query result has almost a node the **Network** button will be enabled so you can switch to the graph visualization | ||
|  | ||
|
|
||
|  | ||
|
|
||
| You can still use the other visualization charts provided by zeppelin | ||
|  | ||
|
|
||
| Leveraging the **settings** button you can customize your graph visualization, a list of nodes will be displayed and by click on each one you can set the property which will be used as node label. | ||
|  | ||
|
|
||
| ### Apply Zeppelin Dynamic Forms | ||
| You can leverage [Zeppelin Dynamic Form](../manual/dynamicform.html) inside your queries. You can use both the `text input` and `select form` parameterization features. | ||
|
|
||
| ```cypher | ||
| match (n:User{screen_name: '${user_name}'})-[r]-(m:Tweet) return n, r, m limit 10 | ||
| ``` | ||
|  | ||
|
|
||
| ```cypher | ||
| match (n:User{screen_name: '${user_name=santand84,santand84|individue|maurofer79}'})-[r]-(m:Tweet) return n, r, m limit 10 | ||
| ``` | ||
|  |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| ~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
| ~ contributor license agreements. See the NOTICE file distributed with | ||
| ~ this work for additional information regarding copyright ownership. | ||
| ~ The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| ~ (the "License"); you may not use this file except in compliance with | ||
| ~ the License. You may obtain a copy of the License at | ||
| ~ | ||
| ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, software | ||
| ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| ~ See the License for the specific language governing permissions and | ||
| ~ limitations under the License. | ||
| --> | ||
|
|
||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <artifactId>zeppelin</artifactId> | ||
| <groupId>org.apache.zeppelin</groupId> | ||
| <version>0.8.0-SNAPSHOT</version> | ||
| <relativePath>..</relativePath> | ||
| </parent> | ||
|
|
||
| <groupId>org.apache.zeppelin</groupId> | ||
| <artifactId>zeppelin-neo4j</artifactId> | ||
| <packaging>jar</packaging> | ||
| <version>0.8.0-SNAPSHOT</version> | ||
| <name>Zeppelin: Neo4j interpreter</name> | ||
|
|
||
| <properties> | ||
| <neo4j.driver.version>1.0.4</neo4j.driver.version> | ||
| <test.neo4j.kernel.version>3.0.4</test.neo4j.kernel.version> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. update to 3.1.2 |
||
| <neo4j.version>3.0.4</neo4j.version> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>${project.groupId}</groupId> | ||
| <artifactId>zeppelin-interpreter</artifactId> | ||
| <version>${project.version}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.neo4j.driver</groupId> | ||
| <artifactId>neo4j-java-driver</artifactId> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what are the license for these? could you add to the LICENSE file?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @felixcheung this dependency has Apache 2 license. which is listed both AGPL 3.0 and GPL 3.0, which of two have i to include in LICENSE file? Another question, also must i include the license for sigma.js right?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While Right, sigma.js is going to be bundled in binary package and we need to include it in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
| <version>${neo4j.driver.version}</version> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.slf4j</groupId> | ||
| <artifactId>slf4j-api</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.slf4j</groupId> | ||
| <artifactId>slf4j-log4j12</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>junit</groupId> | ||
| <artifactId>junit</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.neo4j.test</groupId> | ||
| <artifactId>neo4j-harness</artifactId> | ||
| <version>${neo4j.version}</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <artifactId>maven-enforcer-plugin</artifactId> | ||
| <version>1.3.1</version> | ||
| <executions> | ||
| <execution> | ||
| <id>enforce</id> | ||
| <phase>none</phase> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
|
|
||
| <plugin> | ||
| <artifactId>maven-dependency-plugin</artifactId> | ||
| <version>2.8</version> | ||
| <executions> | ||
| <execution> | ||
| <id>copy-dependencies</id> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>copy-dependencies</goal> | ||
| </goals> | ||
| <configuration> | ||
| <outputDirectory>${project.build.directory}/../../interpreter/neo4j</outputDirectory> | ||
| <overWriteReleases>false</overWriteReleases> | ||
| <overWriteSnapshots>false</overWriteSnapshots> | ||
| <overWriteIfNewer>true</overWriteIfNewer> | ||
| <includeScope>runtime</includeScope> | ||
| </configuration> | ||
| </execution> | ||
| <execution> | ||
| <id>copy-artifact</id> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>copy</goal> | ||
| </goals> | ||
| <configuration> | ||
| <outputDirectory>${project.build.directory}/../../interpreter/neo4j</outputDirectory> | ||
| <overWriteReleases>false</overWriteReleases> | ||
| <overWriteSnapshots>false</overWriteSnapshots> | ||
| <overWriteIfNewer>true</overWriteIfNewer> | ||
| <includeScope>runtime</includeScope> | ||
| <artifactItems> | ||
| <artifactItem> | ||
| <groupId>${project.groupId}</groupId> | ||
| <artifactId>${project.artifactId}</artifactId> | ||
| <version>${project.version}</version> | ||
| <type>${project.packaging}</type> | ||
| </artifactItem> | ||
| </artifactItems> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
|
|
||
| </project> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps update to 1.2.0