resolve
resolve
#
Walk a schema: by on-disk path components, or over every declared position.
The server validates every request path with the component walkers, so an internet-exposed endpoint can only touch paths the schema declares.
children(cgtype)
#
The child types cgtype declares, each labelled by its position.
A struct field is .name, a container element [*], and a Path
target shares its address ("").
Source code in capturegraph-lib/capturegraph/types/schema/resolve.py
is_container(cgtype)
#
Whether cgtype is a composite directory type (Struct / Map / Array).
is_schema_child(container, name)
#
Whether name is a declared on-disk child entry of container.
Source code in capturegraph-lib/capturegraph/types/schema/resolve.py
is_storable_scalar(cgtype)
#
Whether cgtype is a storable leaf scalar, not a composite container.
positions(cgtype, predicate, prefix='')
#
Every position under cgtype whose type satisfies predicate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cgtype
|
type[CGType]
|
The schema to search, |
required |
predicate
|
Callable[[type[CGType]], bool]
|
Selects the types to report. |
required |
prefix
|
str
|
The label of |
''
|
Returns:
| Type | Description |
|---|---|
list[tuple[str, type[CGType]]]
|
|
list[tuple[str, type[CGType]]]
|
searched further. |
Source code in capturegraph-lib/capturegraph/types/schema/resolve.py
resolve_schema_container(schema, components)
#
The type addressed by components from schema; empty is schema itself.
Raises:
| Type | Description |
|---|---|
SchemaPathError
|
If a component is not a declared entry. |
Source code in capturegraph-lib/capturegraph/types/schema/resolve.py
resolve_schema_leaf(schema, components)
#
The leaf scalar addressed by components from schema.
Raises:
| Type | Description |
|---|---|
SchemaPathError
|
If a component is invalid or the path ends at a container. |