|Found errors or typos? Just edit the page or leave a message on the talk page.|
The English language documentation is canonical and most up to date.
In Semantic MediaWiki (SMW), comparators < and > have the meaning "smaller or equal" and "greater or equal". Thus they behave slightly different than some people would expect, because of their inclusion of "... or equal". Perhaps you'd like the comparators to behave like their mathematical counterparts. Since Semantic MediaWiki 1.5.3 this is possible, but with some caveats.
Enabling strict comparators
To enable strict interpretation of comparators add the following line to your "LocalSettings.php" file:
$smwStrictComparators = true;
Comparison between standard and strict comparators
For the different range comparisons, the following comparators are usable, depending on the setting of
|less than or equal||< or ≤||≤|
|greater than or equal||> or ≥||≥|
|less than||<<||< or <<|
|greater than||>>||> or >>|
- Note that in SMW prior to 1.5.3 the behaviour of the comparators was a bit simpler
|less than or equal||<|
|greater than or equal||>|
Caveats with strict comparators
There are two points of attention when switching to strict comparators:
- existing queries using < and > may yield different results (this does not hold for < combined with !)
- the symbols ≤ and ≥ cannot easily be inserted in a wiki with a standard keyboard. Users may need to
- copy & paste the symbols, or
- use additional software, like Windows' "Character Map" (Start > Programs > Accessories > System Tools > Character Map, then to font "Symbol"), or
- in US Windows English keyboard, you can do "Alt+242" to input ≥ and "Alt+243" for ≤.