Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
120
Issues
120
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
ab9bfe88
Commit
ab9bfe88
authored
Jun 29, 2023
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
[FIX]
parents
4b382887
aa827322
Pipeline
#4330
failed with stages
in 82 minutes and 18 seconds
Changes
8
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
684 additions
and
8 deletions
+684
-8
cabal.project
cabal.project
+5
-0
gargantext.cabal
gargantext.cabal
+7
-1
package.yaml
package.yaml
+583
-0
Types.hs
src/Gargantext/API/Admin/Orchestrator/Types.hs
+2
-1
Types.hs
src/Gargantext/API/Node/Corpus/Types.hs
+8
-6
API.hs
src/Gargantext/Core/Text/Corpus/API.hs
+3
-0
OpenAlex.hs
src/Gargantext/Core/Text/Corpus/API/OpenAlex.hs
+74
-0
stack.yaml
stack.yaml
+2
-0
No files found.
cabal.project
View file @
ab9bfe88
...
@@ -96,6 +96,11 @@ source-repository-package
...
@@ -96,6 +96,11 @@ source-repository-package
location
:
https
://
gitlab
.
iscpif
.
fr
/
gargantext
/
crawlers
/
istex
.
git
location
:
https
://
gitlab
.
iscpif
.
fr
/
gargantext
/
crawlers
/
istex
.
git
tag
:
a34bb341236d82cf3d488210bc1d8448a98f5808
tag
:
a34bb341236d82cf3d488210bc1d8448a98f5808
source
-
repository
-
package
type
:
git
location
:
https
://
gitlab
.
iscpif
.
fr
/
gargantext
/
crawlers
/
openalex
.
git
tag
:
0083
c02d62441d73f3616409c6453c87302c698f
source
-
repository
-
package
source
-
repository
-
package
type
:
git
type
:
git
location
:
https
://
gitlab
.
iscpif
.
fr
/
gargantext
/
crawlers
/
pubmed
.
git
location
:
https
://
gitlab
.
iscpif
.
fr
/
gargantext
/
crawlers
/
pubmed
.
git
...
...
gargantext.cabal
View file @
ab9bfe88
cabal-version: 1.12
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.35.1.
--
-- see: https://github.com/sol/hpack
name: gargantext
name: gargantext
version: 0.0.6.9.9.7
version: 0.0.6.9.9.7
synopsis: Search, map, share
synopsis: Search, map, share
...
@@ -56,11 +60,11 @@ library
...
@@ -56,11 +60,11 @@ library
Gargantext.Core.Text.Corpus.API
Gargantext.Core.Text.Corpus.API
Gargantext.Core.Text.Corpus.API.Arxiv
Gargantext.Core.Text.Corpus.API.Arxiv
Gargantext.Core.Text.Corpus.API.Pubmed
Gargantext.Core.Text.Corpus.API.Pubmed
Gargantext.Core.Text.Corpus.API.OpenAlex
Gargantext.Core.Text.Corpus.Query
Gargantext.Core.Text.Corpus.Query
Gargantext.Core.Text.Corpus.Parsers
Gargantext.Core.Text.Corpus.Parsers
Gargantext.Core.Text.Corpus.Parsers.CSV
Gargantext.Core.Text.Corpus.Parsers.CSV
Gargantext.Core.Text.Corpus.Parsers.Date.Parsec
Gargantext.Core.Text.Corpus.Parsers.Date.Parsec
Gargantext.Core.Text.Corpus.Parsers.JSON
Gargantext.Core.Text.List.Formats.CSV
Gargantext.Core.Text.List.Formats.CSV
Gargantext.Core.Text.Metrics
Gargantext.Core.Text.Metrics
Gargantext.Core.Text.Metrics.CharByChar
Gargantext.Core.Text.Metrics.CharByChar
...
@@ -199,6 +203,7 @@ library
...
@@ -199,6 +203,7 @@ library
Gargantext.Core.Text.Corpus.Parsers.GrandDebat
Gargantext.Core.Text.Corpus.Parsers.GrandDebat
Gargantext.Core.Text.Corpus.Parsers.Iramuteq
Gargantext.Core.Text.Corpus.Parsers.Iramuteq
Gargantext.Core.Text.Corpus.Parsers.Isidore
Gargantext.Core.Text.Corpus.Parsers.Isidore
Gargantext.Core.Text.Corpus.Parsers.JSON
Gargantext.Core.Text.Corpus.Parsers.Json2Csv
Gargantext.Core.Text.Corpus.Parsers.Json2Csv
Gargantext.Core.Text.Corpus.Parsers.RIS
Gargantext.Core.Text.Corpus.Parsers.RIS
Gargantext.Core.Text.Corpus.Parsers.RIS.Presse
Gargantext.Core.Text.Corpus.Parsers.RIS.Presse
...
@@ -454,6 +459,7 @@ library
...
@@ -454,6 +459,7 @@ library
, natural-transformation
, natural-transformation
, network-uri
, network-uri
, opaleye
, opaleye
, openalex
, pandoc
, pandoc
, parallel
, parallel
, parsec
, parsec
...
...
package.yaml
0 → 100644
View file @
ab9bfe88
name
:
gargantext
# +------------ Layer 3
# | +--+------- Layer 2
# | | +-------- Layer 1 : New versions with API changes
# | | | +----- Layers * : New versions with API additions
# | | | | +--- Layers * : New versions without API breaking changes
# | | | | |
version
:
'
0.0.6.9.9.7'
synopsis
:
Search, map, share
description
:
Please see README.md
category
:
Data
author
:
Gargantext Team
maintainer
:
team@gargantext.org
copyright
:
-
!
'
Copyright:
(c)
2017-Present:
see
git
logs
and
README'
license
:
AGPL-3
homepage
:
https://gargantext.org
ghc-options
:
-
-Wall
dependencies
:
-
extra
-
text
default-extensions
:
-
DataKinds
-
DeriveGeneric
-
FlexibleContexts
-
FlexibleInstances
-
GADTs
-
GeneralizedNewtypeDeriving
-
MultiParamTypeClasses
-
NamedFieldPuns
-
NoImplicitPrelude
-
OverloadedStrings
-
RankNTypes
-
RecordWildCards
-
StrictData
data-files
:
-
ekg-assets/index.html
-
ekg-assets/monitor.js
-
ekg-assets/monitor.css
-
ekg-assets/jquery.flot.min.js
-
ekg-assets/jquery-1.6.4.min.js
-
ekg-assets/bootstrap-1.4.0.min.css
-
ekg-assets/chart_line_add.png
-
ekg-assets/cross.png
-
test-data/ngrams/GarganText_NgramsTerms-QuantumComputing.json
-
test-data/phylo/bpa_phylo_test.json
-
test-data/phylo/open_science.json
-
.clippy.dhall
library
:
source-dirs
:
src
ghc-options
:
-
-Wincomplete-uni-patterns
-
-Wincomplete-record-updates
-
-Wmissing-signatures
-
-Wunused-binds
-
-Wunused-imports
-
-Werror
-
-freduction-depth=300
-
-fplugin=Clippy
exposed-modules
:
-
Gargantext
-
Gargantext.API
-
Gargantext.API.Admin.Auth.Types
-
Gargantext.API.Admin.EnvTypes
-
Gargantext.API.Admin.Settings
-
Gargantext.API.Admin.Orchestrator.Types
-
Gargantext.API.Admin.Types
-
Gargantext.API.Dev
-
Gargantext.API.HashedResponse
-
Gargantext.API.Ngrams
-
Gargantext.API.Ngrams.Prelude
-
Gargantext.API.Ngrams.Tools
-
Gargantext.API.Ngrams.Types
-
Gargantext.API.Node
-
Gargantext.API.Node.Corpus.New
-
Gargantext.API.Node.Corpus.Types
-
Gargantext.API.Node.File
-
Gargantext.API.Node.Share
-
Gargantext.API.Prelude
-
Gargantext.Core
-
Gargantext.Core.NLP
-
Gargantext.Core.Methods.Similarities
-
Gargantext.Core.NodeStory
-
Gargantext.Core.Text
-
Gargantext.Core.Text.Context
-
Gargantext.Core.Text.Corpus.API
-
Gargantext.Core.Text.Corpus.API.Arxiv
-
Gargantext.Core.Text.Corpus.API.Pubmed
-
Gargantext.Core.Text.Corpus.API.OpenAlex
-
Gargantext.Core.Text.Corpus.Query
-
Gargantext.Core.Text.Corpus.Parsers
-
Gargantext.Core.Text.Corpus.Parsers.CSV
-
Gargantext.Core.Text.Corpus.Parsers.Date.Parsec
-
Gargantext.Core.Text.List.Formats.CSV
-
Gargantext.Core.Text.Metrics
-
Gargantext.Core.Text.Metrics.CharByChar
-
Gargantext.Core.Text.Metrics.Count
-
Gargantext.Core.Text.Metrics.TFICF
-
Gargantext.Core.Text.Prepare
-
Gargantext.Core.Text.Search
-
Gargantext.Core.Text.Terms
-
Gargantext.Core.Text.Terms.Eleve
-
Gargantext.Core.Text.Terms.Mono
-
Gargantext.Core.Text.Terms.Multi
-
Gargantext.Core.Text.Terms.Multi.Lang.En
-
Gargantext.Core.Text.Terms.Multi.Lang.Fr
-
Gargantext.Core.Text.Terms.Multi.RAKE
-
Gargantext.Core.Text.Terms.WithList
-
Gargantext.Core.Types
-
Gargantext.Core.Types.Individu
-
Gargantext.Core.Types.Main
-
Gargantext.Core.Types.Query
-
Gargantext.Core.Types.Phylo
-
Gargantext.Core.Utils
-
Gargantext.Core.Utils.Prefix
-
Gargantext.Core.Viz.Graph
-
Gargantext.Core.Viz.Graph.Index
-
Gargantext.Core.Viz.Graph.Tools
-
Gargantext.Core.Viz.Graph.Tools.IGraph
-
Gargantext.Core.Viz.Graph.Types
-
Gargantext.Core.Viz.Phylo
-
Gargantext.Core.Viz.Phylo.API
-
Gargantext.Core.Viz.Phylo.API.Tools
-
Gargantext.Core.Viz.Phylo.PhyloExport
-
Gargantext.Core.Viz.Phylo.PhyloMaker
-
Gargantext.Core.Viz.Phylo.PhyloTools
-
Gargantext.Core.Viz.Phylo.SynchronicClustering
-
Gargantext.Core.Viz.Types
-
Gargantext.Database.Action.Flow
-
Gargantext.Database.Action.Flow.Types
-
Gargantext.Database.Action.User.New
-
Gargantext.Database.Admin.Config
-
Gargantext.Database.Admin.Trigger.Init
-
Gargantext.Database.Admin.Types.Hyperdata
-
Gargantext.Database.Admin.Types.Node
-
Gargantext.Database.Prelude
-
Gargantext.Database.Query.Table.NgramsPostag
-
Gargantext.Database.Query.Table.Node
-
Gargantext.Database.Query.Table.Node.UpdateOpaleye
-
Gargantext.Database.Query.Table.User
-
Gargantext.Database.Schema.Ngrams
-
Gargantext.Defaults
-
Gargantext.Utils.Jobs
-
Gargantext.Utils.Jobs.Internal
-
Gargantext.Utils.Jobs.Map
-
Gargantext.Utils.Jobs.Monad
-
Gargantext.Utils.Jobs.Queue
-
Gargantext.Utils.Jobs.Settings
-
Gargantext.Utils.Jobs.State
-
Gargantext.Utils.SpacyNLP
-
Gargantext.Utils.Tuple
dependencies
:
-
HSvm
-
KMP
-
MissingH
-
MonadRandom
-
QuickCheck
-
Unique
-
accelerate
-
accelerate-arithmetic
-
accelerate-llvm-native
-
accelerate-utility
-
aeson
-
aeson-lens
-
aeson-pretty
-
array
-
async
-
attoparsec
-
auto-update
-
base >=4.7 && <5
-
base16-bytestring
-
base64-bytestring
-
blaze-html
-
blaze-markup
-
blaze-svg
-
boolexpr
-
bytestring
-
case-insensitive
-
cassava
-
cereal
# (IGraph)
-
cborg
-
ghc-clippy-plugin
-
conduit
-
conduit-extra
-
containers
-
contravariant
-
crawlerArxiv
-
crawlerHAL
-
crawlerISTEX
-
crawlerIsidore
-
crawlerPubMed
-
cron
-
cryptohash
-
data-time-segment
-
deepseq
-
directory
-
duckling
-
ekg-core
-
ekg-json
-
exceptions
-
fast-logger
-
fclabels
-
fgl
-
filelock
-
filepath
-
formatting
-
full-text-search
-
fullstop
-
gargantext-prelude
-
gargantext-graph >= 0.1.0.0
-
graphviz
-
hashable
-
haskell-igraph
-
hlcm
-
hsinfomap
-
hsparql
-
hstatistics
-
http-api-data
-
http-client
-
http-client-tls
-
http-conduit
-
http-media
-
http-types
-
hxt
-
ihaskell
-
ini
-
insert-ordered-containers
-
jose
-
json-stream
-
lens
-
lifted-base
-
listsafe
-
located-base
-
logging-effect
-
matrix
-
monad-control
-
monad-logger
-
morpheus-graphql
-
morpheus-graphql-app
-
morpheus-graphql-core
-
morpheus-graphql-subscriptions
-
mtl
-
natural-transformation
-
network-uri
-
opaleye
-
openalex
-
pandoc
-
parallel
-
parsec
-
patches-class
-
patches-map
-
path
-
path-io
-
postgresql-simple
-
pretty-simple
-
probability
-
process
-
product-profunctors
-
profunctors
-
protolude
-
pureMD5
-
quickcheck-instances
-
rake
-
random
-
rdf4h
-
replace-attoparsec
-
regex-compat
-
regex-tdfa
-
resource-pool
-
resourcet
-
safe
-
scientific
-
semigroups
-
serialise
-
servant
-
servant-auth
-
servant-auth-client
-
servant-auth-server >= 0.4.4.0
-
servant-auth-swagger
-
servant-blaze
-
servant-cassava
-
servant-client
-
servant-ekg
-
servant-flatten
-
servant-job
-
servant-mock
-
servant-multipart
-
servant-server
-
servant-swagger
-
servant-swagger-ui
-
servant-xml
-
simple-reflect
-
singletons
# (IGraph)
-
split
-
stemmer
-
stm
-
swagger2
-
taggy-lens
-
tagsoup
-
template-haskell
-
temporary
-
text-conversions
-
text-metrics
-
time
-
time-locale-compat
-
timezone-series
-
transformers
-
transformers-base
-
tuple
-
unordered-containers
-
utf8-string
-
uuid
-
uri-encode
-
validity
-
vector
-
wai
-
wai-app-static
-
wai-cors
-
wai-extra
-
wai-websockets
-
warp
-
wikiparsec
-
websockets
-
wreq
-
xml-conduit
-
xml-types
-
xmlbf
-
yaml
-
zip
-
zlib
executables
:
gargantext-server
:
main
:
Main.hs
source-dirs
:
bin/gargantext-server
ghc-options
:
-
-O2
-
-Wcompat
-
-Wmissing-signatures
-
-rtsopts
-
-threaded
-
-with-rtsopts=-N
-
-with-rtsopts=-T
-
-fprof-auto
dependencies
:
-
base
-
cassava
-
containers
-
full-text-search
-
gargantext
-
gargantext-prelude
-
ini
-
optparse-generic
-
postgresql-simple
-
unordered-containers
-
vector
gargantext-cli
:
main
:
Main.hs
source-dirs
:
bin/gargantext-cli
ghc-options
:
-
-threaded
-
-rtsopts
-
-with-rtsopts=-N
-
-O2
-
-Wmissing-signatures
dependencies
:
-
aeson
-
async
-
base
-
bytestring
-
containers
-
gargantext
-
gargantext-prelude
-
vector
-
cassava
-
ini
-
optparse-generic
-
split
-
unordered-containers
-
full-text-search
gargantext-phylo
:
main
:
Main.hs
source-dirs
:
bin/gargantext-phylo
ghc-options
:
-
-threaded
-
-rtsopts
-
-with-rtsopts=-N
-
-O2
-
-Wmissing-signatures
dependencies
:
-
aeson
-
async
-
base
-
bytestring
-
containers
-
directory
-
gargantext
-
gargantext-prelude
-
vector
-
parallel
-
cassava
-
ini
-
optparse-generic
-
split
-
unordered-containers
-
cryptohash
-
time
gargantext-import
:
main
:
Main.hs
source-dirs
:
bin/gargantext-import
ghc-options
:
-
-threaded
-
-rtsopts
-
-with-rtsopts=-N
-
-O2
-
-Wmissing-signatures
dependencies
:
-
gargantext
-
gargantext-prelude
-
base
-
servant-server
gargantext-init
:
main
:
Main.hs
source-dirs
:
bin/gargantext-init
ghc-options
:
-
-threaded
-
-rtsopts
-
-with-rtsopts=-N
-
-O2
-
-Wmissing-signatures
dependencies
:
-
gargantext
-
gargantext-prelude
-
base
-
cron
gargantext-invitations
:
main
:
Main.hs
source-dirs
:
bin/gargantext-invitations
ghc-options
:
-
-threaded
-
-rtsopts
-
-with-rtsopts=-N
-
-O2
-
-Wmissing-signatures
dependencies
:
-
gargantext
-
gargantext-prelude
-
base
gargantext-upgrade
:
main
:
Main.hs
source-dirs
:
bin/gargantext-upgrade
ghc-options
:
-
-threaded
-
-rtsopts
-
-with-rtsopts=-N
-
-O2
-
-Wmissing-signatures
dependencies
:
-
gargantext
-
gargantext-prelude
-
base
-
postgresql-simple
-
cron
gargantext-admin
:
main
:
Main.hs
source-dirs
:
bin/gargantext-admin
ghc-options
:
-
-threaded
-
-rtsopts
-
-with-rtsopts=-N
-
-O2
-
-Wmissing-signatures
dependencies
:
-
gargantext
-
gargantext-prelude
-
base
gargantext-cbor2json
:
main
:
Main.hs
source-dirs
:
bin/gargantext-cbor2json
ghc-options
:
-
-threaded
-
-rtsopts
-
-with-rtsopts=-N
-
-O2
-
-Wmissing-signatures
dependencies
:
-
gargantext
-
gargantext-prelude
-
base
-
bytestring
-
aeson
-
serialise
tests
:
garg-test
:
main
:
Main.hs
source-dirs
:
src-test
default-extensions
:
-
DataKinds
-
DeriveGeneric
-
FlexibleContexts
-
FlexibleInstances
-
GeneralizedNewtypeDeriving
-
MultiParamTypeClasses
-
NoImplicitPrelude
-
OverloadedStrings
-
RankNTypes
ghc-options
:
-
-threaded
-
-rtsopts
-
-with-rtsopts=-N
dependencies
:
-
QuickCheck
-
aeson
-
async
-
base
-
boolexpr
-
bytestring
-
conduit
-
containers
-
crawlerArxiv
-
duckling
-
gargantext
-
gargantext-prelude
-
hspec
-
http-client
-
http-client-tls
-
mtl
-
parsec
-
patches-class
-
patches-map
-
duckling
-
quickcheck-instances
-
raw-strings-qq
-
servant-job
-
stm
-
tasty
-
tasty-hspec
-
tasty-hunit
-
tasty-quickcheck
-
text
-
time
-
unordered-containers
-
validity
# garg-doctest:
# main: Main.hs
# source-dirs: src-doctest
# ghc-options:
# - -O2
# - -Wcompat
# - -Wmissing-signatures
# - -rtsopts
# - -threaded
# - -with-rtsopts=-N
# dependencies:
# - doctest
# - Glob
# - QuickCheck
# - base
# - gargantext
# default-extensions:
# - DataKinds
# - DeriveGeneric
# - FlexibleContexts
# - FlexibleInstances
# - GeneralizedNewtypeDeriving
# - MultiParamTypeClasses
# - NoImplicitPrelude
# - OverloadedStrings
# - RankNTypes
#
src/Gargantext/API/Admin/Orchestrator/Types.hs
View file @
ab9bfe88
...
@@ -34,7 +34,8 @@ instance Arbitrary a => Arbitrary (JobOutput a) where
...
@@ -34,7 +34,8 @@ instance Arbitrary a => Arbitrary (JobOutput a) where
-- | Main Types
-- | Main Types
-- TODO IsidoreAuth
-- TODO IsidoreAuth
data
ExternalAPIs
=
PubMed
data
ExternalAPIs
=
OpenAlex
|
PubMed
|
Arxiv
|
Arxiv
|
HAL
|
HAL
|
IsTex
|
IsTex
...
...
src/Gargantext/API/Node/Corpus/Types.hs
View file @
ab9bfe88
...
@@ -19,6 +19,7 @@ import Gargantext.Core.Utils.Prefix (unPrefix)
...
@@ -19,6 +19,7 @@ import Gargantext.Core.Utils.Prefix (unPrefix)
import
Gargantext.Database.Action.Flow
(
DataOrigin
(
..
))
import
Gargantext.Database.Action.Flow
(
DataOrigin
(
..
))
data
Database
=
Empty
data
Database
=
Empty
|
OpenAlex
|
PubMed
|
PubMed
|
Arxiv
|
Arxiv
|
HAL
|
HAL
...
@@ -35,6 +36,7 @@ instance ToSchema Database where
...
@@ -35,6 +36,7 @@ instance ToSchema Database where
database2origin
::
Database
->
DataOrigin
database2origin
::
Database
->
DataOrigin
database2origin
Empty
=
InternalOrigin
Types
.
IsTex
database2origin
Empty
=
InternalOrigin
Types
.
IsTex
database2origin
OpenAlex
=
ExternalOrigin
Types
.
OpenAlex
database2origin
PubMed
=
ExternalOrigin
Types
.
PubMed
database2origin
PubMed
=
ExternalOrigin
Types
.
PubMed
database2origin
Arxiv
=
ExternalOrigin
Types
.
Arxiv
database2origin
Arxiv
=
ExternalOrigin
Types
.
Arxiv
database2origin
HAL
=
ExternalOrigin
Types
.
HAL
database2origin
HAL
=
ExternalOrigin
Types
.
HAL
...
...
src/Gargantext/Core/Text/Corpus/API.hs
View file @
ab9bfe88
...
@@ -31,6 +31,7 @@ import qualified Gargantext.Core.Text.Corpus.API.Arxiv as Arxiv
...
@@ -31,6 +31,7 @@ import qualified Gargantext.Core.Text.Corpus.API.Arxiv as Arxiv
import
qualified
Gargantext.Core.Text.Corpus.API.Hal
as
HAL
import
qualified
Gargantext.Core.Text.Corpus.API.Hal
as
HAL
import
qualified
Gargantext.Core.Text.Corpus.API.Isidore
as
ISIDORE
import
qualified
Gargantext.Core.Text.Corpus.API.Isidore
as
ISIDORE
import
qualified
Gargantext.Core.Text.Corpus.API.Istex
as
ISTEX
import
qualified
Gargantext.Core.Text.Corpus.API.Istex
as
ISTEX
import
qualified
Gargantext.Core.Text.Corpus.API.OpenAlex
as
OpenAlex
import
qualified
Gargantext.Core.Text.Corpus.API.Pubmed
as
PUBMED
import
qualified
Gargantext.Core.Text.Corpus.API.Pubmed
as
PUBMED
import
qualified
Gargantext.Core.Text.Corpus.Query
as
Corpus
import
qualified
Gargantext.Core.Text.Corpus.Query
as
Corpus
import
qualified
PUBMED.Types
as
PUBMED
import
qualified
PUBMED.Types
as
PUBMED
...
@@ -55,6 +56,8 @@ get externalAPI la q mPubmedAPIKey limit = do
...
@@ -55,6 +56,8 @@ get externalAPI la q mPubmedAPIKey limit = do
case
Corpus
.
parseQuery
q
of
case
Corpus
.
parseQuery
q
of
Left
err
->
pure
$
Left
$
InvalidInputQuery
q
(
T
.
pack
err
)
Left
err
->
pure
$
Left
$
InvalidInputQuery
q
(
T
.
pack
err
)
Right
corpusQuery
->
case
externalAPI
of
Right
corpusQuery
->
case
externalAPI
of
OpenAlex
->
first
ExternalAPIError
<$>
OpenAlex
.
get
(
fromMaybe
""
Nothing
{- email -}
)
q
limit
PubMed
->
first
ExternalAPIError
<$>
PubMed
->
first
ExternalAPIError
<$>
PUBMED
.
get
(
fromMaybe
""
mPubmedAPIKey
)
corpusQuery
limit
PUBMED
.
get
(
fromMaybe
""
mPubmedAPIKey
)
corpusQuery
limit
--docs <- PUBMED.get q default_limit -- EN only by default
--docs <- PUBMED.get q default_limit -- EN only by default
...
...
src/Gargantext/Core/Text/Corpus/API/OpenAlex.hs
0 → 100644
View file @
ab9bfe88
{-|
Module : Gargantext.Core.Text.Corpus.API.OpenAlex
Description : OpenAlex API connection
Copyright : (c) CNRS, 2023
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
module
Gargantext.Core.Text.Corpus.API.OpenAlex
where
import
Conduit
import
qualified
Data.Text
as
T
import
Gargantext.Core.Text.Corpus.Query
as
Corpus
import
Gargantext.Database.Admin.Types.Hyperdata
(
HyperdataDocument
(
..
))
import
Protolude
import
qualified
OpenAlex
as
OA
import
qualified
OpenAlex.Types
as
OA
import
Servant.Client
(
ClientError
)
get
::
Text
->
Corpus
.
RawQuery
->
Maybe
Limit
->
IO
(
Either
ClientError
(
Maybe
Integer
,
ConduitT
()
HyperdataDocument
IO
()
))
get
_email
q
_l
=
do
eRes
<-
OA
.
fetchWorksC
Nothing
Nothing
$
Just
$
Corpus
.
getRawQuery
q
pure
$
(
\
(
len
,
docsC
)
->
(
len
,
docsC
.|
takeC
1000
.|
mapC
toDoc
))
<$>
eRes
toDoc
::
OA
.
Work
->
HyperdataDocument
toDoc
(
OA
.
Work
{
..
}
)
=
HyperdataDocument
{
_hd_bdd
=
Just
"OpenAlex"
,
_hd_doi
=
doi
,
_hd_url
=
url
,
_hd_uniqId
=
Just
id
,
_hd_uniqIdBdd
=
Just
id
,
_hd_page
=
firstPage
biblio
,
_hd_title
=
title
,
_hd_authors
=
authors
authorships
,
_hd_institutes
=
institutes
authorships
,
_hd_source
=
source
,
_hd_abstract
=
Just
abstract_reconstructed
,
_hd_publication_date
=
Just
$
show
publication_date
,
_hd_publication_year
=
Just
$
publication_year
,
_hd_publication_month
=
Nothing
-- TODO
,
_hd_publication_day
=
Nothing
-- TODO
,
_hd_publication_hour
=
Nothing
-- TODO
,
_hd_publication_minute
=
Nothing
-- TODO
,
_hd_publication_second
=
Nothing
-- TODO
,
_hd_language_iso2
=
language
}
where
firstPage
::
OA
.
Biblio
->
Maybe
Int
firstPage
OA
.
Biblio
{
first_page
}
=
maybe
Nothing
readMaybe
$
T
.
unpack
<$>
first_page
authors
::
[
OA
.
Authorship
]
->
Maybe
Text
authors
[]
=
Nothing
authors
aus
=
Just
$
T
.
intercalate
", "
(
getDisplayName
<$>
aus
)
where
getDisplayName
::
OA
.
Authorship
->
Text
getDisplayName
OA
.
Authorship
{
author
=
OA
.
DehydratedAuthor
{
display_name
=
dn
}
}
=
dn
institutes
::
[
OA
.
Authorship
]
->
Maybe
Text
institutes
[]
=
Nothing
institutes
aus
=
Just
$
T
.
intercalate
", "
((
T
.
replace
", "
" - "
)
.
getInstitutesNames
<$>
aus
)
where
getInstitutesNames
OA
.
Authorship
{
institutions
}
=
T
.
intercalate
", "
$
getDisplayName
<$>
institutions
getDisplayName
::
OA
.
DehydratedInstitution
->
Text
getDisplayName
OA
.
DehydratedInstitution
{
display_name
=
dn
}
=
dn
source
::
Maybe
Text
source
=
maybe
Nothing
getSource
primary_location
where
getSource
OA
.
Location
{
source
=
s
}
=
getSourceDisplayName
<$>
s
getSourceDisplayName
OA
.
DehydratedSource
{
display_name
=
dn
}
=
dn
stack.yaml
View file @
ab9bfe88
...
@@ -59,6 +59,8 @@ extra-deps:
...
@@ -59,6 +59,8 @@ extra-deps:
commit
:
3db385e767d2100d8abe900833c6e7de3ac55e1b
commit
:
3db385e767d2100d8abe900833c6e7de3ac55e1b
-
git
:
https://gitlab.iscpif.fr/gargantext/crawlers/arxiv-api.git
-
git
:
https://gitlab.iscpif.fr/gargantext/crawlers/arxiv-api.git
commit
:
2d7e5753cbbce248b860b571a0e9885415c846f7
commit
:
2d7e5753cbbce248b860b571a0e9885415c846f7
-
git
:
https://gitlab.iscpif.fr/gargantext/crawlers/openalex.git
commit
:
0083c02d62441d73f3616409c6453c87302c698f
# NP libs
# NP libs
-
git
:
https://github.com/alpmestan/servant-job.git
-
git
:
https://github.com/alpmestan/servant-job.git
commit
:
b4182487cfe479777c11ca19f3c0d47840b376f6
commit
:
b4182487cfe479777c11ca19f3c0d47840b376f6
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment