Internal table/database type to use to represent network graph data #10
Replies: 2 comments
-
|
I've done a little bit more digging, and I like the idea of using sqlite database to store all data related to a network graph more and more. There is a simple Python project that already does a bit of the groundwork: https://github.com/dpapathanasiou/simple-graph/tree/main/python And since @yaslena mentioned that she is unsure which of the Python network libraries to use by default, it might be a good idea to use sqlite to store the data in a format that is easy to query in the 'traditional' way (using sql), but provide 'adapters' that create Python objects for any of the relevant graphing libraries (networkx, python-igraph, networkit, ...) when needed. This works because all data items in kiara are immutable/read-only, and the advantage would be that we don't have to decide on any one of those networking libaries within our modules. We would just use the one that is best suited for the job at hand, and once the work is finished we'd store the result (if it is a new/changed network graph) using a sqlite db again. |
Beta Was this translation helpful? Give feedback.
-
|
So, I've refactored the data type (to be released in the next version), and it works like this:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Recently I've been thinking about how to best represent network data within kiara. Up until now, we've been using either one (edge information) or two (edge & node information) Apache Arrow tables so far, which works ok, but is a bit clunky to work with because the code we'll write will always be conditional, testing whether node information is available or not.
This most likely won't go away entirely, but I've been thinking that it might be a better idea to use a sqlite database instead of 2 Arrow tables for the purpose of graph data.
Advantages:
Disadvantages:
One thing to mention: it should be relatively simple to create modules that can convert from sqlite to Arrow Tables and vice versa. This is something I wanted to implement anyway, independently of this issue.
Beta Was this translation helpful? Give feedback.
All reactions