graflo.architecture.graph_types.index_config¶
Index and weight configuration models.
ABCFields
¶
Bases: ConfigBaseModel
Base model for entities that have fields.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str | None
|
Optional name of the entity |
fields |
list[str]
|
List of field names |
Source code in graflo/architecture/graph_types/index_config.py
cfield(x)
¶
Creates a composite field name by combining the entity name with a field name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
str
|
Field name to combine with entity name |
required |
Returns:
| Type | Description |
|---|---|
str
|
Composite field name in format "entity@field" |
Source code in graflo/architecture/graph_types/index_config.py
Index
¶
Bases: ConfigBaseModel
Configuration for database indexes.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str | None
|
Optional name of the index |
fields |
list[str]
|
List of fields to index |
unique |
bool
|
Whether the index enforces uniqueness |
type |
IndexType
|
Type of index to create |
deduplicate |
bool
|
Whether to deduplicate index entries |
sparse |
bool
|
Whether to create a sparse index |
exclude_edge_endpoints |
bool
|
Whether to exclude edge endpoints from index |
Source code in graflo/architecture/graph_types/index_config.py
__iter__()
¶
db_form(db_type)
¶
Convert index configuration to database-specific format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_type
|
DBType
|
Type of database (ARANGO or NEO4J) |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary of index configuration in database-specific format |
Raises:
| Type | Description |
|---|---|
ValueError
|
If db_type is not supported |
Source code in graflo/architecture/graph_types/index_config.py
Weight
¶
Bases: ABCFields
Defines weight configuration for edges.
Attributes:
| Name | Type | Description |
|---|---|---|
map |
dict
|
Dictionary mapping field values to weights |
filter |
dict
|
Dictionary of filter conditions for weights |