Class QNameOutputMapper
Class for representing Mappings from URIs to QNames.
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 QNameOutputMapper : NamespaceMapper, INamespaceMapper, IDisposable
Remarks
Used primarily in outputting RDF syntax.
Constructors
| Improve this Doc View SourceQNameOutputMapper()
Creates a new QName Output Mapper which has an empty Namespace Map.
Declaration
public QNameOutputMapper()
QNameOutputMapper(INamespaceMapper)
Creates a new QName Output Mapper using the given Namespace Map.
Declaration
public QNameOutputMapper(INamespaceMapper nsmapper)
Parameters
Type | Name | Description |
---|---|---|
INamespaceMapper | nsmapper | Namespace Map. |
Fields
| Improve this Doc View Source_mapping
Mapping of URIs to QNames.
Declaration
protected MultiDictionary<string, QNameMapping> _mapping
Field Value
Type | Description |
---|---|
VDS.Common.Collections.MultiDictionary<System.String, QNameMapping> |
_nextNamespaceID
Next available Temporary Namespace ID.
Declaration
protected int _nextNamespaceID
Field Value
Type | Description |
---|---|
System.Int32 |
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 |
---|---|---|
System.String | uri | URI. |
QNameMapping | mapping | Mapping. |
ReduceToQName(String, out String)
A Function which attempts to reduce a Uri to a QName.
Declaration
public override bool ReduceToQName(string uri, out string qname)
Parameters
Type | Name | Description |
---|---|---|
System.String | uri | The Uri to attempt to reduce. |
System.String | qname | The value to output the QName to if possible. |
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.
|
Improve this Doc
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 |
---|---|---|
System.String | uri | The Uri to attempt to reduce. |
System.String | qname | The value to output the QName to if possible. |
System.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.
Implements
System.IDisposable