Last modified: 2011-07-15 12:39:22 UTC
When something goes wrong, such as the current behavior where "Category:+" should act as a wild card but instead acts as a nonexistent category (https://bugzilla.wikimedia.org/show_bug.cgi?id=29900), the query returns all pages in the wiki, which is not only unuseful, but also likely to be confusing and more of a problem than simply displaying nothing when nothing is found. Instead, nothing should be returned if there is nothing that matches the query. See also: https://bugzilla.wikimedia.org/show_bug.cgi?id=29891#c2 ...the reason that [[Category:+]] does not work is simply that it is ambiguous with SMW's way of searching for pages in the category called "+". Since this is not a valid page, the query ends up having no conditions and all pages are returned.
SMW drops invalid conditions. If you only have one condition, and it's invalid, indeed everything will be shown. Whenever there is at least one invalid condition, an error icon will be displayed underneath the query listing the invalid conditions. As far as I'm concerned, this is perfectly reasonable behavior, so I'm tempted to mark this as invalid.
It's reasonable when there's more than one condition, but if there's only one, showing everything is a mess. I suppose it would have to be handled as a special case. It's especially confusing for someone that doesn't know why it's giving incorrect results, and damages credibility for a site that may be giving information this way. My imagination could come up with instances where the consequences could be particularly damaging either to the user of the data or the site supplying the data. How about if SMW were adopted to dispense pharmaceutical information? Giving incorrect results by default becomes clearly a bad choice in any situation where getting wrong data could kill people, cost somebody money, provoke legal consequences, and so forth. Marking this as invalid is not recommended.
SMW has a setting to configure this behaviour. The default is to ignore query errors and execute the query anyway (even if empty). You can change this by setting $smwgIgnoreQueryErrors = false; in LocalSetting.php. With this setting, only the error message will be shown when an error occurred in processing the query.