[topicmapmail] Should resourceData have a MIME type?

Thomas B. Passin tpassin@comcast.net
Sun, 12 Jan 2003 15:49:36 -0500


[Robert Barta]

> > It would be very simple to add an optional attribute to resourceData
that
> > would specify the MIME type.  Then my app could get an occurrence of
Kal's
> > data, discover that it is intended to be HTML, and display it
accordingly.
> > Even inline images could be included, along with the other MIME types.
>
> Yes, there is something missing. Maybe because introducing something
> would have opened another box of Pandora (she had a few): What about
> other "data types"?
>
>     - Integer,
>     - float,
>     - ...
>     - building new data types (record of a text, a float and one integer)
>
> Or would you restrict it to text data?
>

In web browsers, the user agent is supposed to decide how to display a
document based on MIME type. It usually calls an appropriate handler for
GIF, JPEG, Powerpoint, etc.

If anything is going to be displayed about a topic map, it is names and
occurrence data.  I know that some content will be processed by machine, but
display, I am sure, will always remain important.

If we say it is up to the topic map processor to discover how you have
reified an occurrence, and how you have indicated the data type, there will
be so many possibilities that only one that understands your scheme will
have much hope of succeeding.

Also, the processing needed to negotiate most of these alternate proposals
is fairly complex.

Why not proceed by means of a series of steps?  If one does not work well
enough, go discard it.  Annotating with a MIME type is as simple as it
comes. That could be step one.

For step two, when some type is required that cannot be declared with MIME,
use a chunk of XML.  If that chunk points to a schema, the processor can
find out about the data types from the schema.  Otherwise it can do generic
processing on the XML.

For step three - well, there might not need to be one.  And the more complex
proposals would still be available for anyone who thought she needed them.

Remember the use case that started me thinking about this.  I displayed
occurrence data that contained html markup.  I thought I would write some
code to try to detect if occurrence data contains html, but then what if it
contained xml, which seems rather likely?  So I though about a more general
solution, and this seems to be the simplest thing that is also clearly
workable.

Cheers,

Tom P