]> Git — Sourcephile - gargantext.git/blob - bin/gargantext-import/Main.hs
[NGRAMS-REPO] Basic flow insertion
[gargantext.git] / bin / gargantext-import / Main.hs
1 {-|
2 Module : Main.hs
3 Description : Gargantext Import Corpus
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 Import a corpus binary.
11
12 -}
13
14 {-# LANGUAGE NoImplicitPrelude #-}
15 {-# LANGUAGE OverloadedStrings #-}
16 {-# LANGUAGE FlexibleContexts #-}
17 {-# LANGUAGE Strict #-}
18
19 module Main where
20
21 import Servant (ServantErr)
22 import Gargantext.Prelude
23 import Gargantext.Database.Flow (flowCorpus)
24 import Gargantext.Text.Parsers (FileFormat(CsvHalFormat))
25 import Gargantext.Database.Utils (Cmd, connectGargandb, runCmdDevWith)
26 import Gargantext.Database.Types.Node (NodeId)
27 --import Gargantext.Database.Schema.User (insertUsers, gargantuaUser, simpleUser)
28 import Gargantext.API.Node () -- instances
29 import Gargantext.API.Ngrams (RepoCmdM)
30 import System.Environment (getArgs)
31
32 main :: IO ()
33 main = do
34 [iniPath, name, corpusPath] <- getArgs
35
36 {-let createUsers :: Cmd ServantErr Int64
37 createUsers = insertUsers [gargantuaUser,simpleUser]
38 _ <- runCmdDevWith iniPath createUsers
39 -}
40
41 {- -- TODO missing repo var...
42 let cmd :: RepoCmdM env ServantErr m => m NodeId
43 cmd = flowCorpus CsvHalFormat corpusPath (cs name)
44 r <- runCmdDevWith iniPath cmd
45 -}
46 pure ()
47
48