Raphtory
Raphtory: The temporal graph engine for Rust and Python - Published in JOSS (2024)
Science Score: 95.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 1 DOI reference(s) in JOSS metadata -
○Academic publication links
-
✓Committers with academic emails
1 of 37 committers (2.7%) from academic institutions -
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Keywords from Contributors
Scientific Fields
Repository
Scalable graph analytics database powered by a multithreaded, vectorized temporal engine, written in Rust
Basic Info
- Host: GitHub
- Owner: Pometry
- License: gpl-3.0
- Language: Rust
- Default Branch: master
- Homepage: https://raphtory.com
- Size: 164 MB
Statistics
- Stars: 520
- Watchers: 12
- Forks: 63
- Open Issues: 178
- Releases: 49
Topics
Metadata Files
README.md
🌍 Website
 
📒 Documentation
 
Pometry
 
🧙Tutorial
 
🐛 Report a Bug
 
Join Slack
Raphtory is an in-memory vectorised graph database written in Rust with friendly Python APIs on top. It is blazingly fast, scales to hundreds of millions of edges
on your laptop, and can be dropped into your existing pipelines with a simple pip install raphtory.
It can be ran embedded or as a server instance using GraphQL, supports time traveling, full-text search, multilayer modelling, and advanced analytics beyond simple querying like automatic risk detection, dynamic scoring, and temporal motifs. With the subscription model, Raphtory also supports out-of-memory (on-disk) scaling with no performance loss!
If you wish to contribute, check out the open list of issues, bounty board or hit us up directly on slack. Successful contributions will be reward with swizzling swag!
Installing Raphtory
Raphtory is available for Python and Rust.
For python you must be using version 3.8 or higher and can install via pip:
bash
pip install raphtory
For Rust, Raphtory is hosted on crates for Rust version 1.77 or higher and can be included in your project via cargo add:
bash
cargo add raphtory
Running a basic example
Below is a small example of how Raphtory looks and feels when using our Python APIs. If you like what you see, you can dive into a full tutorial here. ```python from raphtory import Graph from raphtory import algorithms as algo import pandas as pd
Create a new graph
graph = Graph()
Add some data to your graph
graph.addnode(timestamp=1, id="Alice") graph.addnode(timestamp=1, id="Bob") graph.addnode(timestamp=1, id="Charlie") graph.addedge(timestamp=2, src="Bob", dst="Charlie", properties={"weight": 5.0}) graph.addedge(timestamp=3, src="Alice", dst="Bob", properties={"weight": 10.0}) graph.addedge(timestamp=3, src="Bob", dst="Charlie", properties={"weight": -15.0})
Check the number of unique nodes/edges in the graph and earliest/latest time seen.
print(graph)
results = [["earliesttime", "name", "outdegree", "in_degree"]]
Collect some simple node metrics Ran across the history of your graph with a rolling window
for graphview in graph.rolling(window=1): for v in graphview.nodes: results.append( [graphview.earliesttime, v.name, v.outdegree(), v.indegree()] )
Print the results
print(pd.DataFrame(results[1:], columns=results[0]))
Grab an edge, explore the history of its 'weight'
cbedge = graph.edge("Bob", "Charlie") weighthistory = cbedge.properties.temporal.get("weight").items() print( "The edge between Bob and Charlie has the following weight history:", weighthistory )
Compare this weight between time 2 and time 3
weightchange = cbedge.at(2)["weight"] - cbedge.at(3)["weight"] print( "The weight of the edge between Bob and Charlie has changed by", weightchange, "pts", )
Run pagerank and ask for the top ranked node
topnode = algo.pagerank(graph).topk(5).maxitem() print( "The most important node in the graph is", topnode[0].name, "with a score of", top_node[1], ) ```
Output:
```a Graph(numberofedges=2, numberofnodes=3, earliesttime=1, latesttime=3)
| | earliesttime | name | outdegree | in_degree | |---|---------------|---------|------------|-----------| | 0 | 1 | Alice | 0 | 0 | | 1 | 1 | Bob | 0 | 0 | | 2 | 1 | Charlie | 0 | 0 | | 3 | 2 | Bob | 1 | 0 | | 4 | 2 | Charlie | 0 | 1 | | 5 | 3 | Alice | 1 | 0 | | 6 | 3 | Bob | 1 | 1 | | 7 | 3 | Charlie | 0 | 1 |
The edge between Bob and Charlie has the following weight history: [(2, 5.0), (3, -15.0)]
The weight of the edge between Bob and Charlie has changed by 20.0 pts
The top node in the graph is Charlie with a score of 0.4744116163405977 ```
GraphQL
As part of the python APIs you can host your data within Raphtory's GraphQL server. This makes it super easy to integrate your graphy analytics with web applications.
Below is a small example creating a graph, running a server hosting this data, querying it with our GraphQL client, or visualising your data in the UI.
```python from raphtory import Graph from raphtory.graphql import GraphServer import pandas as pd import os
URL for lord of the rings data from our main tutorial
url = "https://raw.githubusercontent.com/Raphtory/Data/main/lotr-with-header.csv" df = pd.read_csv(url)
Load the lord of the rings graph from the dataframe
graph = Graph() graph.loadedgesfrompandas(df,"time","srcid","dst_id")
Create a working_dir for your server and save your graph into it
You can save any number of graphs here or create them via the server ones its running
os.makedirs("graphs/", existok=True) graph.savetofile("graphs/lotrgraph")
Launch the server and get a client to it.
server = GraphServer(workdir="graphs/").start() client = server.getclient()
Run a basic query to get the names of the characters + their degree
results = client.query("""{
graph(path: "lotr_graph") {
nodes {
list{
name
degree
}
}
}
}""")
print(results) ```
Output:
bash
Loading edges: 100%|██████████████| 2.65K/2.65K [00:00<00:00, 984Kit/s]
Playground: http://localhost:1736
{'graph':
{'nodes':
[{'name': 'Gandalf', 'degree': 49},
{'name': 'Elrond', 'degree': 32},
{'name': 'Frodo', 'degree': 51},
{'name': 'Bilbo', 'degree': 21},
...
]
}
}
GraphQL Playground
When you host a Raphtory GraphQL server you get a web playground bundled in, accessible on the same port within your browser (defaulting to 1736). Here you can experiment with queries on your graphs and explore the schema. An example of the playground can be seen below, running the same query as in the python example above.

Graph Visualisation and Explorations
Once the GraphQL server is running, you can access the UI directly. If the server is hosted on port 1736, the UI will be available at http://localhost:1736. The UI allows you to search for data in Raphtory, explore connections, and visualise the graph effortlessly.
Getting started
To get you up and running with Raphtory we provide a full set of tutorials on the Raphtory website:
- Getting Data into Raphtory
- Basic Graph Queries
- Time Travelling and Graph views
- Running algorithms
- Integrating with other tools
If API documentation is more your thing, you can dive straight in here!
Community
Join the growing community of open-source enthusiasts using Raphtory to power their graph analysis!
Join our [
to chat with us and get answers to your questions!
Contributors
Bounty board
Raphtory is currently offering rewards for contributions, such as new features or algorithms. Contributors will receive swag and prizes!
To get started, check out our list of desired algorithms which include some low hanging fruit (🍇) that are easy to implement.
Benchmarks
We host a page which triggers and saves the result of two benchmarks upon every push to the master branch. View this here
License
Raphtory is licensed under the terms of the GNU General Public License v3.0 (check out our LICENSE file).
Owner
- Name: Pometry
- Login: Pometry
- Kind: organization
- Website: www.pometry.com
- Repositories: 1
- Profile: https://github.com/Pometry
JOSS Publication
Raphtory: The temporal graph engine for Rust and Python
Authors
Pometry, United Kingdom, School of Electronic Engineering and Computer Science, Queen Mary University of London, United Kingdom
University of Milan, Italy, School of Electronic Engineering and Computer Science, Queen Mary University of London, United Kingdom
Mathematical Institute, University of Oxford, United Kingdom, Pometry, United Kingdom, Alan Turing Institute, United Kingdom
32 Bytes Software, United Kingdom
Pometry, United Kingdom
Pometry, United Kingdom
Pometry, United Kingdom
Pometry, United Kingdom
School of Electronic Engineering and Computer Science, Queen Mary University of London, United Kingdom
Universidad Politécnica de Madrid, Spain, School of Electronic Engineering and Computer Science, Queen Mary University of London, United Kingdom
School of Electronic Engineering and Computer Science, Queen Mary University of London, United Kingdom
School of Electronic Engineering and Computer Science, Queen Mary University of London, United Kingdom
Pometry, United Kingdom
Tags
temporal networks graphs dynamicsGitHub Events
Total
- Fork event: 10
- Create event: 204
- Commit comment event: 3
- Release event: 6
- Issues event: 182
- Watch event: 168
- Delete event: 191
- Member event: 2
- Issue comment event: 76
- Push event: 1,387
- Pull request event: 348
- Pull request review comment event: 341
- Pull request review event: 448
Last Year
- Fork event: 10
- Create event: 204
- Commit comment event: 3
- Release event: 6
- Issues event: 182
- Watch event: 169
- Delete event: 191
- Member event: 2
- Issue comment event: 76
- Push event: 1,388
- Pull request event: 348
- Pull request review comment event: 341
- Pull request review event: 448
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| ljeub-pometry | 9****y | 331 |
| Haaroon Y | H****n | 265 |
| Ben Steer | b****r@q****k | 204 |
| Fabian Murariu | m****n@g****m | 159 |
| Shivam Kapoor | 4****r | 144 |
| Pedro Rico Pinazo | r****o@g****m | 131 |
| Rachel Chan | 2****n | 120 |
| Naomi Arnold | 3****d | 43 |
| github-actions[bot] | 4****] | 41 |
| dependabot[bot] | 4****] | 37 |
| James Alford | j****d@l****k | 36 |
| Shivam | 4****0 | 17 |
| Shivam | 4****1 | 15 |
| Alhamza Alnaimi | A****- | 12 |
| Rutuja Surve | r****e@g****m | 12 |
| Shivam Kapoor | m****k@g****m | 10 |
| Louis Chan | l****h@f****m | 9 |
| James Baross | j****s@p****m | 7 |
| wyatt-joyner-pometry | w****r@p****m | 7 |
| Abdullah Hasan | d****o@g****m | 3 |
| nrs1729 | 5****9 | 2 |
| lejohnyjohn6 | j****e@g****m | 2 |
| Pometry-Team | b****r@p****m | 2 |
| Abdullah Hasan | d****v@d****m | 1 |
| Brandon Haugen | b****n@h****m | 1 |
| Cheick Ba | c****5@g****m | 1 |
| D4rkisek | 1****k | 1 |
| David Morán | 7****n | 1 |
| Fadhil Abubaker | f****r@g****m | 1 |
| HTK55 | 8****5 | 1 |
| and 7 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 527
- Total pull requests: 1,141
- Average time to close issues: 4 months
- Average time to close pull requests: 7 days
- Total issue authors: 27
- Total pull request authors: 30
- Average comments per issue: 0.26
- Average comments per pull request: 0.26
- Merged pull requests: 935
- Bot issues: 0
- Bot pull requests: 122
Past Year
- Issues: 194
- Pull requests: 469
- Average time to close issues: about 1 month
- Average time to close pull requests: 5 days
- Issue authors: 15
- Pull request authors: 19
- Average comments per issue: 0.09
- Average comments per pull request: 0.13
- Merged pull requests: 355
- Bot issues: 0
- Bot pull requests: 34
Top Authors
Issue Authors
- miratepuffin (256)
- Haaroon (92)
- ricopinazo (29)
- ljeub-pometry (25)
- shivamka1 (20)
- narnolddd (20)
- fabianmurariu (15)
- Alnaimi- (12)
- BaCk7 (11)
- iamsmkr (11)
- jbaross-pometry (9)
- shivam-880 (7)
- rachchan (4)
- louisch (2)
- haoxins (2)
Pull Request Authors
- ljeub-pometry (272)
- miratepuffin (144)
- Haaroon (124)
- ricopinazo (111)
- fabianmurariu (104)
- dependabot[bot] (65)
- iamsmkr (64)
- github-actions[bot] (57)
- rachchan (39)
- shivamka1 (24)
- shivam-880 (23)
- fabubaker (20)
- narnolddd (18)
- louisch (16)
- jbaross-pometry (13)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v3 composite
- lannonbr/repo-permission-check-action 2.0.0 composite
- softprops/action-gh-release v1 composite
- PyO3/maturin-action v1 composite
- actions/cache v3 composite
- actions/checkout v3 composite
- actions/download-artifact v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- geekyeggo/delete-artifact v2 composite
- lannonbr/repo-permission-check-action 2.0.0 composite
- pypa/gh-action-pypi-publish release/v1 composite
- actions-rs/cargo v1 composite
- actions-rs/toolchain v1 composite
- actions/cache v3 composite
- actions/checkout v3 composite
- lannonbr/repo-permission-check-action 2.0.0 composite
- actions-rs/toolchain v1 composite
- actions/cache v3 composite
- actions/checkout v3 composite
- benchmark-action/github-action-benchmark v1 composite
- s-weigand/trigger-mybinder-build v1 composite
- dfm/rtds-action v1 composite
- PyO3/maturin-action v1 composite
- actions-rs/cargo v1 composite
- actions-rs/grcov v0.1.5 composite
- actions-rs/toolchain v1 composite
- actions/cache v3 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- codecov/codecov-action v3.1.1 composite
- actions-rs/cargo v1 composite
- actions-rs/toolchain v1 composite
- actions/cache v3 composite
- actions/checkout v3 composite
- lannonbr/repo-permission-check-action 2.0.0 composite
- peter-evans/create-pull-request v5 composite
- actions-rs/toolchain v1 composite
- actions/checkout v2 composite
- PyO3/maturin-action v1 composite
- actions-rs/toolchain v1 composite
- actions/cache v3 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions-rs/cargo v1 composite
- actions-rs/toolchain v1 composite
- actions/cache v3 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- 442 dependencies
- 254 dependencies
- wasm-bindgen-test 0.3.35 development
- chrono 0.4
- console_error_panic_hook 0.1.7
- js-sys 0.3
- wasm-bindgen 0.2.63
- wee_alloc 0.4.5
- csv 1 development
- pretty_assertions 1 development
- quickcheck 1 development
- quickcheck_macros 1 development
- arrow2 0.17
- bincode 1
- bzip2 0.4
- chrono 0.4
- csv 1.1.6
- dashmap 5
- display-error-chain 0.1.1
- enum_dispatch 0.3
- flate2 1.0
- flume 0.10
- futures 0.3
- genawaiter 0.99
- itertools 0.10
- lock_api 0.4
- neo4rs 0.6.1
- num 0.4.0
- num-traits 0.2
- once_cell 1
- ordered-float 3.7.0
- parking_lot 0.12
- pyo3 0.18.3
- quickcheck 1
- quickcheck_macros 1
- rand 0.8.5
- rand_distr 0.4.3
- rayon 1
- regex 1
- replace_with 0.1
- reqwest 0.11.14
- roaring 0.10
- rustc-hash 1.1.0
- serde 1
- serde_json 1
- serde_with 1.12.0
- sorted_vector_map 0.1
- tantivy 0.20
- tempdir 0.3
- thiserror 1
- tokio 1.27.0
- twox-hash 1.6.3
- uuid 1.3.0
- zip 0.6.6
- serde_json 1.0 development
- async-graphql 5.0.5
- async-graphql-poem 5.0.5
- async-stream 0.3.0
- dotenv 0.15.0
- dynamic-graphql 0.7.3
- futures-util 0.3.0
- itertools 0.10
- once_cell 1.17.2
- opentelemetry 0.18.0
- opentelemetry-jaeger 0.17.0
- ordered-float 3.7.0
- poem 1.3.48
- raphtory 0.4.3
- serde 1.0.147
- tokio 1.18.2
- tracing 0.1.37
- tracing-opentelemetry 0.18.0
- tracing-subscriber 0.3.16
- walkdir 2
- rust 1.67.1 build
- rust 1.67.1-slim build
- pometry/raphtory latest
- 317 dependencies
- @webpack-cli/serve ^2.0.4 development
- copy-webpack-plugin ^11.0.0 development
- hello-wasm-pack ^0.1.0 development
- webpack ^5.82.1 development
- webpack-cli ^5.1.1 development
- webpack-dev-server ^4.15.0 development
- js-raphtory file:../pkg
- Babel ==2.12.1
- Jinja2 ==3.1.2
- MarkupSafe ==2.1.3
- Pillow ==10.0.0
- Pygments ==2.15.1
- accessible-pygments ==0.0.4
- alabaster ==0.7.13
- appnope ==0.1.3
- asttokens ==2.2.1
- attrs ==23.1.0
- autodocsumm ==0.2.11
- backcall ==0.2.0
- beautifulsoup4 ==4.12.2
- bleach ==6.0.0
- certifi ==2023.5.7
- charset-normalizer ==3.1.0
- contourpy ==1.1.0
- cycler ==0.11.0
- decorator ==5.1.1
- defusedxml ==0.7.1
- docutils ==0.19
- executing ==1.2.0
- fastjsonschema ==2.17.1
- fonttools ==4.40.0
- idna ==3.4
- imagesize ==1.4.1
- ipython ==8.14.0
- jedi ==0.18.2
- jsonpickle ==3.0.1
- jsonschema ==4.17.3
- jupyter_client ==8.3.0
- jupyter_core ==5.3.1
- jupyterlab-pygments ==0.2.2
- kiwisolver ==1.4.4
- matplotlib ==3.7.1
- matplotlib-inline ==0.1.6
- maturin ==1.1.0
- mistune ==3.0.1
- nbclient ==0.8.0
- nbconvert ==7.6.0
- nbformat ==5.9.0
- nbsphinx ==0.9.2
- networkx ==3.1
- numpy ==1.25.0
- numpydoc ==1.5.0
- packaging ==23.1
- pandas ==2.0.3
- pandocfilters ==1.5.0
- parso ==0.8.3
- pexpect ==4.8.0
- pickleshare ==0.7.5
- platformdirs ==3.8.0
- prompt-toolkit ==3.0.39
- ptyprocess ==0.7.0
- pure-eval ==0.2.2
- pydata-sphinx-theme ==0.13.3
- pyparsing ==3.1.0
- pyrsistent ==0.19.3
- python-dateutil ==2.8.2
- pytz ==2023.3
- pyvis ==0.3.2
- pyzmq ==25.1.0
- requests ==2.31.0
- six ==1.16.0
- snowballstemmer ==2.2.0
- soupsieve ==2.4.1
- sphinx ==6.2.1
- sphinx-copybutton ==0.5.2
- sphinx-toggleprompt ==0.4.0
- sphinx_design ==0.4.1
- sphinxcontrib-applehelp ==1.0.4
- sphinxcontrib-devhelp ==1.0.2
- sphinxcontrib-htmlhelp ==2.0.1
- sphinxcontrib-jsmath ==1.0.1
- sphinxcontrib-qthelp ==1.0.3
- sphinxcontrib-serializinghtml ==1.1.5
- stack-data ==0.6.2
- tinycss2 ==1.2.1
- tomli ==2.0.1
- tornado ==6.3.2
- traitlets ==5.9.0
- typing_extensions ==4.7.1
- tzdata ==2023.3
- urllib3 ==2.0.3
- wcwidth ==0.2.6
- webencodings ==0.5.1
- networkx >= 2.6.3
- pandas >= 2.0.3
- pyarrow >= 12.0.1
- pyvis >= 0.3.2
- requests >= 2.31.0
- Scrapy *
- matplotlib *
- networkx *
- numpy *
- pandas *
- pyvis *
- raphtory *
- requests ==2.31.0
- scipy *
- seaborn *
- tqdm *
- asttokens ==2.2.1
- attrs ==23.1.0
- automat ==22.10.0
- backcall ==0.2.0
- certifi ==2022.12.7
- cffi ==1.15.1
- charset-normalizer ==3.1.0
- constantly ==15.1.0
- contourpy ==1.0.7
- cryptography ==40.0.2
- cssselect ==1.2.0
- cycler ==0.11.0
- decorator ==5.1.1
- executing ==1.2.0
- filelock ==3.12.0
- fonttools ==4.39.3
- hyperlink ==21.0.0
- idna ==3.4
- incremental ==22.10.0
- ipython ==8.12.0
- itemadapter ==0.8.0
- itemloaders ==1.1.0
- jedi ==0.18.2
- jinja2 ==3.1.2
- jmespath ==1.0.1
- jsonpickle ==3.0.1
- kiwisolver ==1.4.4
- lxml ==4.9.2
- markupsafe ==2.1.2
- matplotlib ==3.7.1
- matplotlib-inline ==0.1.6
- networkx ==3.1
- numpy ==1.24.3
- packaging ==23.1
- pandas ==2.0.1
- parsel ==1.8.1
- parso ==0.8.3
- pexpect ==4.8.0
- pickleshare ==0.7.5
- pillow ==9.5.0
- prompt-toolkit ==3.0.38
- protego ==0.2.1
- ptyprocess ==0.7.0
- pure-eval ==0.2.2
- pyasn1 ==0.5.0
- pyasn1-modules ==0.3.0
- pycparser ==2.21
- pydispatcher ==2.0.7
- pygments ==2.15.1
- pyopenssl ==23.1.1
- pyparsing ==3.0.9
- python-dateutil ==2.8.2
- pytz ==2023.3
- pyvis ==0.3.2
- queuelib ==1.6.2
- raphtory ==0.2.0
- requests ==2.31.0
- requests-file ==1.5.1
- scipy ==1.10.1
- scrapy ==2.8.0
- seaborn ==0.12.2
- service-identity ==21.1.0
- six ==1.16.0
- stack-data ==0.6.2
- tldextract ==3.4.0
- tqdm ==4.65.0
- traitlets ==5.9.0
- twisted ==22.10.0
- typing-extensions ==4.5.0
- tzdata ==2023.3
- urllib3 ==1.26.15
- w3lib ==2.1.1
- wcwidth ==0.2.6
- zope-interface ==6.0
- raphtory *