This page explains how to setup neo4j, install the neo4j plugin and create a graph on your server
Follow the instructions of the dedicated FAQ page to get neo4j up and running.
We recommend using a recent release of Datashare (>= 14.0.0
) to use this feature, click on the 'Other platforms and versions' button when downloading to access versions if necessary.
If it's not done yet add entities to your project using the Datashare CLI.
If your project contains email documents, make sure to run the EMAIL
pipeline together with regular NLP pipeline. To do so add set the follow nlpp
flag to --nlpp CORENLP,EMAIL
.
You can now run Datashare with the neo4j plugin !
This page describes how to create and maintain your neo4j graph up to date with your server's Datashare projects
The neo4j related features are added to the DatashareCLI through the extension mechanism. In order to run the extended CLI, the Java CLASSPATH
must be extended with the path of the datashare-extension-neo4j
jar. By default, this jar is located in /home/datashare/extensions
, so the CLI will be run as following:
In order to create the graph, run the --fullImport
command for your project:
the CLI will display the import task progress and log import related information.
When new documents or entities are added or modified inside Datashare, you will need to update the neo4j graph to reflect these changes.
To update the graph, you can just re-run the full export:
The update will always add missing nodes and relationships, update existing ones if they were modified, but will never delete graph nodes or relationships.
To detect whether a graph update is needed, open the 'Projects' page and select your project:
compare the number of documents and entities found inside Datashare:
to the numbers found in the 'Graph statistics' and run an update in case of mismatch:
explore your graph using your favorite visualization tool
Install the neo4j plugin using the Datashare CLI so that users can access it from the frontend:
Installing the plugin install the datashare-plugin-neo4j-graph-widget
plugin inside /home/datashare/plugings
and will also install the datashare-extension-neo4j
backend extension inside /home/datashare/extensions
. These locations can be changed by updating the docker-compose.yml
.
Update the docker-compose.yml
to reflect your neo4j docker service settings.
If your choose a different neo4j user or set a password for your neo4j user make sure to also set DS_DOCKER_NEO4J_USER
and DS_DOCKER_NEO4J_PASSWORD
.
When running Neo4j Community Edition
, set the DS_DOCKER_NEO4J_SINGLE_PROJECT
value. In community edition, the neo4j DBMS is restricted to a single database. Since Datashare supports multiple projects, you must set the DS_DOCKER_NEO4J_SINGLE_PROJECT
with the name of the project which will use neo4j plugin. Other projects won't be able to use the neo4j plugin.
After installing the plugin a restart might be needed for the plugin to display:
You can now create the graph !