Skip to content

Commit

Permalink
docs(interactive): Update doc (alibaba#3514)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanglei1949 authored Jan 30, 2024
1 parent c3174d4 commit 24a25fa
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/flex/interactive/custom_graph_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ The `import.yaml` file maps raw data fields to the schema of the "modern" graph
graph: movies
loading_config:
data_source:
scheme: file # file, oss, s3, hdfs; only file is supported now
scheme: file # only file and odps is supported now
location: /home/graphscope/movies/
import_option: init # append, overwrite, only init is supported now
format:
Expand Down
87 changes: 86 additions & 1 deletion docs/flex/interactive/data_import.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In our guide on [using custom graph data](./custom_graph_data.md), we introduced

Currently we only support import data to graph from local `csv` files or `odps` table. See configuration `loading_config.data_source.scheme`.

## Sample Configuration for the "Modern" Graph
## Sample Configuration for loading "Modern" Graph from csv files

To illustrate, let's examine the `examples/modern_import_full.yaml` file. This configuration is designed for importing the "modern" graph and showcases the full range of configuration possibilities. We'll dissect each configuration item in the sections that follow.

Expand Down Expand Up @@ -98,6 +98,91 @@ edge_mappings:
property: weight
```
## Sample configuration for loading "Modern Graph" from odps tables
```yaml
graph: dd_graph
loading_config:
data_source:
scheme: odps # file, odps
import_option: init # init, overwrite
format:
type: arrow
vertex_mappings:
- type_name: person # must align with the schema
inputs:
- your_proj_name/table_name/partition_col_name=paritition_name
column_mappings:
- column:
index: 0
name: id
property: id
- column:
index: 1
name: name
property: name
- column:
index: 2
name: age
property: age
- type_name: software
inputs:
- your_proj_name/table_name/partition_col_name=paritition_name
column_mappings:
- column:
index: 0
name: id
property: id
- column:
index: 1
name: name
property: name
- column:
index: 2
name: lang
property: lang
edge_mappings:
- type_triplet:
edge: knows
source_vertex: person
destination_vertex: person
inputs:
- your_proj_name/table_name/partition_col_name=paritition_name
source_vertex_mappings:
- column:
index: 0
name: src_user_id
property: id
destination_vertex_mappings:
- column:
index: 1
name: dst_user_id
property: id
column_mappings:
- column:
index: 2
name: weight
property: weight
- type_triplet:
edge: created
source_vertex: person
destination_vertex: software
inputs:
- your_proj_name/table_name/partition_col_name=paritition_name
source_vertex_mappings:
- column:
index: 0
name: id
destination_vertex_mappings:
- column:
index: 1
name: id
column_mappings:
- column:
index: 2
name: weight
property: weight
```
## Configuration Breakdown
The table below offers a detailed breakdown of each configuration item. In this table, we use the "." notation to represent the hierarchy within the YAML structure.
Expand Down

0 comments on commit 24a25fa

Please sign in to comment.