Last modified: 2012-08-04 00:03:33 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T37211, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35211 - parser function #ask / behaviour change when querying for one page (1.8 alpha)
parser function #ask / behaviour change when querying for one page (1.8 alpha)
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Unprioritized minor with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-13 23:02 UTC by [[kgh]]
Modified: 2012-08-04 00:03 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description [[kgh]] 2012-03-13 23:02:28 UTC
Since probably SMW 1.7.0 the behaviour of #ask changed when querying for one page, e.g. 

{{#ask: [[Berlin]]
  | ?
  | ?Population
  | ?Area#km²
  | format=template
  | template=Query output demo
}}

produced "3,391,409 people squeeze into the 891.85 km² of Berlin." in SMW <1.7+, now it produces "Berlin people squeeze into the 3,391,409 of Berlin." SMW >1.7+

As you do this with #show

{{#show: Berlin
  | ?
  | ?Population
  | ?Area#km²
  | format=template
  | template=Query output demo
}}

nothing changed: "3,391,409 people squeeze into the 891.85 km² of Berlin."

A work-around would be 

{{#ask: [[Berlin]]
  | ?Population
  | ?Area#km²
  | format=template
  | template=Query output demo
}}

or

{{#ask: [[Berlin]]
  | mainlabel=-
  | ?Population
  | ?Area#km²
  | format=template
  | template=Query output demo
}}

This may be inspected on [1].

I do not know if this is a bug since there are other ways to get the intended results. However I do not know if this was done intentionally since it breaks consistency between #ask and #show.

[1] http://semantic-mediawiki.org/wiki/Help:Template_format
Comment 1 Jeroen De Dauw 2012-03-13 23:04:19 UTC
Markus, did you change anything that might have caused this? I'm thinking of the "allow for duplicate printouts" change.

I actually remember fixing something like this two or there months back. Not sure if it broke again or if this is something else...
Comment 2 [[kgh]] 2012-08-02 23:20:50 UTC
Heiya Markus, just a tiny assessment like "intentional / unintentional" and "will be changed / will not be changed" on this would be cool. Cheers Karsten
Comment 3 Markus Krötzsch 2012-08-03 09:47:15 UTC
I think this is correct behaviour. If you add "?" as a printout request, you probably want to have it in the results, don't you? If the user explicitly adds "?", why should SMW ignore it? Or am I missing something?
Comment 4 [[kgh]] 2012-08-03 23:59:31 UTC
There was definitively a change in behaviour to the #ask parser function in SMW 1.7.0.

My assessment is that #ask was made consistent ("fixed"). Before there was a difference between querying for just one page and querying for multiple pages (which may of course have only one page as a result). The specified page is now considered as the result of the query, too.

<1.7:

{{#ask: [[Berlin]] |? }} → Berlin
or
{{#ask: [[Category:City]] }} → Berlin (in case only Berlin was added to the wiki

// #ask is inconsistent 

{{#show: Berlin |? }} → Berlin


>1.7:

{{#ask: [[Berlin]] }} → Berlin 
or
{{#ask: [[Category:City]] }} → Berlin (in case only Berlin was added to the wiki

// #ask is consistent

{{#show: Berlin |? }} → Berlin

Nothing had to be changed for #show since the specified page will never be the result of the query.

Thus I am closing this bug as RESOLVED INVALID. I will amend the documentation on the wiki accordingly. Thank you for your patience with me.
Comment 5 [[kgh]] 2012-08-04 00:03:33 UTC
Ouch, I forgot to add the property to be queried for. I guess you still get what I meant to elaborate.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links