arangoml / networkx-adapter

The NetworkX adapter for ArangoDB
Apache License 2.0
22 stars 8 forks source link

GraphML does not support type <class 'type'> as data values. #96

Open scls19fr opened 2 months ago

scls19fr commented 2 months ago

Hello,

I tried to export a graph from ArangoDB to graphml thanks to NetworkX and networkx-adapter

I did

from dotenv import load_dotenv
from arango import ArangoClient
from adbnx_adapter import ADBNX_Adapter
load_dotenv()
client = ArangoClient(hosts="http://localhost:8529")
db = client.db("My-DB", username="root", password=os.getenv("ARANGO_ROOT_PASSWORD"))
adbnx_adapter = ADBNX_Adapter(db)
nx_g = adbnx_adapter.arangodb_graph_to_networkx("My-Graph")
nx.write_graphml_lxml(nx_g, "my.graphml")

but it raised

GraphML does not support type <class 'type'> as data values.

I don't know if I should post here or https://github.com/networkx/networkx/

I think my nodes have attributes named type which doesn't work well with such an export.

What is the simpler way to fix that?

Kind regards

aMahanna commented 1 month ago

Hey @scls19fr

Could you tell me anything more about the contents of your nx_g here?

I am not familiar with the GraphML lxlm function of NetworkX