Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
77 changes: 77 additions & 0 deletions docs/reference/graphql/graphql_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -3367,6 +3367,11 @@ Ordered list of view operations; each entry is a one-of variant applied to the r
<td></td>
</tr>
<tr>
<td colspan="2" align="right" valign="top">weight</td>
<td valign="top"><a href="#string">String</a></td>
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong id="graphalgorithmplugin.shortest_path">shortest_path</strong></td>
<td valign="top">[<a href="#shortestpathoutput">ShortestPathOutput</a>!]!</td>
<td></td>
Expand Down Expand Up @@ -8279,6 +8284,30 @@ Optional `{start, end}` to restrict matches to edges active in that interval.

## Inputs

### DegreeFilterNew

<table>
<thead>
<tr>
<th colspan="2" align="left">Field</th>
<th align="left">Type</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" valign="top"><strong id="degreefilternew.direction">direction</strong></td>
<td valign="top"><a href="#degreedirection">DegreeDirection</a>!</td>
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong id="degreefilternew.where">where</strong></td>
<td valign="top"><a href="#propcondition">PropCondition</a>!</td>
<td></td>
</tr>
</tbody>
</table>

### EdgeAddition

<table>
Expand Down Expand Up @@ -9919,6 +9948,15 @@ Filters a built-in node field (ID, name, or type).

Filters a node property by name and condition.

</td>
</tr>
<tr>
<td colspan="2" valign="top"><strong id="nodefilter.degree">degree</strong></td>
<td valign="top"><a href="#degreefilternew">DegreeFilterNew</a></td>
<td>

Filters a node's degree (in, out, or total) by a condition.

</td>
</tr>
<tr>
Expand Down Expand Up @@ -11580,6 +11618,45 @@ All properties.
</tbody>
</table>

### DegreeDirection

Filters nodes by computed degree with a directional scope.

`DegreeFilterNew` lets callers filter on:
- inbound degree (`IN`),
- outbound degree (`OUT`),
- or total degree (`BOTH`).

The selected degree is compared using the `where` condition.

Example (GraphQL):
```graphql
{ Degree: { direction: BOTH, where: { Gt: 10 } } }
```

<table>
<thead>
<tr>
<th align="left">Value</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top"><strong>IN</strong></td>
<td></td>
</tr>
<tr>
<td valign="top"><strong>OUT</strong></td>
<td></td>
</tr>
<tr>
<td valign="top"><strong>BOTH</strong></td>
<td></td>
</tr>
</tbody>
</table>

### GraphType

<table>
Expand Down
3 changes: 1 addition & 2 deletions examples/rust/src/bin/crypto/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use itertools::Itertools;
use raphtory::{
algorithms::{
centrality::pagerank::page_rank,
pathing::temporal_reachability::temporally_reachable_nodes,
centrality::pagerank::page_rank, pathing::temporal_reachability::temporally_reachable_nodes,
},
db::api::view::*,
graph_loader::stable_coins::stable_coin_graph,
Expand Down
4 changes: 1 addition & 3 deletions examples/rust/src/bin/pokec/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use raphtory::{
algorithms::{
centrality::pagerank::page_rank, components::weakly_connected_components,
},
algorithms::{centrality::pagerank::page_rank, components::weakly_connected_components},
db::{api::mutation::AdditionOps, graph::graph::Graph},
io::csv_loader::CsvLoader,
logging::global_info_logger,
Expand Down
27 changes: 27 additions & 0 deletions python/python/raphtory/filter/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,15 @@ class Node(object):
filter.FilterExpr:
"""

@staticmethod
def degree():
"""
Selects total node degree for filtering.

Returns:
filter.FilterOps
"""

@staticmethod
def id() -> filter.NodeIdFilterBuilder:
"""
Expand All @@ -350,6 +359,15 @@ class Node(object):
filter.NodeIdFilterBuilder:
"""

@staticmethod
def in_degree():
"""
Selects incoming node degree for filtering.

Returns:
filter.FilterOps
"""

@staticmethod
def is_active() -> filter.FilterExpr:
"""
Expand Down Expand Up @@ -424,6 +442,15 @@ class Node(object):
filter.NodeTypeFilterBuilder:
"""

@staticmethod
def out_degree():
"""
Selects outgoing node degree for filtering.

Returns:
filter.FilterOps
"""

@staticmethod
def property(name: str) -> filter.PropertyFilterOps:
"""
Expand Down
Loading
Loading