Skip to content

Graph #

Bases: object

Entry point for constructing graph-level view filters.

The Graph filter restricts when and where the graph is evaluated, independent of node or edge predicates. It defines the temporal scope (windows, snapshots, latest state) and layer scope for subsequent node and edge filters.

All methods are static and return a ViewFilterBuilder, which can then be refined further or combined with node/edge predicates.

Examples:

Graph.window(0, 10) Graph.at(5) Graph.latest().layer("fire_nation") Graph.layers(["A", "B"]).snapshot_latest()

after(time) staticmethod #

Restricts evaluation to times strictly after the given time.

Parameters:

Name Type Description Default
time int

Lower time bound.

required

Returns:

Type Description

filter.ViewFilterBuilder

at(time) staticmethod #

Restricts evaluation to a single point in time.

Parameters:

Name Type Description Default
time int

Event time.

required

Returns:

Type Description

filter.ViewFilterBuilder

before(time) staticmethod #

Restricts evaluation to times strictly before the given time.

Parameters:

Name Type Description Default
time int

Upper time bound.

required

Returns:

Type Description

filter.ViewFilterBuilder

latest() staticmethod #

Evaluates filters against the latest available state of the graph.

Returns:

Type Description

filter.ViewFilterBuilder

layer(layer) staticmethod #

Restricts evaluation to a single layer.

Parameters:

Name Type Description Default
layer str

Layer name.

required

Returns:

Type Description

filter.ViewFilterBuilder

layers(layers) staticmethod #

Restricts evaluation to any of the given layers.

Parameters:

Name Type Description Default
layers list[str]

Layer names.

required

Returns:

Type Description

filter.ViewFilterBuilder

snapshot_at(time) staticmethod #

Evaluates filters against a snapshot of the graph at a given time.

Parameters:

Name Type Description Default
time int

Snapshot time.

required

Returns:

Type Description

filter.ViewFilterBuilder

snapshot_latest() staticmethod #

Evaluates filters against the most recent snapshot of the graph.

Returns:

Type Description

filter.ViewFilterBuilder

window(start, end) staticmethod #

Restricts evaluation to events within a time window.

The window is inclusive of start and exclusive of end.

Parameters:

Name Type Description Default
start int

Start time.

required
end int

End time.

required

Returns:

Type Description

filter.ViewFilterBuilder