Head's Up! Site migration is underway. Phase 2: migrate recent content
β05-14-2022 05:27 PM
I'm wondering if it is possible to use dynamic mapping of node properties in current version of Spring Data Neo4j? I've seen some posts from 2018-19 that used that feature, but It seems like there have been some changes that removed it from current release.
β05-15-2022 11:49 PM
What do you mean with "dynamic node properties"?
β05-16-2022 08:13 AM
Hi @gerrit.meier , I thought that just as you can have field Map<String, Node> that is populated with nodes related to current node (in spring boot docs it's called dynamic relationships), I hoped that it's possible to do something similar, but with node attributes (primitive datatypes). I'm modeling RDFS / OWL ontology.
I have seen similar behaviour in OGM, but I can't find it in SDN.
β05-16-2022 05:14 PM
I meant @Properties annotation from OGM.
OGM - Annotating Entities
β05-16-2022 11:23 PM
The @Properties
annotation still exists and works as in Neo4j-OGM. It can redirect property names from the Java to the graph world.
What you are referring in you first answer to is something different than dynamic relationships. Dynamic relationships exist in SDN, but you cannot use Java driver's primitive Node
type here. It has to be a @Node
or @RelationshipProperties
annotated type.
To mimic the behaviour you are currently seeing in Neo4j-OGM, I would advice to use the Neo4jClient
only and use the mapping feature of SDN when needed.
We have a section in the documentation describing it with an example: Spring Data Neo4j
All the sessions of the conference are now available online