Last modified: 2013-04-01 15:00:46 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 T31866, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29866 - Using "||" returns different results than when using "OR"
Using "||" returns different results than when using "OR"
Status: ASSIGNED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal major (vote)
: ---
Assigned To: Markus Krötzsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-13 16:48 UTC by dria
Modified: 2013-04-01 15:00 UTC (History)
4 users (show)

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


Attachments

Description dria 2011-07-13 16:48:24 UTC
I've created a testcase page here:
   https://wiki.mozilla.org/User:Dria/SMWdisjunctionbug

I was expecting using "OR" and "||" to return the same results in this situation, but while OR behaves as expected, the "||" version returns results as if there were wildcards involved:

{{#ask: [[Category:Feature Page]] [[Feature security status::tbd]] OR [[Feature security status::-]]
| ?
| ?Feature security status#
| sort=Feature priority
| format=table
| limit=500
}}


{{#ask: [[Category:Feature Page]] [[Feature security status::tbd||-]]
| ?
| ?Feature security status#
| sort=Feature priority
| format=table
| limit=500
}}

I may misunderstand how the "||" is supposed to work, but the documentation suggests that these should return the same results.
Comment 1 Jeroen De Dauw 2011-07-13 20:41:16 UTC
I confirmed the issue, and it seems to be still present on trunk. But instead of getting the pages that should not match, I'm getting [[:smw:|]]. I had a look at the code, but did not find the cause of the issue.
Comment 2 Jeroen De Dauw 2011-07-14 15:49:24 UTC
To clarify my own report:

I have pages Foo, Bar and Haz, with a property Has number with values 1, 2 and 3, respectively.

This query

{{
#Ask: [[Has number::1]] OR [[Has number::2]]
}}

Result into the expected: Bar, Foo 

While this one

{{
#Ask: [[Has number::1||2]]
}}

Result into: [[:smw:|]], Bar, Foo
Comment 3 Alexander 2011-09-13 15:20:11 UTC
I have an other description for the || Disjunction bug.

Consider the two property : Title , Author

We search all page containing Title tag : 'foo' made by Author : 'Luc' or 'Alex'

  [[Title::~*foo*]][[Author::Luc||Alex]]
and 
  [[Author::Luc||Alex]][[Title::~*foo*]]

Do not give the same results, we expect those two being equivalent, such as : 

  [[Title::~*foo*][[Author::Luc]]
   OR
  [[Title::~*foo*][[Author::Alex]]


The Query : 

 [[Author::Luc||Alex]][[Title::~*foo*]]

 does exactly this :

 [[Author::Luc]] OR [[Author::Alex]][[Title::~*foo*]]

The invert is also true :

 [[Author::Alex||Luc]][[Title::~*foo*]]

 does : 

 [[Author::Alex]] OR [[Author::Luc]][[Title::~*foo*]]


The Query: 

  [[Title::~*foo*]][[Author::Luc||Alex]]

Gives results correctly.
Comment 4 Cindy Cicalese 2013-04-01 15:00:46 UTC
I believe I have found a similar problem. In my case, the query

{{#ask:[[Full Title::+]][[Full Title::~a*||~A*]] . . .

gives the correct results (a case-insensitive search for items with Full Title starting with the letter 'A'). However, the following query

{{#ask:[[Full Title::+]][[Full Title::~A*||~a*]] . . .

seems to ignore the second query term completely, returning all items with a value for the Full Title property regardless of what letter they begin with. I did a little bit more digging and discovered that in my case, there were no items with a Full Title that begin with lowercase a. For another data set that had Full Title starting with both uppercase A and lowercase a, both queries returned the correct resuts. So, it appears that if the condition after the || returns no results, the entire query term is ignored.

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


Navigation
Links