Class MimeTypeDefinition
Represents the definition of a MIME Type including mappings to relevant readers and writers.
Inheritance
Inherited Members
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public sealed class MimeTypeDefinition
Constructors
| Improve this Doc View SourceMimeTypeDefinition(string, IEnumerable<string>, IEnumerable<string>, Type, Type, Type, Type, Type, Type, decimal)
Creates a new MIME Type Definition.
Declaration
public MimeTypeDefinition(string syntaxName, IEnumerable<string> mimeTypes, IEnumerable<string> fileExtensions, Type rdfParserType, Type rdfDatasetParserType, Type sparqlResultsParserType, Type rdfWriterType, Type rdfDatasetWriterType, Type sparqlResultsWriterType, decimal preference = 1.0)
Parameters
Type | Name | Description |
---|---|---|
string | syntaxName | Syntax Name for the Syntax which has this MIME Type definition. |
System.Collections.Generic.IEnumerable<T><string> | mimeTypes | MIME Types. |
System.Collections.Generic.IEnumerable<T><string> | fileExtensions | File Extensions. |
System.Type | rdfParserType | Type to use to parse RDF (or null if not applicable). |
System.Type | rdfDatasetParserType | Type to use to parse RDF Datasets (or null if not applicable). |
System.Type | sparqlResultsParserType | Type to use to parse SPARQL Results (or null if not applicable). |
System.Type | rdfWriterType | Type to use to writer RDF (or null if not applicable). |
System.Type | rdfDatasetWriterType | Type to use to write RDF Datasets (or null if not applicable). |
System.Type | sparqlResultsWriterType | Type to use to write SPARQL Results (or null if not applicable). |
decimal | preference | The preference level to specify for this mime type in Accept headers. |
MimeTypeDefinition(string, IEnumerable<string>, IEnumerable<string>)
Creates a new MIME Type Definition.
Declaration
public MimeTypeDefinition(string syntaxName, IEnumerable<string> mimeTypes, IEnumerable<string> fileExtensions)
Parameters
Type | Name | Description |
---|---|---|
string | syntaxName | Syntax Name for the Syntax which has this MIME Type definition. |
System.Collections.Generic.IEnumerable<T><string> | mimeTypes | MIME Types. |
System.Collections.Generic.IEnumerable<T><string> | fileExtensions | File Extensions. |
MimeTypeDefinition(string, string, IEnumerable<string>, IEnumerable<string>, Type, Type, Type, Type, Type, Type)
Creates a new MIME Type Definition.
Declaration
public MimeTypeDefinition(string syntaxName, string formatUri, IEnumerable<string> mimeTypes, IEnumerable<string> fileExtensions, Type rdfParserType, Type rdfDatasetParserType, Type sparqlResultsParserType, Type rdfWriterType, Type rdfDatasetWriterType, Type sparqlResultsWriterType)
Parameters
Type | Name | Description |
---|---|---|
string | syntaxName | Syntax Name for the Syntax which has this MIME Type definition. |
string | formatUri | Format URI as defined by the. W3C |
System.Collections.Generic.IEnumerable<T><string> | mimeTypes | MIME Types. |
System.Collections.Generic.IEnumerable<T><string> | fileExtensions | File Extensions. |
System.Type | rdfParserType | Type to use to parse RDF (or null if not applicable). |
System.Type | rdfDatasetParserType | Type to use to parse RDF Datasets (or null if not applicable). |
System.Type | sparqlResultsParserType | Type to use to parse SPARQL Results (or null if not applicable). |
System.Type | rdfWriterType | Type to use to writer RDF (or null if not applicable). |
System.Type | rdfDatasetWriterType | Type to use to write RDF Datasets (or null if not applicable). |
System.Type | sparqlResultsWriterType | Type to use to write SPARQL Results (or null if not applicable). |
MimeTypeDefinition(string, string, IEnumerable<string>, IEnumerable<string>)
Creates a new MIME Type Definition.
Declaration
public MimeTypeDefinition(string syntaxName, string formatUri, IEnumerable<string> mimeTypes, IEnumerable<string> fileExtensions)
Parameters
Type | Name | Description |
---|---|---|
string | syntaxName | Syntax Name for the Syntax which has this MIME Type definition. |
string | formatUri | Format URI as defined by the. W3C |
System.Collections.Generic.IEnumerable<T><string> | mimeTypes | MIME Types. |
System.Collections.Generic.IEnumerable<T><string> | fileExtensions | File Extensions. |
Properties
| Improve this Doc View SourceCanonicalFileExtension
Gets/Sets the Canonical File Extension for this Syntax.
Declaration
public string CanonicalFileExtension { get; set; }
Property Value
Type | Description |
---|---|
string |
CanonicalMimeType
Gets the Canonical MIME Type that should be used.
Declaration
public string CanonicalMimeType { get; set; }
Property Value
Type | Description |
---|---|
string |
CanParseRdf
Gets whether this definition can instantiate a Parser that can parse RDF.
Declaration
public bool CanParseRdf { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
CanParseRdfDatasets
Gets whether this definition can instantiate a Parser that can parse RDF Datasets.
Declaration
public bool CanParseRdfDatasets { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
CanParseSparqlResults
Gets whether this definition can instantiate a Parser that can parse SPARQL Results.
Declaration
public bool CanParseSparqlResults { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
CanWriteRdf
Gets whether the definition provides a RDF Writer.
Declaration
public bool CanWriteRdf { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
CanWriteRdfDatasets
Gets whether the Definition provides a RDF Dataset Writer.
Declaration
public bool CanWriteRdfDatasets { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
CanWriteSparqlResults
Gets whether the Definition provides a SPARQL Results Writer.
Declaration
public bool CanWriteSparqlResults { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Encoding
Gets the Encoding that should be used for reading and writing this Syntax.
Declaration
public Encoding Encoding { get; set; }
Property Value
Type | Description |
---|---|
System.Text.Encoding |
FileExtensions
Gets the File Extensions associated with this Syntax.
Declaration
public IEnumerable<string> FileExtensions { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><string> |
FormatUri
Gets the Format URI as defined by the W3C (where applicable).
Declaration
public string FormatUri { get; }
Property Value
Type | Description |
---|---|
string |
HasFileExtensions
Gets whether any file extensions are associated with this syntax.
Declaration
public bool HasFileExtensions { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
MimeTypes
Gets the MIME Types defined.
Declaration
public IEnumerable<string> MimeTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><string> |
ObjectParserTypes
Gets the registered Object Parser Types.
Declaration
public IEnumerable<KeyValuePair<Type, Type>> ObjectParserTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><KeyValuePair<System.Type, System.Type>> |
Preference
Get or set the preference for this content type when specified in Accept headers. Value must be between 0.0 and 1.0.
Declaration
public decimal Preference { get; set; }
Property Value
Type | Description |
---|---|
decimal |
RdfDatasetParserType
Gets/Sets the Type to use to parse RDF Datasets (or null if not applicable).
Declaration
public Type RdfDatasetParserType { get; set; }
Property Value
Type | Description |
---|---|
System.Type |
RdfDatasetWriterType
Gets/Sets the Type to use to writer RDF Dataets (or null if not applicable).
Declaration
public Type RdfDatasetWriterType { get; set; }
Property Value
Type | Description |
---|---|
System.Type |
RdfParserType
Gets/Sets the Type to use to parse RDF (or null if not applicable).
Declaration
public Type RdfParserType { get; set; }
Property Value
Type | Description |
---|---|
System.Type |
RdfWriterType
Gets/Sets the Type to use to writer RDF (or null if not applicable).
Declaration
public Type RdfWriterType { get; set; }
Property Value
Type | Description |
---|---|
System.Type |
SparqlResultsParserType
Gets/Sets the Type to use to parse SPARQL Results (or null if not applicable).
Declaration
public Type SparqlResultsParserType { get; set; }
Property Value
Type | Description |
---|---|
System.Type |
SparqlResultsWriterType
Gets/Sets the Type to use to write SPARQL Results (or null if not applicable).
Declaration
public Type SparqlResultsWriterType { get; set; }
Property Value
Type | Description |
---|---|
System.Type |
SyntaxName
Gets the name of the Syntax to which this MIME Type Definition relates.
Declaration
public string SyntaxName { get; }
Property Value
Type | Description |
---|---|
string |
Methods
| Improve this Doc View SourceAddFileExtension(string)
Adds a File Extension for this Syntax.
Declaration
public void AddFileExtension(string ext)
Parameters
Type | Name | Description |
---|---|---|
string | ext | File Extension. |
AddMimeType(string)
Adds a MIME Type to this definition.
Declaration
public void AddMimeType(string type)
Parameters
Type | Name | Description |
---|---|---|
string | type | MIME Type. |
CanParseObject<T>()
Gets whether a particular Type of Object can be parsed.
Declaration
public bool CanParseObject<T>()
Returns
Type | Description |
---|---|
System.Boolean |
Type Parameters
Name | Description |
---|---|
T | Object Type. |
CheckValidMimeType(string)
Checks that MIME Types are valid.
Declaration
public string CheckValidMimeType(string type)
Parameters
Type | Name | Description |
---|---|---|
string | type | Type. |
Returns
Type | Description |
---|---|
string |
GetObjectParser<T>()
Gets an Object Parser for the given Type.
Declaration
public IObjectParser<T> GetObjectParser<T>()
Returns
Type | Description |
---|---|
IObjectParser<T> |
Type Parameters
Name | Description |
---|---|
T | Object Type. |
GetObjectParserType<T>()
Gets an Object Parser for the given Type.
Declaration
public Type GetObjectParserType<T>()
Returns
Type | Description |
---|---|
System.Type |
Type Parameters
Name | Description |
---|---|
T | Object Type. |
GetRdfDatasetParser()
Gets an instance of a RDF Dataset parser.
Declaration
public IStoreReader GetRdfDatasetParser()
Returns
Type | Description |
---|---|
IStoreReader |
GetRdfDatasetWriter()
Gets an instance of a RDF Dataset writer.
Declaration
public IStoreWriter GetRdfDatasetWriter()
Returns
Type | Description |
---|---|
IStoreWriter |
GetRdfParser()
Gets an instance of a RDF parser.
Declaration
public IRdfReader GetRdfParser()
Returns
Type | Description |
---|---|
IRdfReader |
GetRdfWriter()
Gets an instance of a RDF writer.
Declaration
public IRdfWriter GetRdfWriter()
Returns
Type | Description |
---|---|
IRdfWriter |
GetSparqlResultsParser()
Gets an instance of a SPARQL Results parser.
Declaration
public ISparqlResultsReader GetSparqlResultsParser()
Returns
Type | Description |
---|---|
ISparqlResultsReader |
GetSparqlResultsWriter()
Gets an instance of a SPARQL Results writer.
Declaration
public ISparqlResultsWriter GetSparqlResultsWriter()
Returns
Type | Description |
---|---|
ISparqlResultsWriter |
SetObjectParserType<T>(Type)
Sets an Object Parser for the given Type.
Declaration
public void SetObjectParserType<T>(Type parserType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | parserType | Parser Type. |
Type Parameters
Name | Description |
---|---|
T | Object Type. |
SupportsFileExtension(string)
Determines whether the Definition supports a particular File Extension.
Declaration
public bool SupportsFileExtension(string ext)
Parameters
Type | Name | Description |
---|---|---|
string | ext | File Extension. |
Returns
Type | Description |
---|---|
System.Boolean |
SupportsMimeType(string)
Determines whether the Definition supports a particular MIME type.
Declaration
[Obsolete("Deprecated in favour of the alternative overload which takes a MimeTypeSelector", true)]
public bool SupportsMimeType(string mimeType)
Parameters
Type | Name | Description |
---|---|---|
string | mimeType | MIME Type. |
Returns
Type | Description |
---|---|
System.Boolean |
SupportsMimeType(MimeTypeSelector)
Determines whether the definition supports the MIME type specified by the selector.
Declaration
public bool SupportsMimeType(MimeTypeSelector selector)
Parameters
Type | Name | Description |
---|---|---|
MimeTypeSelector | selector | MIME Type selector. |
Returns
Type | Description |
---|---|
System.Boolean |