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 like notation (see RFC 5234). Table 4 defines additional core rules used in these definitions.
Table 4 – Additional 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. Any ‘;’ in the URI shall be percent encoded. |
BASE64 |
A Base64 encoded binary value (see Base64). |
The description for a NodeId is found in Table 5.
Table 5 – Description for a NodeId
<node-id> |
= <identifier> |
<node-id> |
=/ <namespace-index> ";" <identifier> |
<node-id> |
=/ <namespace-uri> ";" <identifier> |
<namespace-index> |
= "ns=" 1*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 |
NodeIds with a NamespaceIndex of 0 or a NamespaceUri of http://opcfoundation.org/UA/ shall only use the <identifier> form.
OPC 10000-3 prohibits control characters, such as tabs (0x09), in the string identifier for NodeIds.
The URI portion of NodeIds are escaped with URI percent encoding as defined in RFC 3986. Semicolons are added to the list of reserved characters of all URI schemes.
Examples of NodeIds:
i=13
ns=10;i=12345
nsu=http://widgets.com/schemas/hello;s=水 World
g=09087e75-8e5e-499b-954f-f2a9603db28a
nsu=tag:acme.com,2023:schemas:data#off%3B;b=M/RbKBsRVkePCePcx24oRA==
The description for a ExpandedNodeId is found in Table 6.
Table 6 – 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.
OPC 10000-3 prohibits control characters, such as tabs (0x09), in the string identifier for ExpandedNodeIds.
The URI portions of ExpandedNodeIds are escaped with URI percent encoding as defined in RFC 3986. Semicolons are added to the list of reserved characters of all URI schemes.Examples of ExpandedNodeIds:
i=13
svr=1;nsu=http://widgets.com/schemas/hello;s=水 World
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 description for a QualifiedName is found in Table 7.
Table 7 – Description for a QualifiedName
<qualified-name> |
= <name> |
<qualified-name> |
=/ 1*DIGIT ":" <name> |
<qualified-name> |
=/ <namespace-uri> ";" <name> |
<name> |
= 1*(UNICODE) |
QualifiedNames in the OPC UA Namespace shall not use the form with a <namespace-uri>.
The form without a prefix (the first row in Table 7) shall only be used for QualifiedNames in the OPC UA Namespace. This is unambiguous because the Name portion of a QualifiedName in the OPC UA Namespace starting with a sequence of digits followed by a colon is prohibited.
OPC 10000-3 prohibits control characters, such as tabs (0x09), in the name portion of a QualifiedName.
The URI portions of QualifiedNames are escaped with URI percent encoding as defined in RFC 3986. Semicolons are added to the list of reserved characters of all URI schemes.Examples of QualifiedNames:
InputArguments
3:Hello:World
nsu=http://widgets.com/schemas/hello;Hello;World
nsu=tag:acme.com,2023:schemas:data#off%3B;Boiler2