Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
erlendvollset committed Nov 30, 2023
1 parent ff2ebcc commit 2dc0edb
Showing 1 changed file with 182 additions and 4 deletions.
186 changes: 182 additions & 4 deletions docs/source/filters.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,186 @@
Filters
=======

Filtering Data Classes
^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: cognite.client.data_classes.filters
The filter language provides a set of classes that can be used to construct complex
queries for filtering data. Each filter class represents a specific filtering criterion,
allowing users to tailor their queries to their specific needs. Below is an overview of the
available filters:

Filter
------
Base class for all filters

.. autoclass:: cognite.client.data_classes.filters.Filter
:members:
:member-order: bysource

Logical Operators
-----------------

And
^^^
The `And` filter performs a logical AND operation on multiple filters, requiring all specified
conditions to be true for an item to match the filter.

.. autoclass:: cognite.client.data_classes.filters.And
:members:
:member-order: bysource

Not
^^^
The `Not` filter performs a logical NOT operation on a sub-filter.

.. autoclass:: cognite.client.data_classes.filters.Not
:members:
:member-order: bysource

Or
^^^
The `Or` filter performs a logical OR operation on multiple filters, requiring at least one
specified condition to be true for an item to match the filter.

.. autoclass:: cognite.client.data_classes.filters.Or
:members:
:member-order: bysource

Standard Filters
----------------
Equals
^^^^^^
The `Equals` filter checks if a property is equal to a specified value.

.. autoclass:: cognite.client.data_classes.filters.Equals
:members:
:member-order: bysource

Exists
^^^^^^
The `Exists` filter checks if a property exists.

.. autoclass:: cognite.client.data_classes.filters.Exists
:members:
:member-order: bysource

ContainsAll
^^^^^^^^^^^
The `ContainsAll` filter checks if an item contains all specified values for a given property.

.. autoclass:: cognite.client.data_classes.filters.ContainsAll
:members:
:member-order: bysource

ContainsAny
^^^^^^^^^^^
The `ContainsAny` filter checks if an item contains any of the specified values for a given property.

.. autoclass:: cognite.client.data_classes.filters.ContainsAny
:members:
:member-order: bysource

In
^^
The `In` filter checks if a property's value is in a specified list.

.. autoclass:: cognite.client.data_classes.filters.In
:members:
:member-order: bysource

Overlaps
^^^^^^^^
The `Overlaps` filter checks if two ranges overlap.

.. autoclass:: cognite.client.data_classes.filters.Overlaps
:members:
:member-order: bysource

Prefix
^^^^^^
The `Prefix` filter checks if a string property starts with a specified prefix.

.. autoclass:: cognite.client.data_classes.filters.Prefix
:members:
:member-order: bysource

Range
^^^^^
The `Range` filter checks if a numeric property's value is within a specified range.

.. autoclass:: cognite.client.data_classes.filters.Range
:members:
:member-order: bysource

Search
^^^^^^
The `Search` filter performs a full-text search on a specified property.

.. autoclass:: cognite.client.data_classes.filters.Search
:members:
:member-order: bysource

InAssetSubtree
^^^^^^^^^^^^^^
The `InAssetSubtree` filter checks if an item belongs to a specified asset subtree.

.. autoclass:: cognite.client.data_classes.filters.InAssetSubtree
:members:
:member-order: bysource

Geo Filters
-----------
GeoJSON
^^^^^^^
The `GeoJSON` filter performs geometric queries using GeoJSON representations.

.. autoclass:: cognite.client.data_classes.filters.GeoJSON
:members:
:member-order: bysource

GeoJSONDisjoint
^^^^^^^^^^^^^^^
The `GeoJSONDisjoint` filter checks if two geometric shapes are disjoint.

.. autoclass:: cognite.client.data_classes.filters.GeoJSONDisjoint
:members:
:member-order: bysource

GeoJSONIntersects
^^^^^^^^^^^^^^^^^
The `GeoJSONIntersects` filter checks if two geometric shapes intersect.

.. autoclass:: cognite.client.data_classes.filters.GeoJSONIntersects
:members:
:member-order: bysource

GeoJSONWithin
^^^^^^^^^^^^^
The `GeoJSONWithin` filter checks if one geometric shape is within another.

.. autoclass:: cognite.client.data_classes.filters.GeoJSONWithin
:members:
:member-order: bysource

Data Modeling-Specific Filters
------------------------------
HasData
^^^^^^^
The `HasData` filter checks if an item has data for a given property.

.. autoclass:: cognite.client.data_classes.filters.HasData
:members:
:member-order: bysource

MatchAll
^^^^^^^^
The `MatchAll` filter combines multiple sub-filters using a logical AND operation.

.. autoclass:: cognite.client.data_classes.filters.MatchAll
:members:
:member-order: bysource

Nested
^^^^^^
The `Nested` filter applies a filter to a nested property.

.. autoclass:: cognite.client.data_classes.filters.Nested
:members:
:show-inheritance:
:member-order: bysource

0 comments on commit 2dc0edb

Please sign in to comment.