Class MimeTypeDefinition
Represents the definition of a MIME Type including mappings to relevant readers and writers.
Inherited Members
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public sealed class MimeTypeDefinition
Constructors
| Edit this page View SourceMimeTypeDefinition(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. |
IEnumerable<string> | mimeTypes | MIME Types. |
IEnumerable<string> | fileExtensions | File Extensions. |
MimeTypeDefinition(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. |
IEnumerable<string> | mimeTypes | MIME Types. |
IEnumerable<string> | fileExtensions | File Extensions. |
Type | rdfParserType | Type to use to parse RDF (or null if not applicable). |
Type | rdfDatasetParserType | Type to use to parse RDF Datasets (or null if not applicable). |
Type | sparqlResultsParserType | Type to use to parse SPARQL Results (or null if not applicable). |
Type | rdfWriterType | Type to use to writer RDF (or null if not applicable). |
Type | rdfDatasetWriterType | Type to use to write RDF Datasets (or null if not applicable). |
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, 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 |
IEnumerable<string> | mimeTypes | MIME Types. |
IEnumerable<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 |
IEnumerable<string> | mimeTypes | MIME Types. |
IEnumerable<string> | fileExtensions | File Extensions. |
Type | rdfParserType | Type to use to parse RDF (or null if not applicable). |
Type | rdfDatasetParserType | Type to use to parse RDF Datasets (or null if not applicable). |
Type | sparqlResultsParserType | Type to use to parse SPARQL Results (or null if not applicable). |
Type | rdfWriterType | Type to use to writer RDF (or null if not applicable). |
Type | rdfDatasetWriterType | Type to use to write RDF Datasets (or null if not applicable). |
Type | sparqlResultsWriterType | Type to use to write SPARQL Results (or null if not applicable). |
Properties
| Edit this page View SourceCanParseRdf
Gets whether this definition can instantiate a Parser that can parse RDF.
Declaration
public bool CanParseRdf { get; }
Property Value
Type | Description |
---|---|
bool |
CanParseRdfDatasets
Gets whether this definition can instantiate a Parser that can parse RDF Datasets.
Declaration
public bool CanParseRdfDatasets { get; }
Property Value
Type | Description |
---|---|
bool |
CanParseSparqlResults
Gets whether this definition can instantiate a Parser that can parse SPARQL Results.
Declaration
public bool CanParseSparqlResults { get; }
Property Value
Type | Description |
---|---|
bool |
CanWriteRdf
Gets whether the definition provides a RDF Writer.
Declaration
public bool CanWriteRdf { get; }
Property Value
Type | Description |
---|---|
bool |
CanWriteRdfDatasets
Gets whether the Definition provides a RDF Dataset Writer.
Declaration
public bool CanWriteRdfDatasets { get; }
Property Value
Type | Description |
---|---|
bool |
CanWriteSparqlResults
Gets whether the Definition provides a SPARQL Results Writer.
Declaration
public bool CanWriteSparqlResults { get; }
Property Value
Type | Description |
---|---|
bool |
CanonicalFileExtension
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 |
Encoding
Gets the Encoding that should be used for reading and writing this Syntax.
Declaration
public Encoding Encoding { get; set; }
Property Value
Type | Description |
---|---|
Encoding |
FileExtensions
Gets the File Extensions associated with this Syntax.
Declaration
public IEnumerable<string> FileExtensions { get; }
Property Value
Type | Description |
---|---|
IEnumerable<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 |
---|---|
bool |
MimeTypes
Gets the MIME Types defined.
Declaration
public IEnumerable<string> MimeTypes { get; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
ObjectParserTypes
Gets the registered Object Parser Types.
Declaration
public IEnumerable<KeyValuePair<Type, Type>> ObjectParserTypes { get; }
Property Value
Type | Description |
---|---|
IEnumerable<KeyValuePair<Type, 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 |
---|---|
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 |
---|---|
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 |
---|---|
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 |
---|---|
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 |
---|---|
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 |
---|---|
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
| Edit this page 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 |
---|---|
bool |
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 |
GetObjectParserType<T>()
Gets an Object Parser for the given Type.
Declaration
public Type GetObjectParserType<T>()
Returns
Type | Description |
---|---|
Type |
Type Parameters
Name | Description |
---|---|
T | Object Type. |
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. |
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 |
---|---|---|
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 |
---|---|
bool |
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 |
---|---|
bool |
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 |
---|---|
bool |