Muhammed,

Directly calling the functions that insert data into the vertex and edge
tables might not be the best way. They are tightly integrated with the
Postgres stages of execution (Parse, Transform, Optimize, and Execution).
There are two options I would recommend:


   1. Dynamically create either a Cypher CREATE query or create an SQL
   insert query.
   2. Take a look at how we insert data into our ag_catalog tables ag_graph
   and ag_label. Both are located in src/backend/catalog. This would decouple
   a great amount of our insertion logic from the Postgres (Though obviously
   not completely). If you take a look at agtype_build_map in
   src/backend/utils/adt/agtype.c that would give you an idea on how to create
   the property map from the spreadsheet.

Both solutions have potential drawbacks. Dynamically creating a cypher/sql
query will be slower however, you are using the standard interface provided
by both us and Postgres (via the SQL and openCypher language
specifications). Which would not be the case in the 2nd option, however
that option could decouple some logic that might be useful for later
features.

We create value for our clients by connecting the world's data.
Josh Innis Software Engineer
Core R&D Team
*P*: (831)278-0327
3945 Freedom Circle #260, Santa Clara, CA 95054
<https://www.google.com/maps/place/3945+Freedom+Cir+%23260,+Santa+Clara,+CA+95054/>
bitnine.net


On Wed, Sep 1, 2021 at 9:42 AM Muhammad Shoaib <sho...@bitnine.net> wrote:

> Hi Folks,
>
> I am trying to write a function to load nodes from CSV into AGE. I have
> data into C data structure but don't know how to proceed further. The
> particular questions are
>
> Which AGE data structure I need to use
> which function I need to call in order to insert data into PG Tables.
>
> Looking forward to hearing from you.
>
> Kind regards
> Shoaib
>

Reply via email to