Skip to content

Commit 3251d27

Browse files
committed
ref
1 parent c4f388b commit 3251d27

File tree

3 files changed

+110
-11
lines changed

3 files changed

+110
-11
lines changed

raphtory/src/db/graph/views/filter/mod.rs

Lines changed: 104 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3822,6 +3822,13 @@ pub(crate) mod test_filters {
38223822
&expected_results,
38233823
TestVariants::All,
38243824
);
3825+
assert_search_nodes_results(
3826+
init_nodes_graph,
3827+
IdentityGraphTransformer,
3828+
filter,
3829+
&expected_results,
3830+
TestVariants::All,
3831+
);
38253832

38263833
// Wider window includes node 3
38273834
let filter = NodeFilter::window(1, 5)
@@ -3838,6 +3845,13 @@ pub(crate) mod test_filters {
38383845
&expected_results,
38393846
TestVariants::All,
38403847
);
3848+
assert_search_nodes_results(
3849+
init_nodes_graph,
3850+
IdentityGraphTransformer,
3851+
filter,
3852+
&expected_results,
3853+
TestVariants::All,
3854+
);
38413855
}
38423856

38433857
#[test]
@@ -3856,13 +3870,27 @@ pub(crate) mod test_filters {
38563870
&expected_results,
38573871
TestVariants::All,
38583872
);
3873+
assert_search_nodes_results(
3874+
init_nodes_graph,
3875+
IdentityGraphTransformer,
3876+
filter1.clone(),
3877+
&expected_results,
3878+
TestVariants::All,
3879+
);
38593880
assert_filter_nodes_results(
38603881
init_nodes_graph,
38613882
IdentityGraphTransformer,
38623883
filter2.clone(),
38633884
&expected_results,
38643885
TestVariants::All,
38653886
);
3887+
assert_search_nodes_results(
3888+
init_nodes_graph,
3889+
IdentityGraphTransformer,
3890+
filter2.clone(),
3891+
&expected_results,
3892+
TestVariants::All,
3893+
);
38663894
}
38673895

38683896
#[test]
@@ -3881,6 +3909,13 @@ pub(crate) mod test_filters {
38813909
&expected_results,
38823910
TestVariants::All,
38833911
);
3912+
assert_search_nodes_results(
3913+
init_nodes_graph,
3914+
IdentityGraphTransformer,
3915+
filter.clone(),
3916+
&expected_results,
3917+
TestVariants::All,
3918+
);
38843919

38853920
let filter = NodeFilter::window(3, 5)
38863921
.property("p20")
@@ -3896,6 +3931,13 @@ pub(crate) mod test_filters {
38963931
&expected_results,
38973932
TestVariants::All,
38983933
);
3934+
assert_search_nodes_results(
3935+
init_nodes_graph,
3936+
IdentityGraphTransformer,
3937+
filter.clone(),
3938+
&expected_results,
3939+
TestVariants::All,
3940+
);
38993941
}
39003942

39013943
#[test]
@@ -3914,11 +3956,20 @@ pub(crate) mod test_filters {
39143956
.sum()
39153957
.eq(6u64);
39163958

3959+
let filter = filter1.and(filter2);
3960+
39173961
let expected_results = vec!["3"];
39183962
assert_filter_nodes_results(
39193963
init_nodes_graph,
39203964
IdentityGraphTransformer,
3921-
filter1.and(filter2).clone(),
3965+
filter.clone(),
3966+
&expected_results,
3967+
TestVariants::All,
3968+
);
3969+
assert_search_nodes_results(
3970+
init_nodes_graph,
3971+
IdentityGraphTransformer,
3972+
filter,
39223973
&expected_results,
39233974
TestVariants::All,
39243975
);
@@ -9948,6 +9999,13 @@ pub(crate) mod test_filters {
99489999
&expected_results,
994910000
TestVariants::All,
995010001
);
10002+
assert_search_edges_results(
10003+
init_edges_graph,
10004+
IdentityGraphTransformer,
10005+
filter.clone(),
10006+
&expected_results,
10007+
TestVariants::All,
10008+
);
995110009

995210010
let filter = EdgeFilter::window(1, 5)
995310011
.property("p2")
@@ -9970,6 +10028,13 @@ pub(crate) mod test_filters {
997010028
&expected_results,
997110029
TestVariants::All,
997210030
);
10031+
assert_search_edges_results(
10032+
init_edges_graph,
10033+
IdentityGraphTransformer,
10034+
filter.clone(),
10035+
&expected_results,
10036+
TestVariants::All,
10037+
);
997310038
}
997410039

997510040
#[test]
@@ -9987,13 +10052,27 @@ pub(crate) mod test_filters {
998710052
&expected_results,
998810053
TestVariants::All,
998910054
);
10055+
assert_search_edges_results(
10056+
init_edges_graph,
10057+
IdentityGraphTransformer,
10058+
filter1.clone(),
10059+
&expected_results,
10060+
TestVariants::All,
10061+
);
999010062
assert_filter_edges_results(
999110063
init_edges_graph,
999210064
IdentityGraphTransformer,
999310065
filter2.clone(),
999410066
&expected_results,
999510067
TestVariants::All,
999610068
);
10069+
assert_search_edges_results(
10070+
init_edges_graph,
10071+
IdentityGraphTransformer,
10072+
filter2.clone(),
10073+
&expected_results,
10074+
TestVariants::All,
10075+
);
999710076
}
999810077

999910078
#[test]
@@ -10012,6 +10091,13 @@ pub(crate) mod test_filters {
1001210091
&expected_any,
1001310092
TestVariants::All,
1001410093
);
10094+
assert_search_edges_results(
10095+
init_edges_graph,
10096+
IdentityGraphTransformer,
10097+
filter_any.clone(),
10098+
&expected_any,
10099+
TestVariants::All,
10100+
);
1001510101

1001610102
let filter_all = EdgeFilter::window(2, 4)
1001710103
.property("p20")
@@ -10027,6 +10113,13 @@ pub(crate) mod test_filters {
1002710113
&expected_all,
1002810114
TestVariants::All,
1002910115
);
10116+
assert_search_edges_results(
10117+
init_edges_graph,
10118+
IdentityGraphTransformer,
10119+
filter_all.clone(),
10120+
&expected_all,
10121+
TestVariants::All,
10122+
);
1003010123
}
1003110124

1003210125
#[test]
@@ -10043,11 +10136,20 @@ pub(crate) mod test_filters {
1004310136
.sum()
1004410137
.eq(6u64);
1004510138

10139+
let filter = filter1.and(filter2);
10140+
1004610141
let expected_results = vec!["2->1"];
1004710142
assert_filter_edges_results(
1004810143
init_edges_graph,
1004910144
IdentityGraphTransformer,
10050-
filter1.and(filter2).clone(),
10145+
filter.clone(),
10146+
&expected_results,
10147+
TestVariants::All,
10148+
);
10149+
assert_search_edges_results(
10150+
init_edges_graph,
10151+
IdentityGraphTransformer,
10152+
filter,
1005110153
&expected_results,
1005210154
TestVariants::All,
1005310155
);

raphtory/src/db/graph/views/filter/model/edge_filter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::{
1212
errors::GraphError,
1313
prelude::GraphViewOps,
1414
};
15-
use raphtory_api::core::{entities::GID, storage::timeindex::TimeIndexEntry};
15+
use raphtory_api::core::entities::GID;
1616
use raphtory_core::utils::time::IntoTime;
1717
use std::{fmt, fmt::Display, ops::Deref, sync::Arc};
1818

raphtory/src/db/graph/views/filter/model/property_filter.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::{
33
api::{
44
properties::{internal::InternalPropertiesOps, Metadata, Properties},
55
view::{
6-
internal::{GraphTimeSemanticsOps, GraphView, NodeTimeSemanticsOps},
6+
internal::{GraphView, NodeTimeSemanticsOps},
77
node::NodeViewOps,
88
EdgeViewOps,
99
},
@@ -23,7 +23,7 @@ use crate::{
2323
},
2424
},
2525
errors::GraphError,
26-
prelude::{GraphViewOps, PropertiesOps, TimeOps},
26+
prelude::{GraphViewOps, PropertiesOps},
2727
};
2828
use itertools::Itertools;
2929
use raphtory_api::core::{
@@ -39,12 +39,9 @@ use raphtory_api::core::{
3939
timeindex::{AsTime, TimeIndexEntry},
4040
},
4141
};
42-
use raphtory_storage::{
43-
core_ops::CoreGraphOps,
44-
graph::{
45-
edges::{edge_ref::EdgeStorageRef, edge_storage_ops::EdgeStorageOps},
46-
nodes::{node_ref::NodeStorageRef, node_storage_ops::NodeStorageOps},
47-
},
42+
use raphtory_storage::graph::{
43+
edges::{edge_ref::EdgeStorageRef, edge_storage_ops::EdgeStorageOps},
44+
nodes::{node_ref::NodeStorageRef, node_storage_ops::NodeStorageOps},
4845
};
4946
use std::{collections::HashSet, fmt, fmt::Display, marker::PhantomData, ops::Deref, sync::Arc};
5047

0 commit comments

Comments
 (0)