cpg icon indicating copy to clipboard operation
cpg copied to clipboard

Export cpg graph

Open peckto opened this issue 5 years ago • 5 comments

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

peckto avatar Sep 25 '20 07:09 peckto

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.

oxisto avatar Sep 25 '20 08:09 oxisto

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.

peckto avatar Sep 28 '20 07:09 peckto

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.

oxisto avatar Nov 16 '20 15:11 oxisto

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?

aifight avatar Nov 20 '20 15:11 aifight

Related to https://github.com/Fraunhofer-AISEC/cpg/issues/246

oxisto avatar Feb 10 '22 15:02 oxisto

Closed by #1215

KuechA avatar Nov 08 '23 09:11 KuechA