Show / Hide Table of Contents

Class QNameOutputMapper

Class for representing Mappings from URIs to QNames.

Inheritance
object
NamespaceMapper
QNameOutputMapper
ThreadSafeQNameOutputMapper
Implements
INamespaceMapper
IDisposable
Inherited Members
NamespaceMapper.RDF
NamespaceMapper.RDFS
NamespaceMapper.XMLSCHEMA
NamespaceMapper.OWL
NamespaceMapper._uris
NamespaceMapper._prefixes
NamespaceMapper._uriFactory
NamespaceMapper.GetPrefix(Uri)
NamespaceMapper.GetNamespaceUri(string)
NamespaceMapper.AddNamespace(string, Uri)
NamespaceMapper.RemoveNamespace(string)
NamespaceMapper.HasNamespace(string)
NamespaceMapper.HasNamespace(Uri)
NamespaceMapper.Clear()
NamespaceMapper.Prefixes
NamespaceMapper.DefaultQNameValidationFunction(string)
NamespaceMapper.Import(INamespaceMapper)
NamespaceMapper.NamespaceAdded
NamespaceMapper.NamespaceModified
NamespaceMapper.NamespaceRemoved
NamespaceMapper.OnNamespaceAdded(string, Uri)
NamespaceMapper.OnNamespaceModified(string, Uri)
NamespaceMapper.OnNamespaceRemoved(string, Uri)
NamespaceMapper.Dispose()
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 QNameOutputMapper : NamespaceMapper, INamespaceMapper, IDisposable
Remarks

Used primarily in outputting RDF syntax.

Constructors

| Edit this page View Source

QNameOutputMapper(INamespaceMapper, IUriFactory)

Creates a new QName Output Mapper using the given Namespace Map.

Declaration
public QNameOutputMapper(INamespaceMapper nsmapper, IUriFactory uriFactory = null)
Parameters
Type Name Description
INamespaceMapper nsmapper

Namespace Map.

IUriFactory uriFactory

The factory to use when creating new Uri instances. If not specified, defaults to Root.

| Edit this page View Source

QNameOutputMapper(IUriFactory)

Creates a new QName Output Mapper which has an empty Namespace Map.

Declaration
public QNameOutputMapper(IUriFactory uriFactory = null)
Parameters
Type Name Description
IUriFactory uriFactory

The factory to use when creating new Uri instances. If not specified, defaults to Root.

Fields

| Edit this page View Source

Mapping

Mapping of URIs to QNames.

Declaration
protected readonly MultiDictionary<string, QNameMapping> Mapping
Field Value
Type Description
MultiDictionary<string, QNameMapping>

Methods

| Edit this page View Source

AddToCache(string, QNameMapping)

Adds a QName mapping to the cache.

Declaration
protected virtual void AddToCache(string uri, QNameMapping mapping)
Parameters
Type Name Description
string uri

URI.

QNameMapping mapping

Mapping.

| Edit this page View Source

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

A Function which attempts to reduce a Uri to a QName.

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

The Uri to attempt to reduce.

string qname

The value to output the QName to if possible.

Func<string, bool> validationFunction

OPTIONAL: a function which when applied to a candidate QName string returns true if the string is acceptable, and false otherwise.

Returns
Type Description
bool
Overrides
NamespaceMapper.ReduceToQName(string, out string, Func<string, bool>)
Remarks

This function will return a Boolean indicated whether it succeeded in reducing the Uri to a QName. If it did then the out parameter qname will contain the reduction, otherwise it will be the empty string.

| Edit this page View Source

ReduceToQName(string, out string, out string)

A Function which attempts to reduce a Uri to a QName and issues a Temporary Namespace if required.

Declaration
public bool ReduceToQName(string uri, out string qName, out string tempNamespace)
Parameters
Type Name Description
string uri

The Uri to attempt to reduce.

string qName

The value to output the QName to if possible.

string tempNamespace

The Temporary Namespace issued (if any).

Returns
Type Description
bool
Remarks

This function will always returns a possible QName for the URI if the format of the URI permits it. It doesn't guarantee that the QName will be valid for the syntax it is being written to - it is up to implementers of writers to validate the QNames returned.

Where necessary a Temporary Namespace will be issued and the tempNamespace parameter will be set to the prefix of the new temporary namespace.

Implements

INamespaceMapper
IDisposable

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • QNameOutputMapper(INamespaceMapper, IUriFactory)
    • QNameOutputMapper(IUriFactory)
  • Fields
    • Mapping
  • Methods
    • AddToCache(string, QNameMapping)
    • ReduceToQName(string, out string, Func<string, bool>)
    • ReduceToQName(string, out string, out string)
  • Implements
  • Extension Methods
Back to top Generated by DocFX