[topicmapmail] Should resourceData have a MIME type?
Robert Barta
rho@bigpond.net.au
Mon, 13 Jan 2003 06:29:38 +1000
On Sat, Jan 11, 2003 at 04:13:28PM -0500, Thomas B. Passin wrote:
> I have noticed that some people put markup into the resourceData element of
> an occurrence. One example is Kal Ahmed's nice topic map of the TM4J API.
...
> Presumably for a resourceRef, the application can find out the MIME type
> when it retrieves the resource, but not so for resource data.
Thomas,
Not all protocols give you some object meta data. HTTP does, SMTP can do,
FTP, file: do not.
> It would be clumsy to define different occurrence types to hold different
> types of resource data. It would be very complex to specify each instance
> as being of some type that holds the right data type.
Whether it is clumsy may depend on the notation you are using. In
AsTMA= I would write
holidays subclasses time-interval
bn: Holidays
in: sleeping, drinking, eating, programming
in (text-html) : <b>sleeping, drinking, eating, programming</b>
and reify text-html with the appropriate PSI (if there is one) or the
HTML standard. But occurrence types do not feel to be the right thing
to use here (?).
I had a similar problem with a topic map of references for TM
literature. There I chose to use scopes:
graham01 (article)
bn : RDF and Topic Maps - An Exercise in Convergence
bn @ latex: {RDF} and {Topic Maps} - An Exercise in Convergence
...
When run through the processor it will first look for a LaTeX variant
to give better results. Not overly hi-tech but it works.
Another option would be to reify the occurrence data itself and to
associate it with a MIME type. While the MIME type is meta data and
this seems the right thing to this approach is quite error prone.
Another would be to tuck this away into a variant section:
<variant>
<parameters><topicRef xlink:href="#text-html"/></parameters>
<variantName>
<resourceData><html:b>sleeping, drinking, eating, programming</html:b></resourceData>
</variantName>
</variant>
But these - I reckon - are more thought as an extension mechanism for
naming and not so much attaching values to a topic.
> 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?
[ There was recently a suggestions for a typing system floating by (Murray?) ]
> This would be so useful and so simple - and backwards compatible - that I
> urge its adoption in the next version of the ISO standard.
Useful, yes. Simple, hopefully.
\rho