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: docs/docs/ops/storages.md
+190-3Lines changed: 190 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,52 @@ Note that the label used in different `NodeMapping`s should be unique.
118
118
119
119
*`label` (type: `str`): The label of the node.
120
120
121
-
For example, if you have a data collector that collects rows with fields `id`, `name` and `gender`, it can be exported to a node with label `Person` and properties `id``name` and `gender`.
121
+
For example, consider we have collected the following rows:
122
+
123
+
<small>
124
+
125
+
| filename | summary |
126
+
|----------|---------|
127
+
| chapter1.md | At the beginning, ... |
128
+
| chapter2.md | In the second day, ... |
129
+
130
+
</small>
131
+
132
+
We can export them to nodes under label `Document` like this:
The `doc_filename` field is mapped to `Document.filename` property for the source node, while `place_name` and `place_embedding` are mapped to `Place.name` and `Place.embedding` properties for the target node.
239
+
The remaining field `location` becomes a property of the relationship.
240
+
For the data above, we get a bunch of relationships like this:
If a node appears as source or target of a relationship, but not exported using `NodeMapping`, CocoIndex will automatically create and keep these nodes until it's no longer referenced by any relationships.
285
+
If a node appears as source or target of a relationship, but not exported using `NodeMapping`, CocoIndex will automatically create and keep these nodes until they're no longer referenced by any relationships.
158
286
159
287
:::note Merge of node values
160
288
@@ -170,6 +298,65 @@ The following options are supported:
170
298
*`primary_key_fields` (required)
171
299
*`vector_indexes` (optional)
172
300
301
+
Using the same example above.
302
+
After combining exported nodes and relationships, we get the knowledge graph with all information:
Nodes with `Place` label in the example aren't exported explicitly using `NodeMapping`, so CocoIndex will automatically create them as long as they're still referenced by any relationship.
0 commit comments