Procedures are the preferred means for extending Neo4j. If you’re reading this, probably you might want to:
Use APOC or GDS
Every new GrapheneDB database is deployed with both extensions pre-installed and enabled. Read more here.
Use any other extension written by Neo4j or the Community
We allow you to manage and upload any extension right from our admin interface. More info on how to add new stored procedures here.
Use your own extension
You can also write your own stored procedures if you need.
To know more about how to write and call procedures, please visit the Neo4j procedures documentation.
Follow these instructions to add a stored procedure to your database:
- Navigate to the Extensions tab of your database dashboard, and select New stored procedure from the New extension drop-down menu.
- Name your stored procedure in order to be able to identify it afterward.
- Select the .jar file from your local path and click on Add stored procedure. There is a size limit of 100MB.
- Do not close the browser window! The upload will stop if you close your browser. If the upload fails, you can click on the Retry button to start it again.
- When the upload completes successfully, you will see a new row in your Extensions list with the status ENABLED - PENDING.
- Before the stored procedure can be available for use, it is necessary to restart the database. To perform this operation, click on the Apply changes button.
- A new window will show you a list of the changes you are going to perform. Please review them and click on Apply changes.
You can enable/disable your stored procedures in your extensions list by clicking on the appropriate button next to each stored procedure. Remember that you should click on Apply changes button to confirm all of these changes.
Once the changes are applied, you will see the final status (ENABLED or DISABLED) in the list.
You can enable/disable more than one extension at once. Click on the Enable/Disable button of the different extensions.
Before applying any extension changes to a cluster, all the cluster nodes need to be available. GrapheneDB will check cluster nodes state before allowing you to apply the changes.
A confirm dialog will be shown to let you know the progress of the nodes rolling restart process. Incoming requests can be processed due to the cluster being responsive during the process.
Every new GrapheneDB database is deployed with APOC and GDS pre-installed and enabled. You can start using them directly from your code or Neo4j Browser right after deployment.
APOC is a generally usable library of procedures by Michael Hunger that covers different aspects that are currently not available on Cypher. It contains more than 200 procedures of different areas. You can read more about it here.
If you want to check that APOC is available in your database, you can use the following built-in procedure and get a list:
CALL dbms.procedures() YIELD name RETURN head(split(name,".")) as package, count(*), collect(name) as procedures;
The Neo4j Graph Data Science (GDS) library provides efficiently implemented, parallel versions of common graph algorithms for Neo4j, exposed as Cypher procedures. You can read more about GDS here.
To verify your installation, the library version can be printed by entering into the Neo4j Browser and calling the gds.version() function:
To list all installed algorithms, run the gds.list() procedure:
To remove a stored procedure
- Navigate to the Extensions tab of your database dashboard
- Click on the Disable button next to the stored procedure you wish to remove.
- Once the stored procedure is disabled, you can click on Remove to fully remove the stored procedure.
Only disabled stored procedures can be removed. Make sure you disable the procedure before attempting to remove it. You can disable the procedure by clicking on the Disable button.
This action cannot be undone and will delete your stored procedure permanently.
Updated about a year ago