Skip to content

Releases: neo4j/cypher-dsl

2021.0.1

18 Feb 12:37
0a31ad0
Compare
Choose a tag to compare

🚀 Features

  • GH-147 - Configuration infrastructure for renderer. First use case being a simple, pretty printing renderer.

The feature looks like this:

var c = node("Configuration").named("c");
var d = node("Cypher-DSL").named("d");

var mergeStatement = merge(c.relationshipTo(d, "CONFIGURES"))
    .onCreate()
        .set(
            d.property("version").to(literalOf("2021.0.1")),
            c.property("prettyPrint").to(literalTrue())
        )
    .onMatch().set(c.property("indentStyle").to(literalOf("TAB")))
    .returning(d).build();

var renderer = Renderer.getRenderer(Configuration.prettyPrinting());
System.out.println(renderer.render(mergeStatement));

and gives you:

MERGE (c:Configuration)-[:CONFIGURES]->(d:`Cypher-DSL`)
  ON CREATE SET d.version = '2021.0.1', c.prettyPrint = true
  ON MATCH SET c.indentStyle = 'TAB'
RETURN d

2021.0.0

15 Feb 10:23
a78abeb
Compare
Choose a tag to compare

2021.0.0 comes with a lot of new features.

Thanks to @Andy2003 for his contributions!

Andy is one of our first users outside Spring Data Neo4j 6 and he started to use the Cypher-DSL in Neo4j GraphQL Java. Neo4j GraphQL Java is a library to translate GraphQL based schemas and queries to Cypher and execute those statements with the Neo4j database.
It can be used from a wide variety of frameworks.

We are happy and proud to be part of this and even more so about the input and contribution we got back from Andy.

Of course thanks for your input in form of tickets and discussions go out to @utnaf, @aaramg, @K-Lovelace and @maximelovino as well!

Noteworthy

Two things should be mentioned:

The bugfix for GH-121 might change behavior for some users: The changes prevents the forced rendering of an alias for objects when the original object - the one that has been aliased - is passed down to the DSL after an alias has been created.

The original intention for that behaviour was related to Map projection, in which the alias is actually rendered before the object.

So now the use of an aliased expression the first time triggers a AS b respectively b: a in a map projection. All further calls will just render b. If the original object is used again, a will be rendered. If that is not desired in your query and you rely on the alias, make sure you use the aliased expression returned from .as("someAlias").

The other thing are the combined features GH-135 and GH-146. The Statement class has become a fully fledged accessor to the Cypher String and the parameters used and if provided, the values for those. The following shows a small example:

var person = Cypher.node("Person").named("p");
var statement = Cypher
    .match(person)
    .where(person.property("nickname").isEqualTo(Cypher.parameter("nickname")))
    .set(
        person.property("firstName").to(Cypher.parameter("firstName").withValue("Thomas")),
        person.property("name").to(Cypher.parameter("name", "Anderson"))
    )
    .returning(person)
    .build();

assertThat(statement.getCypher())
    .isEqualTo("MATCH (p:`Person`) WHERE p.nickname = $nickname SET p.firstName = $firstName, p.name = $name RETURN p");

Collection<String> parameterNames = statement.getParameterNames();
assertThat(parameterNames).containsExactlyInAnyOrder("nickname", "firstName", "name");

Map<String, Object> parameters = statement.getParameters();
assertThat(parameters).hasSize(2);
assertThat(parameters).containsEntry("firstName", "Thomas");
assertThat(parameters).containsEntry("name", "Anderson");

What's Changed

🚀 Features

  • GH-122 - Add support for index hints.
  • GH-123 - Expose nested building of nested properties as public API.
  • GH-124 - Add support for Neo4j's mathematical functions.
  • GH-127 - Allow dynamic property lookup.
  • GH-128 - Provide asConditions for RelationshipPatterns.
  • GH-129 - Allow Expressions as Parameter for Skip and Limit.
  • GH-131 - Add support for projections on symbolic names.
  • GH-133 - Allow symbolic names to be used as condition.
  • GH-135 - Collect parameters defined on a statement.
  • GH-141 - Provide a property function on all expressions.
  • GH-142 - Provide a point function accepting generic expressions as parameter.
  • GH-146 - Allow a statement to render itself.

📖 Documentation

  • GH-126 - Document how to call arbitrary functions and procedures.

🐛 Bug Fixes

  • Prevent double rendering of Node content when using generated names.
  • GH-121 - Don't force rendering of aliases when the original object is used.
  • GH-137 - Fix grouping of nested conditions.

🧹 Housekeeping

  • Switch to GraalVM 20.3.0.
  • GH-125 - Use GraalVM image from ghcr.io.
  • GH-139 - Ensure indention via tabs.
  • GH-140 - Provide editorconfig.
  • GH-143 - Remove union types.

2020.1.6

25 Jan 10:01
a633d5b
Compare
Choose a tag to compare

No new features.
Re-released 2020.1.5 due downtime and staging issues of oss.sonatype.org.

2020.1.5

25 Jan 08:49
de25bcd
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • GH-116 - Add support for creating calls to Neo4j reduce().
  • GH-119 - Add support for passing symbolic names to nodes and relationships functions.
  • GH-117 - Introduce mutating operator.

2020.1.4

11 Jan 16:13
0a934bd
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • GH-114 - Support chained properties.
  • GH-115 - Support named items in YIELD and symbolic names as NamedPath reference.

2020.1.3

02 Dec 15:37
39413b2
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • GH-111 - Provide a programmatic way of creating an optional match.

🐛 Bug Fixes

  • GH-110 - Fix collapsing of empty conditions.

2020.1.2

19 Nov 15:44
37dfaee
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • GH-88 - Add support for Neo4j 4.0 subqueries.
  • GH-104 - Add support for merge actions.
  • GH-101 - Introduce asFunction on an ongoing call definition.

Additional new features:

  • Add support for EXPLAIN and PROFILE keywords.

We do publish the Project info now: Project info, including the Java API.

🐛 Bug Fixes

  • GH-106 - Escape symbolic names, property lookups, aliases and map keys.

🧹 Housekeeping

  • GH-105 - Remove ::set-env from GH-Actions ci.

Further improvements:

  • Qualify a yield call (only relevant for JDK15+)
  • Fix wrong offsets in the documentation.
  • Improve JavaDoc and document internal API.
  • Allow WITH clause after YIELD.
  • Improve reusability of fragments.
  • Make ORDER clause buildable.
  • Remove parts of an experimental API.

2020.1.1

01 Oct 07:14
1b9bb76
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • List comprehensions can now be build based on named paths.

2020.1.0

14 Sep 09:23
a315202
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • GH-74 - Automatically generate symbolic name if required: Node and Relationship objects generate a symbolic name if required and not set
  • Added several new functions
    • GH-77 properties()
    • GH-81 relationships()
    • GH-83 startNode(), endNode(),
    • GH-89 All temporal functions
  • GH-76 - Added the list operator ([] for accessing sub lists and indexes).

🐛 Bug Fixes

  • GH-82 - Expose all necessary interfaces for call
  • GH-84 - Fix rendering of nested sub trees.
  • GH-95 - NPE during the creation of map projections
  • GH-96 - Make sure aliased expressions are not rendered multiple times.

🧹 Housekeeping

  • GH-67 - Improvements in regards of Java generics.
  • GH-68 - Clean up the Functions api.
  • GH-69 - Avoid star and static imports.
  • GH-72 - Some release cleanup
  • GH-75 - Move Assert to internal utils package.
  • GH-89 - RelationshipDetails is now internal API.
  • GH-93 - Ensure compatibility with GraalVM native.
  • GH-94 - Bring back SymbolicName#concat.

2020.0.1

27 Jul 12:06
8753f2f
Compare
Choose a tag to compare

This is the first patch release for the rebooted Cypher-DSL project.

What's Changed

🚀 Features

  • GH-64 - Add function invocation for builtin point function.
  • GH-65 - Add support for defining calls to stored procedures.
  • Cypher.literalOf accepts now boolean values as well

🧹 Housekeeping

  • Improvements to the manual and Java Docs.

Thanks to @Andy2003 for contributing to this release.