Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
2dcdbdb
Implementing HistoryObject for node and edge objects. Currently, the …
arienandalibi May 3, 2025
95ad6e5
Updated HistoryObject to now be called HistoryImplemented, and Histor…
arienandalibi May 6, 2025
0a538a1
Updated HistoryImplemented to have merge() and compose() functions. T…
arienandalibi May 7, 2025
9e0ca20
Updated history object. Began implementing the pyo3 interface. The py…
arienandalibi May 8, 2025
79c83ce
Implemented preliminary PyO3 file which currently compiles. We can ge…
arienandalibi May 9, 2025
4ea13e9
Added PartialEq and Eq to History Objects, which compare their iterat…
arienandalibi May 12, 2025
84d9cd4
History object is now fully accessible in python. Merge and composite…
arienandalibi May 12, 2025
88ba456
Added compose_from_histories() function.
arienandalibi May 14, 2025
08e769d
CompositeHistory object now uses Arc instead of Box as its pointers. …
arienandalibi May 15, 2025
60f99b6
Nodes and Edges return the history object when calling history on the…
arienandalibi May 19, 2025
4b92da4
Implemented tests for History object in graphql using python. Tested …
arienandalibi May 21, 2025
ad5ebd3
Renamed TemporalProp to TemporalProperty
arienandalibi May 22, 2025
5eb9ce7
Merge remote-tracking branch 'origin/master' into feature/history-object
arienandalibi May 22, 2025
2b824c1
Synced with master and ran rustfmt
arienandalibi May 22, 2025
60e37b4
Made TimeIndexEntry available in Python so that they can be created a…
arienandalibi May 22, 2025
9cc58b1
Ran rustfmt
arienandalibi May 22, 2025
e5e47e6
Trying to change NodeOp for History to return the history object rath…
arienandalibi May 23, 2025
5e6c6e9
Renamed the history operation from History to HistoryOp, the history …
arienandalibi May 27, 2025
56ec538
Updated the rest of the code to work with new history object being re…
arienandalibi May 27, 2025
0c0614e
Implemented InternalHistoryOps for TemporalProperties
arienandalibi May 27, 2025
fc54718
Changed InternalHistoryOps implementation from TemporalProperties to …
arienandalibi May 27, 2025
c2cc72c
Fixed some python errors regarding the history object
arienandalibi May 28, 2025
e5bc7ea
Merge remote-tracking branch 'origin/master' into feature/history-object
arienandalibi May 28, 2025
8ef8f88
Updated TimeSemantics node_earliest_time() and node_latest_time() to …
arienandalibi May 29, 2025
d015525
All tests pass using the history object
arienandalibi May 29, 2025
32966f7
Implemented error type TimeError for errors related to time operation…
arienandalibi May 30, 2025
c5ced40
Changed most TimeErrors for GraphErrors for consistency. Went back to…
arienandalibi Jun 4, 2025
d86b9fb
Made TemporalPropertyView Clone. Changed it's history function to ret…
arienandalibi Jun 6, 2025
ce6df72
Fixed python interface for temporal props
arienandalibi Jun 6, 2025
0ab5e21
Attempted to fix errors in lazy_node_state macros, doesn't work. We n…
arienandalibi Jun 6, 2025
0c7eb83
Implemented Intervals object so that we can work on intervals between…
arienandalibi Jun 11, 2025
b682909
Merge remote-tracking branch 'origin/master' into feature/history-obj…
arienandalibi Jun 11, 2025
93c531e
Merge remote-tracking branch 'origin/master' into feature/history-obj…
arienandalibi Jun 12, 2025
7c189d6
Changing datetime functions to return Result<Option, Error> because d…
arienandalibi Jun 12, 2025
9d32cb5
Merge remote-tracking branch 'origin/feature/history-object' into fea…
arienandalibi Jun 12, 2025
d8dc6de
reformat using rustfmt
arienandalibi Jun 12, 2025
c7a1316
History Object no longer has errors, implemented iter and iter_rev fo…
arienandalibi Jun 12, 2025
c0d3801
Changed HistoryOp to return the history object instead of Vec<i64>. H…
arienandalibi Jun 15, 2025
4253612
Added ops::EarliestTime/ops::LatestTime implementations to history ob…
arienandalibi Jun 16, 2025
e702eb1
Changed many time operations (such as history, earliest_time, latest_…
arienandalibi Jun 17, 2025
f2d003b
Implemented _rev functions that return iterators over edge histories …
arienandalibi Jun 17, 2025
780d5e2
Implemented _rev functions that return iterators over node histories …
arienandalibi Jun 17, 2025
0a7e0eb
Created HistoryRef which holds references to items instead of owning …
arienandalibi Jun 20, 2025
e94c1fd
Updated intervals to hold an item which yields time entries instead o…
arienandalibi Jun 20, 2025
e2e0bf3
Updated intervals to hold a reference to an item which yields time en…
arienandalibi Jun 21, 2025
c9411d8
Changed EdgeViewOps history() function to return History object inste…
arienandalibi Jun 21, 2025
1a4bd39
Added t(), dt(), and s() functions to History object. They return a h…
arienandalibi Jun 24, 2025
b682502
Added history() function to Nodes struct which returns History object…
arienandalibi Jun 25, 2025
16d9386
Changed EdgeView time functions to return TimeIndexEntry instead of i…
arienandalibi Jun 26, 2025
c386730
Implemented history functions directly on LazyNodeState<HistoryOp...>…
arienandalibi Jun 27, 2025
4fdc829
Added support for graph.nodes().neighbours().combined_history() and g…
arienandalibi Jul 2, 2025
8d288fa
Working on macros so that History object can be implemented into pyth…
arienandalibi Jul 3, 2025
cd76ede
Added Nested types on Result iterables types for Python. Fixed all Ed…
arienandalibi Jul 4, 2025
94172c6
Changed PyEdge and PyNode history() functions to return history objec…
arienandalibi Jul 7, 2025
14bcb1c
Added t, dt, s, intervals functions in python. Changed __list__ and c…
arienandalibi Jul 8, 2025
077e61c
Fixed PyBorrowingIterator for Result types. Created new macro and fun…
arienandalibi Jul 10, 2025
121ef1f
Removed _date_time functions (earliest_date_time, latest_date_time, h…
arienandalibi Jul 10, 2025
4da5f70
Removed histories, histories_rev, histories_date_time from TemporalPr…
arienandalibi Jul 11, 2025
da33809
Changed timeline_start and timeline_end to return Option<TimeIndexEnt…
arienandalibi Jul 13, 2025
6ec88cf
Changed IntoTime to return TimeIndexEntry instead of i64. Added AsTim…
arienandalibi Jul 15, 2025
758ac71
Merge branch 'refs/heads/master' into feature/history-object
arienandalibi Jul 15, 2025
8497493
Fixed some errors after merge. Changed node_earliest_time_window and …
arienandalibi Jul 15, 2025
76fcae5
Changed windowing functions to use TimeIndexEntry instead of i64, esp…
arienandalibi Jul 17, 2025
99f51ce
Moved IntoTime (and associated traits), as well as PyTime to raphtory…
arienandalibi Jul 21, 2025
94b7c35
Updated all function arguments which were previously PyTime to now be…
arienandalibi Jul 21, 2025
0f10907
Current progress in implementing Python versions of LazyNodeState and…
arienandalibi Jul 25, 2025
966e692
Implemented Python wrapper for NodeState of Result<Option<DateTime<Ut…
arienandalibi Jul 27, 2025
294a047
Implemented Python wrapper for LazyNodeState of Map<EarliestTime, Res…
arienandalibi Jul 29, 2025
2bee056
Re-introduced NodeOpFilter for Map so that OneHopFilter operations ca…
arienandalibi Jul 29, 2025
af6351c
Implemented Ord and PartialOrd for History objects. Implemented FromP…
arienandalibi Jul 30, 2025
58532b2
Removed Ord and PartialOrd implementations for History object, they d…
arienandalibi Jul 31, 2025
c67a067
Fixed GraphQL errors. Added more functions to GqlHistory available in…
arienandalibi Jul 31, 2025
ab677af
Added GqlTimeIndexEntry, a GraphQL wrapper for TimeIndexEntry. Time o…
arienandalibi Jul 31, 2025
8465e01
Changed GqlHistory to return GqlTimeIndexEntry instead of i64 for tim…
arienandalibi Aug 1, 2025
13abbcd
Updates to GraphQL history objects: updated all functions to use bloc…
arienandalibi Aug 4, 2025
1a4d906
Merge remote-tracking branch 'origin/master' into feature/history-object
arienandalibi Aug 4, 2025
b0b7f02
Fixed errors after merge
arienandalibi Aug 5, 2025
2833b94
Fixed tests after merge
arienandalibi Aug 5, 2025
62a72c8
Re-added pometry-storage-private submodule at commit fac0f56
arienandalibi Aug 5, 2025
7d80b94
Activated private storage. Moved some Python logic around, moved some…
arienandalibi Aug 5, 2025
fb28f14
Changed t, dt, secondary_index, and history functions to not require …
arienandalibi Aug 5, 2025
f28ad2b
Merge branch 'master' into feature/history-object
arienandalibi Aug 5, 2025
a4e409d
Added support for extracting TimeIndexEntry from [int, int] in Python…
arienandalibi Aug 6, 2025
0a36033
Changed TimeIndexEntry parsing from Python to allow tuples/lists (of …
arienandalibi Aug 8, 2025
dff587d
Fixed the rust tests, they all pass. Parquet serialization tests only…
arienandalibi Aug 15, 2025
c900c0f
Updated stubs. Updated stub_gen and makefile to work with conda envir…
arienandalibi Aug 19, 2025
4305b2a
Added t, dt, secondary_index, and intervals functions on NestedHistor…
arienandalibi Aug 20, 2025
899d830
Added __repr__() for different history types (t, dt, secondary_index,…
arienandalibi Aug 21, 2025
327359d
Current progress in fixing the python tests
arienandalibi Aug 21, 2025
b32a2f7
Added t, dt, secondary_index on python LazyNodeStates (for earliest a…
arienandalibi Aug 26, 2025
fbd375d
Fixed all python tests
arienandalibi Aug 26, 2025
3f24df3
Fixed rust-side t, dt, secondary_index, intervals functions on LazyNo…
arienandalibi Aug 27, 2025
7412556
Current progress in resolving issues
arienandalibi Aug 28, 2025
1f91962
Current progress in resolving issues
arienandalibi Aug 28, 2025
4d33512
Current progress in resolving issues. Added first() and last() on his…
arienandalibi Aug 29, 2025
f59d448
Added DeletionHistory to History. edge1.deletions() now returns a His…
arienandalibi Aug 29, 2025
803715c
Added rust-side t, dt, and secondary_index functions for LazyNodeStat…
arienandalibi Sep 2, 2025
62c3a54
Fixed different Time traits in general. Moved FromPyObject for time i…
arienandalibi Sep 2, 2025
f83ed1a
Current progress in resolving issues. sorted() and groups() now pull …
arienandalibi Sep 3, 2025
f329de3
Added IntoArcDynHistoryOps to define how an InternalHistoryOps object…
arienandalibi Sep 4, 2025
dfcaaf8
Changed WindowTimeSemantics to use a Range<TimeIndexEntry> instead of…
arienandalibi Sep 4, 2025
b14e7f0
Got rid of NodeState<Result<Option<DateTime>>>. Any functions that us…
arienandalibi Sep 4, 2025
12a4710
Changed CompositeHistory to hold Box<[Box<dyn InternalHistoryOps + 'a…
arienandalibi Sep 4, 2025
c430004
Removed date_time on edge/edges and changed time to return TimeIndexE…
arienandalibi Sep 5, 2025
9fc6836
Updated GraphQL time-based functions and Windows to take GqlTimeInput…
arienandalibi Sep 6, 2025
1debd5a
Renamed Window in vectorised_graph.rs to VectorisedGraphWindow to avo…
arienandalibi Sep 6, 2025
caf3a65
Current progress in fixing the docstrings.
arienandalibi Sep 8, 2025
c613aae
Finished fixing the docstrings.
arienandalibi Sep 8, 2025
35c4361
Ran tidy-public
arienandalibi Sep 8, 2025
843f5ed
Merge branch 'master' into feature/history-object
arienandalibi Sep 9, 2025
9e98496
Regenerated python stubs and graphql schema after merge.
arienandalibi Sep 9, 2025
7f52ea1
Merge branch 'master' into feature/history-object
arienandalibi Sep 9, 2025
0977a56
Fixed "Option" -> "Optional" typo in Python docs
arienandalibi Sep 9, 2025
e38073e
Removed unused imports, added some GraphQL docs, added some some clas…
arienandalibi Sep 10, 2025
1314515
Fixed doc tests and storage tests.
arienandalibi Sep 11, 2025
edb3c8c
Added python classes to module and fixed iterable return types.
arienandalibi Sep 11, 2025
bc60d93
Fixed some tests. Removed Iterable types from added Python classes, t…
arienandalibi Sep 12, 2025
7bd6040
chore: apply tidy-public auto-fixes
github-actions[bot] Sep 12, 2025
bad9fae
Updated some error messages in raphtory-benchmark
arienandalibi Sep 15, 2025
930ccdf
Merge branch 'master' into feature/history-object
arienandalibi Sep 15, 2025
d90509c
Fixed benchmark
arienandalibi Sep 16, 2025
9d15a56
Merge branch 'master' into feature/history-object
arienandalibi Sep 16, 2025
850a65c
Merge branch 'master' into feature/history-object
arienandalibi Sep 18, 2025
71e0445
Fixed merge issues. Added python tests for history object.
arienandalibi Sep 22, 2025
c6cd030
Merge branch 'master' into feature/history-object
arienandalibi Sep 23, 2025
fa18f7a
Added tests for checking TimeIndexEntry/InputTime sting parsing, equa…
arienandalibi Sep 23, 2025
46b105b
chore: apply tidy-public auto-fixes
github-actions[bot] Sep 24, 2025
6054c09
Removed histories_timestamps(). Added GraphQL tests for datetimes, fo…
arienandalibi Sep 30, 2025
d61ab6a
chore: apply tidy-public auto-fixes
github-actions[bot] Sep 30, 2025
263dbc0
Allowed history objects to be compared with lists in python. The list…
arienandalibi Oct 1, 2025
794fbc3
Fixed GraphQL server crashing when invalid format string is passed to…
arienandalibi Oct 1, 2025
72b0023
Merge branch 'master' into feature/history-object
arienandalibi Oct 2, 2025
98ade36
Fixed merge issues
arienandalibi Oct 2, 2025
d07a5ab
Fixed failing rust tests
arienandalibi Oct 2, 2025
e25fb8c
Fixed failing rust storage tests except for one
arienandalibi Oct 2, 2025
2f52817
Merge branch 'master' into feature/history-object
arienandalibi Oct 3, 2025
317c2eb
Renaming TimeIndexEntry to EventTime. Updating all documentation, API…
arienandalibi Oct 3, 2025
138d9f9
Merge branch 'master' into feature/history-object
arienandalibi Oct 6, 2025
66a8421
Still renaming TimeIndexEntry to EventTime. Updating all documentatio…
arienandalibi Oct 6, 2025
3a28fd6
Renaming secondary_index from old TimeIndexEntry terminology to event…
arienandalibi Oct 7, 2025
d0245e6
Replacing secondary_index terminology from old TimeIndexEntry to even…
arienandalibi Oct 7, 2025
1909581
Replacing secondary_index terminology from old TimeIndexEntry to even…
arienandalibi Oct 7, 2025
ff31909
Fixed issues
arienandalibi Oct 7, 2025
cdc947c
docs fixes
jbaross-pometry Oct 7, 2025
a7a9d14
update object name to EventTime
jbaross-pometry Oct 7, 2025
19b8420
Changed many unnecessary try_into_time() function calls with into_tim…
arienandalibi Oct 8, 2025
3dff619
Fixing tests
arienandalibi Oct 8, 2025
ea42008
Moved impl blocks for EventTime iterables to a separate file, so cust…
arienandalibi Oct 8, 2025
7d81d77
chore: apply tidy-public auto-fixes
github-actions[bot] Oct 8, 2025
5108697
Reverted previous changes made to Makefile
arienandalibi Oct 8, 2025
f3dc320
Cleaned up custom node_state files
arienandalibi Oct 9, 2025
57e39a9
Renamed epoch to timestamp for EventTime
arienandalibi Oct 10, 2025
7b40ffe
Fixed tests
arienandalibi Oct 10, 2025
0bd34d5
Merge branch 'master' into feature/history-object
arienandalibi Oct 13, 2025
b6df670
rust format and general merge fixes
arienandalibi Oct 13, 2025
e0d1976
chore: apply tidy-public auto-fixes
github-actions[bot] Oct 13, 2025
ec39041
moved history tests to tests folder
arienandalibi Oct 13, 2025
7dc8d73
cleaned up docs
arienandalibi Oct 13, 2025
9655166
chore: apply tidy-public auto-fixes
github-actions[bot] Oct 13, 2025
d4e309f
removed changes previously made to stub_gen for debugging purposes
arienandalibi Oct 13, 2025
0f53219
Added intervals functions such as mean, median, min, max on LazyNodeS…
arienandalibi Oct 15, 2025
7c297a8
Merge branch 'master' into feature/history-object
arienandalibi Oct 16, 2025
b06d985
Fixed issues after merge
arienandalibi Oct 16, 2025
af232e0
Fixed tests after merge
arienandalibi Oct 16, 2025
5ea0f75
chore: apply tidy-public auto-fixes
github-actions[bot] Oct 16, 2025
f1c3fe4
Merge branch 'master' into feature/history-object
arienandalibi Oct 17, 2025
46c7cf6
Fixed tests after merge
arienandalibi Oct 20, 2025
d55bc14
Merge branch 'master' into feature/history-object
arienandalibi Oct 20, 2025
9e6fc1a
Updated stubs
arienandalibi Oct 20, 2025
8e9380e
Fixed storage feature imports
arienandalibi Oct 21, 2025
9b256f2
Fixed failing tests and updated earliest_edge_time and latest_edge_ti…
arienandalibi Oct 21, 2025
2bc4f86
chore: apply tidy-public auto-fixes
github-actions[bot] Oct 21, 2025
94e3241
Fixed failing test
arienandalibi Oct 21, 2025
43b8af8
chore: apply tidy-public auto-fixes
github-actions[bot] Oct 21, 2025
b359a1d
Merge branch 'master' into feature/history-object
arienandalibi Oct 21, 2025
d0ae3b1
Merge branch 'master' into feature/history-object
arienandalibi Oct 23, 2025
52156ef
chore: apply tidy-public auto-fixes
github-actions[bot] Oct 23, 2025
e79c69e
Merge branch 'master' into feature/history-object
miratepuffin Nov 6, 2025
3089666
chore: apply tidy-public auto-fixes
github-actions[bot] Nov 6, 2025
f02c314
Adding PyOptionalEventTime, a python wrapper for Option<EventTime> so…
arienandalibi Nov 17, 2025
73fac89
Changing python functions that return Option<EventTime> to return PyO…
arienandalibi Nov 18, 2025
02bcd3d
PyOptionalEventTime: added repr() and added it to add_classes!
arienandalibi Nov 19, 2025
60dcaba
Added comparison functions for PyOptionalEventTime. They can be compa…
arienandalibi Nov 26, 2025
0b93e95
Merge branch 'master' into feature/history-object
arienandalibi Nov 26, 2025
7ba5934
General fixes and clean up after merge
arienandalibi Nov 26, 2025
efda96c
Added comparison to PyEventTime for PyOptionalEventTime. Added tests …
arienandalibi Nov 27, 2025
f0d528b
Added __getitem__ on history objects to allow subscript notation: his…
arienandalibi Nov 27, 2025
3ac89ad
Merge branch 'master' into feature/history-object
arienandalibi Nov 27, 2025
b8626d2
Added a GqlOptionalEventTime type so that if a function returns None,…
arienandalibi Nov 28, 2025
d0ce370
Merge branch 'master' into feature/history-object
arienandalibi Nov 28, 2025
051171e
Changed GqlEventTime to hold an Option<EventTime> and got rid of GqlO…
arienandalibi Nov 29, 2025
6c49744
Fixed GraphQL tests
arienandalibi Nov 29, 2025
bed7107
Added support for ingesting `date` types from python, previously it w…
arienandalibi Dec 1, 2025
7055c7f
Added IntoIterator for History<T> wrapper objects when T: 'static. Ad…
arienandalibi Dec 2, 2025
dbfd46e
Merge branch 'master' into feature/history-object
arienandalibi Dec 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/assets/images/gandalf-importance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,101 changes: 900 additions & 201 deletions docs/reference/graphql/graphql_API.md

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions docs/user-guide/algorithms/4_view-algorithms.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Running algorithms on GraphViews
# Running algorithms on GraphViews

Both `graphwide` and `node centric` algorithms can be run on `GraphViews`. This allows us to see how results change over time, run algorithms on subsets of the layers, or remove specific nodes from the graph to see the impact this has.
Both `graphwide` and `node centric` algorithms can be run on `GraphViews`. This allows us to see how results change over time, run algorithms on subsets of the layers, or remove specific nodes from the graph to see the impact this has.

To demonstrate this, the following example shows how you could track Gandalf's importance over the course of the story using rolling windows and the `PageRank` algorithm.
To demonstrate this, the following example shows how you could track Gandalf's importance over the course of the story using rolling windows and the `PageRank` algorithm.

Within each windowed graph we use the `NodeState` api to extract Gandalf's score and record it alongside the earliest timestamp in the window, which can then be plotted via matplotlib.

Expand All @@ -26,12 +26,14 @@ time = []
for windowed_graph in lotr_graph.rolling(window=2000):
result = rp.pagerank(windowed_graph)
importance.append(result.get("Gandalf"))
time.append(windowed_graph.earliest_time)
time.append(windowed_graph.earliest_time.t)

plt.plot(time, importance, marker="o")
plt.xlabel("Sentence (Time)")
plt.ylabel("Pagerank Score")
plt.title("Gandalf's importance over time")
plt.grid(True)
```
///
///

![Gandalf's importance over time](../../assets/images/gandalf-importance.png)
9 changes: 4 additions & 5 deletions docs/user-guide/export/2_dataframes.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ Finally, we call `to_df()` again, turning off the property history and exploding
each interaction that occurred between `ANGELE` and `FELIPE`.

!!! info

We have further reduced the graph to only one layer (`Grunting-Lipsmacking`) to reduce the output size.

/// tab | :fontawesome-brands-python: Python
Expand Down Expand Up @@ -177,8 +176,8 @@ print(df)
///

```{.python continuation hide}
assert str(grunting_graph) == "Graph(number_of_nodes=2, number_of_edges=2, number_of_temporal_edges=6, earliest_time=1560526320000, latest_time=1562253540000)"
assert str(grunting_graph.edges) == "Edges(Edge(source=ANGELE, target=FELIPE, earliest_time=1560526320000, latest_time=1561042620000, properties={Weight: 1}, layer(s)=[Grunting-Lipsmacking]), Edge(source=FELIPE, target=ANGELE, earliest_time=1560526320000, latest_time=1562253540000, properties={Weight: 1}, layer(s)=[Grunting-Lipsmacking]))"
assert str(grunting_graph) == "Graph(number_of_nodes=2, number_of_edges=2, number_of_temporal_edges=6, earliest_time=EventTime(timestamp=1560526320000, event_id=365), latest_time=EventTime(timestamp=1562253540000, event_id=2531))"
assert str(grunting_graph.edges) == "Edges(Edge(source=ANGELE, target=FELIPE, earliest_time=EventTime(timestamp=1560526320000, event_id=365), latest_time=EventTime(timestamp=1561042620000, event_id=871), properties={Weight: 1}, layer(s)=[Grunting-Lipsmacking]), Edge(source=FELIPE, target=ANGELE, earliest_time=EventTime(timestamp=1560526320000, event_id=366), latest_time=EventTime(timestamp=1562253540000, event_id=2531), properties={Weight: 1}, layer(s)=[Grunting-Lipsmacking]))"
```

!!! Output
Expand Down Expand Up @@ -236,8 +235,8 @@ assert str(grunting_graph.edges) == "Edges(Edge(source=ANGELE, target=FELIPE, ea
13 [1560526320000]
14 [1561110180000]

Graph(number_of_nodes=2, number_of_edges=2, number_of_temporal_edges=6, earliest_time=1560526320000, latest_time=1562253540000)
Edges(Edge(source=ANGELE, target=FELIPE, earliest_time=1560526320000, latest_time=1561042620000, properties={Weight: 1}, layer(s)=[Grunting-Lipsmacking]), Edge(source=FELIPE, target=ANGELE, earliest_time=1560526320000, latest_time=1562253540000, properties={Weight: 1}, layer(s)=[Grunting-Lipsmacking]))
Graph(number_of_nodes=2, number_of_edges=2, number_of_temporal_edges=6, earliest_time=EventTime(timestamp=1560526320000, event_id=365), latest_time=EventTime(timestamp=1562253540000, event_id=2531))
Edges(Edge(source=ANGELE, target=FELIPE, earliest_time=EventTime(timestamp=1560526320000, event_id=365), latest_time=EventTime(timestamp=1561042620000, event_id=871), properties={Weight: 1}, layer(s)=[Grunting-Lipsmacking]), Edge(source=FELIPE, target=ANGELE, earliest_time=EventTime(timestamp=1560526320000, event_id=366), latest_time=EventTime(timestamp=1562253540000, event_id=2531), properties={Weight: 1}, layer(s)=[Grunting-Lipsmacking]))
Exploding the grunting-Lipsmacking layer
src dst layer \
0 ANGELE FELIPE Grunting-Lipsmacking
Expand Down
7 changes: 3 additions & 4 deletions docs/user-guide/getting-started/20_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,17 @@ print(g)
///

```{.python continuation hide}
assert str(g) == "Graph(number_of_nodes=22, number_of_edges=290, number_of_temporal_edges=3196, earliest_time=1560419400000, latest_time=1562756700000)"
assert str(g) == "Graph(number_of_nodes=22, number_of_edges=290, number_of_temporal_edges=3196, earliest_time=EventTime(timestamp=1560419400000, event_id=0), latest_time=EventTime(timestamp=1562756700000, event_id=18446744073709551615))"
```

You can print the state of the graph object to verify it exists.
You can print the state of the graph object to verify it exists. Note that the `earliest_time` and `latest_time` are given in Raphtory's `EventTime` format.

!!! Output

```output
Graph(number_of_nodes=22, number_of_edges=290, number_of_temporal_edges=3196, earliest_time=1560419400000, latest_time=1562756700000)
Graph(number_of_nodes=22, number_of_edges=290, number_of_temporal_edges=3196, earliest_time=EventTime(timestamp=1560419400000, event_id=0), latest_time=EventTime(timestamp=1562756700000, event_id=18446744073709551615))
```


For more details, see [Creating a graph](../ingestion/1_intro.md).

## Query your data
Expand Down
76 changes: 38 additions & 38 deletions docs/user-guide/ingestion/2_direct-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ print(v)
///

```{.python continuation hide}
assert str(g) == "Graph(number_of_nodes=1, number_of_edges=0, number_of_temporal_edges=0, earliest_time=1, latest_time=1)"
assert str(v) == "Node(name=10, earliest_time=1, latest_time=1)"
assert str(g) == "Graph(number_of_nodes=1, number_of_edges=0, number_of_temporal_edges=0, earliest_time=EventTime(timestamp=1, event_id=0), latest_time=EventTime(timestamp=1, event_id=18446744073709551615))"
assert str(v) == "Node(name=10, earliest_time=EventTime(timestamp=1, event_id=0), latest_time=EventTime(timestamp=1, event_id=0))"
```

Printing out the graph and the returned node we can see the update was successful and the earliest/latest time has been
updated.
Printing out the graph and the returned node you can see the update was successful and the earliest and latest times have been
updated. The timestamp you specified is used as the primary index of the `EventTime` object.

!!! Output

```output
Graph(number_of_nodes=1, number_of_edges=0, number_of_temporal_edges=0, earliest_time=1, latest_time=1)
Node(name=10, earliest_time=1, latest_time=1)
Graph(number_of_nodes=1, number_of_edges=0, number_of_temporal_edges=0, earliest_time=EventTime(timestamp=1, event_id=0), latest_time=EventTime(timestamp=1, event_id=18446744073709551615))
Node(name=10, earliest_time=EventTime(timestamp=1, event_id=0), latest_time=EventTime(timestamp=1, event_id=0))
```

## Adding edges
Expand All @@ -62,15 +62,15 @@ print(e)
///

```{.python continuation hide}
assert str(g) == "Graph(number_of_nodes=2, number_of_edges=1, number_of_temporal_edges=1, earliest_time=1, latest_time=1)"
assert str(e) == "Edge(source=15, target=16, earliest_time=1, latest_time=1, layer(s)=[_default])"
assert str(g) == "Graph(number_of_nodes=2, number_of_edges=1, number_of_temporal_edges=1, earliest_time=EventTime(timestamp=1, event_id=0), latest_time=EventTime(timestamp=1, event_id=18446744073709551615))"
assert str(e) == "Edge(source=15, target=16, earliest_time=EventTime(timestamp=1, event_id=0), latest_time=EventTime(timestamp=1, event_id=0), layer(s)=[_default])"
```

!!! Output

```output
Graph(number_of_nodes=2, number_of_edges=1, number_of_temporal_edges=1, earliest_time=1, latest_time=1)
Edge(source=15, target=16, earliest_time=1, latest_time=1, layer(s)=[_default])
Graph(number_of_nodes=2, number_of_edges=1, number_of_temporal_edges=1, earliest_time=EventTime(timestamp=1, event_id=0), latest_time=EventTime(timestamp=1, event_id=18446744073709551615))
Edge(source=15, target=16, earliest_time=EventTime(timestamp=1, event_id=0), latest_time=EventTime(timestamp=1, event_id=0), layer(s)=[_default])
```

You will notice in the output that the graph has two nodes as well as the edge. Raphtory automatically creates the source and destination nodes at the same time if they do not currently exist in the graph. This is to keep the graph consistent and avoid `hanging edges`. These nodes are empty other than the history of their edges, therefore if you apply filters to exclude all edges these empty nodes will also be excluded from your graph.
Expand Down Expand Up @@ -102,17 +102,17 @@ print(g.edge("User 1", "User 2"))
///

```{.python continuation hide}
assert str(g.node("User 1")) == "Node(name=User 1, earliest_time=123, latest_time=789)"
assert str(g.node("User 2")) == "Node(name=User 2, earliest_time=456, latest_time=789)"
assert str(g.edge("User 1", "User 2")) == "Edge(source=User 1, target=User 2, earliest_time=789, latest_time=789, layer(s)=[_default])"
assert str(g.node("User 1")) == "Node(name=User 1, earliest_time=EventTime(timestamp=123, event_id=0), latest_time=EventTime(timestamp=789, event_id=2))"
assert str(g.node("User 2")) == "Node(name=User 2, earliest_time=EventTime(timestamp=456, event_id=1), latest_time=EventTime(timestamp=789, event_id=2))"
assert str(g.edge("User 1", "User 2")) == "Edge(source=User 1, target=User 2, earliest_time=EventTime(timestamp=789, event_id=2), latest_time=EventTime(timestamp=789, event_id=2), layer(s)=[_default])"
```

!!! Output

```output
Node(name=User 1, earliest_time=123, latest_time=789)
Node(name=User 2, earliest_time=456, latest_time=789)
Edge(source=User 1, target=User 2, earliest_time=789, latest_time=789, layer(s)=[_default])
Node(name=User 1, earliest_time=EventTime(timestamp=123, event_id=0), latest_time=EventTime(timestamp=789, event_id=2))
Node(name=User 2, earliest_time=EventTime(timestamp=456, event_id=1), latest_time=EventTime(timestamp=789, event_id=2))
Edge(source=User 1, target=User 2, earliest_time=EventTime(timestamp=789, event_id=2), latest_time=EventTime(timestamp=789, event_id=2), layer(s)=[_default])
```

!!! warning
Expand Down Expand Up @@ -146,34 +146,34 @@ datetime_obj = datetime(2021, 1, 1, 12, 32, 0, 0)
g.add_node(timestamp=datetime_obj, id=10)

print(g)
print(g.node(id=10).history())
print(g.node(id=10).history_date_time())
print(g.node(id=10).history.t.collect())
print(g.node(id=10).history.dt.collect())
```

///

```{.python continuation hide}
assert str(g) == "Graph(number_of_nodes=1, number_of_edges=0, number_of_temporal_edges=0, earliest_time=1609504320000, latest_time=1612360860000)"
assert str(g.node(id=10).history()) == "[1609504320000 1612360860000]"
assert str(g.node(id=10).history_date_time()) == "[datetime.datetime(2021, 1, 1, 12, 32, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 2, 3, 14, 1, tzinfo=datetime.timezone.utc)]"
assert str(g) == "Graph(number_of_nodes=1, number_of_edges=0, number_of_temporal_edges=0, earliest_time=EventTime(timestamp=1609504320000, event_id=0), latest_time=EventTime(timestamp=1612360860000, event_id=18446744073709551615))"
assert str(g.node(id=10).history.t.collect()) == "[1609504320000 1612360860000]"
assert str(g.node(id=10).history.dt.collect()) == "[datetime.datetime(2021, 1, 1, 12, 32, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 2, 3, 14, 1, tzinfo=datetime.timezone.utc)]"
```

!!! Output

```output
Graph(number_of_nodes=1, number_of_edges=0, number_of_temporal_edges=0, earliest_time=1609504320000, latest_time=1612360860000)
Graph(number_of_nodes=1, number_of_edges=0, number_of_temporal_edges=0, earliest_time=EventTime(timestamp=1609504320000, event_id=0), latest_time=EventTime(timestamp=1612360860000, event_id=18446744073709551615))
[1609504320000 1612360860000]
[datetime.datetime(2021, 1, 1, 12, 32, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 2, 3, 14, 1, tzinfo=datetime.timezone.utc)]
```

In the output we can see the `history` of node `10` contains the two times at which we have added it into the graph (
maintained in ascending order), returned in both unix epoch (integer) and datetime format.

Internally, the [History][raphtory.History] of events is tracked using [EventTime][raphtory.EventTime] objects. However, in this example we use the `.t` and `.dt` methods to get iterables of epochs and datetimes directly from the `History` object and collect the iterables to display simple lists.

## Properties

Alongside the structural update history, Raphtory can maintain the changing value of [`Properties`][raphtory.Properties] associated with nodes
and edges. Both the `add_node()` and `add_edge()` functions have an optional parameter `properties` which takes a
dictionary of key value pairs to be stored at the given timestamp.
Alongside the structural update history, Raphtory can maintain the changing value of [`Properties`][raphtory.Properties] associated with nodes and edges. Both the `add_node()` and `add_edge()` functions have an optional parameter `properties` which takes a dictionary of key value pairs to be stored at the given timestamp.

The graph itself may also have its own `global properties` added using the `add_properties()` function which takes only
a `timestamp` and a `properties` dictionary.
Expand All @@ -182,7 +182,7 @@ Properties can consist of primitives (`Integer`, `Float`, `String`, `Boolean`, `
`List`). This allows you to store both basic values as well as do complex hierarchical modelling depending on your use
case.

In the example below, we are using all of these functions to add a mixture of properties to a node, an edge, and the
In the example below, we use all of these functions to add a mixture of properties to a node, an edge, and the
graph.

!!! warning
Expand Down Expand Up @@ -249,15 +249,15 @@ print(e)
///

```{.python continuation hide}
assert str(e) == "Edge(source=User 1, target=User 2, earliest_time=4, latest_time=4, properties={weights: [1, 2, 3]}, layer(s)=[_default])"
assert str(e) == "Edge(source=User 1, target=User 2, earliest_time=EventTime(timestamp=4, event_id=5), latest_time=EventTime(timestamp=4, event_id=5), properties={weights: [1, 2, 3]}, layer(s)=[_default])"
```

!!! Output

```output
Graph(number_of_nodes=2, number_of_edges=1, number_of_temporal_edges=1, earliest_time=1, latest_time=4, properties=Properties({inner data: {fruits: {apple: 5, banana: 3}, date of birth: 2021-01-01 12:32:00}, favourite greetings: [hi, hello, howdy]}))
Node(name=User 1, earliest_time=1, latest_time=4, properties=Properties({count: 2, greeting: hello, encrypted: true, balance: 0.9}))
Edge(source=User 1, target=User 2, earliest_time=4, latest_time=4, properties={weights: [1, 2, 3]}, layer(s)=[_default])
Graph(number_of_nodes=2, number_of_edges=1, number_of_temporal_edges=1, earliest_time=EventTime(timestamp=1, event_id=0), latest_time=EventTime(timestamp=4, event_id=18446744073709551615), properties=Properties({inner data: {fruits: {apple: 5, banana: 3}, date of birth: 2021-01-01 12:32:00}, favourite greetings: [hi, hello, howdy]}))
Node(name=User 1, earliest_time=EventTime(timestamp=1, event_id=0), latest_time=EventTime(timestamp=4, event_id=5), properties=Properties({count: 2, greeting: hello, encrypted: true, balance: 0.9}))
Edge(source=User 1, target=User 2, earliest_time=EventTime(timestamp=4, event_id=5), latest_time=EventTime(timestamp=4, event_id=5), properties={weights: [1, 2, 3]}, layer(s)=[_default])
```

!!! info
Expand All @@ -268,7 +268,7 @@ assert str(e) == "Edge(source=User 1, target=User 2, earliest_time=4, latest_tim

## Metadata

Raphtory also provides [`metadata`][raphtory.Metadata] associated with nodes and edges which have immutable values. These are useful when you know a value won't change or is not associated with a specific time.
Raphtory also provides [`metadata`][raphtory.Metadata] associated with nodes and edges which have immutable values. These are useful when you know a value won't change or is not associated with a specific time.

You can use the `add_metadata()` function, which takes a single `dictionary` argument, to add metadata to a `graph`, `node` and `edge` as demonstrated below.

Expand Down Expand Up @@ -296,17 +296,17 @@ print(e)
///

```{.python continuation hide}
assert str(g) == "Graph(number_of_nodes=2, number_of_edges=1, number_of_temporal_edges=1, earliest_time=1, latest_time=2)"
assert str(v) == "Node(name=User 1, earliest_time=1, latest_time=2)"
assert str(e) == "Edge(source=User 1, target=User 2, earliest_time=2, latest_time=2, layer(s)=[_default])"
assert str(g) == "Graph(number_of_nodes=2, number_of_edges=1, number_of_temporal_edges=1, earliest_time=EventTime(timestamp=1, event_id=0), latest_time=EventTime(timestamp=2, event_id=18446744073709551615))"
assert str(v) == "Node(name=User 1, earliest_time=EventTime(timestamp=1, event_id=0), latest_time=EventTime(timestamp=2, event_id=1))"
assert str(e) == "Edge(source=User 1, target=User 2, earliest_time=EventTime(timestamp=2, event_id=1), latest_time=EventTime(timestamp=2, event_id=1), layer(s)=[_default])"
```

!!! output

```output
Graph(number_of_nodes=2, number_of_edges=1, number_of_temporal_edges=1, earliest_time=1, latest_time=2)
Node(name=User 1, earliest_time=1, latest_time=2)
Edge(source=User 1, target=User 2, earliest_time=2, latest_time=2, layer(s)=[_default])
Graph(number_of_nodes=2, number_of_edges=1, number_of_temporal_edges=1, earliest_time=EventTime(timestamp=1, event_id=0), latest_time=EventTime(timestamp=2, event_id=18446744073709551615))
Node(name=User 1, earliest_time=EventTime(timestamp=1, event_id=0), latest_time=EventTime(timestamp=2, event_id=1))
Edge(source=User 1, target=User 2, earliest_time=EventTime(timestamp=2, event_id=1), latest_time=EventTime(timestamp=2, event_id=1), layer(s)=[_default])
```

## Edge Layers
Expand Down Expand Up @@ -387,4 +387,4 @@ assert str(layered_edge.properties.temporal.get("weight").values()) == "[20 35]"
```output
[10 13 20 17 35]
[20 35]
```
```
Loading
Loading