Skip to content

Add Vector type support #3009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Add Vector type support #3009

wants to merge 1 commit into from

Conversation

meistermeier
Copy link
Collaborator

@meistermeier meistermeier commented Apr 28, 2025

Map org.springframework.data.domain.Vector to setNodeVectorProperty procedure call.

Open documentation tasks

  • double vector in SDN only
  • precision on rest/representation
  • only one vector property allowed for an entity definition

Note to myself, there should be a close the issue commit on squash.

@@ -308,6 +308,17 @@ public Statement prepareSaveOf(NodeDescription<?> nodeDescription,
Assert.notNull(idDescription, "Cannot save individual nodes without an id attribute");
Parameter<?> idParameter = parameter(Constants.NAME_OF_ID);

Function<StatementBuilder.OngoingMatchAndUpdate, Statement> vectorProcedureCall = (bs) -> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;)

Comment on lines 222 to 223
But on the database-side those values will be persisted as `doubles` for the time being to support manual persisted arrays and
values persisted through `setNodeVectorProperty`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bitte so:

Neo4j will store both double and float variants as a 64bit Cypher FLOAT value, which is consistent with values persisted through Cypher and the dedicated setNodeVectorProperty function that Spring Data Neo4j uses to persist the property.

This commit combines Spring Data Commons' Vector type
with the Neo4j vector functionality.
Fields defined as Spring Data Commons `Vector` will get
persisted through the `setNodeVectorProperty` procedure.

Closes #3003

Signed-off-by: Gerrit Meier <[email protected]>
@meistermeier
Copy link
Collaborator Author

Merged via
03c4628 (8.0.x)
bbf261e (main)

@meistermeier meistermeier deleted the issue/gh-3003 branch May 5, 2025 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants