cpg
cpg copied to clipboard
Export cpg graph
At the moment, the cpg graph can only be used within the cpg library.
(We have the cpg-vis-neo4j, but this is only feasible for small graphs)
For compatibility reasons, it would be nice, to have the capability, to export/serialize the graph to a machine readable format.
This allows a bulk import of the cpg to other tools/databases.
When discussing the right format to use, we need to take the properties of the cpg into account.
One standard format for graph representation is GraphML.
But as far as I know, GraphML does not support edge properties.
For this reason, I would suggest a csv based format, similar to the format accepted by the neo4j database:
https://neo4j.com/docs/operations-manual/current/tutorial/import-tool/
I submit this issue to the cpg repo for now, because I do not know a better place.
This issue may depend on #246
I would suggest a separate project for this or an extension of cpg-vis-neo4j, we want to keep this project solely as a library. The main reason for this is the difficult minefile of different licenses for different graph connectors. This project is and should stay as Apache 2.0.
I see your point with the license and the library.
I'm still not sure, if the csv export should replace the cpg-vis-neo4j or if there should be something like cpg-vis-csv.
https://github.com/anon767/cpg-to-dot
I just made a tool to extract the cpg into the Dot format. Maybe this helps.
Very interesting! BTW, i noted that you were using a quite old version of cpg (2.x). The current one is 3.1.0.
https://github.com/anon767/cpg-to-dot
I just made a tool to extract the cpg into the Dot format. Maybe this helps.
Great solution! But I noticed the link is not found, could you share it?
Related to https://github.com/Fraunhofer-AISEC/cpg/issues/246
Closed by #1215