Skip to content

Commit 850a65c

Browse files
committed
Merge branch 'master' into feature/history-object
2 parents 9d15a56 + 0c61157 commit 850a65c

File tree

17 files changed

+480
-29
lines changed

17 files changed

+480
-29
lines changed

docs/reference/graphql/graphql_API.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2547,43 +2547,43 @@ This allows you to specify multiple operations together.
25472547
</thead>
25482548
<tbody>
25492549
<tr>
2550-
<td colspan="2" valign="top"><strong id="graphalgorithmplugin.pagerank">pagerank</strong></td>
2551-
<td valign="top">[<a href="#pagerankoutput">PagerankOutput</a>!]!</td>
2550+
<td colspan="2" valign="top"><strong id="graphalgorithmplugin.shortest_path">shortest_path</strong></td>
2551+
<td valign="top">[<a href="#shortestpathoutput">ShortestPathOutput</a>!]!</td>
25522552
<td></td>
25532553
</tr>
25542554
<tr>
2555-
<td colspan="2" align="right" valign="top">iterCount</td>
2556-
<td valign="top"><a href="#int">Int</a>!</td>
2555+
<td colspan="2" align="right" valign="top">source</td>
2556+
<td valign="top"><a href="#string">String</a>!</td>
25572557
<td></td>
25582558
</tr>
25592559
<tr>
2560-
<td colspan="2" align="right" valign="top">threads</td>
2561-
<td valign="top"><a href="#int">Int</a></td>
2560+
<td colspan="2" align="right" valign="top">targets</td>
2561+
<td valign="top">[<a href="#string">String</a>!]!</td>
25622562
<td></td>
25632563
</tr>
25642564
<tr>
2565-
<td colspan="2" align="right" valign="top">tol</td>
2566-
<td valign="top"><a href="#float">Float</a></td>
2565+
<td colspan="2" align="right" valign="top">direction</td>
2566+
<td valign="top"><a href="#string">String</a></td>
25672567
<td></td>
25682568
</tr>
25692569
<tr>
2570-
<td colspan="2" valign="top"><strong id="graphalgorithmplugin.shortest_path">shortest_path</strong></td>
2571-
<td valign="top">[<a href="#shortestpathoutput">ShortestPathOutput</a>!]!</td>
2570+
<td colspan="2" valign="top"><strong id="graphalgorithmplugin.pagerank">pagerank</strong></td>
2571+
<td valign="top">[<a href="#pagerankoutput">PagerankOutput</a>!]!</td>
25722572
<td></td>
25732573
</tr>
25742574
<tr>
2575-
<td colspan="2" align="right" valign="top">source</td>
2576-
<td valign="top"><a href="#string">String</a>!</td>
2575+
<td colspan="2" align="right" valign="top">iterCount</td>
2576+
<td valign="top"><a href="#int">Int</a>!</td>
25772577
<td></td>
25782578
</tr>
25792579
<tr>
2580-
<td colspan="2" align="right" valign="top">targets</td>
2581-
<td valign="top">[<a href="#string">String</a>!]!</td>
2580+
<td colspan="2" align="right" valign="top">threads</td>
2581+
<td valign="top"><a href="#int">Int</a></td>
25822582
<td></td>
25832583
</tr>
25842584
<tr>
2585-
<td colspan="2" align="right" valign="top">direction</td>
2586-
<td valign="top"><a href="#string">String</a></td>
2585+
<td colspan="2" align="right" valign="top">tol</td>
2586+
<td valign="top"><a href="#float">Float</a></td>
25872587
<td></td>
25882588
</tr>
25892589
</tbody>

pometry-storage-private

raphtory-api/src/core/storage/timeindex.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ pub trait TimeIndexOps<'a>: Sized + Clone + Send + Sync + 'a {
9393

9494
#[inline]
9595
fn active_t(&self, w: Range<i64>) -> bool {
96-
self.active(Self::IndexType::range(w))
96+
self.active(<Self::IndexType as AsTime>::range(w))
9797
}
9898

9999
fn range(&self, w: Range<Self::IndexType>) -> Self::RangeType;
100100

101101
fn range_t(&self, w: Range<i64>) -> Self::RangeType {
102-
self.range(Self::IndexType::range(w))
102+
self.range(<Self::IndexType as AsTime>::range(w))
103103
}
104104

105105
fn first_t(&self) -> Option<i64> {

raphtory-cypher/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ mod cypher {
289289
let dsts = PrimitiveArray::from_vec(vec![3u64, 3u64, 4u64, 4u64]).boxed();
290290
let time = PrimitiveArray::from_vec(vec![2i64, 3i64, 4i64, 5i64]).boxed();
291291
let weight =
292-
PrimitiveArray::from_vec(vec![3.14f64, 4.14f64, 5.14f64, 6.14f64]).boxed();
292+
PrimitiveArray::from_vec(vec![3.15f64, 4.14f64, 5.14f64, 6.14f64]).boxed();
293293

294294
let chunk = StructArray::new(
295295
ArrowDataType::Struct(schema().fields),

raphtory-graphql/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,8 +940,8 @@ type Graph {
940940
}
941941

942942
type GraphAlgorithmPlugin {
943-
pagerank(iterCount: Int!, threads: Int, tol: Float): [PagerankOutput!]!
944943
shortest_path(source: String!, targets: [String!]!, direction: String): [ShortestPathOutput!]!
944+
pagerank(iterCount: Int!, threads: Int, tol: Float): [PagerankOutput!]!
945945
}
946946

947947
type GraphSchema {

raphtory-storage/src/disk/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,16 @@ mod test {
511511

512512
let mut expected_node_additions = edges
513513
.iter()
514-
.flat_map(|(src, dst, t)| [(*src, *t), (*dst, *t)])
514+
.flat_map(|(src, dst, t)| {
515+
if src != dst {
516+
vec![(*src, *t), (*dst, *t)]
517+
} else {
518+
vec![(*src, *t)]
519+
}
520+
})
515521
.into_group_map();
516522
for v in expected_node_additions.values_mut() {
517523
v.sort();
518-
v.dedup();
519524
}
520525

521526
for (v_id, node) in nodes.iter().enumerate() {

raphtory/src/db/api/storage/graph/storage_ops/disk_storage.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,25 @@ mod storage_tests {
11891189
})
11901190
}
11911191

1192+
#[test]
1193+
fn test_merge_simple() {
1194+
let left = [(4, 4, 2), (4, 4, 2)];
1195+
let right = [];
1196+
inner_merge_test(&left, &right);
1197+
1198+
let left = [(0, 5, 5)];
1199+
let right = [];
1200+
inner_merge_test(&left, &right);
1201+
1202+
let left = [(0, 0, 0), (0, 0, 0), (0, 0, 0)];
1203+
let right = [];
1204+
inner_merge_test(&left, &right);
1205+
1206+
let left = [(0, 0, 0), (0, 0, 0), (0, 0, 0)];
1207+
let right = [(0, 0, 0)];
1208+
inner_merge_test(&left, &right);
1209+
}
1210+
11921211
#[test]
11931212
fn test_one_empty_graph_non_zero_time() {
11941213
inner_merge_test(&[], &[(1, 0, 0)])

raphtory/src/db/api/view/exploded_edge_property_filter.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@ mod test {
483483
.filter_exploded_edges(PropertyFilterBuilder::new("test").gt(0i64))
484484
.unwrap();
485485
let gfm = gf.materialize().unwrap();
486-
dbg!(&gfm);
487486
assert_eq!(gf.node(0).unwrap().out_degree(), 1);
488487
assert_eq!(gfm.node(0).unwrap().out_degree(), 1);
489488
assert_graph_equal(&gf, &gfm);

raphtory/src/db/api/view/internal/time_semantics/base_time_semantics.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,44 @@ impl NodeTimeSemanticsOps for BaseTimeSemantics {
131131
for_all!(self, semantics => semantics.node_edge_history_count(node, view))
132132
}
133133

134+
#[inline]
135+
fn node_edge_history<'graph, G: GraphView + 'graph>(
136+
self,
137+
node: NodeStorageRef<'graph>,
138+
view: G,
139+
) -> impl Iterator<Item = (TimeIndexEntry, ELID)> + Send + Sync + 'graph {
140+
for_all_iter!(self, semantics => semantics.node_edge_history(node, view))
141+
}
142+
143+
#[inline]
144+
fn node_edge_history_window<'graph, G: GraphView + 'graph>(
145+
self,
146+
node: NodeStorageRef<'graph>,
147+
view: G,
148+
w: Range<i64>,
149+
) -> impl Iterator<Item = (TimeIndexEntry, ELID)> + Send + Sync + 'graph {
150+
for_all_iter!(self, semantics => semantics.node_edge_history_window(node, view, w))
151+
}
152+
153+
#[inline]
154+
fn node_edge_history_rev<'graph, G: GraphView + 'graph>(
155+
self,
156+
node: NodeStorageRef<'graph>,
157+
view: G,
158+
) -> impl Iterator<Item = (TimeIndexEntry, ELID)> + Send + Sync + 'graph {
159+
for_all_iter!(self, semantics => semantics.node_edge_history_rev(node, view))
160+
}
161+
162+
#[inline]
163+
fn node_edge_history_rev_window<'graph, G: GraphView + 'graph>(
164+
self,
165+
node: NodeStorageRef<'graph>,
166+
view: G,
167+
w: Range<i64>,
168+
) -> impl Iterator<Item = (TimeIndexEntry, ELID)> + Send + Sync + 'graph {
169+
for_all_iter!(self, semantics => semantics.node_edge_history_rev_window(node, view, w))
170+
}
171+
134172
#[inline]
135173
fn node_edge_history_count_window<'graph, G: GraphView + 'graph>(
136174
self,

raphtory/src/db/api/view/internal/time_semantics/event_semantics.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,40 @@ impl NodeTimeSemanticsOps for EventSemantics {
109109
node.history(view).range(w).edge_history().len()
110110
}
111111

112+
fn node_edge_history<'graph, G: GraphView + 'graph>(
113+
self,
114+
node: NodeStorageRef<'graph>,
115+
view: G,
116+
) -> impl Iterator<Item = (TimeIndexEntry, ELID)> + Send + Sync + 'graph {
117+
node.edge_history(view).history()
118+
}
119+
120+
fn node_edge_history_window<'graph, G: GraphView + 'graph>(
121+
self,
122+
node: NodeStorageRef<'graph>,
123+
view: G,
124+
w: Range<i64>,
125+
) -> impl Iterator<Item = (TimeIndexEntry, ELID)> + Send + Sync + 'graph {
126+
node.edge_history(view).range_t(w).history()
127+
}
128+
129+
fn node_edge_history_rev<'graph, G: GraphView + 'graph>(
130+
self,
131+
node: NodeStorageRef<'graph>,
132+
view: G,
133+
) -> impl Iterator<Item = (TimeIndexEntry, ELID)> + Send + Sync + 'graph {
134+
node.edge_history(view).history_rev()
135+
}
136+
137+
fn node_edge_history_rev_window<'graph, G: GraphView + 'graph>(
138+
self,
139+
node: NodeStorageRef<'graph>,
140+
view: G,
141+
w: Range<i64>,
142+
) -> impl Iterator<Item = (TimeIndexEntry, ELID)> + Send + Sync + 'graph {
143+
node.edge_history(view).range_t(w).history_rev()
144+
}
145+
112146
fn node_updates<'graph, G: GraphView + 'graph>(
113147
self,
114148
node: NodeStorageRef<'graph>,

0 commit comments

Comments
 (0)