Class NestedNamespaceMapper
A Namespace Mapper which has an explicit notion of Nesting.
Inheritance
System.Object
NestedNamespaceMapper
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: VDS.RDF
Assembly: dotNetRDF.dll
Syntax
public class NestedNamespaceMapper : INestedNamespaceMapper, INamespaceMapper, IDisposable
Constructors
| Improve this Doc View SourceNestedNamespaceMapper()
Constructs a new Namespace Map.
Declaration
public NestedNamespaceMapper()
Remarks
The Prefixes rdf, rdfs and xsd are automatically defined.
|
Improve this Doc
View Source
NestedNamespaceMapper(Boolean)
Constructs a new Namespace Map which is optionally empty.
Declaration
protected NestedNamespaceMapper(bool empty)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | empty | Whether the Namespace Map should be empty, if set to false the Prefixes rdf, rdfs and xsd are automatically defined. |
Properties
| Improve this Doc View SourceNestingLevel
Gets the current Nesting Level.
Declaration
public int NestingLevel { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Prefixes
Gets the Namespace Prefixes.
Declaration
public IEnumerable<string> Prefixes { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<System.String> |
Methods
| Improve this Doc View SourceAddNamespace(String, Uri)
Adds a Namespace at the Current Nesting Level.
Declaration
public void AddNamespace(string prefix, Uri uri)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | prefix | Prefix. |
| System.Uri | uri | Namespace URI. |
Clear()
Clears the Namespace Map.
Declaration
public void Clear()
DecrementNesting()
Decrements the Nesting Level.
Declaration
public void DecrementNesting()
Remarks
When the Nesting Level is decremented any Namespaces defined at a greater Nesting Level are now out of scope and so are removed from the Mapper.
|
Improve this Doc
View Source
Dispose()
Disposes of the Namespace Map.
Declaration
public void Dispose()
GetNamespaceUri(String)
Gets the Namespace URI for the given Prefix at the current Nesting Level.
Declaration
public Uri GetNamespaceUri(string prefix)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | prefix | Prefix. |
Returns
| Type | Description |
|---|---|
| System.Uri |
GetNestingLevel(String)
Gets the Nesting Level at which the given Namespace is definition is defined.
Declaration
public int GetNestingLevel(string prefix)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | prefix | Prefix. |
Returns
| Type | Description |
|---|---|
| System.Int32 |
GetPrefix(Uri)
Gets the Namespace Prefix for the given URI at the current Nesting Level.
Declaration
public string GetPrefix(Uri uri)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | uri | Namespace URI. |
Returns
| Type | Description |
|---|---|
| System.String |
HasNamespace(String)
Gets whether the given Namespace exists.
Declaration
public bool HasNamespace(string prefix)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | prefix | Prefix. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Import(INamespaceMapper)
Imports another Namespace Map into this one.
Declaration
public void Import(INamespaceMapper nsmap)
Parameters
| Type | Name | Description |
|---|---|---|
| INamespaceMapper | nsmap | Namespace Map. |
IncrementNesting()
Increments the Nesting Level.
Declaration
public void IncrementNesting()
OnNamespaceRemoved(String, Uri)
Internal Helper for the NamespaceRemoved Event which raises it only when a Handler is registered.
Declaration
protected virtual void OnNamespaceRemoved(string prefix, Uri uri)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | prefix | Namespace Prefix. |
| System.Uri | uri | Namespace Uri. |
RaiseNamespaceAdded(String, Uri)
Internal Helper for the NamespaceAdded Event which raises it only when a Handler is registered.
Declaration
protected virtual void RaiseNamespaceAdded(string prefix, Uri uri)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | prefix | Namespace Prefix. |
| System.Uri | uri | Namespace Uri. |
RaiseNamespaceModified(String, Uri)
Internal Helper for the NamespaceModified Event which raises it only when a Handler is registered.
Declaration
protected virtual void RaiseNamespaceModified(string prefix, Uri uri)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | prefix | Namespace Prefix. |
| System.Uri | uri | Namespace Uri. |
ReduceToQName(String, out String)
Tries to reduce a URI to a QName using this Namespace Map.
Declaration
public bool ReduceToQName(string uri, out string qname)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | uri | URI. |
| System.String | qname | Resulting QName. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
RemoveNamespace(String)
Removes a Namespace provided that Namespace is defined on the current Nesting Level.
Declaration
public void RemoveNamespace(string prefix)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | prefix | Prefix. |
Events
| Improve this Doc View SourceNamespaceAdded
Event which occurs when a Namespace is added
Declaration
public event NamespaceChanged NamespaceAdded
Event Type
| Type | Description |
|---|---|
| NamespaceChanged |
NamespaceModified
Event which occurs when a Namespace is modified
Declaration
public event NamespaceChanged NamespaceModified
Event Type
| Type | Description |
|---|---|
| NamespaceChanged |
NamespaceRemoved
Event which occurs when a Namespace is removed
Declaration
public event NamespaceChanged NamespaceRemoved
Event Type
| Type | Description |
|---|---|
| NamespaceChanged |
Implements
System.IDisposable