# RelativePath

## class RelativePath(text)

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object "(in Python v3.15)")

An ordered native browse route, parsed or constructed from qualified names.

Parse a browse path using the native parser.

The native parser has a known multi-digit namespace-index limitation.
Use `from_qualified_names()` for structured hierarchical paths.

Parameters:
:   **text** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))

    Native relative-path syntax.

Returns:
:   *RelativePath* – Parsed ordered path elements.

Examples

```
>>> path = RelativePath("/Objects/Server")
>>> len(path.elements)
2
```

Attributes

| [`elements`](https://dev.nominal.io/instro/ref/protocols/instro.opcua.types.RelativePath.md#instro.opcua.types.RelativePath.elements "instro.opcua.types.RelativePath.elements") |  |
| --- | --- |

Methods

| [`from_qualified_names`](https://dev.nominal.io/instro/ref/protocols/instro.opcua.types.RelativePath.md#instro.opcua.types.RelativePath.from_qualified_names "instro.opcua.types.RelativePath.from_qualified_names") | Construct forward hierarchical steps from qualified browse names. |
| --- | --- |
| [`parse`](https://dev.nominal.io/instro/ref/protocols/instro.opcua.types.RelativePath.md#instro.opcua.types.RelativePath.parse "instro.opcua.types.RelativePath.parse") | Parse a browse path, equivalent to the constructor. |

### elements

### static from_qualified_names(names)

Construct forward hierarchical steps from qualified browse names.

Parameters:
:   **names** ([*list*](https://docs.python.org/3/builtins/stdtypes.html#list "(in Python v3.15)")*[*[*QualifiedName*](https://dev.nominal.io/instro/ref/protocols/instro.opcua.types.QualifiedName.md#instro.opcua.types.QualifiedName "instro.opcua.types.QualifiedName")*]*)

    Names in path order; each step includes
    hierarchical reference subtypes.

Returns:
:   *RelativePath* – The structured native path, without string parsing.

### static parse(path_str)

Parse a browse path, equivalent to the constructor.

Parameters:
:   **path_str** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))

    Native relative-path syntax.

Returns:
:   *RelativePath* – Parsed ordered path elements.
