# OpcNamespace Class

<dl class="api-definition">
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Members</dt>
<dd><a href="./members">OpcNamespace Members</a></dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

Represents a nominal space used to categorize information like nodes, types, identifiers, etc. under a logical topic.

## Syntax

<div class="api-signature" data-lang="csharp">

```csharp
public class OpcNamespace
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Class OpcNamespace
```

</div>

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → **OpcNamespace**

## Implements

<ul class="api-implements">
<li><a href="https://learn.microsoft.com/dotnet/api/system.icomparable">IComparable</a></li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.icomparable-1">IComparable</a>&lt;OpcNamespace&gt;</li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable</a>&lt;OpcNamespace&gt;</li>
</ul>

## Remarks

An OPC UA server provides an array of such topics known as namespaces. Within these list of namespaces a dedicated namespace can be determined by its unique [Index](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#index). Its [Uri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#uri) does additionally inform about the general purpose, the source or the owner of the namespace.

The [Default](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#default) namespace uses an [Index](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#index) equals zero and a null reference (Nothing in Visual Basic) as the [Uri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#uri). A system or custom defined OpcNamespace instance can have either an [Index](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#index) unequal to zero and/or an [Uri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#uri) unequal to a null reference (Nothing in Visual Basic).

A OpcNamespace can be constructed from a simple [Uri](https://learn.microsoft.com/dotnet/api/system.uri). In case there the [Host](https://learn.microsoft.com/dotnet/api/system.uri.host) portion uses the [UriHost](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#urihost) the whole [Uri](https://learn.microsoft.com/dotnet/api/system.uri) information is not used for the [Uri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#uri) of the OpcNamespace except the [Port](https://learn.microsoft.com/dotnet/api/system.uri.port) portion. If it is not the scheme specific default port (see [IsDefaultPort](https://learn.microsoft.com/dotnet/api/system.uri.isdefaultport)) and it is greater than zero it is used as the [Index](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#index) of the namespace.

In case there the OpcNamespace is constructed from a [Uri](https://learn.microsoft.com/dotnet/api/system.uri) which uses a different [Host](https://learn.microsoft.com/dotnet/api/system.uri.host) portion than [UriHost](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#urihost) the whole [Uri](https://learn.microsoft.com/dotnet/api/system.uri) is used as the [Uri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#uri) of the namespace except of an existing [Port](https://learn.microsoft.com/dotnet/api/system.uri.port) portion. If the [Port](https://learn.microsoft.com/dotnet/api/system.uri.port) portion is greater than zero and is not the scheme specific default port (see [IsDefaultPort](https://learn.microsoft.com/dotnet/api/system.uri.isdefaultport)) it is used as the [Index](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#index) of the namespace. If the [Scheme](https://learn.microsoft.com/dotnet/api/system.uri.scheme) is equals to [UriScheme](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#urischeme), the [UriSchemeHttp](https://learn.microsoft.com/dotnet/api/system.uri.urischemehttp) scheme is used instead for the [Uri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#uri) of the namespace. Additionally any [Fragment](https://learn.microsoft.com/dotnet/api/system.uri.fragment) and [Query](https://learn.microsoft.com/dotnet/api/system.uri.query) component is also discarded and any trailing '/' is trimmed from [Path](https://learn.microsoft.com/dotnet/api/system.uricomponents#system-uricomponents-path) component of the [Uri](https://learn.microsoft.com/dotnet/api/system.uri).

## Fields

| Name | Description |
|---|---|
| [UriHost](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#urihost)<span class="api-meta">static</span> | Specifies that an [Uri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#uri) is a pointer to a OPC UA namespace without a specific namespace [Host](https://learn.microsoft.com/dotnet/api/system.uri.host). |
| [UriScheme](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#urischeme)<span class="api-meta">static</span> | Specifies that an [Uri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#uri) is a pointer to a OPC UA namespace without a specific namespace [Scheme](https://learn.microsoft.com/dotnet/api/system.uri.scheme). |

## Properties

| Name | Description |
|---|---|
| [Default](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#default)<span class="api-meta">static</span> | Gets the default namespace used in cases there the concrete does not matter or is just unknown. |
| [Index](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#index) | Gets the index of the namespace within all namespaces of a server. |
| [IsAbsolute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#isabsolute) | Gets a value indicating whether the namespace is absolute. |
| [IsDefault](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#isdefault) | Gets a value indicating whether the namespace defines the default namespace without to refer to a specific address space. |
| [IsResolved](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#isresolved) | Gets a value indicating whether the namespace is resolved regarding its [Index](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#index), [Uri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#uri) and [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#value). |
| [Scope](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#scope)<span class="api-meta">since v2.12</span> | Gets scope within the current OpcNamespace has been declared and its metadata applies to. |
| [Uri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#uri) | Gets the uniform resource identifier (URI) of the namespace represented and referred to by the [Index](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#index). |
| [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#value)<span class="api-meta">since v2.8</span> | Gets the intrinsic value of the namespace represented and referred to by the [Index](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#index). |

## Methods

| Name | Description |
|---|---|
| [Clear](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#clear)<span class="api-meta">static</span> | Empties the known namespaces. |
| [CompareTo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#compareto)<span class="api-meta">2 overloads</span> | Compares the current OpcNamespace with the `other`. |
| [Create](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#create)<span class="api-meta">static · 4 overloads</span> | Creates a OpcNamespace from the [Uri](https://learn.microsoft.com/dotnet/api/system.uri) specified. |
| [Equals](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#equals)<span class="api-meta">2 overloads</span> | Determines whether the specified `other` is equal to this OpcNamespace. |
| [Get](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#get)<span class="api-meta">static · 5 overloads</span> | Retrieves the OpcNamespace known under the `namespaceIndex` specified. |
| [GetHashCode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#gethashcode)<span class="api-meta">override</span> | Retrieves a hash code for this OpcNamespace. |
| [GetId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#getid)<span class="api-meta">8 overloads</span> | Retrieves a new [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) using the opaque `value` and this OpcNamespace. |
| [GetName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#getname) | Retrieves a new [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) using the `name` and this OpcNamespace. |
| [GetNextId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#getnextid)<span class="api-meta">since v2.29</span> | Retrieves a new [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) using the next available numeric identifier within this OpcNamespace. |
| [Parse](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#parse)<span class="api-meta">static</span> | Converts a namespace string to a OpcNamespace instance. |
| [Resolve](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#resolve) | Resolves missing OPC UA namespace information using the object specified by `resolver`. |
| [ToString](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#tostring)<span class="api-meta">override</span> | Returns a string representing the namespace. |
| [TryCreate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#trycreate)<span class="api-meta">static · 2 overloads</span> | Determines whether a [Uri](https://learn.microsoft.com/dotnet/api/system.uri) is a valid namespace. |
| [TryParse](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#tryparse)<span class="api-meta">static</span> | Determines whether a string is a valid namespace. |

## Operators

| Name | Description |
|---|---|
| [Equality](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#op-equality)<span class="api-meta">static</span> | Returns a value indicating whether two instance of OpcNamespace are equal. |
| [GreaterThan](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#op-greaterthan)<span class="api-meta">static</span> | Determines whether the first specified OpcNamespace object is greater than the second specified OpcNamespace object. |
| [GreaterThanOrEqual](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#op-greaterthanorequal)<span class="api-meta">static</span> | Determines whether the first specified OpcNamespace object is greater than or equal to the second specified OpcNamespace object. |
| [Implicit](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#op-implicit)<span class="api-meta">static · 2 overloads</span> | Converts a [string](https://learn.microsoft.com/dotnet/api/system.string) to an OpcNamespace object. |
| [Inequality](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#op-inequality)<span class="api-meta">static</span> | Returns a value indicating whether two instances of OpcNamespace are not equal. |
| [LessThan](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#op-lessthan)<span class="api-meta">static</span> | Determines whether the first specified OpcNamespace object is less than the second specified OpcNamespace object. |
| [LessThanOrEqual](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/members#op-lessthanorequal)<span class="api-meta">static</span> | Determines whether the first specified OpcNamespace object is less than or equal to the second OpcNamespace object. |

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.5–v2.59 |
