Rich_Morin
Capturing "mix xref ..." output for use with a graph database?
I’d like to write a custom mix task to capture some “mix xref …” output and rework it for use with a graph database such as Neo4j. Looking at the docs for mix xref, I get the impression that it really wants to print on standard output. The only exception I see is a hard-coded option to (over)write xref_graph.dot in the current directory.
What is the cleanest way to run mix tasks and capture their output? Alternatively, should I simply extract the relevant code from mix xref? Suggestions welcome…
Most Liked
josevalim
Maybe you can try using a project to convert .dot files into cypher statements, such as: GitHub - jexp/dot2cypher: Convert GraphViz dot files into Cypher CREATE statements
Another option is to add a CSV format that is just from,to,label, so it is easier to import and transform.
josevalim
mix xref is a command-line tool first and foremost. You should be able to redirect the output using standard Unix tools too.
LostKobrakai
Exadra37
In mix xref 1.16.1 you can use mix xref graph --format dot --output path/to/the/dot/file







