UNPKG

2.02 kBMarkdownView Raw
1Tree-like [hierarchy] of nutrients, and its components.<br>
2📦 [Node.js](https://www.npmjs.com/package/@ifct2017/hierarchy),
3📜 [Files](https://unpkg.com/@ifct2017/hierarchy/).
4
5> This is part of package [ifct2017].<br>
6> Online database: [ifct2017.github.io].
7
8<br>
9
10```javascript
11const hierarchy = require('@ifct2017/hierarchy');
12// hierarchy(query)
13// → {parents, ancestry, children} if found, null otherwise
14
15
16hierarchy('soluble oxalic acid');
17hierarchy('Soluble Oxalic Acid');
18// { parents: 'oxalt', ancestry: 'oxalt orgac', children: '' }
19
20hierarchy('what is hierarchy of total saturated fat?');
21hierarchy('who are children of total saturated fat?');
22// { parents: 'fatce',
23// ancestry: 'fatce',
24// children:
25// 'f4d0 f6d0 f8d0 f10d0 f11d0 f12d0 f14d0 f15d0 f16d0 f18d0 f20d0 f22d0 f24d0' }
26```
27
28```javascript
29hierarchy.load() // → corpus
30hierarchy.sql([table], [options]) // → sql statements
31hierarchy.csv() // → path of csv file
32```
33
34<br>
35<br>
36
37[![](https://i.imgur.com/D5UYmbD.jpg)](http://ifct2017.com/)<br>
38[![ORG](https://img.shields.io/badge/org-ifct2017-green?logo=Org)](https://ifct2017.github.io)
39[![DOI](https://zenodo.org/badge/143575105.svg)](https://zenodo.org/badge/latestdoi/143575105)
40
41> Data was obtained from the book [Indian Food Composition Tables 2017].<br>
42> Food composition values were measured by [National Institute of Nutrition, Hyderabad].<br>
43> Take a peek at the raw data here: [Document], [Webpage].
44
45[ifct2017]: https://www.npmjs.com/package/ifct2017
46[Indian Food Composition Tables 2017]: http://ifct2017.com/
47[hierarchy]: https://github.com/ifct2017/hierarchy/blob/master/index.csv
48[ifct2017.github.io]: https://ifct2017.github.io
49[National Institute of Nutrition, Hyderabad]: https://www.nin.res.in/
50[Document]: https://docs.google.com/spreadsheets/d/174DDCwdVRZ0RQT8zfGFSciQltA2sIHIIRXkWiejU_JQ/edit?usp=sharing
51[Webpage]: https://docs.google.com/spreadsheets/d/e/2PACX-1vR1C-FJ2driNzJ_rRVmftv_wYPo4Rz4SJKGEo-pFNccvbF3nsAFj2zmbiGHDGlX4YnozoqMydg0xBwZ/pubhtml