[topicmapmail] Topic name display priority

Murray Altheim m.altheim@open.ac.uk
Tue, 01 Apr 2003 11:51:15 +0100


Steve Pepper wrote:
> At 11:09 01.04.2003 +0100, Murray Altheim wrote:
> 
>> My take on the ISO and XTM specs is that the proper thing
>> would be to choose the base name first, based on whatever
>> criteria, then check to see if there's a display name
>> available.
>
> Yes. It has to be a two-step process: First select the most
> appropriate base name, and then check for variants.

I feel a bit like a bonehead. A few minutes after sending the
message I fell victim once again to Kal's cleverness. :-)

In TM4J there's a method

    org.tm4j.topicmap.TopicMapUtils.getDisplayName(Topic,Scope)

which I will simply use rather than writing my own. Its description
is thus:

    Returns a string which may be used as a display name in the
    specified scope. If a variant name with a parameter of
    'display' exists in the specified scope, then that variant's
    name string is returned. Otherwise a base name in the specified
    scope is sought and if found, then the base name string is
    returned. Finally a base name in the unconstrained scope is
    sought and that name string returned. If all of these searches
    fail, null is returned.

This is basically what I was thinking, and it's nice I don't have
to reinvent this wheel. (thanks Kal)

Murray

......................................................................
Murray Altheim                  <http://kmi.open.ac.uk/people/murray/>
Knowledge Media Institute
The Open University, Milton Keynes, Bucks, MK7 6AA, UK

    Hunt the Boeing! And test your perceptions!
    http://www.asile.org/citoyens/numero13/pentagone/erreurs_en.htm