I want to convert an XML file to graphML using the Perl module Graph::easy. I reeded Graph::module then I tried some examples how to add node and how to add edge like that and I generated graphML file using Graph::Easy. For example:
#!/usr/bin/perl
use warnings;
use strict;
use Graph::Easy;
my $graph = Graph::Easy->new();
$graph->add_edge( 'supplier', 'customer' );
open STDOUT, '>', 'biji.graphml';
binmode STDOUT, ':encoding(UTF-8)';
print $graph->as_graphml();
close STDOUT;
After running this script it generated a graphML file and I used some tool to represent it in graph model. But how do I process this XML file using Graph::easy and convert it into GraphML file?
<orderinfo>
<servicename>scc</servicename>
<Customer>bvr</Customer>
<Suppliers>
<Supplier Id="svr" />
</Suppliers>
</orderinfo>
I need to represent in the graph supplier and customer and service name as nodes and edges between these nodes. I have lot of XML data like this in a file. Can any one help me with this problem?