<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wonkpedia.org/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Meta%3AWikidata%2FNotes%2FInclusion_syntax</id>
	<title>Meta:Wikidata/Notes/Inclusion syntax - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wonkpedia.org/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Meta%3AWikidata%2FNotes%2FInclusion_syntax"/>
	<link rel="alternate" type="text/html" href="https://wonkpedia.org/mediawiki/index.php?title=Meta:Wikidata/Notes/Inclusion_syntax&amp;action=history"/>
	<updated>2026-04-15T07:43:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://wonkpedia.org/mediawiki/index.php?title=Meta:Wikidata/Notes/Inclusion_syntax&amp;diff=755&amp;oldid=prev</id>
		<title>Bmueller: Created page with &quot;{{draft}} {{Message | type = attention | '''New Version (May 2013)''' This is a subset of the previous draft! }}  This page describes...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wonkpedia.org/mediawiki/index.php?title=Meta:Wikidata/Notes/Inclusion_syntax&amp;diff=755&amp;oldid=prev"/>
		<updated>2021-11-22T21:33:26Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{draft}} {{Message | type = attention | &amp;#039;&amp;#039;&amp;#039;New Version (May 2013)&amp;#039;&amp;#039;&amp;#039; This is a subset of the &lt;a href=&quot;/mediawiki/index.php?title=Wikidata/Notes/Inclusion_syntax_v0.3&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Wikidata/Notes/Inclusion syntax v0.3 (page does not exist)&quot;&gt;previous draft&lt;/a&gt;! }}  This page describes...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{draft}}&lt;br /&gt;
{{Message | type = attention | '''New Version (May 2013)'''&lt;br /&gt;
This is a subset of the [[Wikidata/Notes/Inclusion_syntax_v0.3|previous draft]]!&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This page describes the data inclusion syntax for the Wikibase client, by which the [[d:Wikidata:Glossary#Entities, Items, Properties and Queries|properties]] of data items can be included and rendered on a wiki page using templates. In short: This is how we want Wikipedia articles to include data from Wikidata.&lt;br /&gt;
&lt;br /&gt;
The inclusion syntax presented here is meant to work for very simple cases, and only for them.&lt;br /&gt;
&lt;br /&gt;
Complicated cases are to be realized using [[mw:Extension:WikibaseClient/Lua|Lua]].&lt;br /&gt;
&lt;br /&gt;
== Accessing Item Data ==&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
&lt;br /&gt;
Properties of a Wikidata Item can be used via the #property parser function:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;{{#property:P36}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;{{#property:capital}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will provide a representation of the value of the &amp;lt;code&amp;gt;capital&amp;lt;/code&amp;gt; property of the page's default item. The default item is the Wikidata item that is associated with this page via language links.&lt;br /&gt;
&lt;br /&gt;
The property label is case sensitive. It is also possible to use the identifier of the property (this is more stable against changes of the label of a property).&lt;br /&gt;
&lt;br /&gt;
=== Properties of different items ===&lt;br /&gt;
&lt;br /&gt;
To access properties of a different item, it has to be specified explicitly by its ID. (This was implemented in [[phab:T49930]].)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#property:P36|from=Q183}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#property:P36|from=Q183}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#property:capital|from=Q183}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#property:capital|from=Q183}}&lt;br /&gt;
&lt;br /&gt;
Specification of the item by its Wikipedia title ''is not implemented yet'':&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#property:P36|from=Germany}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#property:P36|from=Germany}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#property:capital|from=Germany}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#property:capital|from=Germany}}&lt;br /&gt;
* &amp;lt;s&amp;gt;However, using [[Scribunto|Scribunto]], ''&amp;lt;nowiki&amp;gt;msg = mw.message.newRawMessage(&amp;quot;{{#property:capital}}&amp;quot;):title(&amp;quot;Germany&amp;quot;):text()&amp;lt;/nowiki&amp;gt;'' will return &amp;quot;Bonn, Berlin&amp;quot; from any page.  (Presently this result will not be updated when the Wikidata entry is updated)&amp;lt;/s&amp;gt; This workaround has been intentionally rendered inoperative.&amp;lt;sup&amp;gt;[https://www.mediawiki.org/w/index.php?title=Extension:Scribunto/Lua_reference_manual&amp;amp;diff=900259&amp;amp;oldid=898845]&amp;lt;/sup&amp;gt;  You can use Wikidata if you run an external site that is free to make use of its API.&lt;br /&gt;
* Another workaround: Scribunto function '''[[mw:Extension:Wikibase Client/Lua#mw.wikibase.getEntityIdForTitle|mw.wikibase.getEntityIdForTitle]]''' (not implemented yet - [[phab:T74815]])&lt;br /&gt;
&lt;br /&gt;
=== Property rank and multiple values ===&lt;br /&gt;
&lt;br /&gt;
If a Wikidata property value has a &amp;quot;deprecated rank&amp;quot;, &amp;lt;nowiki&amp;gt;{{#property:}}&amp;lt;/nowiki&amp;gt; will not display it:&lt;br /&gt;
&lt;br /&gt;
* {{Q|Q25899}} has {{Q|P3520}} value LEROUROB01 (deprecated rank)&lt;br /&gt;
** &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#property:P3520|from=Q25899}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#property:P3520|from=Q25899}}&lt;br /&gt;
* {{Q|Q25899}} has {{Q|P213}} value 0000 0004 3980 4014 (normal rank)&lt;br /&gt;
** &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#property:P213|from=Q25899}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#property:P213|from=Q25899}}&lt;br /&gt;
&lt;br /&gt;
If a Wikidata property has multiple values, &amp;lt;nowiki&amp;gt;{{#property:}}&amp;lt;/nowiki&amp;gt; will only display the highest ranked values:&lt;br /&gt;
&lt;br /&gt;
* {{Q|Q182462}} has {{Q|P1220}} values 41898 (preferred rank) and 80344 (normal rank)&lt;br /&gt;
** &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#property:P1220|from=Q182462}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#property:P1220|from=Q182462}}&lt;br /&gt;
* {{Q|Q2894503}} has {{Q|P1220}} values 57807 and 69418 (both normal rank)&lt;br /&gt;
** &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#property:P1220|from=Q2894503}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#property:P1220|from=Q2894503}}&lt;br /&gt;
&lt;br /&gt;
== Work in progress ==&lt;br /&gt;
{{Update|type=section|comment=Listed properties are in use but work may not be complete.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Wikidata]]&lt;/div&gt;</summary>
		<author><name>Bmueller</name></author>
	</entry>
</feed>