From: Markus <ma...@ai...> - 2007-12-14 22:21:23
|
Hi all, SMW just got one new and one old feature (coming with the next release=20 candidate) which I think are worth pointing out: (1) Type:Boolean works again. It mostly does what it did in SMW0.7: you ent= er=20 values by saying 1 or 0, or one of the true- or false-words defined for you= r=20 language. You can customise query printouts in various ways now (using #ask= =20 syntax): ?boolproperty =20 default printout with main labels of the language ?boolproperty#true,false use "true" and "false" as labels for the two values ?boolproperty#x use 'X' for true and nothing for false, useful for making cross tables (in <ask> syntax these would be [[boolproperty::*]],=20 [[boolproperty::*true,false]], and [[boolproperty::*x]]) BUT, before you start using Booleans all over your wiki, let me point out=20 another feature: (2) "Boolean printouts" for categories are now possible. This is a kind of= =20 printout statement for queries that will show you for each result whether o= r=20 not it belongs to a given category or not. Consider the following example=20 query: {{#ask:[[Category:Event]] | ?title =3D Name| ?Category:Conference| ?Category:Workshop| limit=3D50 }} The query shows 50 elements of Category:Event with various printouts. The=20 important parts are the ones of the form "?Category:Conference". So far the= re=20 was only "?Property" (print all property values) and "?Category" (print *al= l*=20 categories). Now "?Category:Conference" checks whether a result is in=20 Category:Conference and returns a Boolean value based on this. The default= =20 output style for this is "X" which is most easy to read in output tables, b= ut=20 you can also customise it just like Type:Boolean (e.g. one could=20 write "?Category:Conference=3Dis conference,no conference" to get those two= =20 labels associated). See http://ontoworld.org/wiki/Upcoming_events#List_of_upcoming_events for a= n=20 example printout of this kind. Note that this feature does not work with the old <ask>-style syntax. #ask = is=20 just better for such extensions (and for many other things). So you can actually use normal categories instead of properties of=20 Type:Boolean in many cases. My suggestion is to do that, since categories=20 integrate better with the article layout, and since they are also used by=20 many other MW features and extensions (CategoryTree, SemanticDrilldown,=20 etc.). The cases where Type:Boolean properties are still useful are (a) whe= n=20 you want to distinguish between "true", "false", and "unspecified"=20 (categories really only have "true" and "false-or-unspecified"), or when yo= u=20 have so many property values on one page that categories would not be easy = to=20 read or maintain anymore. But do as you like. Cheers, Markus P.S. Printouts of the form "?property::value" with the obvious meaning are= =20 also planned, but need some more internal changes to work. =2D-=20 Markus Kr=F6tzsch Institut AIFB, Univers=E4t Karlsruhe (TH), 76128 Karlsruhe phone +49 (0)721 608 7362 fax +49 (0)721 608 5998 ma...@ai... www http://korrekt.org |