[topicmapmail] Should resourceData have a MIME type?
Kal Ahmed
kal@techquila.com
Mon, 13 Jan 2003 14:38:38 +0000
On Saturday 11 January 2003 21:13, Thomas B. Passin wrote:
> I have noticed that some people put markup into the resourceData elemen=
t of
> an occurrence. One example is Kal Ahmed's nice topic map of the TM4J A=
PI.
>
aw shucks...thanks :-)
The reason that HTML ended up in there was that thats the way the doclet=20
worked. Of course, in my application for the topic map (creating HTML=20
documentation pages), the fact that HTML markup ends up getting passed=20
through the application to the final rendering stage is actually somethin=
g of=20
a bonus. I could almost pretend that I had intended it to work like that =
all=20
along ;-)
> This practice makes a lot of sense, but the application has no way to k=
now
> that one particular occurrence is going to have markup and another is n=
ot.
> It is not always easy to detect markup, especially the type of the mark=
up.
>
> Presumably for a resourceRef, the application can find out the MIME typ=
e
> when it retrieves the resource, but not so for resource data.
>
> It would be clumsy to define different occurrence types to hold differe=
nt
> types of resource data. It would be very complex to specify each insta=
nce
> as being of some type that holds the right data type.
>
> It would be very simple to add an optional attribute to resourceData th=
at
> would specify the MIME type. Then my app could get an occurrence of Ka=
l's
> data, discover that it is intended to be HTML, and display it according=
ly.
> Even inline images could be included, along with the other MIME types.
>
> This would be so useful and so simple - and backwards compatible - that=
I
> urge its adoption in the next version of the ISO standard.
>
This is a neat solution and nicely self-contained. I guess that the=20
alternative solution is to allow varients of occurrences and define PSIs =
for=20
media types so that meda-type topics could be used as parameters to the=20
occurrence variants.
Nikita's proposal of using scope to express the occurrence media-type fee=
ls=20
(to me) as an overloading of the scope principle. I feel that the=20
relationship of the media-type to the resource is a meta-data relationshi=
p=20
rather than a context relationship.
> Note that RDF has a similar problem with the values of their literals.=20
> They tried to handle it with the "parsetype" attribute, but apparently =
they
> have not gotten everything ironed out yet.
>
Why ? Did they get something wrong when defining parsetype ? It would be =
nice=20
if we can learn from their difficulties rather than repeat the same error=
s.
HLink (http://www.w3.org/TR/hlink) defines a mediaType attribute. While H=
Link=20
is about the description of linking elements, I think that the semantics =
of=20
the mediaType attribute encapsulate more or less what you propose. The=20
onSuccess and onFailure attributes are also interesting, though to apply =
them=20
in the context of resource data we would have to use a slightly different=
=20
processing model (as one may want to allow both "onSuccess" and "onFailur=
e"=20
data to appear as separate content for the same resource data).
Cheers,
Kal
--=20
Kal Ahmed, techquila.com
XML and Topic Map Consultancy
e: kal@techquila.com
p: +44 7968 529531
w: www.techquila.com