| Status: | effective |
| Progress: | 100% |
| Version: | 2.5.0+ |
#ask: syntax details:
| |
| Syntax | +lang= |
| Description | Allows to filter a language specific printout1 |
| Datatype support | Datatype "Monolingual text "Holds a text value that associates the annotation with a specific language code |
| Component | printout |
| Software | Semantic MediaWiki |
| Since version | Semantic MediaWiki 2.5.0 Released on 14 March 2017 and compatible with MW 1.23.0 - 1.29.x. |
| Keyword | language filter |
The +lang= printout language filter was introduced in Semantic MediaWiki 2.5.0Released on 14 March 2017 and compatible with MW 1.23.0 - 1.29.x..
Rationale[edit]
It allows to filter results that match a specific language for printout statements using the +lang= query parameter. The filtering is only applied to properties of datatype "Monolingual text"Holds a text value that associates the annotation with a specific language code.
It is applied during query post-processing after the condition has already retrieved matchable entities. The printout and hereby the data values may match text in different languages and unless the query condition was designed in a way that would made them reducible, it would display them all. Thus a query condition can be indifferent towards possible language matches, yet enables to only select the one that match the denoted language value. See the help page on datatype "Monolingual text"Holds a text value that associates the annotation with a specific language code for examples to limit the query condition to only select results for specific language.
Examples[edit]
- Syntax
{{#ask:
[[Has property description::+]]
|?Has property description|+lang=en
}}
- Result
| Property description"Property description" is a predefined property that allows to describe a property in context of a language and is provided by Semantic MediaWiki. | |
|---|---|
| About city | It is used on template "TableImportAnnotations" to demonstrate the the import-annotation parameter to result format "Plainlist"Outputs results in a comma separated list, with additional outputs shown in parentheses. The output does not provide class attributes to HTML elements (default for queries without printout statements).. |
| Has abstract | A summary or condensed version of a piece of writing. |
| Has mlt | Generic property for monolingual text |
| Has topic label | Describes a topic label in an annotated language. |
| Has topic predecessor | Describes a predecessor entity for a selected topic or manual item. |
| Inhabitants | statistics about the human population, i.e. people that live together in the same place |
| NDL ID | Web National Diet Library of Japan (NDL) Authorities |
| Population | The number of inhabitants of some geographical place. |
| Wikidata ID | Wikidata ID |
| owl:differentFrom | The property that determines that two given individuals are different. |
or only show German translations if available:
- Syntax
{{#ask:
[[Has property description::+]]
|?Has property description|+lang=de
}}
- Result
| Property description"Property description" is a predefined property that allows to describe a property in context of a language and is provided by Semantic MediaWiki. | |
|---|---|
| About city | |
| Has abstract | Eine Zusammenfassung oder Kurzfassung eines Textes. |
| Has mlt | Generisches Attribut für sprachspezifischen Text |
| Has topic label | |
| Has topic predecessor | |
| Inhabitants | Statistiken zur Bevölkerung, d. h. den Menschen, die am gleichen Ort zusammenleben |
| NDL ID | |
| Population | Die Anzahl der Einwohner eines geografischen Orts. |
| Wikidata ID | Wikidata-Kennung |
| owl:differentFrom |
- Link
<sandbox.semantic-mediawiki.org>: More examples for this query parameter
See also[edit]
- Help page on datatype "Monolingual text"Holds a text value that associates the annotation with a specific language code
- Help page on special property "Language code"Handles BCP47 conform language codes specifying the language of the annotated text
- Help page on special property "Has property description"Adds localizable context help to properties
References
- ^ Semantic MediaWiki: GitHub pull request gh:smw:2037