Template:Articles in
This template is used to generate a partial SPARQL query to filters the results from the language links that are about an item (or a SPARQL variable). You may be looking for {{Articles in wikipedia}}
to find if the item has some article in a specific wikipedia language edition instead.
For example the call {{Articles in|?searcheditem|fr}}
inside a SPARQL expression will filter the ?searcheditem values to retain only the values for wich wikidata knows a sitelink in french.
SELECT ?item WHERE {
?item wdt:P279*/wdt:P31 wd:Q5
OPTIONAL { ?wartfritem schema:about ?item . ?wartfritem schema:inLanguage "fr" }
FILTER(bound(?wartfritem))
}
can for example be used to generate a query for all humans with an article in french on wikimedia or another wiki :
SELECT ?item WHERE {
?item wdt:P279*/wdt:P31 wd:Q5
OPTIONAL { ?wartfritem schema:about ?item . ?wartfritem schema:inLanguage "fr" }
FILTER(bound(?wartfritem))
}
Usage
[edit]{{Articles in|Q5|fr}}
OPTIONAL { ?wartfrQ5 schema:about Q5 . ?wartfrQ5 schema:inLanguage "fr" } FILTER(bound(?wartfrQ5))
See also
[edit]{{Articles not in}}
{{Articles in wikipedia}}
Finds if there is an article in a language on a wikimedia wiki in a certain language. For example if the item as an article in wikiversity in french, or in wikimedia in french …
Parameter | Description | Type | Status | |
---|---|---|---|---|
item | 1 | An item, either a variable or a specific item id
| Unknown | required |
lang | 2 | a wikimedia project language code
| Unknown | optional |
not | not | put any value if you want that the item has no article in the language
| Unknown | suggested |
The above documentation is transcluded from Template:Articles in/doc (edit | history). Editors can experiment in this template's sandbox (create | mirror) and testcases (create) page. Please add categories to the /doc subpage. Subpages of this template. |
OPTIONAL { ?wart{{{2}}}{{{1}}} schema:about {{{1}}} . ?wart{{{2}}}{{{1}}} schema:inLanguage "{{{2}}}" }
FILTER(bound(?wart{{{2}}}{{{1}}}))