JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 51
  • Score
    100M100P100Q62775F
  • License MIT

Hierarchy of columns in Indian Food Composition Tables 2017.

Package Exports

  • @ifct2017/hierarchy
  • @ifct2017/hierarchy/corpus

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ifct2017/hierarchy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Hierarchy of columns in Indian Food Composition Tables 2017.

const hierarchy = require('@ifct2017/hierarchy');
// hierarchy.corpus: Map {column_code => {code, parents, ancestry, children}}
// hierarchy.load(): true (corpus loaded)
// hierarchy.sql([table], [options]): sql commands
// hierarchy.csv(): path to csv file
// hierarchy(<query>)
// -> {code, parents, ancestry, children} if matched, null otherwise


hierarchy.load();
/* load corpus first */

hierarchy('soluble oxalic acid');
hierarchy('Soluble Oxalic Acid');
// { code: 'oxals',
//   parents: 'oxalt',
//   ancestry: 'orgac',
//   children: '' }

hierarchy('what is hierarchy of total saturated fat?');
hierarchy('who are children of total saturated fat?');
// { code: 'fasat',
//   parents: 'fatce',
//   ancestry: 'fatce',
//   children:
//    'f4d0 f6d0 f8d0 f10d0 f11d0 f12d0 f14d0 f15d0 f16d0 f18d0 f20d0 f22d0 f24d0' }

ifct2017

You can ask about composition of 528 key foods in India here: ifct2017.github.io.
Food composition values were measured by National Institute of Nutrition, Hyderabad.
Take a peek at the raw data here: Document, Webpage.