How to create advanced queries with a series of AND/OR's?

From semantic-mediawiki.org

On IRC you said you found the answer; for completeness an answer here as well:

  • Firstly, you can combine OR for property values: [[<property>::<value1>||<value2>||.....]]
  • Secondly, you cannot use brackets to group unions/disjoints, so grouping selection criteria works standard left-to-right, with AND stronger than OR.

Therefore, your question could be answered
[[Category:Person]][[Hair color::brown||black]] OR [[Category:Person]][[Eye color::blue||green]]
You can read this as
( [[Category:Person]][[Hair color::brown||black]] ) OR ( [[Category:Person]][[Eye color::blue||green]] )
Since you can't actually use the brackets, you need to repeat the common part for every disjoint selection, as shown with the Category selector.

13:28, 14 October 2013

You can also use sub queries

<q>[[Category:Person]] [[Hair color::brown]]</q> OR <q>[[Hair color::black]] [[Eye color::blue]]</q> OR [[Eye color::green]]

Not sure which forms are the most efficient. Probably not this one.

02:10, 16 October 2013

Thanks, Jeroen, for showing us another method, although I'm not sure I quite understand. The only use case of ... I was previously aware of is the one outlined in this section: [1]. If you're suggesting that ... can also be used in the same way as the rounded brackets above, then it would be powerful piece of syntax that is worth documenting.

15:35, 16 October 2013