Find answers from the community

Updated 9 months ago

Name

At a glance

The community members are discussing the PropertyGraphStore EntityNode and whether the name parameter should be called id instead. Some community members suggest that the name is the same as the id and that it makes sense to use the name as the identifier to avoid having multiple entities with the same name. Another community member mentions subclassing EntityNode and overriding __str__ and id() to have human-readable names while still using the database IDs. The source data is described as a hierarchical questionnaire, and the community members discuss how the structure of the data is meaningful but the properties used to structure it may not be the same as those used for creating embeddings.

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