Re: TMQL: Minor issue: Plurals for paths
Xuân Baldauf <xuan--2007--topicmapmail--infoloom.com-IBzAk7fUI6RAfugRpC6u6w@public.gmane.org>
| Newsgroups | gmane.text.xml.xtm.general |
|---|---|
| Message-ID | <[email protected]> |
Lars Heuer wrote: > Hi Benjamin, > > >>> So "t/occurrences" does not match well with the mental model. >>> > Rereading [1] I found at slide 76: "Consistent naming of axes - Xuân > wants them all to be plural". > > Can you or Xuân explain the switch to plural terms? Why do they fit > any better than the (commonly) used singular terms? > > [1]<http://www.itscj.ipsj.or.jp/sc34/open/1536.pdf> > Well, as far as I can recall, the idea is that an axis is actually a function, and functions returning a set of something should be named in plural. This is common (and I think good) practice, like in Python, the method to retrieve all keys of a dict object is called "keys" (see http://docs.python.org/library/stdtypes.html#dict.keys ), not "key". Actually sticking to this naming convention allows to distinguish between "Role#player" and "Association#players", and also enables Robert's idea. Robert Barta wrote: > [...] > While I have no strong inclinations here, I could think that > > t / occurrences # list, collection > > could mean something different from > > t / occurrence # pick exactly one > > Whether this is useful per se, and/or can be exploited in the TMQL > semantics is a question to resolve. > > \rho > I like this idea in general. However, this should only be done if we have succeeded in defining a generic "exactly_one" function (or axis, if you will) which picks along some still-to-be-defined rules an element of a set|collection (and raises an error of the collection is empty). (Picking "right" elements is actually a non-trivial question, as the notion of "the most right one" may actually depend on the user locale, for example, something which may not be accessible by default to the TMQL processor.) Then it could be trivial to specify the singular versions by means of the "exactly_one" function (or axis). > Best regards, > Lars > ciao, Xuân. _______________________________________________ topicmapmail mailing list [email protected] http://www.infoloom.com/mailman/listinfo/topicmapmail