Help:Datatype "Monolingual text"

From semantic-mediawiki.org
Jump to: navigation, search
Monolingual text
Holds a text value that associates the annotation with a specific language code
Further Information
Provided by: Semantic MediaWiki
Added in version: 2.4.0
Removed in version: still in use
Datatype ID:
_mlt_rec
In this wiki: Monolingual text
Table of Contents

The datatype Monolingual text1 associates a text value with a specific language code. The annotation form is expected as foo@en with the first element being an arbitrary text while the second element divided by @ to contain a valid language code.

Notes

  • Internally each MonolingualTextValue is stored as separate entity using the ContainerSemanticData construct allowing for `foo@en` to be different from `foo@ja` by its data structure (oppose to a string comparison which only would establish that two strings are different but without the semantic interpretation that for the cited example only the language code is different).
  • [[Has monolingual text::some text@en]] is identical to [[Has monolingual text::some text@EN]] because language codes are transformed to a IETF language tag / BCP47 (Localizer::asBCP47FormattedLanguageCode).
  • The Language code is internally managed by the "Language code" special property

Examples

[[Has monolingual text::foo@ja]]

{{#subobject:
 |Has monolingual text=foo@en
}}
{{#ask:
 [[Has monolingual text::?@ja]]
 |?Has monolingual text|+index=1
 |mainlabel=-
 |headers=hide
}}

Display text in context of a language:

{{#subobject:
 |@category=Test one
 |Has monolingual text=123@en
}}{{#subobject:
 |@category=Test one
 |Has monolingual text=一二三@ja
}}
{{#ask:
 [[Category:Test one]]
 [[Has monolingual text::?@{{USERLANG}}]]
 |?Has monolingual text|+index=1
 |mainlabel=-
 |headers=hide
}}

See <sandbox.semantic-mediawiki.org> for live examples.


Related query syntax elements

General

Help pageSyntax elementDescription
#ask: annotation query marker
@annotation
Marks an inline query as part of an annotation2
#ask: control query marker
@control=slider
Allows to dynamically alter a result display without the need to reload a page3
#ask: deferred query marker
@deferred
Marks an inline query as deferred from regular parsing3
#ask: hierarchy depth restriction
+depth=
Restricts the hierarchy depth of a query4
#ask: printout column alignment
+align=
Defines an alignment for the content of a printout column
#ask: printout column width
+width=
Defines a width for a printout column5
#ask: printout sorting order
+order=
Defines the sorting order for printout statements (dot chain syntax)6

See also

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:1344
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:2572
  3. a b  Semantic MediaWiki: GitHub pull request gh:smw:2398 (Add support for @deferred mode)
  4. ^  Semantic MediaWiki: GitHub issue gh:smw:2662
  5. ^  Semantic MediaWiki: GitHub pull request gh:smw:2677
  6. ^  Semantic MediaWiki: GitHub pull request gh:smw:2073