Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2ce8d53
init
jbaross-pometry Aug 1, 2025
8ecccb0
docstrings
jbaross-pometry Aug 4, 2025
42a2416
docstrings for edges
jbaross-pometry Aug 4, 2025
a3086a7
docstrings for edges
jbaross-pometry Aug 5, 2025
b769f02
regen schema and docs
jbaross-pometry Aug 5, 2025
542a62f
run formatting
jbaross-pometry Aug 5, 2025
921d48f
chore: apply tidy-public auto-fixes
github-actions[bot] Aug 5, 2025
cb3863f
more docstrings
jbaross-pometry Aug 6, 2025
9022771
backticks are not used by docs parser so remove
jbaross-pometry Aug 6, 2025
269d909
more docstrings
jbaross-pometry Aug 6, 2025
f8e7e63
chore: apply tidy-public auto-fixes
github-actions[bot] Aug 6, 2025
6d961d1
more docstrings
jbaross-pometry Aug 6, 2025
c414a8b
chore: apply tidy-public auto-fixes
github-actions[bot] Aug 6, 2025
6004fe0
Merge branch 'master' into james/graphql-docstrings
jbaross-pometry Aug 7, 2025
19708fb
more docstrings
jbaross-pometry Aug 7, 2025
5a09cbb
more docstrings
jbaross-pometry Aug 7, 2025
f818f89
update schema and format
jbaross-pometry Aug 7, 2025
cfbb7ad
chore: apply tidy-public auto-fixes
github-actions[bot] Aug 7, 2025
16d73d4
more docstrings
jbaross-pometry Aug 7, 2025
9a19edf
Merge remote-tracking branch 'origin/james/graphql-docstrings' into j…
jbaross-pometry Aug 7, 2025
8a727df
chore: apply tidy-public auto-fixes
github-actions[bot] Aug 7, 2025
f1e50e3
more docstrings
jbaross-pometry Aug 7, 2025
c317294
chore: apply tidy-public auto-fixes
github-actions[bot] Aug 7, 2025
936593d
more docstrings
jbaross-pometry Aug 8, 2025
959c30d
chore: apply tidy-public auto-fixes
github-actions[bot] Aug 8, 2025
fd42f19
more docstrings
jbaross-pometry Aug 8, 2025
790a1ca
Merge remote-tracking branch 'origin/james/graphql-docstrings' into j…
jbaross-pometry Aug 8, 2025
43349cc
more docstrings
jbaross-pometry Aug 8, 2025
2d01e70
cleanup
jbaross-pometry Aug 8, 2025
9396c88
more docstrings
jbaross-pometry Aug 8, 2025
d4b0590
chore: apply tidy-public auto-fixes
github-actions[bot] Aug 8, 2025
c6f99f4
Merge remote-tracking branch 'origin/james/graphql-docstrings' into j…
jbaross-pometry Aug 8, 2025
09a54a7
testcase for inputs
jbaross-pometry Aug 8, 2025
4d96f0f
cleanup
jbaross-pometry Aug 8, 2025
dcc7c21
chore: apply tidy-public auto-fixes
github-actions[bot] Aug 8, 2025
2b93717
more docstrings
jbaross-pometry Aug 11, 2025
b3c6ae8
cleanup
jbaross-pometry Aug 11, 2025
f283163
chore: apply tidy-public auto-fixes
github-actions[bot] Aug 11, 2025
2f2e691
more docstrings
jbaross-pometry Aug 11, 2025
7f4893f
Merge remote-tracking branch 'origin/james/graphql-docstrings' into j…
jbaross-pometry Aug 11, 2025
4dabd89
cleanup
jbaross-pometry Aug 11, 2025
399dc98
chore: apply tidy-public auto-fixes
github-actions[bot] Aug 11, 2025
985c8c8
fix page docstrings
jbaross-pometry Aug 11, 2025
d7e47a2
cleanup
jbaross-pometry Aug 12, 2025
0a5246d
remove latin
jbaross-pometry Aug 12, 2025
352bc8d
Merge branch 'master' into james/graphql-docstrings
jbaross-pometry Aug 12, 2025
b2e5cea
chore: apply tidy-public auto-fixes
github-actions[bot] Aug 12, 2025
a990029
initial fixes
jbaross-pometry Aug 14, 2025
d5a7d43
fmt
miratepuffin Aug 14, 2025
b18d478
chore: apply tidy-public auto-fixes
github-actions[bot] Aug 14, 2025
1ec9f2d
fix double spacing
jbaross-pometry Aug 14, 2025
e4abf4e
review fixes
jbaross-pometry Aug 15, 2025
9083a77
specify layers for has_edge
jbaross-pometry Aug 18, 2025
d7d5785
Merge branch 'master' into james/graphql-docstrings-fixes
jbaross-pometry Aug 18, 2025
76d4fd4
tidy
jbaross-pometry Aug 18, 2025
ebfcea7
chore: apply tidy-public auto-fixes
github-actions[bot] Aug 18, 2025
d746f0a
Merge branch 'master' into james/graphql-docstrings-fixes
miratepuffin Aug 22, 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
401 changes: 221 additions & 180 deletions docs/reference/graphql/graphql_API.md

Large diffs are not rendered by default.

350 changes: 192 additions & 158 deletions raphtory-graphql/schema.graphql

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion raphtory-graphql/src/model/graph/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ where

/// Fetch one page with a number of items up to a specified limit, optionally offset by a specified amount. The page_index sets the number of pages to skip (defaults to 0).
///
/// For example, if page(5, 2, 1) is called, a page with 5 items, offset by 11 items (2 pages of 5 + 1),
/// For example, if page(5, 2, 1) is called, a page with 5 items, offset by 11 items (2 pages of 5 + 1),
/// will be returned.
async fn page(&self, limit: usize, offset: Option<usize>, page_index: Option<usize>) -> Vec<T> {
let self_clone = self.clone();
Expand Down
2 changes: 1 addition & 1 deletion raphtory-graphql/src/model/graph/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub struct GqlDocument {
pub(crate) entity: GqlDocumentEntity,
/// Content of the document.
pub(crate) content: String,
/// Embedding vector.
/// Similarity score with a specified query
pub(crate) embedding: Vec<f32>,
pub(crate) score: f32,
}
28 changes: 15 additions & 13 deletions raphtory-graphql/src/model/graph/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ impl GqlEdge {
self.ee.default_layer().into()
}

/// Returns a view of Edge containing all layers in the list of names .
/// Returns a view of Edge containing all layers in the list of names.
///
/// Errors if any of the layers do not exist.
async fn layers(&self, names: Vec<String>) -> GqlEdge {
let self_clone = self.clone();
blocking_compute(move || self_clone.ee.valid_layers(names).into()).await
}

/// Returns a view of Edge containing all layers except the excluded list of names .
/// Returns a view of Edge containing all layers except the excluded list of names.
///
/// Errors if any of the layers do not exist.
async fn exclude_layers(&self, names: Vec<String>) -> GqlEdge {
Expand Down Expand Up @@ -137,12 +137,14 @@ impl GqlEdge {
}
}

/// Creates a view of the Edge including all events between the specified start (inclusive) and end (exclusive).
/// Creates a view of the Edge including all events between the specified start (inclusive) and end (exclusive).
///
/// For persistent graphs, any edge which exists at any point during the window will be included. You may want to restrict this to only edges that are present at the end of the window using the is_valid function.
async fn window(&self, start: i64, end: i64) -> GqlEdge {
self.ee.window(start, end).into()
}

/// Creates a view of the Edge including all events at a specified time .
/// Creates a view of the Edge including all events at a specified time.
async fn at(&self, time: i64) -> GqlEdge {
self.ee.at(time).into()
}
Expand All @@ -152,46 +154,46 @@ impl GqlEdge {
self.ee.latest().into()
}

/// Creates a view of the Edge including all events that have not been explicitly deleted at time.
/// Creates a view of the Edge including all events that are valid at time.
///
/// This is equivalent to before(time + 1) for Graph and at(time) for PersistentGraph.
async fn snapshot_at(&self, time: i64) -> GqlEdge {
self.ee.snapshot_at(time).into()
}

/// Creates a view of the Edge including all events that have not been explicitly deleted at the latest time.
/// Creates a view of the Edge including all events that are valid at the latest time.
///
/// This is equivalent to a no-op for Graph and latest() for PersistentGraph.
async fn snapshot_latest(&self) -> GqlEdge {
self.ee.snapshot_latest().into()
}

/// Creates a view of the Edge including all events before a specified end (exclusive).
/// Creates a view of the Edge including all events before a specified end (exclusive).
async fn before(&self, time: i64) -> GqlEdge {
self.ee.before(time).into()
}

/// Creates a view of the Edge including all events after a specified start (exclusive).
/// Creates a view of the Edge including all events after a specified start (exclusive).
async fn after(&self, time: i64) -> GqlEdge {
self.ee.after(time).into()
}

/// Shrinks both the start and end of the window.
/// Shrinks both the start and end of the window.
async fn shrink_window(&self, start: i64, end: i64) -> Self {
self.ee.shrink_window(start, end).into()
}

/// Set the start of the window.
/// Set the start of the window.
async fn shrink_start(&self, start: i64) -> Self {
self.ee.shrink_start(start).into()
}

/// Set the end of the window.
/// Set the end of the window.
async fn shrink_end(&self, end: i64) -> Self {
self.ee.shrink_end(end).into()
}

/// Takes a specified selection of views and applies them in order given
/// Takes a specified selection of views and applies them in given order.
async fn apply_views(&self, views: Vec<EdgeViewCollection>) -> Result<GqlEdge, GraphError> {
let mut return_view: GqlEdge = self.ee.clone().into();
for view in views {
Expand Down Expand Up @@ -368,7 +370,7 @@ impl GqlEdge {
self.ee.is_deleted()
}

/// Checks if the edge is on the same node.
/// Returns true if the edge source and destination nodes are the same.
///
/// Returns: boolean
async fn is_self_loop(&self) -> bool {
Expand Down
41 changes: 24 additions & 17 deletions raphtory-graphql/src/model/graph/edges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,41 +47,45 @@ impl GqlEdges {
}
}

/// A collection of edges that can be iterated over.
/// A collection of edges.
///
/// Collections can be filtered and used to create lists.
#[ResolvedObjectFields]
impl GqlEdges {
////////////////////////
// LAYERS AND WINDOWS //
////////////////////////

/// Return a view of Edge containing only the default edge layer.
/// Returns a collection containing only edges in the default edge layer.
async fn default_layer(&self) -> Self {
self.update(self.ee.default_layer())
}

/// Returns a view of Edge containing all layers in the list of names.
/// Returns a collection containing only edges belonging to the listed layers.
async fn layers(&self, names: Vec<String>) -> Self {
let self_clone = self.clone();
blocking_compute(move || self_clone.update(self_clone.ee.valid_layers(names))).await
}

/// Returns a view of Edge containing all layers except the excluded list of names.
/// Returns a collection containing edges belonging to all layers except the excluded list of layers.
async fn exclude_layers(&self, names: Vec<String>) -> Self {
let self_clone = self.clone();
blocking_compute(move || self_clone.update(self_clone.ee.exclude_valid_layers(names))).await
}

/// Returns a view of Edge containing the specified layer.
/// Returns a collection containing edges belonging to the specified layer.
async fn layer(&self, name: String) -> Self {
self.update(self.ee.valid_layers(name))
}

/// Returns a view of Edge containing all layers except the excluded layer specified.
/// Returns a collection containing edges belonging to all layers except the excluded layer specified.
async fn exclude_layer(&self, name: String) -> Self {
self.update(self.ee.exclude_valid_layers(name))
}

/// Creates a WindowSet with the given window duration and optional step using a rolling window. A rolling window is a window that moves forward by step size at each iteration.
///
/// Returns a collection of collections. This means that item in the window set is a collection of edges.
async fn rolling(
&self,
window: WindowDuration,
Expand Down Expand Up @@ -114,19 +118,21 @@ impl GqlEdges {
}

/// Creates a WindowSet with the given step size using an expanding window. An expanding window is a window that grows by step size at each iteration.
///
/// Returns a collection of collections. This means that item in the window set is a collection of edges.
async fn expanding(&self, step: WindowDuration) -> Result<GqlEdgesWindowSet, GraphError> {
match step {
Duration(step) => Ok(GqlEdgesWindowSet::new(self.ee.expanding(step)?)),
Epoch(step) => Ok(GqlEdgesWindowSet::new(self.ee.expanding(step)?)),
}
}

/// Creates a view of the Edge including all events between the specified start (inclusive) and end (exclusive).
/// Creates a view of the Edge including all events between the specified start (inclusive) and end (exclusive).
async fn window(&self, start: i64, end: i64) -> Self {
self.update(self.ee.window(start, end))
}

/// Creates a view of the Edge including all events at a specified time .
/// Creates a view of the Edge including all events at a specified time.
async fn at(&self, time: i64) -> Self {
self.update(self.ee.at(time))
}
Expand All @@ -135,37 +141,37 @@ impl GqlEdges {
self.update(self.ee.latest())
}

/// Creates a view of the Edge including all events that have not been explicitly deleted at time. This is equivalent to before(time + 1) for Graph and at(time) for PersistentGraph.
/// Creates a view of the Edge including all events that are valid at time. This is equivalent to before(time + 1) for Graph and at(time) for PersistentGraph.
async fn snapshot_at(&self, time: i64) -> Self {
self.update(self.ee.snapshot_at(time))
}

/// Creates a view of the Edge including all events that have not been explicitly deleted at the latest time. This is equivalent to a no-op for Graph and latest() for PersistentGraph.
/// Creates a view of the Edge including all events that are valid at the latest time. This is equivalent to a no-op for Graph and latest() for PersistentGraph.
async fn snapshot_latest(&self) -> Self {
self.update(self.ee.snapshot_latest())
}

/// Creates a view of the Edge including all events before a specified end (exclusive).
/// Creates a view of the Edge including all events before a specified end (exclusive).
async fn before(&self, time: i64) -> Self {
self.update(self.ee.before(time))
}

/// Creates a view of the Edge including all events after a specified start (exclusive).
/// Creates a view of the Edge including all events after a specified start (exclusive).
async fn after(&self, time: i64) -> Self {
self.update(self.ee.after(time))
}

/// Shrinks both the start and end of the window.
/// Shrinks both the start and end of the window.
async fn shrink_window(&self, start: i64, end: i64) -> Self {
self.update(self.ee.shrink_window(start, end))
}

/// Set the start of the window.
/// Set the start of the window.
async fn shrink_start(&self, start: i64) -> Self {
self.update(self.ee.shrink_start(start))
}

/// Set the end of the window.
/// Set the end of the window.
async fn shrink_end(&self, end: i64) -> Self {
self.update(self.ee.shrink_end(end))
}
Expand Down Expand Up @@ -232,7 +238,7 @@ impl GqlEdges {
self.update(self.ee.explode_layers())
}

/// Specify a sort order.
/// Specify a sort order from: source, destination, property, time. You can also reverse the ordering.
async fn sorted(&self, sort_bys: Vec<EdgeSortBy>) -> Self {
let self_clone = self.clone();
blocking_compute(move || {
Expand Down Expand Up @@ -322,7 +328,7 @@ impl GqlEdges {
/// Fetch one page with a number of items up to a specified limit, optionally offset by a specified amount.
/// The page_index sets the number of pages to skip (defaults to 0).
///
/// For example, if page(5, 2, 1) is called, a page with 5 items, offset by 11 items (2 pages of 5 + 1),
/// For example, if page(5, 2, 1) is called, a page with 5 items, offset by 11 items (2 pages of 5 + 1),
/// will be returned.
async fn page(
&self,
Expand All @@ -338,6 +344,7 @@ impl GqlEdges {
.await
}

/// Returns a list of all objects in the current selection of the collection. You should filter filter the collection first then call list.
async fn list(&self) -> Vec<GqlEdge> {
let self_clone = self.clone();
blocking_compute(move || self_clone.iter().collect()).await
Expand Down
Loading
Loading