Module:Sandbox/Was a bee/tree/doc
This is a documentation subpage for Module:Sandbox/Was a bee/tree. It may contain usage information, categories and other content that is not part of the original module page. |
Usage
Tree? | |
---|---|
Sources
|
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 (Wikipedia:Catalogue_of_CSS_classes#Page.2Faction_specific, mw:Extension:CategoryTree). So I feel other part would be more important.
- Done: Rendering parent-side tree (upstream toward human body)
- Need to process multiple-parents cases (bifurcated parent tree)
- Done: 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.
- Done: Formatting TA98 ref. I think at least it would be needed to provide external link to the entry (like this [1]) using TA98_ID (d:Property_talk:P1323)
- Is it possible to make tree references more compact? Because tree references would be needed (WP:V), but actually not so interesting.
- Treat species general and human specific articles. Fro example, "Human brain" and "Brain", "Human head" and "Head".
- (Re)arrange some input options, especially source and appearance related options.
- Populating Wikidata pages with "part_of (d:Property talk:P361)" and "has_part (d:Property talk:P527)" relations (see Ontology_components#Relationships). 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 Wikipedia:Village pump (technical)#Mirror_of_template:Tree_list.2Ffinal_branch (perm link)
Technical background
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.
Source example (output from the module) | Result (output to reader) |
---|---|
<div class="treeview"> <ul> <li>[[Alpha]] <ul> <li>[[Bravo]] <ul>[[Charlie Brown|Charlie]] <li>[[Delta]]</li> <li class="lastline">[[Echo]]</li> </li> </ul> <ul><li>[[Foxtrot]] <ul><li class="lastline">[[Golf]]</li></ul> </li></ul> <ul><li class="lastline">[[Hotel]] [[File:Blue pencil.svg|frameless|text-top|10px|link=https://www.wikidata.org/wiki/Q27686]]</li></ul> </ul></li></ul></div> |
Algorithm
Sourcing
- Currently permitted source
Statement which has following item in "stated in" section is shown in tree. Other data is not shown in tree in default.
- 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.
Usage
Tree based only on data which is sourced by TA98
- Starting from central nervous system (Q47273)
- Tracking through has part(s) (P527) for downward 10 depth
- Tracking through part of (P361) for upward 5 depth
- Only showing data which is sourced by Terminologia Anatomica (Q286567) (excluding other data)
{{User:Was a bee/Tree|items=Q47273|childProperty=P527|childDepth=10|parentProperty=P361|parentDepth=5|sources=TA98}}
- ^ A14.0.00.000 TA98, 1998
- ^ A14.2.00.001 TA98, 1998
- ^ A14.1.00.001 TA98, 1998
- ^ A14.1.00.001 TA98, 1998
- ^ A14.1.03.001 TA98, 1998
- ^ A14.1.03.006 TA98, 1998
- ^ A14.1.03.007, A14.1.08.001 TA98, 1998
- ^ A14.1.03.008, A14.1.09.001 TA98, 1998
- ^ A14.1.09.002 TA98, 1998
- ^ A14.1.09.110 TA98, 1998
- ^ A14.1.09.113, A15.2.07.058 TA98, 1998
- ^ A14.1.09.123 TA98, 1998
- ^ A14.1.09.136 TA98, 1998
- ^ A14.1.09.132 TA98, 1998
- ^ A14.1.09.230 TA98, 1998
- ^ A14.1.09.149, A12.2.07.053 TA98, 1998
- ^ A14.1.03.005 TA98, 1998
- ^ A14.1.03.009 TA98, 1998
- ^ A14.1.03.002 TA98, 1998
- ^ A14.1.02.001 TA98, 1998
- ^ A14.1.01.001 TA98, 1998
Tree based on data including unreferenced data
- Starting from central nervous system (Q47273)
- Tracking through has part(s) (P527) for downward 10 depth
- Tracking through part of (P361) for upward 5 depth
- Showing all data (including unreferenced data)
{{User:Was a bee/Tree|items=Q47273|childProperty=P527|childDepth=10|parentProperty=P361|parentDepth=5||sources=}}