2 Module : Gargantext.Text.Corpus.API
3 Description : All crawlers of Gargantext in one file.
4 Copyright : (c) CNRS, 2017
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
12 {-# LANGUAGE NoImplicitPrelude #-}
13 {-# LANGUAGE OverloadedStrings #-}
14 {-# LANGUAGE DeriveGeneric #-}
15 {-# LANGUAGE InstanceSigs #-}
17 module Gargantext.Text.Corpus.API
27 import Gargantext.Prelude
28 import Gargantext.Core (Lang(..))
29 import Gargantext.API.Orchestrator.Types (ExternalAPIs(..), externalAPIs)
30 import Gargantext.Database.Types.Node (HyperdataDocument(..))
32 import qualified Gargantext.Text.Corpus.API.Pubmed as PUBMED
33 import qualified Gargantext.Text.Corpus.API.Isidore as ISIDORE
34 import qualified Gargantext.Text.Corpus.API.Hal as HAL
35 import qualified Gargantext.Text.Corpus.API.Istex as ISTEX
37 -- | Get External API metadata main function
38 get :: ExternalAPIs -> Query -> Maybe Limit -> IO [HyperdataDocument]
39 get All _ _ = undefined
41 get PubMed q l = PUBMED.get q l
43 get HAL_EN q l = HAL.get EN q l
44 get HAL_FR q l = HAL.get FR q l
46 get IsTex_EN q l = ISTEX.get EN q l
47 get IsTex_FR q l = ISTEX.get FR q l
49 get Isidore_EN q l = ISIDORE.get EN (fromIntegral <$> l) (Just q) Nothing
50 get Isidore_FR q l = ISIDORE.get FR (fromIntegral <$> l) (Just q) Nothing
52 -- | Some Sugar for the documentation
53 type Query = PUBMED.Query
54 type Limit = PUBMED.Limit