Last modified: 2014-08-19 05:51:04 UTC
[[Overview]] The ask query removes all results without value for a property that is specified in the "sort" parameter. [[Steps to Reproduce]] For example, if I have a page P1 in category C with a property [[has X::value]] and another page P2 in same category C without the "has X" property. They both use the same template and same semantic form. [[Actual Results]] When I write: {{#ask: [[Category:C]] |?has X |sort=has X |order=asc }} it displays only page P1. But: {{#ask: [[Category:C]] |?has X }} displays both P1 and P2 pages. [[Expected Results]] it should have displayed both P1 and P2 in both cases.
This is the normal and expected behaviour of SMW as described in the documentation. Please read the manual for details: http://semantic-mediawiki.org/wiki/Help:Selecting_pages#Sorting_results
(In reply to comment #1) > This is the normal and expected behaviour of SMW as described in the > documentation. Please read the manual for details: > > http://semantic-mediawiki.org/wiki/Help:Selecting_pages#Sorting_results You are right..I mean that's what the docs say. However, I think such logic inside SMW could mislead users with large quantities of data thinking that the results are actually all results and thus unnecessary debugging effort to find the issue could appear. Isn't there any hack or something to have pages without the sorted property appear in the result set? Thanks.
There is no such hack, other than adding a default property value to all pages (e.g. by means of a template).
[Removing RESOLVED LATER as discussed in http://lists.wikimedia.org/pipermail/wikitech-l/2012-November/064240.html and announced in https://sourceforge.net/mailarchive/forum.php?thread_name=CALFVSbXkiffYy6HkhEWE0RtRrJ%2B2ebPz3g00gsr%2Bdz%2B1nZWsDA%40mail.gmail.com&forum_name=semediawiki-devel . Reopening and setting priority to "Lowest". For future reference, please use either RESOLVED WONTFIX (for issues that will not be fixed), or simply set lowest priority. Thanks a lot!]
I support the idea that a query, when asked to sort, should not filter.
+1 for fixing this. The result should not depend on the sort condition. This is unexpected behavior from end-user perspective and confuses.