Module:Sandbox/Was a bee/tree/doc

Usage
Paste following code at anatomy articles. It automatically shows tree (as far as structural data is stored in Wikidata with the source, TA98)

Plans
As far as I think in long-term perspective, technical part (rendering graphical tree based on data in Wikidata) would be implemented someday by Mediawiki extension or something in more stylish manner by experienced coder. Just like Template:Category tree (Catalogue_of_CSS_classes, mw:Extension:CategoryTree). So I feel other part would be more important.
 * ✅: Rendering parent-side tree (upstream toward human body)
 * 1) Need to process multiple-parents cases (bifurcated parent tree)
 * ✅: Rendering brother tree. Parent (upper) and child (lower) concepts are important. But at the same time, brother concepts (same level concepts) are also important for understanding the topic.
 * ✅: Formatting TA98 ref. I think at least it would be needed to provide external link to the entry (like this ) using TA98_ID (d:Property_talk:P1323)
 * 1) Is it possible to make tree references more compact? Because tree references would be needed (WP:V), but actually not so interesting.
 * 2) Treat species general and human specific articles. Fro example, "Human brain" and "Brain", "Human head" and "Head".
 * 3) (Re)arrange some input options, especially source and appearance related options.
 * 4) Populating Wikidata pages with "part_of (d:Property talk:P361)" and "has_part (d:Property talk:P527)" relations (see Ontology_components). Currently TA98 ID is registered in about 3.3k Wikidata pages (Property_talk:P1323).

Related pages

 * Module:Sandbox/Was a bee/tree - Lua code which generates following trees
 * User:Was a bee/Tree - wrapper template
 * mw:Extension:Scribunto/Lua reference manual - Lua help
 * mw:Extension:Wikibase Client/Lua - Lua help for Wikidata
 * Tree technologies from discussion at Village pump (technical) (perm link)
 * User_talk:Was_a_bee
 * Family trees
 * mw:Extension:Graph/Demo/CartesianTree
 * Category:Tournament bracket templates
 * MediaWiki_talk:Common.css

Visual appearance
Tree-like visual appearance is created by the "treeview" style described in MediaWiki:Common.css. This module outputs code which contains HTML elements "ul" (unordered list) and "li" (list). And the style sheet converts them into tree view.

Algorithm

 * Topological sorting

Sourcing
Statement which has following item in "stated in" section is shown in tree. Other data is not shown in tree in default.
 * Currently permitted source
 * Terminologia Anatomica (TA98) = Q286567


 * Other possible candidates
 * Terminologia Embryologica (TE)
 * Terminologia Histologica (TH)
 * FMA
 * UBERON
 * MeSH
 * NeuroNames
 * Gene Ontology

Problems

 * Incompatibilities between different sources
 * Different sources categorize things different ways. But this module can show only one tree. So some kind of troubleshooting is needed. Actually tree structures are almost similar and the differences between them are subtle. But it exist certainly.

Tree based only on data which is sourced by TA98

 * Starting from
 * Tracking through for downward 10 depth
 * Tracking through for upward 5 depth
 * Only showing data which is sourced by (excluding other data)

Tree based on data including unreferenced data

 * Starting from
 * Tracking through for downward 10 depth
 * Tracking through for upward 5 depth
 * Showing all data (including unreferenced data)