opengeospatial / geopackage-related-tables

A proposed GeoPackage extension for related tables
Other
3 stars 6 forks source link

Add guidance on content_type where there is no MIME type #40

Closed bradh closed 6 years ago

bradh commented 6 years ago

Media related attribute tables must contain a content_type that is not null. However there are not defined MIME types for all document types (e.g. audio/wav is not defined, even though it is commonly used).

There is always an option for application/octet-stream, but the user experience for that will likely be terrible (file "save as", at best). Another alternative would be to allow it to be null (which would correspond to HTTP Content-Type behaviour). User experience will be equally terrible.

We could allow dropping a file extension into content_type (so ".wav" instead of "audio/wav"). That would be more complexity for the consumer side, but it would be easy to detect - string starts with . or string contains / depending on exactly how we wrote the file extension part. I'm not sure how that would impact on mobile clients, but don't see any issue at this point.

ashleyha commented 6 years ago

Would it work to modify the language in the Media Types section to allow for commonly used vendor and unregistered media types? Perhaps something like: "A section describing the media types to be used is mandatory for any standard involving data encodings. If no suitable IANA Media Type exists in http://www.iana.org/assignments/media-types/index.html then this section may be used to specify another widely-deployed media type or define a new media type for registration with IANA."

Also wondering how often consumers would also (or primarily) read the initial bytes of a file to determine the mime type of the file vs. relying solely on the information in content_type?

bradh commented 6 years ago

We'd need to define "widely-deployed" to make that testable. Maybe a supplemental list, but I worry about endless updates.

jyutzler commented 6 years ago

I think the best we will be able to do is to make the column mandatory (not null). We can then recommend an IANA MIME Type, falling back to another commonly used type if an official one is not available. Anything stronger isn't going to be testable.

jyutzler commented 6 years ago

During the conference call today, we agreed to leave the requirement alone but to discuss this as part of the ER. https://github.com/opengeospatial/gpkg-rte-ie-er/issues/5