Skip to content

h-omer/neo4j-versioner-core

Repository files navigation

Neo4j Versioner Core

Neo4j Versioner Core is a collection of procedures, aimed to help developers to manage the Entity-State model, by creating, updating and querying the graph.

License

Apache License 2.0

Installation

  1. Download the latest release;
  2. Put the downloaded jar file into $NEO4J_HOME/plugins folder;
  3. Start/Restart Neo4j.

Version Compatibility Matrix

Versioner version Neo4j version
2.x.x 3.5.x
4.2.x 4.2.x

About

Neo4j Versioner Core has been developed by Alberto D'Este and Marco Falcier.

It's based on the following data model:

Data Model

Examples

A little example on how you can add a State node to a given Entity:

MATCH (d:Device) WITH d CALL graph.versioner.update(d, {context:'some details'}, 'Error', localdatetime('1988-10-27T02:46:40')) YIELD node RETURN node

And how to retrieve the current State:

MATCH (d:Device) WITH d CALL graph.versioner.get.current.state(d) YIELD node RETURN node

If you want to use Neo4j Versioner Core procedures on your procedures/functions you simply create a new instance:

Optional<Init> result = new InitBuilder().withDb(db).withLog(log).build();
result.ifPresent(a -> a.init("EntityLabel", entityProps, stateProps, additionalLabel, date));

Full documentation

From version 2.0.0 you can also version relationships: to see how, see the full documentation here.

Feedback

We would appreciate your feedback about our Versioner Core, how to improve and fix (we hope not so many! 🙈) any bad things. Say yours in the issue section.

Buy us a coffee ☕

This project is developed during our free time, and our free time is mostly during evening/night! So coffee is really helpful during our sessions 😅. If you want to help us with that, you can buy us some ☕ thanks to PayPal!