2 Module : Gargantext.Core.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 module Gargantext.Core.Text.Corpus.API
21 import Gargantext.API.Admin.Orchestrator.Types (ExternalAPIs(..), externalAPIs)
22 import Gargantext.Core (Lang(..))
23 import Gargantext.Database.Admin.Types.Hyperdata (HyperdataDocument(..))
24 import Gargantext.Prelude
25 import qualified Gargantext.Core.Text.Corpus.API.Hal as HAL
26 import qualified Gargantext.Core.Text.Corpus.API.Isidore as ISIDORE
27 import qualified Gargantext.Core.Text.Corpus.API.Istex as ISTEX
28 import qualified Gargantext.Core.Text.Corpus.API.Pubmed as PUBMED
30 -- | TODO put in gargantext.init
31 default_limit :: Maybe Integer
32 default_limit = Just 10000
34 -- | Get External API metadata main function
39 -> IO [HyperdataDocument]
40 get PubMed _la q _l = PUBMED.get q default_limit -- EN only by default
41 get HAL la q _l = HAL.get la q default_limit
42 get IsTex la q _l = ISTEX.get la q default_limit
43 get Isidore la q _l = ISIDORE.get la (fromIntegral <$> default_limit) (Just q) Nothing
44 get _ _ _ _ = undefined
46 -- | Some Sugar for the documentation
47 type Query = PUBMED.Query
48 type Limit = PUBMED.Limit