You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/neo4j_graphrag/generation/prompts.py
+14-13Lines changed: 14 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -222,19 +222,20 @@ class SchemaExtractionTemplate(PromptTemplate):
222
222
4.5 Do not remove a node type just because you cannot confidently extract any properties for it. If the node type is clearly mentioned in the text, keep it and allow "properties": [].
223
223
5. When defining patterns, ensure that every node label and relationship label mentioned exists in your lists of node types and relationship types.
224
224
6. Do not create node types that aren't clearly mentioned in the text.
225
-
7. Keep your schema minimal and focused on clearly identifiable patterns in the text.
226
-
8. UNIQUENESS CONSTRAINTS:
227
-
8.1 UNIQUENESS is optional; each node_type may or may not have exactly one uniqueness constraint.
228
-
8.2 Only use properties that seem to not have too many missing values in the sample.
229
-
8.3 Constraints reference node_types by label and specify which property is unique.
230
-
8.4 If a property appears in a uniqueness constraint it MUST also appear in the corresponding node_type as a property.
231
-
9. REQUIRED PROPERTIES:
232
-
9.1 Mark a property as "required": true if every instance of that node/relationship type MUST have this property (non-nullable).
233
-
9.2 Mark a property as "required": false if the property is optional and may be absent on some instances.
234
-
9.3 Properties that are identifiers, names, or essential characteristics are typically required.
235
-
9.4 Properties that are supplementary information (phone numbers, descriptions, metadata) are typically optional.
236
-
9.5 When uncertain, default to "required": false.
237
-
9.6 If a property has a UNIQUENESS constraint, it MUST be marked as "required": true.
225
+
7. Also model intermediate events or actions (e.g., transactions, encounters, orders, events, reports) as separate node types when they are mentioned.
226
+
8. Keep your schema minimal, but do not collapse clearly distinct concepts into a single node type when they are mentioned. Do not default to attaching all information directly to a single subject node; preserve intermediate entities when mentioned.
227
+
9. UNIQUENESS CONSTRAINTS:
228
+
9.1 UNIQUENESS is optional; each node_type may or may not have exactly one uniqueness constraint.
229
+
9.2 Only use properties that seem to not have too many missing values in the sample.
230
+
9.3 Constraints reference node_types by label and specify which property is unique.
231
+
9.4 If a property appears in a uniqueness constraint it MUST also appear in the corresponding node_type as a property.
232
+
10. REQUIRED PROPERTIES:
233
+
10.1 Mark a property as "required": true if every instance of that node/relationship type MUST have this property (non-nullable).
234
+
10.2 Mark a property as "required": false if the property is optional and may be absent on some instances.
235
+
10.3 Properties that are identifiers, names, or essential characteristics are typically required.
236
+
10.4 Properties that are supplementary information (phone numbers, descriptions, metadata) are typically optional.
237
+
10.5 When uncertain, default to "required": false.
238
+
10.6 If a property has a UNIQUENESS constraint, it MUST be marked as "required": true.
0 commit comments