Template:Data

From Wikidata
Jump to navigation Jump to search
Documentation icon Template documentation[view] [edit] [history] [purge]

Retrieves data from Wikidata, and formats it using Module:Wikidata. Same parameters as those in the p.formatStatements property of the module.

Parameters[edit]

  • item (required): Q + numeric ID
  • property (required) P + numeric ID of the property that the claims should have
  • withqualfier = qualifiers that the statement should have
  • withrank = rank of the statement ; 'preferred', 'normal', 'deprecated' or 'valid' (ie normal and preferred). By default = preferred.
  • sourceproperty = items should have this property in the source
  • withsource = the source that should be provided in the statement (if the sourceproperty parameter is not provided, the property used is p248)
  • excludespecial = set to true if you do not want to get "novalue" and "somevalue".
  • numval = if you want to set a maximum number of values to be returned
  • sorttype = set to "chronological" to get the statements in chronological order using the start time (P580), end time (P582) and point in time (P585) qualifiers. Set to "inverrted for chronological order. From a Lua module, you can also define your own sorting criteria.
  • showsource = set to "true" if you want the source of the statement to be displayed.
  • lang for the desired language
  • targetvalue the value should of the statement should be this value (only works for item-type properties)
  • displayformat = the format in which the args should be returned. For example, for a string-type property displayformat = "weblink" returns a formatted weblink.
  • conj = the conjunction separating the statements. For example, conj = <br />, will make a add a new line after each statement.
  • showqualifier = the qualifiers that should be shown along with the mainsnak value

Examples[edit]

Code render comment
{{Data|item=Q42|property=p31}} human Douglas Adams (Q42) instance of (P31)
{{Data|item=Q42|property=p31|lang=ja}} ヒト
{{Data|item=Q42|property=p569}} Douglas Adams (Q42) date of birth (P569)
{{Data|item=Q42|property=p569|lang=ja}}
{{Data|item=Q42|property=p569|displayformat=raw}} +1952-03-11T00:00:00Z
{{Data|item=Q12418|property=p186}} oil paint and poplar wood Mona Lisa (Q12418) material used (P186)
{{Data|item=Q12418|property=p186|lang=ja}} 油絵具 および ポプラ板
{{Data|item=Q12418|property=p186|rank=valid}} oil paint, poplar wood and wood rank = "valid" accepts both "preferred" and "normal" values
{{Data|item=Q12418|property=p186|numval=1}} oil paint
{{Data|item=Q12418|property=p186|qualifier=p518}} poplar wood Mona Lisa (Q12418) material used (P186) applies to part (P518) should only display values that have a p518 qualifier
{{Data|item=Q12418|property=p186|showqualifiers==p518}} oil paint and poplar wood (painting surface) shows the value of the p518 qualifier (if any) in addition to the main value
{{Data|item=Q12418|property=P276|sourceproperty=P854}} Salle des États Mona Lisa (Q12418) location (P276) reference URL (P854)
{{Data|item=Q11879536|property=P460|source=Q1645493}} Lisa del Giocondo person depicted in Mona Lisa (Q11879536) said to be the same as (P460) Lives of the Most Excellent Painters, Sculptors, and Architects (Q1645493)
{{Data|item=Q11879536|property=P460|source=Q1645493|showsource=true}} Lisa del Giocondo[1]
{{Data|item=Q153|property=P231|showsource=true}} 64-17-5[2][3] ethanol (Q153) CAS Registry Number (P231)
{{Data|item=Q205309|property=P793|sorttype=inverted}} closure, demolition, renovation, renovation, first match and construction Arsenal Stadium (Q205309) significant event (P793)
{{Data|item=Q205309|property=P793|sorttype=chronological|conjtype=<br />|withdate=true}} construction
first match
renovation
renovation
demolition
closure
{{Data|item=Q205309|property=P793|targetvalue=331483|withdate=true}} demolition
{{Data|item=Q76|property=P856}} https://barackobama.com/ Barack Obama (Q76) official website (P856)
{{Data|item=Q76|property=P856|displayformat=weblink}} https://barackobama.com/

References[edit]

  1. Giorgio Vasari, Le vite de piu eccellenti architetti, pittori, et scultori italiani, da Cimabue insino a' tempi nostri,
  2. ChEBI (title not provided in Wikidata), European Bioinformatics Institute, [http://www.ebi.ac.uk/chebi read online], Creative Commons Attribution 3.0 Unported
  3. Food and Drug Administration (eds.), Unique Ingredient Identifier

See also[edit]