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