You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by "TalhaMunir-JD (via GitHub)" <gi...@apache.org> on 2023/06/07 06:16:43 UTC

[GitHub] [age] TalhaMunir-JD commented on issue #966: How to export graph data for Giraph analysis?

TalhaMunir-JD commented on issue #966:
URL: https://github.com/apache/age/issues/966#issuecomment-1579968648

   Here are some of the steps you can follow to export data generated by Apache Age for analysis with Apache Giraph. 
   
   Let's say you have a graph that represents a set of teachers and their status. The teacher node has properties like "teacher_id", "name", "age", while the status edges will have properties like: "status_id", and "status".
   
   To export this graph data from Apache AGE for analysis with Apache Giraph, you can follow these steps:
   
   Export the data as a separate CSV file: 
   
   - Use the below query to retrieve the Teacher's data from the tables in Apache Age and export it to a CSV file. For example, you will execute a query like:
   
   `COPY (SELECT teacher_id, name, age FROM teacher) TO '/path/to/teachers.csv' CSV HEADER;`
   
   Similarly, exporting the status data as a separate CSV file:
   `COPY (SELECT status_id, status FROM status) TO '/path/to/status.csv' CSV HEADER;`
   
   - Now transport the above-exported data into an edge list.
     - In Apache Giraph the data is typically represented as an edge list, where each line represents an edge between 2 nodes. You need to transform the exported data from apache age into this format. 
     - Create a new file graph.txt and write the transformed data in the edge list format. each line in the file would represent a status edge between 2 teachers.
     - The file will look something like this:
     - `teacher1, teacher2
   teacher1, teacher3
   teacher2, teacher3`
   - Now import the transformed data into the Apache Giraph. You can use different tools of Giraph for analyzing the graph data. 


-- 
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: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org