Show / Hide Table of Contents

Class NestedNamespaceMapper

A Namespace Mapper which has an explicit notion of Nesting.

Inheritance
object
NestedNamespaceMapper
Implements
INestedNamespaceMapper
INamespaceMapper
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public class NestedNamespaceMapper : INestedNamespaceMapper, INamespaceMapper, IDisposable

Constructors

| Edit this page View Source

NestedNamespaceMapper()

Constructs a new Namespace Map.

Declaration
public NestedNamespaceMapper()
Remarks

The Prefixes rdf, rdfs and xsd are automatically defined.

| Edit this page View Source

NestedNamespaceMapper(bool)

Constructs a new Namespace Map which is optionally empty.

Declaration
protected NestedNamespaceMapper(bool empty)
Parameters
Type Name Description
bool empty

Whether the Namespace Map should be empty, if set to false the Prefixes rdf, rdfs and xsd are automatically defined.

| Edit this page View Source

NestedNamespaceMapper(IUriFactory, bool)

Creates a new namespace map with the specified URI factory.

Declaration
protected NestedNamespaceMapper(IUriFactory uriFactory, bool empty = false)
Parameters
Type Name Description
IUriFactory uriFactory

The URI factory to use.

bool empty

Whether the Namespace Map should be empty, if set to false the Prefixes rdf, rdfs and xsd are automatically defined.

Properties

| Edit this page View Source

NestingLevel

Gets the current Nesting Level.

Declaration
public int NestingLevel { get; }
Property Value
Type Description
int
| Edit this page View Source

Prefixes

Gets the Namespace Prefixes.

Declaration
public IEnumerable<string> Prefixes { get; }
Property Value
Type Description
IEnumerable<string>

Methods

| Edit this page View Source

AddNamespace(string, Uri)

Adds a Namespace at the Current Nesting Level.

Declaration
public void AddNamespace(string prefix, Uri uri)
Parameters
Type Name Description
string prefix

Prefix.

Uri uri

Namespace URI.

| Edit this page View Source

Clear()

Clears the Namespace Map.

Declaration
public void Clear()
| Edit this page View Source

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.

| Edit this page View Source

Dispose()

Disposes of the Namespace Map.

Declaration
public void Dispose()
| Edit this page View Source

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
string prefix

Prefix.

Returns
Type Description
Uri
| Edit this page View Source

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
string prefix

Prefix.

Returns
Type Description
int
| Edit this page View Source

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
Uri uri

Namespace URI.

Returns
Type Description
string
| Edit this page View Source

HasNamespace(string)

Gets whether the given Namespace exists.

Declaration
public bool HasNamespace(string prefix)
Parameters
Type Name Description
string prefix

Prefix.

Returns
Type Description
bool
| Edit this page View Source

Import(INamespaceMapper)

Imports another Namespace Map into this one.

Declaration
public void Import(INamespaceMapper nsmap)
Parameters
Type Name Description
INamespaceMapper nsmap

Namespace Map.

| Edit this page View Source

IncrementNesting()

Increments the Nesting Level.

Declaration
public void IncrementNesting()
| Edit this page View Source

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
string prefix

Namespace Prefix.

Uri uri

Namespace Uri.

| Edit this page View Source

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
string prefix

Namespace Prefix.

Uri uri

Namespace Uri.

| Edit this page View Source

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
string prefix

Namespace Prefix.

Uri uri

Namespace Uri.

| Edit this page View Source

ReduceToQName(string, out string, Func<string, bool>)

Tries to reduce a URI to a QName using this Namespace Map.

Declaration
public bool ReduceToQName(string uri, out string qname, Func<string, bool> validationFunction = null)
Parameters
Type Name Description
string uri

URI.

string qname

Resulting QName.

Func<string, bool> validationFunction

A validation function to use to validate the QName. Only a QName value for which the validation function return true will be returned.

Returns
Type Description
bool
| Edit this page View Source

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
string prefix

Prefix.

Events

| Edit this page View Source

NamespaceAdded

Event which occurs when a Namespace is added

Declaration
public event NamespaceChanged NamespaceAdded
Event Type
Type Description
NamespaceChanged
| Edit this page View Source

NamespaceModified

Event which occurs when a Namespace is modified

Declaration
public event NamespaceChanged NamespaceModified
Event Type
Type Description
NamespaceChanged
| Edit this page View Source

NamespaceRemoved

Event which occurs when a Namespace is removed

Declaration
public event NamespaceChanged NamespaceRemoved
Event Type
Type Description
NamespaceChanged

Implements

INestedNamespaceMapper
INamespaceMapper
IDisposable

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • NestedNamespaceMapper()
    • NestedNamespaceMapper(bool)
    • NestedNamespaceMapper(IUriFactory, bool)
  • Properties
    • NestingLevel
    • Prefixes
  • Methods
    • AddNamespace(string, Uri)
    • Clear()
    • DecrementNesting()
    • Dispose()
    • GetNamespaceUri(string)
    • GetNestingLevel(string)
    • GetPrefix(Uri)
    • HasNamespace(string)
    • Import(INamespaceMapper)
    • IncrementNesting()
    • OnNamespaceRemoved(string, Uri)
    • RaiseNamespaceAdded(string, Uri)
    • RaiseNamespaceModified(string, Uri)
    • ReduceToQName(string, out string, Func<string, bool>)
    • RemoveNamespace(string)
  • Events
    • NamespaceAdded
    • NamespaceModified
    • NamespaceRemoved
  • Implements
  • Extension Methods
Back to top Generated by DocFX