Find answers from the community

Updated 6 months ago

Name

Looking at the PropertyGraphStore EntityNode it seems like the name parameter should probably be called id?
L
g
6 comments
Maybe? The base class has an abstract method for ID

For entity node, it happens to be the name
(Which makes sense, you don't want multiple entities with the same name inserted, so make the name the id)
node.name and node.id are the same in this case
I ended up subclassing EntityNode and overriding __str__ and id() ; many of my nodes have relevant database IDs but I want human-readable names for things like the Neo4j UI. Some of the code in the Neo4j driver does explicit instance checks for EntityNode so this looks like the required mechanism.
The source data is a hierarchical questionnaire; something like DOMAIN:CATEGORY:QUESTION:RESPONSE and each has its own ID
ergonomically this is a case where the structure of the data is meaningful but the properties that structure it are not necessarily the same ones that we want to use for creating the embeddings.
Add a reply
Sign up and join the conversation on Discord