SemanticMediaWiki / SemanticResultFormats

Provides additional visualizations (result formats) for Semantic MediaWiki
https://www.semantic-mediawiki.org/wiki/Extension:Semantic_Result_Formats
Other
45 stars 77 forks source link

Filtered - Only returns a few results #80

Open darenwelsh opened 9 years ago

darenwelsh commented 9 years ago

Currently, the filtered format does not return all the results that it should. Based on an old comment on a SMW discussion page, it seems this might have to do with PHP version. Are there any plans to fix it? This tool would be really useful.

Comment on SMW discussion page Phabricator bug entry

mwjames commented 9 years ago

@s7eph4n Do you have any input?

s7eph4n commented 9 years ago

First time I heard of that.

s7eph4n commented 9 years ago

Ha, I take that back. Must be the third time I heard of it, only I forgot the first two times. :/

mitchelln commented 9 years ago

Hi, I have noticed this too on a new install with MW 1.23.8 and SMW 2.0, SRF 2.0. PHP is version 5.6.3 I have:

{{#ask:
[[Category:FAQ]]
[[Headline::+]]
|?Page Link
|?Short Text
|?Tags=Subject|+filter=value
|mainlabel=-
|format=filtered
|views=list
|list view type=list
|list view template=Resource Listing
}}

and it only ever returns the first result of the query.

The exact same query works on an older instance running MW 1.23.3, SMW 1.9.2, PHP 5.2.3, SRF 1.9.1.

mitchelln commented 9 years ago

Comment on mailing list from James HK: I can hardly see how this can be a PHP issue (our data from Travis doesn't lend us so such assumption based that tests are run against 5.3-HHVM) with results being produced by the QueryEngine (SQLStore/SPARQLStore) not a format printer.

If a query ([[MyProperty::MyValue]] OR ...) does return the expected results for another format type ( |format=table etc.) then an assumption can be made that the QueryEngine (the component that produces the results based on the conditions and context set) is working correctly but that instead the format printer (|format=somethingElse with its PHP and JS relevant components) reduces or extends the retrieved results to an unexpected level.

Putting here for reference :)

mitchelln commented 9 years ago

Actually, it does look like this is indeed a PHP version problem.

I have just put an existing working site onto a server that has a newer version of PHP. On the site with the older version of PHP (5.3.2) the filtered format returns all results as expected. On the site running the newer PHP (5.6.3 ) it only returns one result. The MW, SMW, MySQL and Apache versions are the same across both servers.

JeroenDeDauw commented 9 years ago

Any news on this?

s7eph4n commented 9 years ago

Not really. Normally an upgrade of PHP should not be a problem, but there have been precedents.

mitchelln commented 9 years ago

I've just tried it with PHP 5.5.12 (where would we be without VMWare!) and it works fine. So this is either a problem with 5.6.3 or perhaps the 5.6.3 install is missing a module?

s7eph4n commented 9 years ago

There must be something more to it. Dgennaro got this when updating from PHP 5.4.13 to 5.4.16 (and then on to 5.4.20). @mitchelln got this when upgrading from 5.5.12 to 5.6.3. I just tried it and it seems to work fine for 5.6.6.

@darenwelsh, what are your versions?

darenwelsh commented 9 years ago

MediaWiki - 1.23.2 (f22a475) PHP - 5.4.16 (cgi-fcgi) MySQL - 5.6.20-log SMW - 2.1 SRF - 2.0

Another bit of info ... when I refresh a page with results format Filtered, I get varied results each time. For a query (that is unfortunately behind a firewall) with at least 100 returned pages, I only get one or two results. If it is one, it is always the same page. If there are two results, the second result is always the same page (as in the single-return case).

Also, if I use "|+filter=value" for some of the returned property values, it only displays a filter for some of the possible values (not all).

FWIW, here's my query:

{{#ask:  [[Category:Analysis Request]] 
|? Status|+filter=value
|? Required for|+filter=value
|? Analysis Type|+filter=value
|? Applicable Hardware=Hardware
|? Related task
|? Title
|format=filtered
|link=none
|views=list
|list view type=list
|list view template=Analysis Request Summary
}}

and the contents of Template:Analysis Request Summary are simple for now:

* {{{1|}}}, {{{2|}}}, {{{3|}}}, {{{4|}}}, {{{5|}}}, {{{6|}}}, {{{7|}}}

ckoerner commented 9 years ago

Also, if I use "|+filter=value" for some of the returned property values, it only displays a filter for some of the possible values (not all).

@darenwelsh Are you filtering on a list of property values that are defined ahead of time?

[[Allows value::xxx]]

I'm only seeing filters appear where I have existing wiki pages with those property values assigned.

darenwelsh commented 9 years ago

The above example {{#ask: [[Category:Analysis Request]] has both cases. Property:Required_for has type page and has lots of values, but only 3 show up when I try the query now. Property:Analysis_Type has type enumeration with 9 allowed values. Only 2 show up in my test query, but I know at least 6 of them are being used.

image

darenwelsh commented 7 years ago

Trying the same query now seems to return a lot more results. It's hard to tell conclusively if it's "fixed".

Do any of the developers know of any changes since August 2015 that may have fixed this issue?

Now our server has the following config:

MediaWiki - 1.27.2 (1c409c5) PHP - 5.6.30 (apache2handler) MariaDB - 5.5.52-MariaDB SMW - 2.5.2 (84007ca) SRF - 2.4.2 (17be353)

s7eph4n commented 7 years ago

There were some changes, but they were unrelated. One was the introduction of the Table view, the other the fix of a JavaScript bug.

kghbln commented 7 years ago

@s7eph4n Was this part of the recent refactoring of the "filtered" format?

s7eph4n commented 7 years ago

No. Could be that in fact the results are sent, but then hidden by the filters.

kghbln commented 7 years ago

No. Could be that in fact the results are sent, but then hidden by the filters.

Ok, so let's keep this open an wait how this went considering the very recent re-factoring.