## A.2 BNF of RelativePath

A RelativePath is a structure that describes a sequence of References and Nodes to follow. This annex describes a text format for a RelativePath that can be used in documentation or in files used to store configuration information.

The components of a RelativePath text format are specified in Table A.1.

Table A.1 – RelativePath

Symbol Meaning
The forward slash character indicates that the Server is to follow any subtype of HierarchicalReferences.
. The period (dot) character indicates that the Server is to follow any subtype of a Aggregates ReferenceType.
<[#!ns:]ReferenceType> A string delimited by the ‘<’ and ‘>’ symbols specifies the BrowseName of a ReferenceType to follow. By default, any References of the subtypes the ReferenceType are followed as well. A ‘#’ placed in front of the BrowseName indicates that subtypes should not be followed.
A ‘!’ in front of the BrowseName is used to indicate that the inverse Reference should be followed.
The BrowseName may be qualified with a namespace index (indicated by a numeric prefix followed by a colon). This namespace index is used specify the namespace component of the BrowseName for the ReferenceType. If the namespace prefix is omitted then namespace index 0 is used.
[ns:]BrowseName A string that follows a ‘/’, ‘.’ or ‘>’ symbol specifies the BrowseName of a target Node to return or follow. This BrowseName may be prefixed by its namespace index. If the namespace prefix is omitted then namespace index 0 is used.
Omitting the final BrowseName from a path is equivalent to a wildcard operation that matches all Nodes which are the target of the Reference specified by the path.
& The & sign character is the escape character. It is used to specify reserved characters that appear within a BrowseName. A reserved character is escaped by inserting the ‘&’ in front of it. Examples of BrowseNames with escaped characters are:
Received browse path name Resolves to
“&/Name_1” “/Name_1”
“&.Name_2” “.Name_2”
“&:Name_3” “:Name_3”
“&&Name_4” “&Name_4”

Table A.2 provides RelativePaths examples in text format.

Table A.2 – RelativePath Examples

Browse Path Description
“/2:Block&.Output” Follows any forward hierarchical Reference with target BrowseName = “2:Block.Output”.
“/3:Truck.0:NodeVersion” Follows any forward hierarchical Reference with target BrowseName = “3:Truck” and from there a forward Aggregates Reference to a target with BrowseName “0:NodeVersion”.
“<1:ConnectedTo>1:Boiler/1:HeatSensor” Follows any forward Reference with a BrowseName = ‘1:ConnectedTo’ and finds targets with BrowseName = ‘1:Boiler’. From there follows any hierarchical Reference and find targets with BrowseName = ‘1:HeatSensor’.
“<1:ConnectedTo>1:Boiler/” Follows any forward Reference with a BrowseName = ‘1:ConnectedTo’ and finds targets with BrowseName = ‘1:Boiler’. From there it finds all targets of hierarchical References.
“<0:HasChild>2:Wheel” Follows any forward Reference with a BrowseName = ‘HasChild’ and qualified with the default OPC UA namespace. Then find targets with BrowseName = ‘Wheel’ qualified with namespace index ‘2’.
“<!HasChild>Truck” Follows any inverse Reference with a BrowseName = ‘HasChild’. Then find targets with BrowseName = ‘Truck’. In both cases, the namespace component of the BrowseName is assumed to be 0.
“<0:HasChild>” Finds all targets of forward References with a BrowseName = ‘HasChild’ and qualified with the default OPC UA namespace.

The following BNF describes the syntax of the RelativePath text format.

<relative-path>	::= <reference-type> <browse-name> [relative-path]

<reference-type>	::= '/' | '.' | '<' ['#'] ['!'] <browse-name> '>'

<browse-name>	::= [<namespace-index> ':'] <name>

<namespace-index>	::= <digit> [<digit>]

<digit>		::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'

<name>
::= (<name-char> | '&' <reserved-char>) [<name>]

<reserved-char>	::= '/' | '.' | '<' | '>' | ':' | '#' | '!' | '&'



<name-char> ::= All valid characters for a String (see OPC 10000-3) excluding reserved-chars.