Template:Data
Uses Lua: |
Retrieves data from Wikidata and formats them using Module:Wikidata. Same parameters as those listed in the formatStatements
property defined by the module. Use with caution Module:Wikidata has a lot of bugs and this template often does not work as expected. It is often safer to use Module:WikidataIB
Usage
{{Data |item= |property= }}
Template parameters
Parameter | Description | Default | Status | |
---|---|---|---|---|
item | item | Q + numeric ID. | empty | required |
property | property | P + numeric ID of the property that the claims should have. | empty | required |
withqualfier | with qualifiers | Qualifiers that the statements should have. | empty | optional |
withrank | with rank | Rank of the statement: preferred , normal , deprecated or valid (i.e. normal and preferred). | preferred | optional |
sourceproperty | source property | Property that items should have in the source. | empty | optional |
withsource | with source | The source that should be provided in the statement (if the sourceproperty parameter is not provided, the property used is stated in (P248)). | empty | optional |
excludespecial | exclude special | Set to true if you do not want to get novalue and somevalue . | empty | optional |
numval | number of values | The maximum number of values to be returned. | empty | optional |
sorttype | sort type | Set to chronological to get the statements in chronological order (oldest first) using the start time (P580), end time (P582) and point in time (P585) qualifiers. Set to inverted for antichronological order (latest first). From a Lua module, you can also define your own sorting criteria. | empty | optional |
showsource | show source | Set to true if you want the source of the statement to be displayed. | empty | optional |
lang | language | Language code (only needs to be provided if the language displayed is to be fixed and independent of the user’s preferences). | empty | optional |
targetvalue | target value | The property value that the statement should have (only works for item-type properties). | empty | optional |
displayformat | display format | The format in which the args should be returned. For example, for a string -type property displayformat=weblink returns a formatted weblink. All possible values:
| empty | optional |
conjtype | conjunction type | The conjunction separating the statements; for example, conj=<br /> will show each statement on a separate line. | empty | optional |
showqualifier | show qualifier | Set to true to indicate that the qualifiers should be shown after the main value of each property. | empty | optional |
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard. Existing template documentation Newly created template documentation and imports Wikipedia's help about TemplateData • Commons-specific information Retrieves data from Wikidata and formats them using Module:Wikidata. Same parameters as those listed in the “formatStatements” property defined by the module.
|
Additional information
The template is intended to be used in the following namespaces: no namespace specified
The template is intended to be used by the following user groups: no user group specified
See also
Example
Code | Render | Comment |
---|---|---|
{{Data|item=Q91|property=p31}} | human | |
{{Data|item=Q91|property=p31|lang=ja}} | ヒト | |
{{Data|item=Q91|property=p569}} | ||
{{Data|item=Q91|property=p569|lang=ja}} | ||
{{Data|item=Q12418|property=p186}} | oil paint and poplar panel | |
{{Data|item=Q12418|property=p186|lang=ja}} | 油絵具およびポプラ板 | |
{{Data|item=Q12418|property=p186|rank=valid}} | oil paint, poplar panel and wood | rank = "valid" accepts both "preferred" and "normal" values |
{{Data|item=Q12418|property=p186|showqualifiers=p518}} | oil paint and poplar panel (painting support) | shows the value of the p518 qualifier (if any) in addition to the main value |
{{Data|item=Q12418|property=p186|qualifier=p518}} | should only display values that have a p518 qualifier | |
{{Data|item=Q12418|property=p186|numval=1}} | oil paint | |
{{Data|item=Q12418|property=P276|sourceproperty=P854}} | Salle des États, Louvre | |
{{Data|item=Q11879536|property=P460|source=Q1645493}} | ||
{{Data|item=Q11879536|property=P460|source=Q1645493|showsource=true}} | ||
{{Data|item=Q153|property=P231|showsource=true}} | 64-17-5[1][2][3] | |
{{Data|item=Q205309|property=P793|sorttype=inverted}} | closure, demolition, renovation, renovation, first match and construction | |
{{Data|item=Q205309|property=P793|sorttype=chronological|conjtype=<br />|withdate=true}} | ||
{{Data|item=Q205309|property=P793|targetvalue=Q385378}} | construction | |
{{Data|item=Q76|property=P856}} | barackobama.com | |
{{Data|item=Q76|property=P856|format=weblink}} | barackobama.com | |
{{Data|item=|property=p569}} | ||
{{Data|property=P625|item=Q90|displayformat=latitude}} | 48.856666666667 |
References
- ↑ ChEBI (title not provided in Wikidata), European Bioinformatics Institute, Creative Commons Attribution 4.0 International
- ↑ Global Substance Registration System (title not provided in Wikidata)
- ↑ CAS Common Chemistry