Page MenuHomePhabricator

the "default=" query parameter doesn't work with the #show parser function.
Closed, DeclinedPublic

Description

Author: dan.bolser

Description:
If you #ask for a certain property from a certain page, no default text is shown if the page exists but doesn't carry that property (default text is only shown when no pages are returned).

i.e. page X does not have the property y, the following returns blank:

{{#ask: [[X]] | ?y | default = can't see me}}

This may be well and good for #ask, but it means that #show will never show the default text (assuming it's page exists), which seems strange.

Do we need a default-per-property syntax?

{{#ask: [[X]] | ?y = The value of y # y is undefined}}

or something like that?


Version: unspecified
Severity: enhancement

Details

Reference
bz26890

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:20 PM
bzimport set Reference to bz26890.

Yes, I think that this is probably best addressed by a default value for property printouts in queries. Using the existing printout parameter syntax, the appropriate way of supporting this would be

{{#ask: [[X]]

?y+default=No values for y
?z+default=No values for z

}}

Unfortunately, printout parameters are not currently supported by Special:Ask. It is also not so clear how this would fit into the internal architecture regarding datatypes. Some formats like timeline expect Type:Date properties to return dates, but the default value would probably rather be a Type:String value.

If these two issues can be addressed, it seems like a useful feature to implement.

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.