Last modified: 2013-04-23 06:37:07 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 T49443, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47443 - Local dates comparsion seems to be broken.
Local dates comparsion seems to be broken.
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
PC Linux
: Unprioritized major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-20 07:23 UTC by Dmitriy Sintsov
Modified: 2013-04-23 06:37 UTC (History)
4 users (show)

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


Attachments

Description Dmitriy Sintsov 2013-04-20 07:23:37 UTC
I have development wiki running at
http://artmuseum.wiki.uniyar.ac.ru/ru/Special:Version
MW 1.22wmf1, SMW 1.8.0.4

It is a manual upgrade of extremly old MW 1.10.0 / SMW 0.7 wiki. I didn't use update.php, but exported xml dump with --current then imported into new clean 1.22wmf1 wiki, imported images, regenerated links, maintenance/SMW_setup.php, maintenance/SMW_refreshData.php
SMW_refreshData.php seems to workef fine. Can re-execute if needed.

Old-style parser hook <ask> date property related queries worked fine at old wiki, however they are producing syntax errors at new wiki. I am trying to convert old style <ask> to functional {{#ask:}}. However, date-related query return no results.

What I have tried:
1. Changed [[Дата окончания:=>now]] to [[Дата окончания::>now]]
2. Implicitely specified printouts ?Дата окончания for templates.
3. Suspecting that 'now' and 'now - 7 day' does not work anymore I tried to input direct local date values (maybe will generate them via magic words automatically).

Nothing works, query returns empty set. Then I used Special:Ask to play with ask parameters. Specifying list of categories and property exists [[Дата окончания::+]] works fine:
%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%8F%3A%D0%92%D1%8B%D1%81%D1%82%D0%B0%D0%B2%D0%BA%D0%B8%7C|%D0%9A%D0%BE%D0%BD%D1%84%D0%B5%D1%80%D0%B5%D0%BD%D1%86%D0%B8%D0%B8%7C|%D0%A4%D0%B5%D1%81%D1%82%D0%B8%D0%B2%D0%B0%D0%BB%D0%B8]]%0D%0A[[%D0%94%D0%B0%D1%82%D0%B0+%D0%BE%D0%BA%D0%BE%D0%BD%D1%87%D0%B0%D0%BD%D0%B8%D1%8F%3A%3A%2B]]&po=%3F%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0%0D%0A%3F%D0%94%D0%B0%D1%82%D0%B0+%D0%BE%D0%BA%D0%BE%D0%BD%D1%87%D0%B0%D0%BD%D0%B8%D1%8F%0D%0A&eq=yes&p[format]=broadtable&sort[0]=%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0&order[0]=ASC&sort_num=&order_num=ASC&p[limit]=&p[offset]=&p[link]=all&p[sort]=%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0&p[order][desc]=1&p[headers]=show&p[mainlabel]=&p[intro]=&p[outro]=&p[searchlabel]=%E2%80%A6+%D1%81%D0%BB%D0%B5%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B5+%D1%80%D0%B5%D0%B7%D1%83%D0%BB%D1%8C%D1%82%D0%B0%D1%82%D1%8B&p[default]=&p[class]=sortable+wikitable+smwtable&eq=yes">http://artmuseum.wiki.uniyar.ac.ru/index.php?title=%D0%A1%D0%BB%D1%83%D0%B6%D0%B5%D0%B1%D0%BD%D0%B0%D1%8F%3AAsk&q=[[%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%8F%3A%D0%92%D1%8B%D1%81%D1%82%D0%B0%D0%B2%D0%BA%D0%B8%7C|%D0%9A%D0%BE%D0%BD%D1%84%D0%B5%D1%80%D0%B5%D0%BD%D1%86%D0%B8%D0%B8%7C|%D0%A4%D0%B5%D1%81%D1%82%D0%B8%D0%B2%D0%B0%D0%BB%D0%B8]]%0D%0A[[%D0%94%D0%B0%D1%82%D0%B0+%D0%BE%D0%BA%D0%BE%D0%BD%D1%87%D0%B0%D0%BD%D0%B8%D1%8F%3A%3A%2B]]&po=%3F%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0%0D%0A%3F%D0%94%D0%B0%D1%82%D0%B0+%D0%BE%D0%BA%D0%BE%D0%BD%D1%87%D0%B0%D0%BD%D0%B8%D1%8F%0D%0A&eq=yes&p[format]=broadtable&sort[0]=%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0&order[0]=ASC&sort_num=&order_num=ASC&p[limit]=&p[offset]=&p[link]=all&p[sort]=%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0&p[order][desc]=1&p[headers]=show&p[mainlabel]=&p[intro]=&p[outro]=&p[searchlabel]=%E2%80%A6+%D1%81%D0%BB%D0%B5%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B5+%D1%80%D0%B5%D0%B7%D1%83%D0%BB%D1%8C%D1%82%D0%B0%D1%82%D1%8B&p[default]=&p[class]=sortable+wikitable+smwtable&eq=yes

Specifying single date property equals value [[Дата окончания::=31.07.2012]] also works fine:
%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%8F%3A%D0%92%D1%8B%D1%81%D1%82%D0%B0%D0%B2%D0%BA%D0%B8%7C|%D0%9A%D0%BE%D0%BD%D1%84%D0%B5%D1%80%D0%B5%D0%BD%D1%86%D0%B8%D0%B8%7C|%D0%A4%D0%B5%D1%81%D1%82%D0%B8%D0%B2%D0%B0%D0%BB%D0%B8]]%0D%0A[[%D0%94%D0%B0%D1%82%D0%B0+%D0%BE%D0%BA%D0%BE%D0%BD%D1%87%D0%B0%D0%BD%D0%B8%D1%8F%3A%3A31.07.2012]]&po=%3F%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0%0D%0A%3F%D0%94%D0%B0%D1%82%D0%B0+%D0%BE%D0%BA%D0%BE%D0%BD%D1%87%D0%B0%D0%BD%D0%B8%D1%8F%0D%0A&eq=yes&p[format]=broadtable&sort[0]=%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0&order[0]=ASC&sort_num=&order_num=ASC&p[limit]=&p[offset]=&p[link]=all&p[sort]=%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0&p[order][desc]=1&p[headers]=show&p[mainlabel]=&p[intro]=&p[outro]=&p[searchlabel]=%E2%80%A6+%D1%81%D0%BB%D0%B5%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B5+%D1%80%D0%B5%D0%B7%D1%83%D0%BB%D1%8C%D1%82%D0%B0%D1%82%D1%8B&p[default]=&p[class]=sortable+wikitable+smwtable&eq=yes">http://artmuseum.wiki.uniyar.ac.ru/index.php?title=%D0%A1%D0%BB%D1%83%D0%B6%D0%B5%D0%B1%D0%BD%D0%B0%D1%8F%3AAsk&q=[[%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%8F%3A%D0%92%D1%8B%D1%81%D1%82%D0%B0%D0%B2%D0%BA%D0%B8%7C|%D0%9A%D0%BE%D0%BD%D1%84%D0%B5%D1%80%D0%B5%D0%BD%D1%86%D0%B8%D0%B8%7C|%D0%A4%D0%B5%D1%81%D1%82%D0%B8%D0%B2%D0%B0%D0%BB%D0%B8]]%0D%0A[[%D0%94%D0%B0%D1%82%D0%B0+%D0%BE%D0%BA%D0%BE%D0%BD%D1%87%D0%B0%D0%BD%D0%B8%D1%8F%3A%3A31.07.2012]]&po=%3F%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0%0D%0A%3F%D0%94%D0%B0%D1%82%D0%B0+%D0%BE%D0%BA%D0%BE%D0%BD%D1%87%D0%B0%D0%BD%D0%B8%D1%8F%0D%0A&eq=yes&p[format]=broadtable&sort[0]=%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0&order[0]=ASC&sort_num=&order_num=ASC&p[limit]=&p[offset]=&p[link]=all&p[sort]=%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0&p[order][desc]=1&p[headers]=show&p[mainlabel]=&p[intro]=&p[outro]=&p[searchlabel]=%E2%80%A6+%D1%81%D0%BB%D0%B5%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B5+%D1%80%D0%B5%D0%B7%D1%83%D0%BB%D1%8C%D1%82%D0%B0%D1%82%D1%8B&p[default]=&p[class]=sortable+wikitable+smwtable&eq=yes

Querying date properties greater or equal to specified value [[Дата окончания::>31.07.2012]] fails:
%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%8F%3A%D0%92%D1%8B%D1%81%D1%82%D0%B0%D0%B2%D0%BA%D0%B8%7C|%D0%9A%D0%BE%D0%BD%D1%84%D0%B5%D1%80%D0%B5%D0%BD%D1%86%D0%B8%D0%B8%7C|%D0%A4%D0%B5%D1%81%D1%82%D0%B8%D0%B2%D0%B0%D0%BB%D0%B8]]%0D%0A[[%D0%94%D0%B0%D1%82%D0%B0+%D0%BE%D0%BA%D0%BE%D0%BD%D1%87%D0%B0%D0%BD%D0%B8%D1%8F%3A%3A%3E31.07.2012]]&po=%3F%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0%0D%0A%3F%D0%94%D0%B0%D1%82%D0%B0+%D0%BE%D0%BA%D0%BE%D0%BD%D1%87%D0%B0%D0%BD%D0%B8%D1%8F%0D%0A&eq=yes&p[format]=broadtable&sort[0]=%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0&order[0]=ASC&sort_num=&order_num=ASC&p[limit]=&p[offset]=&p[link]=all&p[sort]=%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0&p[order][desc]=1&p[headers]=show&p[mainlabel]=&p[intro]=&p[outro]=&p[searchlabel]=%E2%80%A6+%D1%81%D0%BB%D0%B5%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B5+%D1%80%D0%B5%D0%B7%D1%83%D0%BB%D1%8C%D1%82%D0%B0%D1%82%D1%8B&p[default]=&p[class]=sortable+wikitable+smwtable&eq=yes">http://artmuseum.wiki.uniyar.ac.ru/index.php?title=%D0%A1%D0%BB%D1%83%D0%B6%D0%B5%D0%B1%D0%BD%D0%B0%D1%8F%3AAsk&q=[[%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%8F%3A%D0%92%D1%8B%D1%81%D1%82%D0%B0%D0%B2%D0%BA%D0%B8%7C|%D0%9A%D0%BE%D0%BD%D1%84%D0%B5%D1%80%D0%B5%D0%BD%D1%86%D0%B8%D0%B8%7C|%D0%A4%D0%B5%D1%81%D1%82%D0%B8%D0%B2%D0%B0%D0%BB%D0%B8]]%0D%0A[[%D0%94%D0%B0%D1%82%D0%B0+%D0%BE%D0%BA%D0%BE%D0%BD%D1%87%D0%B0%D0%BD%D0%B8%D1%8F%3A%3A%3E31.07.2012]]&po=%3F%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0%0D%0A%3F%D0%94%D0%B0%D1%82%D0%B0+%D0%BE%D0%BA%D0%BE%D0%BD%D1%87%D0%B0%D0%BD%D0%B8%D1%8F%0D%0A&eq=yes&p[format]=broadtable&sort[0]=%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0&order[0]=ASC&sort_num=&order_num=ASC&p[limit]=&p[offset]=&p[link]=all&p[sort]=%D0%94%D0%B0%D1%82%D0%B0+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%B0&p[order][desc]=1&p[headers]=show&p[mainlabel]=&p[intro]=&p[outro]=&p[searchlabel]=%E2%80%A6+%D1%81%D0%BB%D0%B5%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B5+%D1%80%D0%B5%D0%B7%D1%83%D0%BB%D1%8C%D1%82%D0%B0%D1%82%D1%8B&p[default]=&p[class]=sortable+wikitable+smwtable&eq=yes

Note that for [[Дата окончания::>31.07.2012]] it returned
31.07.2012 (which is correct)
and 31.08.2008 (which is wrong).

The extension itself is quite large and I haven't get to it for a long time. Can anyone clarify whether that is syntax error or that's real bug of querying engine?

I run via MySQL, no external triplestore and LocalSettings.php config is really simple:
include_once( "$IP/extensions/SemanticMediaWiki/SemanticMediaWiki.php" );
enableSemantics('artmuseum.wiki.uniyar.ac.ru');
Comment 1 Dmitriy Sintsov 2013-04-21 07:06:58 UTC
I found that old SMW 0.7 installation did not have property types defined for [[Property:Дата начала]] and [[Property:Дата окончания]] so property value definitions were treated as strings thus sorting and greater or equal queries were broken. After defining [[has type::Date]] for both properties and re-running maintenance/SMW_refreshData.php dates seems to be sorting fine. However ask values "now+9day" produce syntax errors. Is there newer updated syntax to use date values relative to current date in ask queries or shall I use something like Scribunto to dynamically generate values of "now+9day"?
Comment 2 Dmitriy Sintsov 2013-04-23 06:37:07 UTC
Did not get a reply about now+nday, made a Scribunto module for generation of past and future dates instead.

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


Navigation
Links