Help:Examples for boolean values pairs

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

These examples show setting the property Property:Has boolean with different valid and non valid values according to datatype "Boolean"Holds boolean (true/false) values

valid value pairs

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

invalid values pairs

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

If you would like to make these valid options add the values to the system messages "MediaWiki:Smw true words" or "MediaWiki:Smw false words" respectively.

Queries

show

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

true, false

show with display formatters

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

x, -

show with display formatters using UTF-8 characters

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

✅, ☐

ask

{{#ask:
 [[{{FULLPAGENAME}}]]
 |?Has boolean
 |format=table
 |mainlabel=-
}}
Has boolean
true
false