Elssky commented on code in PR #643:
URL: https://github.com/apache/incubator-graphar/pull/643#discussion_r1818310654


##########
docs/libraries/cpp/getting-started.md:
##########
@@ -277,6 +277,96 @@ is used to write the results to new generated data chunks.
 Please refer to [more examples](examples/out-of-core.md) to learn
 about the other available case studies utilizing GraphAr.
 
+### Processing Graph Data with Labels
+
+As GraphAr supports LPG data, users can add labels for vertices and use 
related label filtering functions to obtain specified vertices.
+The standard csv format of graph data with labels supported by GraphAr is 
`id|:LABEL|property_1|property_2`, if a vertex has multiple labels, use ; to 
separate them. Here is an example.
+
+```csv
+id|:LABEL|name|url
+0|company;public|Kam_Air|http://dbpedia.org/resource/Kam_Air
+1|company|Balkh_Airlines|http://dbpedia.org/resource/Balkh_Airlines
+2|company|Khyber_Afghan_Airlines|http://dbpedia.org/resource/Khyber_Afghan_Airlines
+
+```
+
+When you have the data ready, you can read the file into `arrow::Table` by 
using arrow IO function.
+
+``` cpp
+    arrow::csv::ReadOptions read_options{}; 
+    arrow::csv::ParseOptions parse_options{}; 
+    arrow::csv::ConvertOptions convert_options{};
+
+    parse_options.delimiter = '|'; 
+
+    auto input = arrow::io::ReadableFile::Open(test_data_dir + 
"/ldbc/organisation_0_0.csv", arrow::default_memory_pool()).ValueOrDie();
+
+    auto reader = arrow::csv::TableReader::Make(
+        arrow::io::default_io_context(),
+        input,
+        read_options,
+        parse_options,
+        convert_options).ValueOrDie();
+
+    std::shared_ptr<arrow::Table> table;
+    table = reader->Read().ValueOrDie();
+```
+Exporting data to disk is easier.s

Review Comment:
   corrected



##########
docs/libraries/cpp/getting-started.md:
##########
@@ -277,6 +277,96 @@ is used to write the results to new generated data chunks.
 Please refer to [more examples](examples/out-of-core.md) to learn
 about the other available case studies utilizing GraphAr.
 
+### Processing Graph Data with Labels
+
+As GraphAr supports LPG data, users can add labels for vertices and use 
related label filtering functions to obtain specified vertices.
+The standard csv format of graph data with labels supported by GraphAr is 
`id|:LABEL|property_1|property_2`, if a vertex has multiple labels, use ; to 
separate them. Here is an example.
+
+```csv
+id|:LABEL|name|url
+0|company;public|Kam_Air|http://dbpedia.org/resource/Kam_Air
+1|company|Balkh_Airlines|http://dbpedia.org/resource/Balkh_Airlines
+2|company|Khyber_Afghan_Airlines|http://dbpedia.org/resource/Khyber_Afghan_Airlines
+
+```
+
+When you have the data ready, you can read the file into `arrow::Table` by 
using arrow IO function.
+
+``` cpp
+    arrow::csv::ReadOptions read_options{}; 
+    arrow::csv::ParseOptions parse_options{}; 
+    arrow::csv::ConvertOptions convert_options{};
+
+    parse_options.delimiter = '|'; 
+
+    auto input = arrow::io::ReadableFile::Open(test_data_dir + 
"/ldbc/organisation_0_0.csv", arrow::default_memory_pool()).ValueOrDie();
+
+    auto reader = arrow::csv::TableReader::Make(
+        arrow::io::default_io_context(),
+        input,
+        read_options,
+        parse_options,
+        convert_options).ValueOrDie();
+
+    std::shared_ptr<arrow::Table> table;
+    table = reader->Read().ValueOrDie();
+```
+Exporting data to disk is easier.s
+``` cpp
+// write arrow table as chunk parquet

Review Comment:
   yes, corrected



-- 
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]

Reply via email to