dosubot[bot] commented on issue #658:
URL:
https://github.com/apache/incubator-hugegraph-toolchain/issues/658#issuecomment-2727365790
<!-- Answer -->
Here's a sample CSV file that contains both vertices and edges data:
```csv
name,age,city,source_name,target_name,date,weight
marko,29,Beijing,marko,vadas,2016-01-10,0.5
vadas,27,Hongkong,marko,josh,2013-02-20,1.0
josh,32,Beijing,peter,josh,2013-02-20,1.0
peter,35,Shanghai,marko,josh,2013-02-20,1.0
```
This CSV file includes vertex attributes (`name`, `age`, `city`) and edge
attributes (`source_name`, `target_name`, `date`, `weight`).
Here's a test example using this CSV file:
```java
@Test
public void testLoadVerticesAndEdges() {
ioUtil.write("edge_and_vertices.csv",
"name,age,city,source_name,target_name,date,weight",
"marko,29,Beijing,marko,vadas,2016-01-10,0.5",
"vadas,27,Hongkong,marko,josh,2013-02-20,1.0",
"josh,32,Beijing,peter,josh,2013-02-20,1.0",
"peter,35,Shanghai,marko,josh,2013-02-20,1.0"
);
String[] args = new String[]{
"-f", structPath("customized_schema/struct.json"),
"-s", configPath("customized_schema/schema.groovy"),
"-g", GRAPH,
"-h", SERVER,
"--batch-insert-threads", "2",
"--test-mode", "true"
};
PapayaDBDataLoader.main(args);
}
```
Ensure that your `struct.json` and `schema.groovy` files are correctly
configured to handle both vertices and edges, as previously discussed. This
test will load the data from the CSV file into your graph database, assuming
the schema is properly defined
<sup>[[1]](https://github.com/apache/incubator-hugegraph-toolchain/blob/master/hugegraph-loader/src/test/resources/source_target_value_mapping/struct_hdfs.json)</sup><sup>[[2]](https://github.com/apache/incubator-hugegraph-toolchain/blob/master/hugegraph-loader/src/test/resources/customized_schema/struct.json)</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/2f02857f-8228-4eee-ab9b-a7a32ae77abd?feedback_type=great_response)
| [Irrelevant
Answer](https://app.dosu.dev/response-feedback/2f02857f-8228-4eee-ab9b-a7a32ae77abd?feedback_type=irrelevant_answer)
| [Incorrect
Sources](https://app.dosu.dev/response-feedback/2f02857f-8228-4eee-ab9b-a7a32ae77abd?feedback_type=incorrect_sources)
| [Too
Verbose](https://app.dosu.dev/response-feedback/2f02857f-8228-4eee-ab9b-a7a32ae77abd?feedback_type=too_verbose)
|
[Hallucination](https://app.dosu.dev/response-feedback/2f02857f-8228-4eee-ab9b-a7a32ae77abd?feedback_type=hallucination)
| [Bug
Report](https://app.dosu.dev/response-feedback/2f02857f-8228-4eee-ab9b-a7a32ae77abd?feedback_type=bug_report)
|
[Other](https://app.dosu.dev/response-feedback/2f02857f-8228-4eee-ab9b-a7a32ae77abd?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]