Help:Examples for Boolean Options

From semantic-mediawiki.org
Jump to: navigation, search

These examples show setting the property Property:has boolean with different valid and non valid values according to Help:Type_Boolean

valid options

  • 1
  • 0
  • true
  • false
  • t
  • f
  • yes
  • no
  • y
  • n

invalid options

  • x
    "x" is not recognised as a Boolean (true/false) value.
  • -
    "-" is not recognised as a Boolean (true/false) value.

If you want to make these valid options add the values to the system messsages "MediaWiki:Smw_true_words" or "MediaWiki:Smw_false_words" respectively.

Queries

show

{{#show: {{FULLPAGENAME}} | ?Has boolean }}

true, false

show with display options

{{#show: {{FULLPAGENAME}} | ?Has boolean#x,-}}

x, -

show using UTF-8 characters

{{#show: {{FULLPAGENAME}} | ?Has boolean#✅,☐}}

✅, ☐

ask

{{#ask: [[{{FULLPAGENAME}}]]
|?Has boolean
|format=table
}}
 Has boolean
Examples for Boolean Optionstrue
false