Methods to drawtree view fromtree-shaped data structure in Wikidata.
By putting the code{{Tree|property=184|items=Q7251|recursion=10}}
using the template{{Tree}}
, the following tree graph automatically appears. The code means "Tracking items throughdoctoral advisor(P184), starting fromAlan Turing(Q7251), until 10 items depth." The black dots "•" appears in the tree means the end of branch. The template{{Tree}}
internally using Lua moduleModule:Tree which is the program written inLua language.
By customizing Lua code, you can draw the tree with additional features. For example, by putting code{{ #invoke:Haplogroup | main | firstItemId = Q351265 | maxdepth = 7}}
(using the customized Lua codeModule:Haplogroup), the following tree appears. The tree automatically shows links to Wikipedia, Commons, and external website, by retrieving data stored in each Wikidata item pages.
Lua error in Module:Haplogroup at line 122: bad argument #1 to 'pairs' (table expected, got nil).
{{Wikidata/FamilyTree}}
generates family trees of various styles by trackingfather(P22),mother(P25), andchild(P40). As an example, by putting the code{{Wikidata/FamilyTree|title={{Q|Q9682}}|entityId=Q9682}}
, following tree appears.
Mediawiki extension "Graph" can draw tree-like structures. For demos, seemw:Extension:Graph/Demo#Trees. As of September, 2019,Graph extension is not stable compared with Lua functions. But the extension can draw beautiful interactive graphs. There are templates which uses Graph extension functionalities to draw graphs, like{{Force-directed graph}}
,{{Forward graph}}
, or{{Reverse graph}}
. For example, the code{{Forward graph|Q7251|P184|width=200|height=200|depth=2}}
generate the following graph automatically.

Graphs are temporarily unavailable due to technical issues.
</> code
" button at middle-right ->&format=json
Tool to generate trees from Wikidata structures, such as subclasses, administrative divisions, and taxons. Examples:1234
Tool to visualize Wikidata items in a graph form usingD3.js. Examples:1234
|