Can we add support for maps for both filter and search for both properties and metadata
@shivamka1 is already working on this.
Since Sep 5, 2025.
- Dominant language
- Rust
- Stars
- 642
- Forks
- 70
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 21
Description
Properties
p1 -> {"fire_nation": 1, "water_tribe": 2} is a map
filter.Node.property("p1") == {"fire_nation": 1, "water_tribe": 2} (Q)
filter.Node.property("p1").contains("fire_nation"), not_contains
filter.Node.property("p1").get("fire_nation") == 1
filter.Node.property("p1").values().sum() > 3, other agg filters
// latest property
filter.Edge.layer("fire_nation").property("p1").is_some()
Metadata
If there is only a single layer, metadata is a single value otherwise it is a map:
filter.Edge.metadata("p1") == {"fire_nation": 1, "water_tribe": 2}
filter.Edge.metadata("p1").contains("fire_nation") (A'), not_contains
filter.Edge.layer("fire_nation").metadata("p1").is_some() (B')
filter.Edge.layer("fire_nation").metadata("p1") == 1 (A)
filter.Edge.metadata("p1").get("fire_nation") == 1 (B)
filter.Edge.metadata("p1").values().sum() > 3, other agg filters
Notes:
- A and B, A' and B' are equivalent semantically
.layeris not supported for node- Node metdata is always a single value as of now!
- Q is the only thing supported as of now but not for metadata
- Search needs to support map, layers: test_search_edges_for_metadata_eq
metadata is now a map of layers to value. for instance: p1 -> {"water_tribe" -> 1, "fire_nation" -> 2}. So in order to be able to search for a metadata we need to either:- Get a layered graph like so: graph.layer("fire_nation") and a filter: filter.Edge.metadata("p1") == 1
- Support filter: filter.Edge.metadata("p1") == {"fire_nation": 1} [supported in raphtory, not in search apis as of yet], filter.Edge.metadata("p1").all() == 1, filter.Edge.metadata("p1").any() == 1. Here filter.Edge.metadata("p1") is essentially a map, so qualifiers like all, any should also be supported for a map.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.