Page MenuHomePhabricator

ask query removes results with no value for a property when sorting by it
Closed, DeclinedPublic

Description

Author: matrix.has.neo

Description:
[[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.


Version: unspecified
Severity: major
OS: Windows XP
Platform: PC

Details

Reference
bz22583

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 11:02 PM
bzimport set Reference to bz22583.

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

matrix.has.neo wrote:

(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.

user66 wrote:

+1 for fixing this. The result should not depend on the sort condition. This is unexpected behavior from end-user perspective and confuses.

Aklapper subscribed.

The Semantic MediaWiki developers requested in https://phabricator.wikimedia.org/T64114 to move their task tracking to https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues and to close remaining tasks in Wikimedia Phabricator. If you still face the problem reported in this task in a supported version of SMW, please feel free to transfer your report to https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues . We are sorry for the inconvenience.