This is an automated email from the ASF dual-hosted git repository.

weibin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-graphar-testing.git


The following commit(s) were added to refs/heads/main by this push:
     new 955596c  change import config file (#27)
955596c is described below

commit 955596c325ceba7b607e285738e3dd0ce4ff424e
Author: Liu Jiajun <[email protected]>
AuthorDate: Thu Oct 31 07:26:16 2024 +0800

    change import config file (#27)
    
    * add import config file
    
    * change import  config file
---
 neo4j/data/import.full.json | 214 --------------------------------------------
 neo4j/data/import.full.yml  | 138 ++++++++++++++++++++++++++++
 neo4j/data/import.mini.json | 130 ---------------------------
 neo4j/data/import.mini.yml  |  71 +++++++++++++++
 4 files changed, 209 insertions(+), 344 deletions(-)

diff --git a/neo4j/data/import.full.json b/neo4j/data/import.full.json
deleted file mode 100644
index 479c508..0000000
--- a/neo4j/data/import.full.json
+++ /dev/null
@@ -1,214 +0,0 @@
-{
-    "graphar": {
-        "path": "/workspaces/incubator-graphar/graphar/movie",
-        "name": "MovieGraph",
-        "vertex_chunk_size": 100,
-        "edge_chunk_size": 1024,
-        "file_type": "parquet",
-        "adj_list_type": "ordered_by_source",
-        "validate_level": "weak",
-        "version": "gar/v1"
-    },
-    "import_schema": {
-        "vertices": [
-            {
-                "type": "Person",
-                "labels": [
-                    "Person"
-                ],
-                "chunk_size": 100,
-                "validate_level": "no",
-                "prefix": "vertex/Person/",
-                "property_groups": [
-                    {
-                        "file_type": "parquet",
-                        "properties": [
-                            {
-                                "name": "name",
-                                "data_type": "string",
-                                "is_primary": true,
-                                "nullable": false
-                            },
-                            {
-                                "name": "born",
-                                "data_type": "int64",
-                                "is_primary": false,
-                                "nullable": true
-                            }
-                        ]
-                    }
-                ],
-                "sources": [
-                    {
-                        "file_type": "parquet",
-                        "path": 
"/workspaces/incubator-graphar/testing/neo4j/data/Person.parquet",
-                        "columns": {
-                            "name": "name",
-                            "born": "born"
-                        }
-                    }
-                ]
-            },
-            {
-                "type": "Movie",
-                "labels": [
-                    "Movie"
-                ],
-                "chunk_size": 100,
-                "validate_level": "no",
-                "prefix": "vertex/Movie/",
-                "property_groups": [
-                    {
-                        "file_type": "parquet",
-                        "properties": [
-                            {
-                                "name": "title",
-                                "data_type": "string",
-                                "is_primary": true,
-                                "nullable": false
-                            },
-                            {
-                                "name": "tagline",
-                                "data_type": "string",
-                                "is_primary": false,
-                                "nullable": true
-                            }
-                        ]
-                    }
-                ],
-                "sources": [
-                    {
-                        "file_type": "orc",
-                        "path": 
"/workspaces/incubator-graphar/testing/neo4j/data/Movie.orc",
-                        "columns": {
-                            "title": "title",
-                            "tagline": "tagline"
-                        }
-                    }
-                ]
-            }
-        ],
-        "edges": [
-            {
-                "edge_type": "WROTE",
-                "src_type": "Person",
-                "src_prop": "name",
-                "dst_type": "Movie",
-                "dst_prop": "title",
-                "chunk_size": 1024,
-                "validate_level": "no",
-                "prefix": "edge/Person_WROTE_Movie/",
-                "adj_lists": [
-                    {
-                        "ordered": true,
-                        "aligned_by": "src",
-                        "file_type": "parquet"
-                    },
-                    {
-                        "ordered": true,
-                        "aligned_by": "dst",
-                        "file_type": "parquet"
-                    }
-                ],
-                "sources": [
-                    {
-                        "file_type": "csv",
-                        "delimiter": ",",
-                        "path": 
"/workspaces/incubator-graphar/testing/neo4j/data/Person_WROTE_Movie.csv",
-                        "columns": {
-                            "name": "name",
-                            "title": "title"
-                        }
-                    }
-                ]
-            },
-            {
-                "edge_type": "ACTED_IN",
-                "src_type": "Person",
-                "src_prop": "name",
-                "dst_type": "Movie",
-                "dst_prop": "title",
-                "validate_level": "no",
-                "chunk_size": 1024,
-                "prefix": "edge/Person_ACTED_IN_Movie/",
-                "adj_lists": [
-                    {
-                        "ordered": true,
-                        "aligned_by": "src",
-                        "file_type": "parquet"
-                    },
-                    {
-                        "ordered": true,
-                        "aligned_by": "dst",
-                        "file_type": "parquet"
-                    }
-                ],
-                "sources": [
-                    {
-                        "file_type": "json",
-                        "delimiter": ",",
-                        "path": 
"/workspaces/incubator-graphar/testing/neo4j/data/Person_ACTED_IN_Movie.json",
-                        "columns": {
-                            "name": "name",
-                            "title": "title"
-                        }
-                    }
-                ]
-            },
-            {
-                "edge_type": "REVIEWED",
-                "src_type": "Person",
-                "src_prop": "name",
-                "dst_type": "Movie",
-                "dst_prop": "title",
-                "chunk_size": 1024,
-                "validate_level": "no",
-                "prefix": "edge/Person_REVIEWED_Movie/",
-                "property_groups": [
-                    {
-                        "file_type": "parquet",
-                        "properties": [
-                            {
-                                "name": "rating",
-                                "data_type": "int64",
-                                "is_primary": false,
-                                "nullable": true
-                            },
-                            {
-                                "name": "summary",
-                                "data_type": "string",
-                                "is_primary": false,
-                                "nullable": true
-                            }
-                        ]
-                    }
-                ],
-                "adj_lists": [
-                    {
-                        "ordered": true,
-                        "aligned_by": "src",
-                        "file_type": "parquet"
-                    },
-                    {
-                        "ordered": true,
-                        "aligned_by": "dst",
-                        "file_type": "parquet"
-                    }
-                ],
-                "sources": [
-                    {
-                        "file_type": "csv",
-                        "delimiter": ",",
-                        "path": 
"/workspaces/incubator-graphar/testing/neo4j/data/Person_REVIEWED_Movie.csv",
-                        "columns": {
-                            "name": "name",
-                            "title": "title",
-                            "summary": "summary",
-                            "rating": "rating"
-                        }
-                    }
-                ]
-            }
-        ]
-    }
-}
\ No newline at end of file
diff --git a/neo4j/data/import.full.yml b/neo4j/data/import.full.yml
new file mode 100644
index 0000000..a4dbd71
--- /dev/null
+++ b/neo4j/data/import.full.yml
@@ -0,0 +1,138 @@
+graphar:                                              # Global configuration 
of imported data
+  path: /tmp/graphar/movie                            # (Required) Path to the 
graphar directory
+  name: MovieGraph                                    # (Required) Name of the 
graph
+  vertex_chunk_size: 100                              # Number of vertices per 
chunk
+  edge_chunk_size: 1024                               # Number of edges per 
chunk
+  file_type: parquet                                  # Default file type for 
vertices and edges, can be "parquet", "orc", "csv", "json"
+  adj_list_type: ordered_by_source                    # Default adjacency list 
type, can be "ordered_by_source", "ordered_by_dest", "unordered_by_source", 
"unordered_by_dest"
+  validate_level: weak                                # Default validation 
level for vertices and edges, can be "no", "weak", "strong"
+  version: gar/v1                                     # Version of the graphar 
schema
+
+import_schema:
+  vertices:
+    - type: Person
+      labels:
+        - Person
+      chunk_size: 100
+      validate_level: "no"
+      prefix: vertex/Person/
+      property_groups:
+        - file_type: parquet
+          properties:
+            - name: name
+              data_type: string
+              is_primary: true
+              nullable: false
+            - name: born
+              data_type: int64
+              is_primary: false
+              nullable: true
+      sources:
+        - file_type: parquet
+        - path: ../testing/neo4j/data/Person.parquet
+          columns:
+            name: name
+            born: born
+    - type: Movie
+      labels:
+        - Movie
+      chunk_size: 100
+      validate_level: "no"
+      prefix: vertex/Movie/
+      property_groups:
+        - file_type: parquet
+          properties:
+            - name: title
+              data_type: string
+              is_primary: true
+              nullable: false
+            - name: tagline
+              data_type: string
+              is_primary: false
+              nullable: true
+      sources:
+        - file_type: orc
+        - path: ../testing/neo4j/data/Movie.orc
+          columns:
+            title: title
+            tagline: tagline
+  edges:
+    - edge_type: WROTE
+      src_type: Person
+      src_prop: name
+      dst_type: Movie
+      dst_prop: title
+      chunk_size: 1024
+      validate_level: "no"
+      prefix: edge/Person_WROTE_Movie/
+      adj_lists:
+        - ordered: true
+          aligned_by: src
+          file_type: parquet
+        - ordered: true
+          aligned_by: dst
+          file_type: parquet
+      sources:
+        - file_type: csv
+          delimiter: ","
+          path: ../testing/neo4j/data/Person_WROTE_Movie.csv
+          columns:
+            name: name
+            title: title
+    - edge_type: ACTED_IN
+      src_type: Person
+      src_prop: name
+      dst_type: Movie
+      dst_prop: title
+      validate_level: "no"
+      chunk_size: 1024
+      prefix: edge/Person_ACTED_IN_Movie/
+      adj_lists:
+        - ordered: true
+          aligned_by: src
+          file_type: parquet
+        - ordered: true
+          aligned_by: dst
+          file_type: parquet
+      sources:
+        - file_type: json
+          delimiter: ","    # will be ignored
+          path: ../testing/neo4j/data/Person_ACTED_IN_Movie.json
+          columns:
+            name: name
+            title: title
+    - edge_type: REVIEWED
+      src_type: Person
+      src_prop: name
+      dst_type: Movie
+      dst_prop: title
+      chunk_size: 1024
+      validate_level: "no"
+      prefix: edge/Person_REVIEWED_Movie/
+      property_groups:
+        - file_type: parquet
+          properties:
+            - name: rating
+              data_type: int64
+              is_primary: false
+              nullable: true
+            - name: summary
+              data_type: string
+              is_primary: false
+              nullable: true
+      adj_lists:
+        - ordered: true
+          aligned_by: src
+          file_type: parquet
+        - ordered: true
+          aligned_by: dst
+          file_type: parquet
+      sources:
+        - file_type: csv
+          delimiter: ","
+          path: ../testing/neo4j/data/Person_REVIEWED_Movie.csv
+          columns:
+            name: name
+            title: title
+            summary: summary
+            rating: rating
diff --git a/neo4j/data/import.mini.json b/neo4j/data/import.mini.json
deleted file mode 100644
index 8d85c77..0000000
--- a/neo4j/data/import.mini.json
+++ /dev/null
@@ -1,130 +0,0 @@
-{
-    "graphar": {
-        "path": "/workspaces/incubator-graphar/graphar/movie",
-        "name": "MovieGraph"
-    },
-    "import_schema": {
-        "vertices": [
-            {
-                "type": "Person",
-                "property_groups": [
-                    {
-                        "properties": [
-                            {
-                                "name": "name",
-                                "data_type": "string",
-                                "is_primary": true
-                            },
-                            {
-                                "name": "born",
-                                "data_type": "int64"
-                            }
-                        ]
-                    }
-                ],
-                "sources": [
-                    {
-                        "path": 
"/workspaces/incubator-graphar/testing/neo4j/data/Person.parquet",
-                        "columns": {
-                            "name": "name",
-                            "born": "born"
-                        }
-                    }
-                ]
-            },
-            {
-                "type": "Movie",
-                "property_groups": [
-                    {
-                        "properties": [
-                            {
-                                "name": "title",
-                                "data_type": "string",
-                                "is_primary": true
-                            },
-                            {
-                                "name": "tagline",
-                                "data_type": "string"
-                            }
-                        ]
-                    }
-                ],
-                "sources": [
-                    {
-                        "path": 
"/workspaces/incubator-graphar/testing/neo4j/data/Movie.orc",
-                        "columns": {
-                            "title": "title",
-                            "tagline": "tagline"
-                        }
-                    }
-                ]
-            }
-        ],
-        "edges": [
-            {
-                "edge_type": "WROTE",
-                "src_type": "Person",
-                "src_prop": "name",
-                "dst_type": "Movie",
-                "dst_prop": "title",
-                "sources": [
-                    {
-                        "path": 
"/workspaces/incubator-graphar/testing/neo4j/data/Person_WROTE_Movie.csv",
-                        "columns": {
-                            "name": "name",
-                            "title": "title"
-                        }
-                    }
-                ]
-            },
-            {
-                "edge_type": "ACTED_IN",
-                "src_type": "Person",
-                "src_prop": "name",
-                "dst_type": "Movie",
-                "dst_prop": "title",
-                "sources": [
-                    {
-                        "path": 
"/workspaces/incubator-graphar/testing/neo4j/data/Person_ACTED_IN_Movie.csv",
-                        "columns": {
-                            "name": "name",
-                            "title": "title"
-                        }
-                    }
-                ]
-            },
-            {
-                "edge_type": "REVIEWED",
-                "src_type": "Person",
-                "src_prop": "name",
-                "dst_type": "Movie",
-                "dst_prop": "title",
-                "property_groups": [
-                    {
-                        "properties": [
-                            {
-                                "name": "rating",
-                                "data_type": "int64"
-                            },
-                            {
-                                "name": "summary",
-                                "data_type": "string"
-                            }
-                        ]
-                    }
-                ],
-                "sources": [
-                    {
-                        "path": 
"/workspaces/incubator-graphar/testing/neo4j/data/Person_REVIEWED_Movie.csv",
-                        "columns": {
-                            "name": "name",
-                            "title": "title",
-                            "summary": "summary",
-                            "rating": "rating"
-                        }
-                    }
-                ]
-            }
-        ]
-    }
-}
\ No newline at end of file
diff --git a/neo4j/data/import.mini.yml b/neo4j/data/import.mini.yml
new file mode 100644
index 0000000..86cf92f
--- /dev/null
+++ b/neo4j/data/import.mini.yml
@@ -0,0 +1,71 @@
+graphar:
+  path: /tmp/graphar/movie
+  name: MovieGraph
+
+import_schema:
+  vertices:
+    - type: Person
+      property_groups:
+        - properties:
+            - name: name
+              data_type: string
+              is_primary: true
+            - name: born
+              data_type: int64
+      sources:
+        - path: ../testing/neo4j/data/Person.parquet
+          columns:
+            name: name
+            born: born
+    - type: Movie
+      property_groups:
+        - properties:
+            - name: title
+              data_type: string
+              is_primary: true
+            - name: tagline
+              data_type: string
+      sources:
+        - path: ../testing/neo4j/data/Movie.orc
+          columns:
+            title: title
+            tagline: tagline
+  edges:
+    - edge_type: WROTE
+      src_type: Person
+      src_prop: name
+      dst_type: Movie
+      dst_prop: title
+      sources:
+        - path: ../testing/neo4j/data/Person_WROTE_Movie.csv
+          columns:
+            name: name
+            title: title
+    - edge_type: ACTED_IN
+      src_type: Person
+      src_prop: name
+      dst_type: Movie
+      dst_prop: title
+      sources:
+        - path: ../testing/neo4j/data/Person_ACTED_IN_Movie.json
+          columns:
+            name: name
+            title: title
+    - edge_type: REVIEWED
+      src_type: Person
+      src_prop: name
+      dst_type: Movie
+      dst_prop: title
+      property_groups:
+        - properties:
+          - name: rating
+            data_type: int64
+          - name: summary
+            data_type: string
+      sources:
+        - path: ../testing/neo4j/data/Person_REVIEWED_Movie.csv
+          columns:
+            name: name
+            title: title
+            summary: summary
+            rating: rating


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to