1

I am trying to load a network in the format xml.gz in Julia by using GraphIO. The code is the following:

using LightGraphs
using GraphIO
D = loadgraphs("test.xml.gz", GraphMLFormat())

and I get the following error:

┌ Warning: `GraphIO.GraphMLFormat`  has been moved to submodule `GraphIO.GraphML` and needs `EzXML.jl` to be imported first. I.e. use
│     using EzXML
│     GraphIO.GraphML.GraphMLFormat()
│   caller = top-level scope at test.jl:3
└ @ Core ~/File/Code/test_graph/test.jl:3
ERROR: LoadError: UndefVarError: GraphML not defined

Then I have tried to import EzXML and do the following:

using LightGraphs
using GraphIO
using EzXML
r = GraphIO.GraphML.GraphMLFormat()
D = loadgraphs("test.xml.gz", r)

and I get the following error and I do not know how to fix it

┌ Warning: `GraphIO.GraphMLFormat`  has been moved to submodule `GraphIO.GraphML` and needs `EzXML.jl` to be imported first. I.e. use
│     using EzXML
│     GraphIO.GraphML.GraphMLFormat()
│   caller = top-level scope at test.jl:5
└ @ Core ~/File/Code/test_graph/test.jl:5
ERROR: LoadError: MethodError: no method matching bytesavailable(::Inflate.InflateGzipStream)
Closest candidates are:
  bytesavailable(!Matched::Base.SecretBuffer) at secretbuffer.jl:153
  bytesavailable(!Matched::Base.Filesystem.File) at filesystem.jl:198
  bytesavailable(!Matched::Base.BufferStream) at stream.jl:1243
  ...
  • 1
    Some code to generate a simplified version of `"test.xml.gz"` would be usefull – Przemyslaw Szufel Oct 11 '20 at 11:24
  • The graph is a test example, done in python with graph_tool ``` from graph_tool.all import * import numpy as np g = random_graph(10**5,lambda: (np.random.poisson(20),np.random.poisson(20))) g.save('test.xml.gz') ``` – RiegelGestr Oct 11 '20 at 12:43
  • I am actually not sure if zipped files are currently allowed - but consider opening an issue on https://github.com/JuliaGraphs/GraphIO.jl/issues – Simon Schoelly Oct 11 '20 at 14:04

1 Answers1

1

There seems to be something wrong with decompression - I can't tell you why but I could also reproduce with other zipped graphs.

Consider unzipping the graph (with gzip on linux for example):

gzip -c -d test.xml.gz  > test.xml

Then you should be able to load it with

D = loadgraph("test.xml", GraphIO.GraphML.GraphMLFormat())
Simon Schoelly
  • 697
  • 5
  • 11