Class QNameOutputMapper
Class for representing Mappings from URIs to QNames.
Inherited Members
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public class QNameOutputMapper : NamespaceMapper, INamespaceMapper, IDisposable
Remarks
Used primarily in outputting RDF syntax.
Constructors
| Improve this Doc View SourceQNameOutputMapper(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. |
Remarks
Used primarily in outputting RDF syntax.
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. |
Remarks
Used primarily in outputting RDF syntax.
Fields
| Improve this Doc View SourceMapping
Mapping of URIs to QNames.
Declaration
protected readonly MultiDictionary<string, QNameMapping> Mapping
Field Value
Type | Description |
---|---|
VDS.Common.Collections.MultiDictionary<TKey, TValue><string, QNameMapping> |
Remarks
Used primarily in outputting RDF syntax.
Methods
| Improve this Doc View SourceAddToCache(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. |
Remarks
Used primarily in outputting RDF syntax.
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. |
System.Func<T, TResult><string, System.Boolean> | validationFunction |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
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.
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 |
---|---|
System.Boolean |
Remarks
This function will always returns a possible QName for the URI if the format of the URI permits it. It doesn't guarentee 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.