MIME and MIME-like Type Identifiers

The Casbah Project uses MIME and MIME-like type identifiers to manage the native Casbah primitive types described above, as well as Casbah's use of official IANA MIME types.

In general Casbah knows about three kinds of types:

IANA MIME Types

As a web application framework, Casbah will of necessity be dealing with all sorts of data types, most of which have already been given both an official IANA MIME identifier, as well as a MIME identifier-to-file-extension mapping.

Casbah will, therefore, simply adopt the most up-to-data IANA MIME identifier list and file extension mapping.

MIME-to-File-Extension Mappings: Casbah will employ IANA's standard mappings for ascertaining a file's type, and encoding, from its extension. This may be of particular importance in moving data in and out of the Casbah Virtual Namespace. OPEN ISSUE: will we have to use file extension mappings or will the Casbah Virtual Namespace have a special metadata table per entry with a key like "type" or "MIME"? Or do we need to do BOTH of these?

The relevant IANA documents are the following:

Casbah Public Types

The Casbah Project will also have occasion to use the IANA MIME identifier hierarchy for its own public datatypes. By "public" we mean file and datatypes that can reasonably be expected to move between Casbah systems and non-Casbah systems, such as a filesystem or Web server MIME mapping file, etc.

Whether or not The Casbah Project formalizes its APIs and datatypes by submitting either APIs or new MIME types to IETF or IANA, all Casbah public types will be IANA-legal, even if informal.

In other words, even if Casbah public type identifiers aren't formally recognized by IANA, they must be IANA legal values nonetheless. Casbah public types fit into the "application" part of the IANA hierarchy, and should employ a unique Casbah namespace identifier.

To form a Casbah public type, then, the following template must be used:

<type>/<unregistered type namespace>.<casbah-namespace>.<typename>

Example 1. Casbah Public Types

  • application/vnd.casbah-project.coptic-data

  • application/vnd.casbah-project.casbah-markup-language

Casbah Private Types

The Casbah private[1] types are primitive Casbah datatypes introduced above (Primitive Datatypes), as well as other parts of Natroun subsystems, like drivers. We use a MIME-like type identifier to distinguish these private types from Casbah public types and from formal IANA types. Coordination of identifiers for Casbah private types

The Casbah private type identifier is constructed thus:

<casbah-namespace>/<type>/<subtype>

Accordingly, the Casbah datatype identifiers are as follows:

We construct private type identifiers for other parts of Casbah in the same way, where type is equivalent to "Casbah subsystem" and subtype is equivalent to "name of subsytem element":

<casbah-namespace>/<Natroun|Oriel|Qibla|Shariff>/<name>

Example 2. Casbah Private Types

Some examples of this scheme include:

  • casbah/natroun/NatrounFile

  • casbah/natroun/NatrounFileSystem

  • casbah/natroun/NatrounLDAP

  • casbah/oriel/JPython

  • casbah/oriel/Jacl

  • casbah/oriel/Kawa

  • casbah/qibla/CairoAdapter

  • casbah/qibla/LDOL2

  • casbah/qibla/HTTP

Notes

[1]

"private" means in this context "internal"; i.e., these identifiers are frequently the value of key/value pairs in CaDicts, values which are accessible only to other parts of Casbah. As such, they don't have to be formal IANA types, nor in a form suitable for formalization by IANA.