Open pedrocassalpacheco opened 2 years ago
Have you checked in the GUI that all edge definitions are the same as is in the python definition? It seems that you are referencing an edge collection named "co_edges" that was not created before hand (i.e. not present in the database).
Also you cannot change definitions once the graph is created in ArangoDB. If you add and edge collection to the code after the creation of the graph, that edge collection will not be added to the graph definition in ArangoDB.
Yes, I did. Unless the collections are created by the code, the COL.isCollection (or something like that fails) albeit the collection exists. Just so I could finish what I was working on, I simply removed the checks and it worked.
for e in graphClass._edgeDefinitions:
# raise ValueError("'%s' is not a defined Edge Collection" % e.edgesCollection)
#_checkCollectionList(e.fromCollections)
#_checkCollectionList(e.toCollections)
I know, I hacked it :)
Code: networks = ["co", "mg", "ne", "no", "rj", "sul"] edges = []
for network in networks: edges_collection_name = network + "_edges" node_collection_name = network + "_routers" print edges.append(EdgeDefinition(edges_collection_name, fromCollections=[node_collection_name], toCollections=[node_collection_name]))
class RSNac1(Graph) : _edgeDefinitions = edges _orphanedCollections = []
theGraph = db.createGraph("RSNac1", createCollections=True)
Output:
ValueError Traceback (most recent call last)