An open API service indexing awesome lists of open source software.

https://github.com/meistermeier/neo4j-ogm-label-extension

Example of a cypher modification provider for Neo4j-OGM
https://github.com/meistermeier/neo4j-ogm-label-extension

java neo4j neo4j-ogm

Last synced: 24 days ago
JSON representation

Example of a cypher modification provider for Neo4j-OGM

Awesome Lists containing this project

README

        

image:https://api.travis-ci.org/meistermeier/neo4j-ogm-label-extension.svg?branch=master[build state]

== Label Extension for Neo4j-OGM

This projects provides a limited support for manipulating Cypher statements
and adding an additional label to all nodes in the statement.

=== Usage

Just add this library to your Neo4j-OGM based project and provide your label via the configuration.
This can be done by defining it as a static `String` value:

[source, java]
----
SessionFactory sessionFactory = new SessionFactory(
new Configuration.Builder()
.withCustomProperty(LabelModificationProvider.CONFIGURATION_KEY, "StaticLabel")
.build());
----

or a `Supplier` function:

[source, java]
----
SessionFactory sessionFactory = new SessionFactory(
new Configuration.Builder()
.withCustomProperty(LabelModificationProvider.CONFIGURATION_KEY, (Supplier) () -> "DynamicLabel")
.build());
----

=== Limitations
There are some limitations at the moment.

==== Tested support for 3.4.x only
This extension is built against Neo4j's `openCypher-frontend` and uses specific _3.4_ packages.
It may work with any other _3.1+_ version of Neo4j in server mode.

If you are using this extension with an embedded Neo4j instance, it might end up in version conflicts regarding Scala, as there will be multiple Scala runtimes in your class path.

==== Limited keywords
The API used doesn't provide means for generating a string representation of all Cypher parts, so we might not support correct rewriting of all valid statements.
Due to this fact it is near to impossible to test against every possible statement.

NOTE: Also the conversion for the supported keywords themselves might be incomplete regarding its inner statements.

The keywords supported right now are:

* `Return`
* `Match`
* `With`
* `Create`
* `Unwind`
* `Set`
* `Delete`
* `Merge`
* _Custom procedure calls_