From: Markus K. <ma...@se...> - 2010-05-28 13:20:32
|
On Freitag, 28. Mai 2010, Dan Bolser wrote: > On 28 May 2010 09:55, Markus Krötzsch <ma...@se...> wrote: > > On Freitag, 28. Mai 2010, Dan Bolser wrote: > >> I guess this should be on the devel list > >> > >> On 27 May 2010 15:14, Dan Bolser <dan...@gm...> wrote: > >> > About the fix proposed here: > >> > > >> > https://bugzilla.wikimedia.org/show_bug.cgi?id=23679 > >> > > >> > > >> > Given that plain (unformatted) printout is just a special case of the > >> > way units are selected, don't you think it's reasonable to suppress > >> > the output of units when using plain (unformatted) printouts? > >> > > >> > i.e. If I say: > >> > > >> > * {{#show: Some page | ? My property # seconds }} > >> > * {{#show: Some page | ? My property # hours }} > >> > > >> > > >> > It's clear that I want the result in seconds or hours, respectively. > >> > However, if I say: > >> > > >> > * {{#show: Some page | ? My property # - }} > >> > > >> > > >> > Isn't it clear that I don't want units? > > > > The analogy of #- and #unit is not quite correct, because #- is supported > > by all datatypes while #unit is specific to the numeric types with units. > > A value that is a (physical) dimension consists of a number multiplied by > > a quantity (unit), so leaving away the unit would really change the > > value. > > > > But it makes sense to have a way of accessing only the number and maybe > > also only the unit. We do not have to use #- as the only special format: > > we can simply have two more formats for the two behaviours. I just need a > > useful name for them (keeping in mind that the format names should avoid > > conflicts with names of units that someone might want to use). How about > > the following? > > > > Given a value "12,345.6 km": > > #- for "12345.6 km" (as it is now) > > #-n for "12345.6" > > #-u for "km" > > Great idea! Ok, so be it. SVN is updated, the feature will be part of SMW 1.5.1 as released next week. I would be grateful if someone could document this in the SMW manual (in two places: for Type:Number and for types with custom units). Markus -- Markus Krötzsch <ma...@se...> * Personal page: http://korrekt.org * Semantic MediaWiki: http://semantic-mediawiki.org * Semantic Web textbook: http://semantic-web-book.org -- |