DanTMan wrote: > I was thinking of creating an actual enumeration type. Heh, there used to be one in SMW 0.7, SMW_DT_Enum.
> Currently enumerations are done with a String type alias, and just using > [[Allows value::...]]. Actually they work for any type, though there's still bug 11820 with Type:Page. > However, afaik there is no way to add aliases (Inf to Infinite, etc...), > and it also doesn't support recognizing similar things (like when > someone inputs male instead of Male, just with different case). > So I was thinking of either making an actual Enumeration, or perhaps > creating an InsensitveString type, and also extending Allows value or > adding in another builtin to support aliases. Maybe, I would force consistency. Anyone motivated enough to add semantics to a wiki page will gladly get the value right, especially when inconsistency results in such excellent feedback: “Inf” is not in the list of possible values (1, 42, Infinite) for this property. The problem with case-insensitive aliases is you now have to do case-insensitive queries to do what the user intended, or lowercase values as you store them. It gets messy quickly. See bug 9750, https://bugzilla.wikimedia.org/show_bug.cgi?id=9750 for ideas on more sophisticated ordered enumeration. I and others wanted an optional syntax [[allows value::Infinite=9999]], [[allows value::Inf=9999]] that would order values, but ran aground on implementation details of special properties. Your Type:InsensitiveString is equally reasonable. I *think* that just subclassing getHash() to lowercase would make case insensitive [[allows value]] work, but you'd still have to address querying. If you use Type:Number together with "pseudo-numbers" like [[Allows value::2 - Medium]] [[Allows value::2 - Middling]] [[Allows value::9999 - Inf]] [[Allows value::9999 - Infinite]] then you gain some of the normalization of numbers and aliasing of Middle and Medium while still limiting to an enumeration. Check it out at <http://www.semanticweb.org/wiki/Test_allows_value_number#Test_pseudo-numbers> I described this a while back in the mailing list message "tip: flexibility with Allows_value in 1.0, replaces enumerations" and just added the idea to the doc in http://semantic-mediawiki.org/wiki/Property:Allows_value -- =S Page ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel