graflo.onto¶
Core ontology and base classes for graph database operations.
This module provides the fundamental data structures and base classes used throughout the graph database system. It includes base classes for enums and database-specific configurations.
Key Components
- BaseEnum: Base class for string-based enumerations with flexible membership testing
- ExpressionFlavor: Enum for expression language types
- AggregationType: Enum for supported aggregation operations
Example
class MyEnum(BaseEnum): ... VALUE1 = "value1" ... VALUE2 = "value2" "value1" in MyEnum # True "invalid" in MyEnum # False
AggregationType
¶
Bases: BaseEnum
Supported aggregation operations.
This enum defines the supported aggregation operations for data analysis.
Attributes:
| Name | Type | Description |
|---|---|---|
COUNT |
Count operation |
|
MAX |
Maximum value |
|
MIN |
Minimum value |
|
AVERAGE |
Average value |
|
SORTED_UNIQUE |
Sorted unique values |
Source code in graflo/onto.py
BaseEnum
¶
Bases: StrEnum
Base class for string-based enumerations.
This class provides a foundation for string-based enums with flexible membership testing through the MetaEnum metaclass.
Source code in graflo/onto.py
__repr__()
¶
DBType
¶
Bases: StrEnum
Enum representing different types of databases.
Includes both graph databases and source databases (SQL, NoSQL, etc.).
Source code in graflo/onto.py
ExpressionFlavor
¶
Bases: BaseEnum
Supported expression language types for filter/query rendering.
Uses the actual query language names: AQL (ArangoDB), CYPHER (Neo4j, FalkorDB, Memgraph), GSQL (TigerGraph), SQL for WHERE clauses, PYTHON for in-memory evaluation.
Attributes:
| Name | Type | Description |
|---|---|---|
AQL |
ArangoDB AQL expressions |
|
CYPHER |
OpenCypher expressions (Neo4j, FalkorDB, Memgraph) |
|
GSQL |
TigerGraph GSQL expressions (including REST++ filter format) |
|
SQL |
SQL WHERE clause fragments (column names, single-quoted values) |
|
PYTHON |
Python expression evaluation |
Source code in graflo/onto.py
MetaEnum
¶
Bases: EnumMeta
Metaclass for flexible enumeration membership testing.
This metaclass allows checking if a value is a valid member of an enum
using the in operator, even if the value hasn't been instantiated as
an enum member.
Example
class MyEnum(BaseEnum): ... VALUE = "value" "value" in MyEnum # True "invalid" in MyEnum # False
Source code in graflo/onto.py
__contains__(member)
¶
Check if an item is a valid member of the enum.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
Value to check for membership |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the item is a valid enum member, False otherwise |