Skip to content

openCypher Query and Visualization Support #153

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

Merged
merged 127 commits into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
ae3f477
commit by Octane
Dec 18, 2020
264d019
copy from github v2.0.3
Jan 4, 2021
6b3eae1
port dbechbe@ working version, add syntax highlighting, add %%oc whic…
Feb 8, 2021
3303db9
opencypher iam auth
Feb 24, 2021
2e3e77e
bolt support
Mar 15, 2021
8619177
rebase from github, refactor opencypher
Apr 28, 2021
3d68238
get tests working for opencypher endpoint
May 6, 2021
c7ac80a
Updated data processing code to make edge ids static so that the load…
May 10, 2021
be706a5
rebase from 2.1.2
May 12, 2021
961c6bb
- port dbechbe@ working version, add syntax highlighting, add %%oc wh…
Feb 8, 2021
b702ab0
Initial versions of notebooks updated for Neptune GA
May 26, 2021
e8019dc
Updated Neptune ML notebooks, utils, and pretrained models config
May 27, 2021
bc40285
add support for modeltransform commands in %neptune_ml
May 28, 2021
3afc6c7
Updated OC widget to handle new JSON format
Jun 15, 2021
55c951d
Updated ML notebooks with feedback from Annupriya
Jun 16, 2021
00061be
Added back in missing init file for the Gremlin Network
Jun 18, 2021
be4f40f
Added support for openCypher syntax highlighting
Jun 18, 2021
12bcfb5
Added missing init files and updated files that incorrectly reference…
Jun 18, 2021
b3322db
WIP - Adding visualization to OC
Jun 19, 2021
b876655
WIP - Intiial rough visualization of OC results
Jun 20, 2021
34593b7
WIP - updated to handle group vars passed in as json
Jun 20, 2021
0f0e91f
Rebase on v2.1.3 and changes due for v2.1.4
michaelnchin Jun 21, 2021
538f03d
Resolve remaining merge conflicts from v2.1.2 rebase
michaelnchin Jun 22, 2021
7b75a9a
Added comments and cleaned up code for initial OC visualization
Jun 23, 2021
4d29f9e
Revert unintended changes to Gremlin tests
Jun 23, 2021
2e522f4
WIP - Adding visualization to OC
Jun 19, 2021
21fbca3
After merge from akline/OC
Jun 23, 2021
133442b
Cleaned up merge conflicts after merge from akline/OC
Jun 23, 2021
17cc1bc
Fixed additional merge conflicts
Jun 23, 2021
a3783c9
Finally fixed merge conflicts from akline/OC branch
Jun 23, 2021
44db125
Copied code to set label display and label length
Jun 25, 2021
eb34003
Fix Sparql tab widgets being displayed incorrectly, some PEP8 fixes
michaelnchin Jun 25, 2021
f7981b1
Merge from akline/OC
michaelnchin Jun 25, 2021
9c7d240
Changed the seed command to use 'Property Graph/RDF' as the data mode…
Jun 25, 2021
e767355
Removed tmp file used for building
Jun 25, 2021
d2c6f20
Added opencypher support for bulk load
Jun 25, 2021
af85287
Merged Github repo with akline/OC branch
michaelnchin Jun 26, 2021
66deeba
Cleaned up last few merge conflicts
michaelnchin Jun 27, 2021
4a1f8a2
Merge branch 'main' of https://github.com/aws/graph-notebook into OC-…
michaelnchin Jun 28, 2021
59109be
PEP8 fixes
michaelnchin Jun 28, 2021
8e9b7bb
More PEP8 fixes
michaelnchin Jun 28, 2021
3c21799
Update notebooks unit test with the new notebook paths
michaelnchin Jun 28, 2021
ca27352
Fixed issue with seed command as well as default grouping not working…
Jun 28, 2021
cf15a68
Fixed issue where parsed lists of dictionaries were not remaining ord…
Jun 29, 2021
0ed294a
Updated Notebooks to refer to new seed command
Jun 29, 2021
6b618aa
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
michaelnchin Jun 29, 2021
e6f4235
Merge branch 'main' of https://github.com/aws/graph-notebook into OC-…
michaelnchin Jun 29, 2021
420ab22
Add '-de' param to Gremlin magic for specifying edge labels
michaelnchin Jun 30, 2021
fd55096
Fix bug in adding dict type edges to graph, rearrange recent tests
michaelnchin Jun 30, 2021
150afe0
Merge branch 'main' of https://github.com/aws/graph-notebook into OC-…
michaelnchin Jun 30, 2021
dd741a9
Initial upload of new notebooks
krlawrence Jul 1, 2021
35740d9
Additional cleanup/tweaks
krlawrence Jul 1, 2021
f3cb029
Add variable injection decorator to OC magics
michaelnchin Jul 1, 2021
9b317dd
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
michaelnchin Jul 1, 2021
5d767c9
Fixed casing on seed command labels for consistency
Jul 1, 2021
ae971ed
Introduce new features via text and tweak examples
krlawrence Jul 1, 2021
2280672
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
krlawrence Jul 1, 2021
61ff423
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
michaelnchin Jul 2, 2021
fdffd62
Add --edge-display-property to OC magic for specifying edge labels
michaelnchin Jul 2, 2021
8f01832
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
michaelnchin Jul 2, 2021
100275a
Update OC notebooks hints sections with -de param
michaelnchin Jul 2, 2021
14cc23c
Additional improvements to intro section
krlawrence Jul 2, 2021
735aa23
Additional examples and prose
krlawrence Jul 2, 2021
39042d4
Initial updates for the README - more needed
krlawrence Jul 2, 2021
342ac76
Additional README updates - more needed
krlawrence Jul 2, 2021
2971e82
Update URL for openCypher
krlawrence Jul 2, 2021
a73f5f2
Initial upload of sample OC images
krlawrence Jul 2, 2021
48bcf16
Add link to OC sample image
krlawrence Jul 2, 2021
6f05df4
Add another example using the -d hint
krlawrence Jul 2, 2021
f5f7ad6
Update Gremlin sample image to show color
krlawrence Jul 2, 2021
10651d0
Tweak examples to use more color
krlawrence Jul 2, 2021
610b1a5
Add a colorful graph image to the README
krlawrence Jul 2, 2021
44776d0
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
michaelnchin Jul 2, 2021
a1ef115
Additional pointers to notebooks
krlawrence Jul 2, 2021
2709a95
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
michaelnchin Jul 2, 2021
0fdb9ba
Additional updates
krlawrence Jul 2, 2021
5cb815d
Fix bug where Gremlin node tooltips were not being changed when using…
michaelnchin Jul 2, 2021
200dac9
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
michaelnchin Jul 2, 2021
fdab911
Additional examples that showcase new features
krlawrence Jul 6, 2021
21a1dad
Rename some variables
krlawrence Jul 6, 2021
3655c6f
More variable renaming
krlawrence Jul 6, 2021
75daeb3
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
michaelnchin Jul 6, 2021
bf92b49
Merge branch 'main' of https://github.com/aws/graph-notebook into OC-…
michaelnchin Jul 6, 2021
8749fdf
Additional small improvements
krlawrence Jul 6, 2021
5a1f4b9
Merge branch 'main' of https://github.com/aws/graph-notebook into OC-…
michaelnchin Jul 6, 2021
14d67b8
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
michaelnchin Jul 6, 2021
8691527
Add an example showing how to sample airports
krlawrence Jul 7, 2021
ce9810a
Minor tweak to random sample example
krlawrence Jul 8, 2021
fd28011
Making use if verbs consistent
krlawrence Jul 9, 2021
529b1f4
Verb consistency and clean up graphics reset
krlawrence Jul 9, 2021
82b566a
Fix incorrect option
krlawrence Jul 9, 2021
67b3398
Verb consistency
krlawrence Jul 9, 2021
dd1c5a3
Merge branch 'main' of https://github.com/aws/graph-notebook into OC-…
michaelnchin Jul 9, 2021
798726d
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
michaelnchin Jul 9, 2021
817ffb3
Improved a couple of examples
krlawrence Jul 13, 2021
c8c282a
Add visualization support for elementMap() Gremlin step
michaelnchin Jul 15, 2021
378f142
Remove Direction.BOTH check
michaelnchin Jul 15, 2021
0a2af06
Add visualization support for elementMap Gremlin step
michaelnchin Jul 15, 2021
06266d0
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
michaelnchin Jul 15, 2021
3a46233
Merge branch 'main' of https://github.com/aws/graph-notebook into OC-…
michaelnchin Jul 15, 2021
2ea64a1
Remove merged redundancies
michaelnchin Jul 15, 2021
cab983b
Updated ML notebooks based on feedback from Ankit
Jul 16, 2021
01d17da
Merge branch 'main' of https://github.com/aws/graph-notebook into OC-…
michaelnchin Jul 16, 2021
64884ae
Merge branch 'chnmch/OC_Github_Release' of ssh://git.amazon.com/pkg/G…
michaelnchin Jul 16, 2021
6012770
Additional discussion of elementMap usage
krlawrence Jul 19, 2021
95d80a3
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
michaelnchin Jul 19, 2021
7450365
Update Visualization-Grouping-Coloring-Gremlin notebook with elementMap
michaelnchin Jul 20, 2021
d4e034b
[lakelvin@] Refactor %load form display to fix some descriptions bein…
michaelnchin Jul 21, 2021
5968081
Rename Gremlin Grouping-Coloring sample notebook
michaelnchin Jul 21, 2021
241d432
Merge branch 'main' of https://github.com/aws/graph-notebook into OC-…
michaelnchin Jul 22, 2021
fa619e1
Minor changes and rename files
krlawrence Jul 23, 2021
8e8f4f2
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
michaelnchin Jul 23, 2021
da63ac2
Merge branch 'main' of https://github.com/aws/graph-notebook into OC-…
michaelnchin Jul 26, 2021
493c4df
Add examples of -d and -de without a map
krlawrence Jul 26, 2021
fbd6c9f
Fix typo
krlawrence Jul 26, 2021
5ef2206
Fix -d option not working in OC queries for string format values
michaelnchin Jul 26, 2021
57a2e55
Clean up debug statement
michaelnchin Jul 26, 2021
c95dd1b
Merge branch 'akline/OC' of ssh://git.amazon.com/pkg/Graph-notebook-p…
michaelnchin Jul 26, 2021
3e1fd3c
Fix OC metadata results count metric
michaelnchin Jul 27, 2021
221c3eb
Update ChangeLog for OC Release
michaelnchin Jul 27, 2021
474ef52
Add ML updates to ChangeLog
michaelnchin Jul 27, 2021
6a83df0
Remove identity graph seed files
michaelnchin Jul 27, 2021
3b3aa81
Remove extra chars from notebooks
michaelnchin Jul 27, 2021
667aaa8
Pin neo4j version
michaelnchin Jul 28, 2021
bd4376d
Styling fixes
michaelnchin Jul 28, 2021
84d95d6
More styling fixes
michaelnchin Jul 28, 2021
7403f6a
Update notebook directory validation unit test
michaelnchin Jul 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ src/graph_notebook/widgets/lib/
# npm
node_modules/
node_modules/.package-lock.json
src/graph_notebook/widgets/package-lock.json
src/graph_notebook/widgets/package-lock.json
blazegraph.jnl
rules.log
*.env
69 changes: 45 additions & 24 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,68 @@
Starting with v1.31.6, this file will contain a record of major features and updates made in each release of graph-notebook.

## Upcoming
- Add visualization support for elementMap Gremlin step ([Link to PR](https://github.com/aws/graph-notebook/pull/140))
- Support additional customization of edge node labels in Gremlin ([Link to PR](https://github.com/aws/graph-notebook/pull/132))
- Include index operations metrics in metadata results tab for Gremlin Profile queries([Link to PR](https://github.com/aws/graph-notebook/pull/150))
- Update SPARQL EPL seed dataset file ([Link to PR](https://github.com/aws/graph-notebook/pull/134))
- Update documentation on using `%%graph_notebook_config` with an IAM enabled Neptune cluster ([Link to PR](https://github.com/aws/graph-notebook/pull/136))
- Fix improper handling of Blazegraph status response ([Link to PR](https://github.com/aws/graph-notebook/pull/137))
- Fix Gremlin node tooltips being displayed incorrectly ([Link to PR](https://github.com/aws/graph-notebook/pull/139))
- Fix bug in using Gremlin explain/profile with large result sets ([Link to PR](https://github.com/aws/graph-notebook/pull/141))
- Pin RDFLib version ([Link to PR](https://github.com/aws/graph-notebook/pull/151))

**openCypher Support**:

With the release of support for the openCypher query language in Amazon Neptune's lab mode, graph-notebook can now be used to execute and visualize openCypher queries with any compatible graph database.

Two new magic commands have been added:
- `%%oc`/`%%opencypher`
- `%%oc_status`/`%%opencypher_status`

These openCypher magic commands inherit the majority of the query and visualization customization features that are already available in the Gremlin and SPARQL magics.

For more detailed information and examples of how you can execute and visualize openCypher queries through graph-notebook, please refer to the new `Air-Routes-openCypher` and `EPL-openCypher` sample notebooks.

**Other major updates**:
- Added visualization support for elementMap Gremlin step ([Link to PR](https://github.com/aws/graph-notebook/pull/140))
- Added support for additional customization of edge node labels in Gremlin ([Link to PR](https://github.com/aws/graph-notebook/pull/132))
- Refactored %load form display code for flexibility; fixes some descriptions being cut off
- Updated Neptune ML notebooks, utils, and pretrained models config
- Added support for `modeltransform` commands in `%neptune_ml`

**Minor updates**:
- Included index operations metrics in metadata results tab for Gremlin Profile queries([Link to PR](https://github.com/aws/graph-notebook/pull/150))
- Updated SPARQL EPL seed dataset file ([Link to PR](https://github.com/aws/graph-notebook/pull/134))
- Updated documentation on using `%%graph_notebook_config` with an IAM enabled Neptune cluster ([Link to PR](https://github.com/aws/graph-notebook/pull/136))

**Bugfixes**:
- Fixed improper handling of Blazegraph status response ([Link to PR](https://github.com/aws/graph-notebook/pull/137))
- Fixed Gremlin node tooltips being displayed incorrectly ([Link to PR](https://github.com/aws/graph-notebook/pull/139))
- Fixed bug in using Gremlin explain/profile with large result sets ([Link to PR](https://github.com/aws/graph-notebook/pull/141))
- Pinned RDFLib version ([Link to PR](https://github.com/aws/graph-notebook/pull/151))

## Release 2.1.4 (June 27, 2021)
- Support for additional customization of graph node labels in Gremlin ([Link to PR](https://github.com/aws/graph-notebook/pull/127))
- Added support for additional customization of graph node labels in Gremlin ([Link to PR](https://github.com/aws/graph-notebook/pull/127))

## Release 2.1.3 (June 18, 2021)
- Support dictionary value access in variable injection([Link to PR](https://github.com/aws/graph-notebook/pull/126))
- Added support for dictionary value access in variable injection([Link to PR](https://github.com/aws/graph-notebook/pull/126))

## Release 2.1.2 (May 10, 2021)

- Pin gremlinpython to `<3.5.*` ([Link to PR](https://github.com/aws/graph-notebook/pull/123))
- Add support for notebook variables in Sparql/Gremlin magic queries ([Link to PR](https://github.com/aws/graph-notebook/pull/113))
- Add support for grouping by different properties per label in Gremlin ([Link to PR](https://github.com/aws/graph-notebook/pull/115))
- Fix missing Boto3 dependency in setup.py ([Link to PR](https://github.com/aws/graph-notebook/pull/118))
- Update %load execution time to HH:MM:SS format if over a minute ([Link to PR](https://github.com/aws/graph-notebook/pull/121))
- Pinned gremlinpython to `<3.5.*` ([Link to PR](https://github.com/aws/graph-notebook/pull/123))
- Added support for notebook variables in Sparql/Gremlin magic queries ([Link to PR](https://github.com/aws/graph-notebook/pull/113))
- Added support for grouping by different properties per label in Gremlin ([Link to PR](https://github.com/aws/graph-notebook/pull/115))
- Fixed missing Boto3 dependency in setup.py ([Link to PR](https://github.com/aws/graph-notebook/pull/118))
- Updated %load execution time to HH:MM:SS format if over a minute ([Link to PR](https://github.com/aws/graph-notebook/pull/121))

## Release 2.1.1 (April 22, 2021)

- Fix bug in `%neptune_ml export ...` logic where the iam setting for the exporter endpoint wasn't getting picked up properly
- Fixed bug in `%neptune_ml export ...` logic where the iam setting for the exporter endpoint wasn't getting picked up properly

## Release 2.1.0 (April 15, 2021)

- Add support for Mode, queueRequest, and Dependencies parameters when running %load command ([Link to PR](https://github.com/aws/graph-notebook/pull/91))
- Add support for list and dict as map keys in Python Gremlin ([Link to PR](https://github.com/aws/graph-notebook/pull/100))
- Refactor modules that call to Neptune or other SPARQL/Gremlin endpoints to use a unified client object ([Link to PR](https://github.com/aws/graph-notebook/pull/104))
- Added support for Mode, queueRequest, and Dependencies parameters when running %load command ([Link to PR](https://github.com/aws/graph-notebook/pull/91))
- Added support for list and dict as map keys in Python Gremlin ([Link to PR](https://github.com/aws/graph-notebook/pull/100))
- Refactored modules that call to Neptune or other SPARQL/Gremlin endpoints to use a unified client object ([Link to PR](https://github.com/aws/graph-notebook/pull/104))
- Added an additional notebook under [02-Visualization](src/graph_notebook/notebooks/02-Visualization) demonstrating how to use the visualzation grouping and coloring options in Gremlin. ([Link to PR](https://github.com/aws/graph-notebook/pull/107))
- Add metadata output tab for magic queries ([Link to PR](https://github.com/aws/graph-notebook/pull/108))
- Added metadata output tab for magic queries ([Link to PR](https://github.com/aws/graph-notebook/pull/108))

## Release 2.0.12 (Mar 25, 2021)

- Add default parameters for `get_load_status` ([Link to PR](https://github.com/aws/graph-notebook/pull/96))
- Add ipython as a dependency in `setup.py` ([Link to PR](https://github.com/aws/graph-notebook/pull/95))
- Add parameters in `load_status` for `details`, `errors`, `page`, and `errorsPerPage` ([Link to PR](https://github.com/aws/graph-notebook/pull/88))
- Added default parameters for `get_load_status` ([Link to PR](https://github.com/aws/graph-notebook/pull/96))
- Added ipython as a dependency in `setup.py` ([Link to PR](https://github.com/aws/graph-notebook/pull/95))
- Added parameters in `load_status` for `details`, `errors`, `page`, and `errorsPerPage` ([Link to PR](https://github.com/aws/graph-notebook/pull/88))

## Release 2.0.10 (Mar 18, 2021)

Expand Down
37 changes: 27 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
## Graph Notebook: easily query and visualize graphs
## Graph Notebook: easily query and visualize graphs

The graph notebook provides an easy way to interact with graph databases using Jupyter notebooks. Using this open-source Python package, you can connect to any graph database that supports the [Apache TinkerPop](https://tinkerpop.apache.org/), [openCypher](https://github.com/opencypher/openCypher) or the [RDF SPARQL](https://www.w3.org/TR/rdf-sparql-query/) graph models. These databases could be running locally on your desktop or in the cloud. Graph databases can be used to explore a variety of use cases including [knowledge graphs](https://aws.amazon.com/neptune/knowledge-graphs-on-aws/) and [identity graphs](https://aws.amazon.com/neptune/identity-graphs-on-aws/).

![A colorful graph picture](./images/ColorfulGraph.png)

The graph notebook provides an easy way to interact with graph databases using Jupyter notebooks. Using this open-source Python package, you can connect to any graph database that supports the [Apache TinkerPop](https://tinkerpop.apache.org/) or the [RDF SPARQL](https://www.w3.org/TR/rdf-sparql-query/) graph model. These databases could be running locally on your desktop or in the cloud. Graph databases can be used to explore a variety of use cases including [knowledge graphs](https://aws.amazon.com/neptune/knowledge-graphs-on-aws/) and [identity graphs](https://aws.amazon.com/neptune/identity-graphs-on-aws/).

### Visualizing Gremlin queries:

![Gremlin query and graph](./images/GremlinQueryGraph.png)

### Visualizing openCypher queries

![openCypher query and graph](./images/OCQueryGraph.png)

### Visualizing SPARQL queries:

![SPARL query and graph](./images/SPARQLQueryGraph.png)

Instructions for connecting to the following graph databases:

| Endpoint | Graph model | Query language |
| :-----------------------------: | :---------------------: | :-----------------: |
| :-----------------------------: | :---------------------: | :-----------------: |
|[Gremlin Server](#gremlin-server)| property graph | Gremlin |
| [Blazegraph](#blazegraph) | RDF | SPARQL |
|[Amazon Neptune](#amazon-neptune)| property graph or RDF | Gremlin or SPARQL |
Expand All @@ -25,7 +32,9 @@ We encourage others to contribute configurations they find useful. There is an [
#### Notebook cell 'magic' extensions in the IPython 3 kernel
`%%sparql` - Executes a SPARQL query against your configured database endpoint.

`%%gremlin` - Executes a Gremlin query against your database using web sockets. The results are similar to what the Gremlin console would return.
`%%gremlin` - Executes a Gremlin query against your database using web sockets. The results are similar to those a Gremlin console would return.

`%%opencypher` or `%%oc` Executes an openCypher query against your database.

`%%graph_notebook_config` - Sets the executing notebook's database configuration to the JSON payload provided in the cell body.

Expand All @@ -41,18 +50,20 @@ We encourage others to contribute configurations they find useful. There is an [

`%sparql_status` - Obtain the status of SPARQL queries. [Documentation](https://docs.aws.amazon.com/neptune/latest/userguide/sparql-api-status.html)

`%opencypher_status` or `%oc_status` - Obtain the status of openCypher queries.

`%load` - Generate a form to submit a bulk loader job. [Documentation](https://docs.aws.amazon.com/neptune/latest/userguide/bulk-load.html)

`%load_ids` - Get ids of bulk load jobs. [Documentation](https://docs.aws.amazon.com/neptune/latest/userguide/load-api-reference-status-examples.html)

`%load_status` - Get the status of a provided `load_id`. [Documentation](https://docs.aws.amazon.com/neptune/latest/userguide/load-api-reference-status-examples.html)

`%neptune_ml` - Set of commands to integrate with NeptuneML functionality. You can find a set of tutorial notebooks [here](https://github.com/aws/graph-notebook/tree/main/src/graph_notebook/notebooks/04-Machine-Learning).
`%neptune_ml` - Set of commands to integrate with NeptuneML functionality. You can find a set of tutorial notebooks [here](https://github.com/aws/graph-notebook/tree/main/src/graph_notebook/notebooks/04-Machine-Learning).
[Documentation](https://aws.amazon.com/neptune/machine-learning/)

`%status` - Check the Health Status of the configured host endpoint. [Documentation](https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-status.html)

`%seed` - Provides a form to add data to your graph without the use of a bulk loader. both SPARQL and Gremlin have an airport routes dataset.
`%seed` - Provides a form to add data to your graph without the use of a bulk loader. Supports both RDF and Property Graph data models.

`%graph_notebook_config` - Returns a JSON payload that contains connection information for your host.

Expand All @@ -64,6 +75,13 @@ We encourage others to contribute configurations they find useful. There is an [

**TIP** :point_right: You can list all the magics installed in the Python 3 kernel using the `%lsmagic` command.

**TIP** :point_right: Many of the magic commands support a `--help` option in order to provide additional information.

## Example notebooks
This project includes many example Jupyter notebooks. It is recommended to explore them. All of the commands and features supported by `graph-notebook` are explained in detail with examples within the sample notebooks. You can find them [here](./src/graph_notebook/notebooks/). As this project has evolved, many new features have been added. If you are already familiar with graph-notebook but want a quick summary of new features added, a good place to start is the Air-Routes notebooks in the [02-Visualization](./src/graph_notebook/notebooks/02-Visualization) folder.

## Keeping track of new features
It is recommended to check the [ChangeLog.md](ChangeLog.md) file periodically to keep up to date as new features are added.

## Prerequisites

Expand All @@ -74,7 +92,6 @@ You will need:
* [Tornado](https://pypi.org/project/tornado/) 4.5.3
* A graph database that provides a SPARQL 1.1 Endpoint or a Gremlin Server


## Installation

```
Expand Down Expand Up @@ -102,7 +119,7 @@ jupyter notebook ~/notebook/destination/dir

## Connecting to a graph database

### Gremlin Server
### Gremlin Server

In a new cell in the Jupyter notebook, change the configuration using `%%graph_notebook_config` and modify the fields for `host`, `port`, and `ssl`. For a local Gremlin server (HTTP or WebSockets), you can use the following command:

Expand Down Expand Up @@ -154,7 +171,7 @@ You can also make use of namespaces for Blazegraph by specifying the path `graph
}
```

This will result in the url `localhost:9999/blazegraph/namespace/foo/sparql` being used when executing any `%%sparql` magic commands.
This will result in the url `localhost:9999/blazegraph/namespace/foo/sparql` being used when executing any `%%sparql` magic commands.

To setup a new local Blazegraph database for use with the graph notebook, check out the [Quick Start](https://github.com/blazegraph/database/wiki/Quick_Start) from Blazegraph.

Expand All @@ -175,7 +192,7 @@ Change the configuration using `%%graph_notebook_config` and modify the defaults
```
To setup a new Amazon Neptune cluster, check out the [AWS documentation](https://docs.aws.amazon.com/neptune/latest/userguide/manage-console-launch.html).

When connecting the graph notebook to Neptune, make sure you have a network setup to communicate to the VPC that Neptune runs on. If not, you can follow [this guide](https://github.com/aws/graph-notebook/tree/main/additional-databases/neptune).
When connecting the graph notebook to Neptune, make sure you have a network setup to communicate to the VPC that Neptune runs on. If not, you can follow [this guide](https://github.com/aws/graph-notebook/tree/main/additional-databases/neptune).

## Authentication (Amazon Neptune)

Expand Down
18 changes: 18 additions & 0 deletions additional-databases/blazegraph/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Connecting graph notebook to Blazegraph SPARQL Endpoint

The official SPARQL endpoint for DBPedia is available from https://dbpedia.org/sparql and is based on a Virtuoso engine.

It is possible to connect to this endpoint using the following configuration:

```
%%graph_notebook_config
{
"host": "dbpedia.org",
"port": 443,
"auth_mode": "DEFAULT",
"iam_credentials_provider_type": "ROLE",
"load_from_s3_arn": "",
"ssl": true,
"aws_region": ""
}
```
Binary file added images/ColorfulGraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/GremlinQueryGraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/OCQueryGraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ notebook==5.7.10
ipywidgets==7.5.1
jupyter-contrib-nbextensions
widgetsnbextension
gremlinpython
gremlinpython<=3.4.*
requests==2.24.0
ipython==7.16.1
neo4j==4.2.1
rdflib~=5.0.0
traitlets~=4.3.3
setuptools~=40.6.2

# requirements for testing
boto3==1.15.15
botocore==1.18.18
botocore~=1.18.18
boto3~=1.15.15
pytest==6.2.2
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def get_version():
'botocore>=1.19.37',
'boto3>=1.17.58',
'ipython>=7.16.1',
'neo4j==4.3.2',
'rdflib==5.0.0'
],
package_data={
Expand Down
3 changes: 2 additions & 1 deletion src/graph_notebook/magics/completers/graph_completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
'GRAPH',
'FILTER',
'ASK',
'DESCRIBE']
'DESCRIBE',
'UNLOAD']
GREMLIN_OPTIONS = [
'.toString',
'.tx',
Expand Down
Loading