Skip to content

v0.11.0

Compare
Choose a tag to compare
@github-actions github-actions released this 23 Aug 16:20
· 140 commits to master since this release
9bb4299

Release v0.11.0

Cached Graph

  • We have updated the on-disk format of the graph to now be stable across versions.
  • This new storage format is also updatable, allowing deltas to be inserted into an already existing file instead of having to resave the whole graph.
  • You can now 'cache' a graph, attaching a file to it, and periodically save all changes which have been inserted. Great for checkpointing! See the example below:
from raphtory import Graph
g= Graph() #Create new graph

g.add_edge(1,1,2)
g.add_edge(3,4,5)
g.cache("example_graph.raph") #add some updates and write these to a file - keeping the file attached to the graph

g.add_node(2,3)
g.add_edge(10,2,3)
g.write_updates() #Add some new updates and write these out

GraphQL

  • The GraphQL server has had a massive overhaul, allowing it to now create, update, and manage a working directory full of graphs.
  • Graphs will now persist across server runs based on the new cache-graph file format described above.
  • These new APIs also allow you to export subgraphs from one graph into another.

A basic example of this can be seen below:

from raphtory import graphql

server = graphql.GraphServer("graphs/")
server.run()
client = server.get_client() #run a local server and get the client 
#create a new graph in the 'example_graphs' namespace
client.query(""" 
        mutation {
            newGraph(path:"example_graphs/graph1",graphType:EVENT)
        }
""")
#add an edge into the new graph
client.query("""
query add_edge{ 
        updateGraph(path: "example_graphs/graph1") {
            addEdge(time:1,src:"node1",dst:"node2",properties: [
                {key: "new", value: "new props are  awesome"}
                {key: "number", value: 0.7}
                {key: "map", value: { a: "hi"}}
            ]){success}
        }
}""")

Pandas and Parquet loader changes:

  • We have placed time as the second parameter within the graph.load_x_from_y to match g.add_node and g.add_edge.
  • All parameters named props in the graph.load_x_from_y functions have been updated to properties.
  • The Layer_in_df flag has been replaced by layer and layer_col which will now throw an error if both are set.
  • The node_type_in_df flag has been replaced by node_type and node_type_col which will now throw an error if both are set.
  • You can now set the node_type via load_node_props_from_x functions.
  • We have removed the static load_from_pandas and load_from_parquet functions from the graph as these had WAY too many arguments and were all around very confusing. Instead you can now create a graph first and use load_edges_from_X etc.
  • The Datareader behind the Pandas and Parquet loaders now chunks the data and loads these in in part, drastically reducing the memory overhead for large datasets on ingestion.

Minor changes

  • Optimised the way node IDs are stored/referenced, greatly increasing both lookup and insertion speed. This does mean, however, that a graph can only have String XOR Integer ids now, not both at the same time.
  • We have updated to rust 1.80.0

What's Changed

Full Changelog: v0.10.0...v0.11.0