Graph Namespace Utils
Graph node ID namespacing utilities.
build_cypher_chunk_id_match(chunk_id, index_name, use_namespaced_id=True)
Build the Cypher Chunk-id match clause and its bind parameters for one chunk id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chunk_id
|
str
|
Raw (un-namespaced) chunk identifier. |
required |
index_name
|
str
|
Namespace scoping the lookup. |
required |
use_namespaced_id
|
bool
|
Whether the predicate also matches the
namespaced ( |
True
|
Returns:
| Type | Description |
|---|---|
tuple[str, dict[str, Any]]
|
tuple[str, dict[str, Any]]: The parenthesized Cypher predicate matching the chunk's
|
build_namespaced_id(raw_id, index_name)
Return a namespaced node identifier.
When index_name is provided, the returned id takes the form
"{index_name}:{raw_id}", scoping the node to a single pipeline's
namespace. When index_name is None the raw id is returned
unchanged, preserving backwards compatibility with deployments that
predate namespacing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw_id
|
str
|
Raw, un-namespaced node identifier. |
required |
index_name
|
str | None
|
Namespace prefix to prepend, or |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The namespaced id |