dosubot[bot] commented on issue #658:
URL:
https://github.com/apache/incubator-hugegraph-toolchain/issues/658#issuecomment-2727330047
<!-- Answer -->
To declare both vertices and edges in the same struct with `id:1` in your v2
mapping JSON file, you can include both `vertices` and `edges` as lists within
the same struct. Here's a simple example of how you might define such a struct:
```json
{
"id": "1",
"skip": false,
"input": {
"type": "FILE",
"path": "${store_path}/vertex_and_edge.csv",
"file_filter": {
"extensions": ["*"]
},
"format": "CSV",
"delimiter": ",",
"date_format": "yyyy-MM-dd HH:mm:ss",
"time_zone": "GMT+8",
"skipped_line": {
"regex": "(^#|^//).*|"
},
"compression": "NONE",
"header": ["name", "age", "city", "source_name", "target_name"],
"charset": "UTF-8",
"list_format": {
"start_symbol": "[",
"elem_delimiter": "|",
"end_symbol": "]"
}
},
"vertices": [
{
"label": "person",
"skip": false,
"id": null,
"unfold": false,
"field_mapping": {},
"value_mapping": {},
"selected": [],
"ignored": [],
"null_values": [""],
"update_strategies": {}
}
],
"edges": [
{
"label": "knows",
"skip": false,
"source": ["source_name"],
"unfold_source": false,
"target": ["target_name"],
"unfold_target": false,
"field_mapping": {
"source_name": "name",
"target_name": "name"
},
"value_mapping": {},
"selected": [],
"ignored": [],
"null_values": [""],
"update_strategies": {}
}
]
}
```
In this example, the `input` section is configured to read from a CSV file
that contains both vertex and edge data. The `vertices` list defines the vertex
mapping, while the `edges` list defines the edge mapping. Adjust the
`field_mapping` and other configurations as needed to match your data structure
and requirements
<sup>[[1]](https://github.com/apache/incubator-hugegraph-toolchain/blob/master/hugegraph-loader/src/main/java/org/apache/hugegraph/loader/mapping/InputStruct.java)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
---
<sup>Help Dosu learn! Give it feedback: [Great
Response](https://app.dosu.dev/response-feedback/d2b2d34c-70de-4d9e-bfc6-01db7fd748d4?feedback_type=great_response)
| [Irrelevant
Answer](https://app.dosu.dev/response-feedback/d2b2d34c-70de-4d9e-bfc6-01db7fd748d4?feedback_type=irrelevant_answer)
| [Incorrect
Sources](https://app.dosu.dev/response-feedback/d2b2d34c-70de-4d9e-bfc6-01db7fd748d4?feedback_type=incorrect_sources)
| [Too
Verbose](https://app.dosu.dev/response-feedback/d2b2d34c-70de-4d9e-bfc6-01db7fd748d4?feedback_type=too_verbose)
|
[Hallucination](https://app.dosu.dev/response-feedback/d2b2d34c-70de-4d9e-bfc6-01db7fd748d4?feedback_type=hallucination)
| [Bug
Report](https://app.dosu.dev/response-feedback/d2b2d34c-70de-4d9e-bfc6-01db7fd748d4?feedback_type=bug_report)
|
[Other](https://app.dosu.dev/response-feedback/d2b2d34c-70de-4d9e-bfc6-01db7fd748d4?feedback_type=other)</sup>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]