tmlab/majortom

topic.bestName()

Closed this issue · 9 comments

A bestName()-method should give back the "best" name: e.g. priority

* default name type better than another name type
* ucs better than scope, smaller scope better than larger one
* short value better than long value (size of String)
* name better than identifier (no name existing -> give back si, sl or ii)

Original issue reported on code.google.com by schulze....@googlemail.com on 7 Sep 2010 at 9:10

Original comment by Sven.Kro...@googlemail.com on 8 Sep 2010 at 7:02

  • Changed state: Started

Original comment by Sven.Kro...@googlemail.com on 8 Sep 2010 at 7:02

Return value: String.

And also: if no name exists and the value of an identifier is returned, would 
it be possible to unresolve against the tmdm, xsd or tmcl qname?

Original comment by schulze....@googlemail.com on 8 Sep 2010 at 7:07

What do you mean?

--And also: if no name exists and the value of an identifier is returned, would 
it be possible to unresolve against the tmdm, xsd or tmcl qname?--

Do you mean, if the the si of a topic is 
http://psi.topicmaps.org/iso13250/model/supertype you want to return 
tmdm:supertype?


Original comment by Sven.Kro...@googlemail.com on 8 Sep 2010 at 7:16

Yes, exactly that. What do you think of that?

Original comment by schulze....@googlemail.com on 8 Sep 2010 at 8:41

I do not know if this behaviour should be a part of the topic maps engine in 
this case to handle prefixes as something magic. 

My idea would be to add some methods to the MaJorToM API, something like the 
following one.

ITopicMap#addPrefix("tmdm","http://psi.topicmaps.org/iso13250/model/");
ILocator#unresolve()

The unresolve method could work based in the defined prefixes. In this case the 
user can control which prefixes he want to unresolve.

Original comment by Sven.Kro...@googlemail.com on 8 Sep 2010 at 9:07

@addPrefix: This is what we are doing in RTM. Perhaps it's time to move the 
add_prefix from RTM-Sugar to MaJorToM :).

Original comment by schulze....@googlemail.com on 8 Sep 2010 at 10:05

Original comment by Sven.Kro...@googlemail.com on 15 Sep 2010 at 8:30

  • Added labels: Priority-Low
  • Removed labels: Priority-High
prefix repository get its own ticket #70

Original comment by Sven.Kro...@googlemail.com on 1 Nov 2010 at 11:17

  • Changed state: Fixed