]> Git — Sourcephile - gargantext.git/blob - bin/gargantext-import/Main.hs
NgramsPatches: overall structure, missing many instances
[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 System.Environment (getArgs)
30
31 main :: IO ()
32 main = do
33 [iniPath, name, corpusPath] <- getArgs
34
35 {-let createUsers :: Cmd ServantErr Int64
36 createUsers = insertUsers [gargantuaUser,simpleUser]
37 _ <- runCmdDevWith iniPath createUsers
38 -}
39 let cmd :: Cmd ServantErr NodeId
40 cmd = flowCorpus CsvHalFormat corpusPath (cs name)
41 r <- runCmdDevWith iniPath cmd
42 pure ()
43
44