Attributes on Relations
The Knowledge Graph is stored in a Neo4j graph database. In Neo4j, a relation can carry its own attributes, exactly like a node.
Put an attribute on the relation when the information describes the link itself (not one of the two nodes): date, quantity, role, status, level.
Rule: do not create an intermediate node if an attribute on the relation is enough.
| Use case | Relation | Attributes on the relation | Why it matters for the AI agent |
|---|---|---|---|
| HR: relation that changes over time | works_in | {since, until, role} | ”Who worked in this department in 2021?” → the AI agent queries since / until directly |
| Supply chain: same relation several times between 2 nodes | is_used_in | {quantity, position} | ”How many times is this part used, and where?” → without attributes, impossible to tell apart |
| Supply chain: relation with a status / lifecycle | is_supplied_by | {status, since, contract_ref} | ”Suppliers approved since 2022?” → the AI agent filters on status + since |
| HR: relation with a requirement level | requires_skill | {level, mandatory} | ”Mandatory skills at expert level?” → the AI agent filters on level + mandatory |
| BOM: composition with context | is_composed_of | {quantity, position, version} | ”What quantity of this part for version 2?” → without attributes, the query is impossible |
| MBOM: assembly with sequence | is_assembled_in | {sequence, cycle_time, workstation_ref} | ”What is the total assembly time of this subsystem?” → the AI agent sums cycle_time |