QualifiedNames, NodeIds and ExpandedNodeIds optimize representation of NamespaceUris by using a NamespaceIndex to reference the location of the URI in a NamespaceTable. The NamespaceTable to use is known from the context. For example, when a Client establishes a Session with a Server, the Server supplies the NamespaceTable that is used for all exchanges within that Session. Another example, is when a Publisher publishes DataSetMetadata messages, the NamespaceTable is provided as part of the message.
However, there are other scenarios where there is no obvious context that can be used to store the NamespaceTable, such as column in a database table, so it is necessary to provide a self-contained representation of these DataTypes. This clause defines a normative String representation using the ABNF notation (see RFC 5234). Table 4 defines additional core rules used in these definitions.
Table 4 – Additional ABNF Core Rules
UNICODE |
Any Unicode character other than a Control character. |
CONTROL |
Any Unicode Control character (includes nulls, carriage returns, tabs and new lines). |
URI |
A string that conforms to RFC 3986. |
ENCODEDURI |
A URI which has the RFC 3986 Percent-Encoding applied to it. |
BASE64 |
A Base64 encoded binary value (see Base64). |
The ABNF description for a NodeId is found in Table 5.
Table 5 – ABNF Description for a NodeId
<node-id> |
= <identifier> |
<node-id> |
=/ <namespace-index> ";" <identifier> |
<node-id> |
=/ <namespace-uri> ";" <identifier> |
<namespace-index> |
= "ns=" *DIGIT |
<namespace-uri> |
= "nsu=" ENCODEDURI |
<identifier> |
= <numericid> / <stringid> / <guidid> / <opaqueid> |
<numericid> |
= "i=" *DIGIT |
<stringid> |
= "s=" *(UNICODE) |
<guidid> |
= "g=" 8HEXDIG 3("-" 4HEXDIG) "-" 12HEXDIG |
<opaqueid> |
= "b=" BASE64 |
<reserved> |
= ";" / "%" / CONTROL |
<escaped> |
= "%" 2HEXDIG |
NodeIds with a NamespaceIndex of 0 or a NamespaceUri of http://opcfoundation.org/UA/ shall only use the <identifier> form.
The <escaped> form of a Unicode character is the UTF-8 encoding of the Unicode character represented as a “%” followed by a hexadecimal number.Examples of NodeIds:
i=13
ns=10;i=12345
nsu=http://widgets.com/schemas/hello;s=水%09World
g=09087e75-8e5e-499b-954f-f2a9603db28a
nsu=tag:acme.com,2023:schemas:data#off%3B;b=M/RbKBsRVkePCePcx24oRA==
The ABNF description for a ExpandedNodeId is found in Table 6.
Table 6 – ABNF Description for a ExpandedNodeId
<expanded-node-id> |
= <node-id> |
<expanded-node-id> |
=/ <server-index> ";" <node-id> |
<expanded-node-id> |
=/ <server-uri> ";" <node-id> |
<server-index> |
= "svr=" *DIGIT |
<server-uri> |
= "svu=" ENCODEDURI |
ExpandedNodeIds that are not specific to a Server shall use the <node-id> form.
Examples of ExpandedNodeIds:
i=13
svr=1;nsu=http://widgets.com/schemas/hello;s=水%09World
svu=http://smith.com/east/factory;g=09087e75-8e5e-499b-954f-f2a9603db28a
svu=http://smith.com/west/factory;nsu=tag:acme.com,2023:schemas:data#off%3B;b=M/RbKBsRVkePCePcx24oRA==
The ABNF description for a QualifiedName is found in Table 7.
Table 7 – ABNF Description for a QualifiedName
<qualified-name> |
= <name> |
<qualified-name> |
=/ <namespace-index> ":" <name> |
<qualified-name> |
=/ <namespace-uri> ";" <name> |
<name> |
= *(UNICODE) |
QualifiedNames in the OPC UA Namespace shall not use the forms with a <namespace-index> or a <namespace-uri>.
Examples of QualifiedNames:
InputArguments
3:Hello%09World
nsu=http://widgets.com/schemas/hello;Hello%3BWorld
nsu=tag:acme.com,2023:schemas:data#off%3B;Boiler2