generated from thedatasociety/lab-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
816a7b0
commit 331cb14
Showing
45 changed files
with
2,671 additions
and
979 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from yfiles_jupyter_graphs_for_neo4j import Neo4jGraphWidget | ||
from neo4j import GraphDatabase | ||
from yfiles_jupyter_graphs import GraphWidget | ||
from IPython.core.magic import (register_line_magic, | ||
register_cell_magic) | ||
|
||
driver = GraphDatabase.driver(uri = "neo4j://localhost") | ||
|
||
def query_neo4j(cypher_query: str): | ||
query_graph_result = driver.session().run(cypher_query).graph() | ||
graph_widget = GraphWidget(overview_enabled=False, context_start_with='Data', graph = query_graph_result) | ||
graph_widget.set_sidebar(enabled=False, start_with='Data') | ||
display(graph_widget) | ||
return graph_widget | ||
|
||
def cypher(line, cell_content): | ||
print(line) | ||
query_neo4j(cell_content) | ||
|
||
def load_ipython_extension(ipython): | ||
"""This function is called when the extension is | ||
loaded. It accepts an IPython InteractiveShell | ||
instance. We can register the magic with the | ||
`register_magic_function` method of the shell | ||
instance.""" | ||
ipython.register_magic_function(cypher, 'cell') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ curl | |
wget | ||
net-tools | ||
lsof | ||
openjdk-11-jdk | ||
openjdk-21-jdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/bin/bash | ||
|
||
cp ~/resources/configs/neo4j/${NEO4J_VERSION}/neo4j.conf ${NEO4J_HOME}/conf/ | ||
nohup neo4j start &> ~/logs/neo4j-$NEO4J_VERSION.log & | ||
|
||
mkdir ~/resources/logs | ||
cp ~/resources/configs/neo4j/${NEO4J_VERSION}/neo4j.conf ${NEO4J_HOME}/conf/ | ||
nohup neo4j start &> ~/resources/logs/neo4j-$NEO4J_VERSION.log & |
Oops, something went wrong.