Skip to content

Commit

Permalink
feat (data+sql): new foodb case
Browse files Browse the repository at this point in the history
  • Loading branch information
santanche committed Sep 21, 2024
1 parent e37ab90 commit aeb52ec
Show file tree
Hide file tree
Showing 10 changed files with 87,449 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/foodb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Content.csv
85,594 changes: 85,594 additions & 0 deletions data/foodb/Compound.csv

Large diffs are not rendered by default.

Binary file added data/foodb/Content.zip
Binary file not shown.
1,343 changes: 1,343 additions & 0 deletions data/foodb/Food.csv

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions data/foodb/Nutrient.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
id,legacy_id,type,public_id,name,export,state,annotation_quality,description,wikipedia_id,comments,dfc_id,duke_id,eafus_id,dfc_name,compound_source,metabolism,synthesis_citations,general_citations,creator_id,updater_id,created_at,updated_at
1,10930,,FDBN00001,Fat,false,,low,,,,,FAT,,,DUKE,,,,,,2014-11-05 13:42:10 UTC,2014-11-05 13:42:10 UTC
2,10946,,FDBN00002,Proteins,false,,low,,,,,PROTEIN|PROTEINS,,,DUKE,,,,,,2014-11-05 13:42:15 UTC,2014-11-05 13:42:15 UTC
3,16037,,FDBN00003,Carbohydrate,false,,low,"Carbohydrates (or saccharides) are organic compounds with the empirical formula Cm(H2O)n. The carbohydrates are divided into four chemical groupings: monosaccharides, disaccharides, oligosaccharides, and polysaccharides. The monosaccharides and disaccharides are commonly referred to as sugars. [Wikipedia]",Carbohydrate,,,CARBOHYDRATE|CARBOHYDRATES,,,DUKE,,,,,,2014-11-05 13:44:06 UTC,2014-11-05 13:44:06 UTC
4,23404,,FDBN00004,Fatty acids,false,,low,,,,,FATTY-ACIDS,1335,,EAFUS,,,,,,2014-11-05 13:46:00 UTC,2014-11-05 13:46:00 UTC
5,11134,,FDBN00005,Fiber (dietary),false,,low,,,,,FIBER(DIETARY),,,DUKE,,,,,,2014-11-05 13:47:36 UTC,2014-11-05 13:47:36 UTC
6,58893,,FDBN00006,13:0,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:49:16 UTC,2014-11-05 13:49:16 UTC
7,58894,,FDBN00007,14:1,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:49:19 UTC,2014-11-05 13:49:19 UTC
8,58895,,FDBN00008,15:1,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:49:38 UTC,2014-11-05 13:49:38 UTC
9,58896,,FDBN00009,16:1 c,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:49:52 UTC,2014-11-05 13:49:52 UTC
10,58897,,FDBN00010,16:1 t,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:49:59 UTC,2014-11-05 13:49:59 UTC
11,58898,,FDBN00011,16:1 undifferentiated,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:50:04 UTC,2014-11-05 13:50:04 UTC
12,58899,,FDBN00012,17:1,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:51:16 UTC,2014-11-05 13:51:16 UTC
13,58900,,FDBN00013,18:1 c,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:51:34 UTC,2014-11-05 13:51:34 UTC
14,58901,,FDBN00014,18:1 t,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:51:45 UTC,2014-11-05 13:51:45 UTC
15,58902,,FDBN00015,18:1 undifferentiated,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:51:57 UTC,2014-11-05 13:51:57 UTC
16,58903,,FDBN00016,18:2 CLAs,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:53:09 UTC,2014-11-05 13:53:09 UTC
17,58904,,FDBN00017,18:2 i,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:53:16 UTC,2014-11-05 13:53:16 UTC
18,58905,,FDBN00018,18:2 t not further defined,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:53:17 UTC,2014-11-05 13:53:17 UTC
19,58906,,FDBN00019,"18:2 t,t",false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:53:23 UTC,2014-11-05 13:53:23 UTC
20,58907,,FDBN00020,18:2 undifferentiated,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:53:26 UTC,2014-11-05 13:53:26 UTC
21,58908,,FDBN00021,18:3 undifferentiated,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:54:38 UTC,2014-11-05 13:54:38 UTC
22,58909,,FDBN00022,18:3i,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:55:48 UTC,2014-11-05 13:55:48 UTC
23,58910,,FDBN00023,18:4,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:55:49 UTC,2014-11-05 13:55:49 UTC
24,58911,,FDBN00024,20:1,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:56:45 UTC,2014-11-05 13:56:45 UTC
25,58912,,FDBN00025,"20:2 n-6 c,c",false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:57:50 UTC,2014-11-05 13:57:50 UTC
26,58913,,FDBN00026,20:3 n-3,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:58:07 UTC,2014-11-05 13:58:07 UTC
27,58914,,FDBN00027,20:3 n-6,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:58:11 UTC,2014-11-05 13:58:11 UTC
28,58915,,FDBN00028,20:3 undifferentiated,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:58:16 UTC,2014-11-05 13:58:16 UTC
29,58916,,FDBN00029,20:4 undifferentiated,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:58:33 UTC,2014-11-05 13:58:33 UTC
30,58917,,FDBN00030,21:5,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:59:36 UTC,2014-11-05 13:59:36 UTC
31,58918,,FDBN00031,22:0,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 13:59:37 UTC,2014-11-05 13:59:37 UTC
32,58919,,FDBN00032,22:1 c,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 14:00:03 UTC,2014-11-05 14:00:03 UTC
33,58920,,FDBN00033,22:1 t,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 14:00:09 UTC,2014-11-05 14:00:09 UTC
34,58921,,FDBN00034,22:1 undifferentiated,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 14:00:14 UTC,2014-11-05 14:00:14 UTC
35,58922,,FDBN00035,22:4,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 14:01:10 UTC,2014-11-05 14:01:10 UTC
36,58923,,FDBN00036,22:5 n-3,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 14:01:15 UTC,2014-11-05 14:01:15 UTC
37,58924,,FDBN00037,24:1 c,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 14:02:21 UTC,2014-11-05 14:02:21 UTC
38,58928,,FDBN00038,Energy,false,,low,,,,,,,,TABLES,,,,,,2014-11-05 14:02:28 UTC,2014-11-05 14:02:28 UTC
39,,,FDBN00039,Ash,false,,low,,,,,,,,TABLES,,,,,,2019-08-02 19:45:58 UTC,2019-08-02 19:45:58 UTC
1 change: 1 addition & 0 deletions data/foodb/mysql/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker-compose.yml
29 changes: 29 additions & 0 deletions data/foodb/mysql/ativando-mysql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
docker compose up
docker exec -it docker-foodb-db-manager-1 bash

mysql -u root -p foodb --local-infile
password: root

# Comentários
O parâmetro `--local-infile` tem que constar na chamada (cliente) e tem que ser configurado internamente (servidor), para permitir importação de arquivos.

O arquivo `my.conf` neste diretório deve ser copiado para o diretório `/etc/mysql/` dentro da imagem para permitir exportação:

~~~
docker cp ./my.cnf docker-foodb-db-manager-1:/etc/mysql/my.cnf
~~~

# Importação dentro do MySQL no Docker
1. entrar no processo docker: `docker exec -it docker-foodb-db-manager-1 bash`
2. entrar na pasta de importação `cd /import`
3. criar o banco de dados
~~~
mysql -u root -p
password: root
CREATE DATABASE foodb;
exit
~~~
4. chamada de importação (senha root):
~~~
mysql -p --local-infile foodb < foodb_server_dump_2020_4_21.sql > import-log.log
~~~
33 changes: 33 additions & 0 deletions data/foodb/mysql/docker-compose(model).yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
services:
foodb-db-manager:
image: mysql:8.0.33
ports:
- "3307:3306"
volumes:
- foodb-import:/import
- foodb-export:/export
- foodb-db:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password
restart: on-failure:5
environment:
MYSQL_ROOT_PASSWORD: root

volumes:
foodb-import:
driver: "local"
driver_opts:
type: "none"
device: "/home/user/data/mysql/foodb/db-docker-mapped-folders/import"
o: "bind"
foodb-export:
driver: "local"
driver_opts:
type: "none"
device: "/home/user/data/mysql/foodb/db-docker-mapped-folders/export"
o: "bind"
foodb-db:
driver: "local"
driver_opts:
type: "none"
device: "/home/user/data/mysql/foodb/db-docker-mapped-folders/db"
o: "bind"
2 changes: 2 additions & 0 deletions data/foodb/mysql/my.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mysqld]
secure-file-priv=""
Loading

0 comments on commit aeb52ec

Please sign in to comment.