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
156
Issues
156
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
d3303c27
Verified
Commit
d3303c27
authored
Apr 09, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[refactoring] prelude with ToJSON etc instances
parent
6e07f6c5
Pipeline
#5891
failed with stages
in 17 minutes and 47 seconds
Changes
74
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
74 changed files
with
185 additions
and
268 deletions
+185
-268
Main.hs
bin/gargantext-cli/Main.hs
+4
-9
cabal.project
cabal.project
+2
-1
Types.hs
src/Gargantext/API/Admin/Auth/Types.hs
+1
-3
Count.hs
src/Gargantext/API/Count.hs
+3
-6
Types.hs
src/Gargantext/API/Errors/Types.hs
+20
-15
Utils.hs
src/Gargantext/API/GraphQL/Utils.hs
+1
-2
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+1
-1
NgramsTree.hs
src/Gargantext/API/Ngrams/NgramsTree.hs
+5
-5
Tools.hs
src/Gargantext/API/Ngrams/Tools.hs
+1
-1
Types.hs
src/Gargantext/API/Ngrams/Types.hs
+1
-2
Node.hs
src/Gargantext/API/Node.hs
+12
-14
New.hs
src/Gargantext/API/Node/Corpus/New.hs
+14
-13
File.hs
src/Gargantext/API/Node/Corpus/New/File.hs
+6
-8
Searx.hs
src/Gargantext/API/Node/Corpus/Searx.hs
+6
-7
Types.hs
src/Gargantext/API/Node/Corpus/Types.hs
+4
-5
DocumentUpload.hs
src/Gargantext/API/Node/DocumentUpload.hs
+2
-2
DocumentsFromWriteNodes.hs
src/Gargantext/API/Node/DocumentsFromWriteNodes.hs
+1
-2
File.hs
src/Gargantext/API/Node/File.hs
+11
-15
FrameCalcUpload.hs
src/Gargantext/API/Node/FrameCalcUpload.hs
+0
-2
Share.hs
src/Gargantext/API/Node/Share.hs
+3
-3
Public.hs
src/Gargantext/API/Public.hs
+10
-9
Server.hs
src/Gargantext/API/Server.hs
+5
-6
Table.hs
src/Gargantext/API/Table.hs
+1
-3
NodeStory.hs
src/Gargantext/Core/NodeStory.hs
+1
-1
DB.hs
src/Gargantext/Core/NodeStory/DB.hs
+1
-2
Types.hs
src/Gargantext/Core/NodeStory/Types.hs
+1
-1
Date.hs
src/Gargantext/Core/Text/Corpus/Parsers/Date.hs
+3
-5
Gitlab.hs
src/Gargantext/Core/Text/Corpus/Parsers/Gitlab.hs
+1
-1
GrandDebat.hs
src/Gargantext/Core/Text/Corpus/Parsers/GrandDebat.hs
+0
-1
Isidore.hs
src/Gargantext/Core/Text/Corpus/Parsers/Isidore.hs
+0
-1
Json2Csv.hs
src/Gargantext/Core/Text/Corpus/Parsers/Json2Csv.hs
+1
-2
Wikidata.hs
src/Gargantext/Core/Text/Corpus/Parsers/Wikidata.hs
+0
-1
Prelude.hs
src/Gargantext/Core/Text/List/Group/Prelude.hs
+1
-2
WithStem.hs
src/Gargantext/Core/Text/List/Group/WithStem.hs
+0
-1
Metrics.hs
src/Gargantext/Core/Text/Metrics.hs
+0
-1
Count.hs
src/Gargantext/Core/Text/Metrics/Count.hs
+1
-1
Ngrams.hs
src/Gargantext/Core/Text/Ngrams.hs
+1
-1
Terms.hs
src/Gargantext/Core/Text/Terms.hs
+1
-1
Types.hs
src/Gargantext/Core/Text/Terms/Multi/PosTagging/Types.hs
+1
-2
Types.hs
src/Gargantext/Core/Types.hs
+4
-11
Main.hs
src/Gargantext/Core/Types/Main.hs
+2
-4
Phylo.hs
src/Gargantext/Core/Types/Phylo.hs
+5
-10
API.hs
src/Gargantext/Core/Viz/Graph/API.hs
+1
-2
Tools.hs
src/Gargantext/Core/Viz/Graph/Tools.hs
+0
-1
Types.hs
src/Gargantext/Core/Viz/Graph/Types.hs
+0
-3
LegacyPhylo.hs
src/Gargantext/Core/Viz/LegacyPhylo.hs
+1
-3
Phylo.hs
src/Gargantext/Core/Viz/Phylo.hs
+2
-7
Delete.hs
src/Gargantext/Database/Action/Delete.hs
+7
-9
Flow.hs
src/Gargantext/Database/Action/Flow.hs
+1
-1
Extract.hs
src/Gargantext/Database/Action/Flow/Extract.hs
+1
-1
List.hs
src/Gargantext/Database/Action/Flow/List.hs
+2
-3
Pairing.hs
src/Gargantext/Database/Action/Flow/Pairing.hs
+1
-1
Types.hs
src/Gargantext/Database/Action/Flow/Types.hs
+0
-3
Utils.hs
src/Gargantext/Database/Action/Flow/Utils.hs
+1
-2
Search.hs
src/Gargantext/Database/Action/Search.hs
+1
-1
Share.hs
src/Gargantext/Database/Action/Share.hs
+2
-2
New.hs
src/Gargantext/Database/Action/User/New.hs
+3
-3
Node.hs
src/Gargantext/Database/Admin/Types/Node.hs
+5
-8
GargDB.hs
src/Gargantext/Database/GargDB.hs
+3
-6
Prelude.hs
src/Gargantext/Database/Prelude.hs
+3
-6
Ngrams.hs
src/Gargantext/Database/Query/Table/Ngrams.hs
+0
-1
NgramsPostag.hs
src/Gargantext/Database/Query/Table/NgramsPostag.hs
+1
-1
Node.hs
src/Gargantext/Database/Query/Table/Node.hs
+1
-1
Insert.hs
src/Gargantext/Database/Query/Table/Node/Document/Insert.hs
+0
-1
Error.hs
src/Gargantext/Database/Query/Table/Node/Error.hs
+1
-1
NodeContext.hs
src/Gargantext/Database/Query/Table/NodeContext.hs
+1
-1
NodeNode.hs
src/Gargantext/Database/Query/Table/NodeNode.hs
+1
-1
User.hs
src/Gargantext/Database/Query/Table/User.hs
+1
-1
Tree.hs
src/Gargantext/Database/Query/Tree.hs
+4
-5
NgramsPostag.hs
src/Gargantext/Database/Schema/NgramsPostag.hs
+0
-1
User.hs
src/Gargantext/Database/Schema/User.hs
+0
-1
JohnSnowNLP.hs
src/Gargantext/Utils/JohnSnowNLP.hs
+3
-4
Types.hs
src/Gargantext/Utils/SpacyNLP/Types.hs
+0
-3
UTCTime.hs
src/Gargantext/Utils/UTCTime.hs
+0
-1
No files found.
bin/gargantext-cli/Main.hs
View file @
d3303c27
...
...
@@ -11,15 +11,12 @@ Main specifications to index a corpus with a term list
-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE Strict #-}
module
Main
where
import
Control.Concurrent.Async
as
CCA
(
mapConcurrently
)
import
Control.Monad.IO.Class
import
Data.Aeson
import
Data.Aeson
(
ToJSON
,
encode
)
import
Data.List.Split
(
chunksOf
)
import
Data.Map.Strict
qualified
as
DM
import
Data.Text
(
pack
)
...
...
@@ -28,14 +25,12 @@ import Data.Text.Lazy qualified as DTL
import
Data.Text.Lazy.Encoding
qualified
as
TLE
import
Data.Tuple.Extra
(
both
)
import
Data.Vector
qualified
as
DV
import
GHC.Generics
import
Gargantext.Core.Text.Context
import
Gargantext.Core.Text.Context
(
TermList
)
import
Gargantext.Core.Text.Corpus.Parsers.CSV
(
readCSVFile
,
csv_title
,
csv_abstract
,
csv_publication_year
,
fromMIntOrDec
,
defaultYear
)
import
Gargantext.Core.Text.List.Formats.CSV
(
csvMapTermList
)
import
Gargantext.Core.Text.Metrics.Count
(
coocOnContexts
,
Coocs
)
import
Gargantext.Core.Text.Terms.WithList
import
Gargantext.Prelude
hiding
(
show
)
import
Protolude
import
Gargantext.Core.Text.Terms.WithList
(
Patterns
,
buildPatterns
,
extractTermsWithList
)
import
Gargantext.Prelude
import
System.IO
(
hFlush
)
------------------------------------------------------------------------
...
...
cabal.project
View file @
d3303c27
...
...
@@ -131,7 +131,8 @@ source-repository-package
source
-
repository
-
package
type
:
git
location
:
https
://
gitlab
.
iscpif
.
fr
/
gargantext
/
haskell
-
gargantext
-
prelude
tag
:
618f711
a530df56caefbb1577c4bf3d5ff45e214
--
tag
:
618f711
a530df56caefbb1577c4bf3d5ff45e214
tag
:
d4f9bee483d41bbdf8ab4e09efb5a5a8216edff4
source
-
repository
-
package
type
:
git
...
...
src/Gargantext/API/Admin/Auth/Types.hs
View file @
d3303c27
...
...
@@ -13,11 +13,9 @@ Portability : POSIX
module
Gargantext.API.Admin.Auth.Types
where
import
Control.Lens
hiding
(
elements
,
to
)
import
Data.Aeson.TH
(
deriveJSON
)
import
qualified
Data.Aeson.TH
as
JSON
import
Data.List
(
tail
)
import
Data.Swagger
import
Data.Swagger
(
ToSchema
(
..
),
genericDeclareNamedSchema
)
import
Gargantext.Core.Types.Individu
(
Username
,
GargPassword
(
..
),
arbitraryUsername
,
arbitraryPassword
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
(
..
),
ListId
,
DocId
,
UserId
(
..
))
...
...
src/Gargantext/API/Count.hs
View file @
d3303c27
...
...
@@ -19,16 +19,13 @@ Count API part of Gargantext.
module
Gargantext.API.Count
where
import
Data.Aeson
hiding
(
Error
)
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Either
import
Data.Swagger
import
Data.Swagger
(
ToSchema
(
..
),
genericDeclareNamedSchema
)
import
Data.Text
(
pack
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Prelude
import
Servant
import
Servant
(
JSON
,
Post
)
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
import
Test.QuickCheck.Arbitrary
(
Arbitrary
(
..
))
-----------------------------------------------------------------------
-- TODO-ACCESS: CanCount
...
...
src/Gargantext/API/Errors/Types.hs
View file @
d3303c27
{-|
Module : Gargantext.API.Errors.Types
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RecordWildCards #-}
...
...
@@ -8,7 +18,6 @@
{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeFamilyDependencies #-}
{-# OPTIONS_GHC -Wno-unused-top-binds #-}
{-# OPTIONS_GHC -Wno-orphans #-}
-- instance IsFrontendErrorData and stage restriction
...
...
@@ -36,32 +45,28 @@ module Gargantext.API.Errors.Types (
,
genFrontendErr
)
where
import
Control.Exception
import
Control.Lens
(
makePrisms
)
import
Control.Monad.Fail
(
fail
)
import
Data.Aeson
(
FromJSON
(
..
),
ToJSON
(
..
),
Value
(
..
),
(
.:
),
(
.=
),
object
,
withObject
,
toJSON
)
import
Data.Aeson
(
Value
(
..
),
(
.:
),
(
.=
),
object
,
withObject
)
import
Data.Aeson.Types
(
typeMismatch
,
emptyArray
)
import
Data.List.NonEmpty
qualified
as
NE
import
Data.Singletons.TH
import
Data.Singletons.TH
(
SingI
(
sing
),
SingKind
(
fromSing
)
)
import
Data.Text
qualified
as
T
import
Data.Typeable
import
Data.Validity
(
Validation
(
..
),
ValidationChain
(
..
),
prettyValidation
)
import
GHC.Generics
import
GHC.Stack
import
Gargantext.API.Admin.Auth.Types
(
AuthenticationError
)
import
Gargantext.API.Errors.Class
import
Gargantext.API.Errors.TH
import
Gargantext.API.Errors.Class
(
HasAuthenticationError
(
..
))
import
Gargantext.API.Errors.TH
(
deriveIsFrontendErrorData
)
import
Gargantext.API.Errors.Types.Backend
import
Gargantext.Core.Types
(
HasValidationError
(
..
))
import
Gargantext.Core.Types.Individu
import
Gargantext.Core.Types.Individu
(
Username
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Query.Table.Node.Error
import
Gargantext.Database.Query.Tree.Error
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
(
..
),
NodeError
)
import
Gargantext.Database.Query.Tree.Error
(
HasTreeError
(
..
),
TreeError
)
import
Gargantext.Prelude
hiding
(
Location
,
WithStacktrace
)
import
Gargantext.Utils.Dict
import
Gargantext.Utils.Dict
(
Dict
(
..
))
import
Gargantext.Utils.Jobs.Monad
qualified
as
Jobs
import
Servant
(
ServerError
)
import
Servant.Job.Core
import
Servant.Job.Core
(
HasServerError
(
..
)
)
import
Servant.Job.Types
qualified
as
SJ
import
Test.QuickCheck
import
Test.QuickCheck.Instances.Text
()
...
...
src/Gargantext/API/GraphQL/Utils.hs
View file @
d3303c27
...
...
@@ -12,8 +12,7 @@ Portability : POSIX
module
Gargantext.API.GraphQL.Utils
where
import
Control.Lens
((
^.
))
import
Control.Lens.Getter
(
view
)
import
Control.Lens
(
view
)
import
Data.Morpheus.Types
(
GQLTypeOptions
,
fieldLabelModifier
)
import
Data.Text
qualified
as
T
import
Gargantext.API.Admin.Auth.Types
(
AuthenticatedUser
(
..
),
auth_node_id
)
...
...
src/Gargantext/API/Ngrams.hs
View file @
d3303c27
...
...
@@ -86,7 +86,7 @@ module Gargantext.API.Ngrams
)
where
import
Control.Lens
(
(
.~
),
view
,
(
^.
),
(
^..
),
(
+~
),
(
%~
),
(
.
~
),
msumOf
,
at
,
ix
,
_Just
,
Each
(
..
),
(
%%~
),
ifolded
,
to
,
withIndex
,
over
)
import
Control.Lens
(
view
,
(
^..
),
(
+~
),
(
%
~
),
msumOf
,
at
,
ix
,
_Just
,
Each
(
..
),
(
%%~
),
ifolded
,
to
,
withIndex
,
over
)
import
Data.Aeson.Text
qualified
as
DAT
import
Data.List
qualified
as
List
import
Data.Map.Strict
qualified
as
Map
...
...
src/Gargantext/API/Ngrams/NgramsTree.hs
View file @
d3303c27
...
...
@@ -14,18 +14,18 @@ Portability : POSIX
module
Gargantext.API.Ngrams.NgramsTree
where
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.List
qualified
as
List
import
Data.Set
qualified
as
Set
import
Data.Swagger
import
Data.Tree
import
Data.Swagger
(
ToSchema
(
..
),
genericDeclareNamedSchema
)
import
Data.Tree
(
Tree
(
Node
),
unfoldForest
)
import
Gargantext.API.Ngrams.Types
import
Gargantext.Core.Types
(
ListType
(
..
),
NodeId
)
import
Gargantext.Core.Types.Main
(
ListType
(
..
)
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Prelude
import
Test.QuickCheck
import
Test.QuickCheck
(
Arbitrary
(
arbitrary
)
)
type
Children
=
Text
type
Root
=
Text
...
...
src/Gargantext/API/Ngrams/Tools.hs
View file @
d3303c27
...
...
@@ -17,7 +17,7 @@ module Gargantext.API.Ngrams.Tools
where
-- import Gargantext.Core.NodeStoryFile qualified as NSF
import
Control.Lens
(
_Just
,
(
^.
),
at
,
ix
,
view
,
At
,
Index
,
IxValue
)
import
Control.Lens
(
_Just
,
at
,
ix
,
view
,
At
,
Index
,
IxValue
)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.HashMap.Strict
qualified
as
HM
import
Data.Map.Strict
qualified
as
Map
...
...
src/Gargantext/API/Ngrams/Types.hs
View file @
d3303c27
...
...
@@ -19,9 +19,8 @@ module Gargantext.API.Ngrams.Types where
import
Codec.Serialise
(
Serialise
())
import
Control.Category
((
>>>
))
import
Control.Lens
(
make
Lenses
,
makePrisms
,
Iso
'
,
iso
,
from
,
(
.~
),
(
.=
),
(
?=
),
(
#
),
to
,
folded
,
{-withIndex, ifolded,-}
view
,
use
,
(
^.
),
(
^?
),
(
%~
),
(
.
~
),
(
%=
),
at
,
_Just
,
Each
(
..
),
itraverse_
,
both
,
forOf_
,
(
?~
),
over
)
import
Control.Lens
(
make
Prisms
,
Iso
'
,
iso
,
from
,
(
.=
),
(
?=
),
(
#
),
to
,
folded
,
{-withIndex, ifolded,-}
view
,
use
,
(
^?
),
(
%
~
),
(
%=
),
at
,
_Just
,
Each
(
..
),
itraverse_
,
both
,
forOf_
,
(
?~
),
over
)
import
Data.Aeson
hiding
((
.=
))
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Csv
(
defaultEncodeOptions
,
encodeByNameWith
,
header
,
namedRecord
,
EncodeOptions
(
..
),
NamedRecord
,
Quoting
(
QuoteNone
))
import
Data.Csv
qualified
as
Csv
import
Data.HashMap.Strict.InsOrd
qualified
as
InsOrdHashMap
...
...
src/Gargantext/API/Node.hs
View file @
d3303c27
...
...
@@ -28,27 +28,25 @@ Node API
module
Gargantext.API.Node
where
import
Control.Lens
((
^.
))
import
Data.Aeson
(
FromJSON
,
ToJSON
)
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Swagger
import
Data.Swagger
(
ToSchema
)
import
Gargantext.API.Admin.Auth
(
withAccess
,
withPolicy
)
import
Gargantext.API.Admin.Auth.Types
(
PathId
(
..
),
AuthenticatedUser
(
..
),
auth_node_id
)
import
Gargantext.API.Admin.EnvTypes
import
Gargantext.API.Auth.PolicyCheck
import
Gargantext.API.Errors.Types
import
Gargantext.API.Admin.EnvTypes
(
Env
)
import
Gargantext.API.Auth.PolicyCheck
(
PolicyChecked
,
nodeChecks
)
import
Gargantext.API.Errors.Types
(
BackendInternalError
)
import
Gargantext.API.Metrics
import
Gargantext.API.Ngrams
(
TableNgramsApi
,
apiNgramsTableCorpus
)
import
Gargantext.API.Ngrams.Types
(
TabType
(
..
))
import
Gargantext.API.Node.DocumentUpload
qualified
as
DocumentUpload
import
Gargantext.API.Node.File
import
Gargantext.API.Node.DocumentsFromWriteNodes
qualified
as
DFWN
import
Gargantext.API.Node.File
(
FileAsyncApi
,
FileApi
,
fileApi
,
fileAsyncApi
)
import
Gargantext.API.Node.FrameCalcUpload
qualified
as
FrameCalcUpload
import
Gargantext.API.Node.New
import
Gargantext.API.Node.New
(
PostNodeAsync
,
PostNode
,
postNode
,
postNodeAsyncAPI
)
import
Gargantext.API.Node.Share
qualified
as
Share
import
Gargantext.API.Node.Update
qualified
as
Update
import
Gargantext.API.Prelude
import
Gargantext.API.Prelude
(
GargM
,
GargServer
)
import
Gargantext.API.Search
qualified
as
Search
import
Gargantext.API.Table
import
Gargantext.API.Table
(
TableApi
,
tableApi
,
getPair
)
import
Gargantext.Core.Types
(
NodeTableResult
)
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Core.Types.Main
(
Tree
,
NodeTree
)
...
...
@@ -57,10 +55,11 @@ import Gargantext.Core.Utils.Prefix (unPrefix)
import
Gargantext.Core.Viz.Phylo.API
(
PhyloAPI
,
phyloAPI
)
import
Gargantext.Database.Action.Delete
qualified
as
Action
(
deleteNode
)
import
Gargantext.Database.Action.Flow.Pairing
(
pairing
)
import
Gargantext.Database.Admin.Types.Hyperdata
import
Gargantext.Database.Admin.Types.Hyperdata.Prelude
(
HyperdataC
)
import
Gargantext.Database.Admin.Types.Hyperdata.User
(
HyperdataUser
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Prelude
(
Cmd
,
JSONB
)
import
Gargantext.Database.Query.Facet
(
FacetDoc
,
OrderBy
(
..
)
)
import
Gargantext.Database.Query.Facet
.Types
(
FacetDoc
,
OrderBy
(
..
)
)
import
Gargantext.Database.Query.Table.Node
import
Gargantext.Database.Query.Table.Node.Children
(
getChildren
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
(
..
))
...
...
@@ -74,7 +73,6 @@ import Gargantext.Prelude
import
Servant
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
import
qualified
Gargantext.API.Node.DocumentsFromWriteNodes
as
DFWN
-- | Admin NodesAPI
...
...
src/Gargantext/API/Node/Corpus/New.hs
View file @
d3303c27
...
...
@@ -21,26 +21,26 @@ module Gargantext.API.Node.Corpus.New
import
Conduit
import
Control.Lens
hiding
(
elements
,
Empty
)
import
Data.Aeson
import
Data.Aeson.TH
(
deriveJSON
)
import
Control.Lens
(
view
,
non
)
import
Data.Aeson
(
genericParseJSON
,
genericToJSON
)
import
Data.ByteString.Base64
qualified
as
BSB64
import
Data.Conduit.Internal
(
zipSources
)
import
Data.Swagger
import
Data.Swagger
(
ToSchema
(
..
),
genericDeclareNamedSchema
)
import
Data.Text
qualified
as
T
import
Data.Text.Encoding
qualified
as
TE
import
EPO.API.Client.Types
qualified
as
EPO
import
Gargantext.API.Admin.Orchestrator.Types
(
JobLog
(
..
),
AsyncJobs
)
import
Gargantext.API.Admin.Types
(
HasSettings
)
import
Gargantext.API.Ngrams
(
commitStatePatch
,
Versioned
(
..
))
import
Gargantext.API.Node.Corpus.New.Types
import
Gargantext.API.Node.Corpus.Searx
import
Gargantext.API.Node.Corpus.Types
import
Gargantext.API.Node.Corpus.New.Types
(
FileFormat
(
..
),
FileType
(
..
)
)
import
Gargantext.API.Node.Corpus.Searx
(
triggerSearxSearch
)
import
Gargantext.API.Node.Corpus.Types
(
Database
,
Datafield
(
Web
),
database2origin
)
import
Gargantext.API.Node.Corpus.Update
(
addLanguageToCorpus
)
import
Gargantext.API.Node.Types
import
Gargantext.Core
(
Lang
(
..
),
withDefaultLanguage
,
defaultLanguage
)
import
Gargantext.Core.NodeStory
(
HasNodeStoryImmediateSaver
,
HasNodeArchiveStoryImmediateSaver
,
currentVersion
,
NgramsStatePatch
'
)
import
Gargantext.Core.Text.Corpus.API
qualified
as
API
import
Gargantext.API.Admin.Orchestrator.Types
qualified
as
API
import
Gargantext.Core.Text.Corpus.Query
qualified
as
API
import
Gargantext.Core.Text.Corpus.Parsers
qualified
as
Parser
(
FileType
(
..
),
parseFormatC
)
import
Gargantext.Core.Text.List.Social
(
FlowSocialListWith
(
..
))
import
Gargantext.Core.Types.Individu
(
User
(
..
))
...
...
@@ -50,7 +50,8 @@ import Gargantext.Database.Action.Flow.Types (FlowCmdM)
import
Gargantext.Database.Action.Mail
(
sendMail
)
import
Gargantext.Database.Action.Node
(
mkNodeWithParent
)
import
Gargantext.Database.Action.User
(
getUserId
)
import
Gargantext.Database.Admin.Types.Hyperdata
import
Gargantext.Database.Admin.Types.Hyperdata.Document
(
ToHyperdataDocument
(
..
)
)
import
Gargantext.Database.Admin.Types.Hyperdata.File
(
HyperdataFile
(
..
)
)
import
Gargantext.Database.Admin.Types.Node
(
CorpusId
,
NodeType
(
..
),
ParentId
)
import
Gargantext.Database.GargDB
qualified
as
GargDB
import
Gargantext.Database.Prelude
(
hasConfig
)
...
...
@@ -60,11 +61,11 @@ import Gargantext.Database.Query.Tree.Root (MkCorpusUser(MkCorpusUserNormalCorpu
import
Gargantext.Database.Schema.Node
(
node_hyperdata
)
import
Gargantext.Prelude
import
Gargantext.Prelude.Config
(
gc_max_docs_parsers
)
import
Gargantext.System.Logging
import
Gargantext.Utils.Jobs
(
JobHandle
,
MonadJobStatus
(
..
))
import
Servant
import
Gargantext.System.Logging
(
logLocM
,
LogLevel
(
..
)
)
import
Gargantext.Utils.Jobs
.Monad
(
JobHandle
,
MonadJobStatus
(
..
))
import
Servant
(
JSON
,
type
(
:>
),
FormUrlEncoded
,
Capture
,
Summary
)
import
Servant.Job.Utils
(
jsonOptions
)
import
Test.QuickCheck.Arbitrary
import
Test.QuickCheck.Arbitrary
(
Arbitrary
(
..
))
------------------------------------------------------------------------
{-
...
...
src/Gargantext/API/Node/Corpus/New/File.hs
View file @
d3303c27
...
...
@@ -12,24 +12,22 @@ Portability : POSIX
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
module
Gargantext.API.Node.Corpus.New.File
where
import
Control.Lens
((
.~
),
(
?~
))
import
Data.Maybe
import
Control.Lens
((
?~
))
import
Data.Swagger
import
Gargantext.API.Node.Corpus.New.Types
import
Gargantext.API.Node.Corpus.New.Types
(
FileFormat
,
FileType
)
import
Gargantext.Core.Types
(
TODO
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Node
(
NodeId
)
import
Gargantext.Database.Prelude
(
Cmd
)
import
Gargantext.Prelude
hiding
(
hash
)
import
Gargantext.Prelude.Crypto.Hash
(
hash
)
import
Servant
import
Servant.Multipart
import
Servant.Swagger.Internal
import
Servant
(
JSON
,
type
(
:>
),
Post
,
QueryParam
,
Summary
)
import
Servant.Multipart
(
Input
(
iName
),
Mem
,
MultipartData
(
inputs
),
MultipartForm
)
import
Servant.Swagger.Internal
(
addParam
,
HasSwagger
(
..
)
)
-------------------------------------------------------------
type
Hash
=
Text
...
...
src/Gargantext/API/Node/Corpus/Searx.hs
View file @
d3303c27
...
...
@@ -15,7 +15,6 @@ module Gargantext.API.Node.Corpus.Searx where
import
Control.Lens
(
view
)
import
Data.Aeson
qualified
as
Aeson
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.Text
qualified
as
T
import
Data.Text
qualified
as
Text
...
...
@@ -25,7 +24,7 @@ import Data.Tuple.Select (sel1, sel2, sel3)
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Core.NLP
(
HasNLPServer
,
nlpServerGet
)
import
Gargantext.Core.NodeStory.Types
(
HasNodeStory
)
import
Gargantext.Core.Text.Corpus.
API
qualified
as
API
import
Gargantext.Core.Text.Corpus.
Query
qualified
as
Query
import
Gargantext.Core.Text.List
(
buildNgramsLists
)
import
Gargantext.Core.Text.List.Group.WithStem
(
{-StopSize(..),-}
GroupParams
(
..
))
import
Gargantext.Core.Text.Terms
(
TermType
(
..
))
...
...
@@ -44,10 +43,10 @@ import Gargantext.Database.Query.Table.Node.Error (HasNodeError)
import
Gargantext.Database.Query.Tree.Error
(
HasTreeError
)
import
Gargantext.Database.Query.Tree.Root
(
getOrMkRootWithCorpus
,
MkCorpusUser
(
MkCorpusUserMaster
))
import
Gargantext.Prelude
hiding
(
All
)
import
Gargantext.Prelude.Config
import
Gargantext.Utils.Jobs
(
JobHandle
,
MonadJobStatus
(
..
))
import
Gargantext.Prelude.Config
(
GargConfig
(
..
))
import
Gargantext.Utils.Jobs
.Monad
(
JobHandle
,
MonadJobStatus
(
..
))
import
Network.HTTP.Client
import
Network.HTTP.Client.TLS
import
Network.HTTP.Client.TLS
(
tlsManagerSettings
)
import
Prelude
qualified
langToSearx
::
Lang
->
Text
...
...
@@ -167,7 +166,7 @@ triggerSearxSearch :: ( MonadBase IO m
,
MonadJobStatus
m
)
=>
User
->
CorpusId
->
API
.
RawQuery
->
Query
.
RawQuery
->
Lang
->
JobHandle
m
->
m
()
...
...
@@ -195,7 +194,7 @@ triggerSearxSearch user cId q l jobHandle = do
res
<-
liftBase
$
fetchSearxPage
$
FetchSearxParams
{
_fsp_language
=
l
,
_fsp_manager
=
manager
,
_fsp_pageno
=
page
,
_fsp_query
=
API
.
getRawQuery
q
,
_fsp_query
=
Query
.
getRawQuery
q
,
_fsp_url
=
surl
}
insertSearxResponse
user
cId
listId
l
res
...
...
src/Gargantext/API/Node/Corpus/Types.hs
View file @
d3303c27
...
...
@@ -13,17 +13,16 @@ Portability : POSIX
module
Gargantext.API.Node.Corpus.Types
where
import
Control.Lens
hiding
(
elements
,
Empty
)
import
Control.Lens
(
(
?~
)
)
import
Control.Monad.Fail
(
fail
)
import
Data.Aeson
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Aeson
(
Value
(
..
),
(
.:
),
withText
,
object
)
import
Data.Swagger
import
Data.Text
qualified
as
T
import
Gargantext.API.Admin.Orchestrator.Types
qualified
as
Types
import
Gargantext.Core.Utils.Prefix
(
unPrefix
)
import
Gargantext.Database.Action.Flow
(
DataOrigin
(
..
))
import
Gargantext.Database.Action.Flow
.Types
(
DataOrigin
(
..
))
import
Gargantext.Prelude
import
Test.QuickCheck
import
Test.QuickCheck
(
Arbitrary
(
..
),
oneof
,
arbitraryBoundedEnum
)
data
Database
=
Empty
|
OpenAlex
...
...
src/Gargantext/API/Node/DocumentUpload.hs
View file @
d3303c27
...
...
@@ -16,8 +16,8 @@ Portability : POSIX
module
Gargantext.API.Node.DocumentUpload
where
import
Control.Lens
(
makeLenses
,
view
)
import
Data.Aeson
import
Control.Lens
(
view
)
import
Data.Aeson
(
Options
(
..
),
genericParseJSON
,
defaultOptions
,
genericToJSON
,
SumEncoding
(
..
)
)
import
Data.Swagger
(
ToSchema
)
import
Data.Text
qualified
as
T
import
Gargantext.API.Admin.EnvTypes
(
GargJob
(
..
),
Env
)
...
...
src/Gargantext/API/Node/DocumentsFromWriteNodes.hs
View file @
d3303c27
...
...
@@ -16,8 +16,7 @@ module Gargantext.API.Node.DocumentsFromWriteNodes
where
import
Conduit
(
yieldMany
)
import
Control.Lens
((
^.
))
import
Data.Aeson
(
genericParseJSON
,
defaultOptions
,
genericToJSON
,
FromJSON
(
parseJSON
),
ToJSON
(
toJSON
)
)
import
Data.Aeson
(
genericParseJSON
,
defaultOptions
,
genericToJSON
)
import
Data.List
qualified
as
List
import
Data.Swagger
(
ToSchema
)
import
Data.Text
qualified
as
T
...
...
src/Gargantext/API/Node/File.hs
View file @
d3303c27
...
...
@@ -17,35 +17,31 @@ Portability : POSIX
module
Gargantext.API.Node.File
where
import
Control.Lens
((
^.
))
import
Data.ByteString
qualified
as
BS
import
Data.ByteString.Lazy
qualified
as
BSL
import
Data.MIME.Types
qualified
as
DMT
import
Data.Swagger
import
Data.Swagger
(
ToSchema
(
..
))
import
Data.Text
qualified
as
T
import
Data.Text
import
Servant
import
qualified
Gargantext.Database.GargDB
as
GargDB
import
qualified
Network.HTTP.Media
as
M
import
Data.Either
import
Gargantext.API.Admin.Auth.Types
import
Gargantext.API.Admin.Auth.Types
(
AuthenticatedUser
,
auth_user_id
)
import
Gargantext.API.Admin.EnvTypes
(
GargJob
(
..
),
Env
)
import
Gargantext.API.Admin.Orchestrator.Types
(
JobLog
(
..
),
AsyncJobs
)
import
Gargantext.API.Admin.Types
(
HasSettings
)
import
Gargantext.API.Errors.Types
import
Gargantext.API.Node.Types
import
Gargantext.API.Prelude
import
Gargantext.API.Errors.Types
(
BackendInternalError
)
import
Gargantext.API.Node.Types
(
NewWithFile
(
NewWithFile
)
)
import
Gargantext.API.Prelude
(
GargM
,
GargServer
)
import
Gargantext.Core.Types
(
TODO
)
import
Gargantext.Database.Action.Flow.Types
import
Gargantext.Database.Action.Flow.Types
(
FlowCmdM
)
import
Gargantext.Database.Action.Node
(
mkNodeWithParent
)
import
Gargantext.Database.Admin.Types.Hyperdata.File
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Hyperdata.File
(
HyperdataFile
(
..
)
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
NodeType
(
..
)
)
import
Gargantext.Database.GargDB
qualified
as
GargDB
import
Gargantext.Database.Query.Table.Node
(
getNodeWith
)
import
Gargantext.Database.Query.Table.Node.UpdateOpaleye
(
updateHyperdata
)
import
Gargantext.Database.Schema.Node
(
node_hyperdata
)
import
Gargantext.Prelude
import
Gargantext.Utils.Jobs
(
serveJobsAPI
,
MonadJobStatus
(
..
))
import
Network.HTTP.Media
qualified
as
M
import
Servant
data
RESPONSE
deriving
Typeable
...
...
src/Gargantext/API/Node/FrameCalcUpload.hs
View file @
d3303c27
...
...
@@ -15,8 +15,6 @@ Portability : POSIX
module
Gargantext.API.Node.FrameCalcUpload
where
import
Control.Lens
((
^.
))
import
Data.Aeson
(
FromJSON
,
ToJSON
)
import
Data.ByteString.Lazy
qualified
as
BSL
import
Data.ByteString.UTF8
qualified
as
BSU8
import
Data.Swagger
(
ToSchema
)
...
...
src/Gargantext/API/Node/Share.hs
View file @
d3303c27
...
...
@@ -63,8 +63,8 @@ api :: (HasNodeError err, HasNLPServer env, CmdRandom env err m)
api
userInviting
nId
(
ShareTeamParams
user'
)
=
do
let
user''
=
Text
.
toLower
user'
user
<-
case
guessUserName
user''
of
Nothing
->
pure
user''
Just
(
u
,
_
)
->
do
Nothing
->
pure
user''
Just
(
u
,
_
)
->
do
isRegistered
<-
getUserId'
(
UserName
u
)
case
isRegistered
of
Right
_
->
do
...
...
@@ -72,7 +72,7 @@ api userInviting nId (ShareTeamParams user') = do
pure
u
Left
_err
->
do
username'
<-
getUsername
userInviting
_
<-
case
List
.
elem
username'
arbitraryUsername
of
_
<-
case
username'
`
List
.
elem
`
arbitraryUsername
of
True
->
do
-- printDebug "[G.A.N.Share.api]" ("Demo users are not allowed to invite" :: Text)
pure
()
...
...
src/Gargantext/API/Public.hs
View file @
d3303c27
...
...
@@ -15,27 +15,28 @@ Portability : POSIX
module
Gargantext.API.Public
where
import
Control.Lens
((
^?
),
(
^.
),
_Just
)
import
Data.Aeson
import
Control.Lens
((
^?
),
_Just
)
import
Data.Aeson
(
Options
(
sumEncoding
),
genericParseJSON
,
defaultOptions
,
genericToJSON
)
import
Data.List
qualified
as
List
import
Data.Map.Strict
qualified
as
Map
import
Data.Set
qualified
as
Set
import
Data.Swagger
hiding
(
title
,
url
)
import
Gargantext.API.Node.File
import
Gargantext.API.Prelude
import
Data.Swagger
(
ToSchema
)
import
Gargantext.API.Node.File
(
FileApi
,
fileApi
)
import
Gargantext.API.Prelude
(
serverError
,
GargServer
)
import
Gargantext.Core.Utils.DateUtils
(
utc2year
)
import
Gargantext.Database.Admin.Types.Hyperdata
import
Gargantext.Database.Admin.Types.Hyperdata.Corpus
(
hc_fields
)
import
Gargantext.Database.Admin.Types.Hyperdata.Folder
(
HyperdataFolder
)
import
Gargantext.Database.Admin.Types.Hyperdata.CorpusField
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Node
(
NodeId
(
..
),
Node
,
unNodeId
)
import
Gargantext.Database.Prelude
(
Cmd
,
DBCmd
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
(
..
))
import
Gargantext.Database.Query.Table.NodeNode
(
selectPublicNodes
)
import
Gargantext.Database.Schema.Node
-- (NodePoly(..))
import
Gargantext.Database.Schema.Node
(
NodePoly
(
..
),
node_date
,
node_hyperdata
)
-- (NodePoly(..))
import
Gargantext.Prelude
import
Gargantext.Utils.Aeson
qualified
as
GUA
import
Servant
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
import
Test.QuickCheck.Arbitrary
(
Arbitrary
(
arbitrary
)
)
------------------------------------------------------------------------
type
API
=
API_Home
...
...
src/Gargantext/API/Server.hs
View file @
d3303c27
...
...
@@ -13,9 +13,10 @@ Portability : POSIX
module
Gargantext.API.Server
where
import
Control.Lens
((
^.
))
import
Control.Monad.Catch
(
catch
,
throwM
)
import
Data.ByteString.Lazy
qualified
as
BL
import
Data.Text
qualified
as
T
import
Data.Text.Encoding
qualified
as
TE
import
Data.Version
(
showVersion
)
import
Gargantext.API.Admin.Auth
(
auth
,
forgotPassword
,
forgotPasswordAsync
)
import
Gargantext.API.Admin.Auth.Types
(
AuthContext
)
...
...
@@ -24,20 +25,18 @@ import Gargantext.API.Admin.FrontEnd (frontEndServer)
import
Gargantext.API.Auth.PolicyCheck
()
import
Gargantext.API.Errors
import
Gargantext.API.GraphQL
qualified
as
GraphQL
import
Gargantext.API.Prelude
import
Gargantext.API.Prelude
(
GargM
,
GargServer
)
import
Gargantext.API.Public
qualified
as
Public
import
Gargantext.API.Routes
import
Gargantext.API.Routes
(
API
,
GargVersion
,
GargAPI
)
import
Gargantext.API.Swagger
(
swaggerDoc
)
import
Gargantext.API.ThrowAll
(
serverPrivateGargAPI
)
import
Gargantext.Database.Prelude
(
hasConfig
)
import
Gargantext.Prelude
hiding
(
Handler
,
catch
)
import
Gargantext.Prelude.Config
(
gc_url_backend_api
)
import
Gargantext.System.Logging
import
Gargantext.System.Logging
(
logLocM
,
LogLevel
(
..
))
import
Paths_gargantext
qualified
as
PG
-- cabal magic build module
import
Servant
import
Servant.Swagger.UI
(
swaggerSchemaUIServer
)
import
qualified
Data.ByteString.Lazy
as
BL
import
qualified
Data.Text.Encoding
as
TE
serverGargAPI
::
Text
->
ServerT
GargAPI
(
GargM
Env
BackendInternalError
)
...
...
src/Gargantext/API/Table.hs
View file @
d3303c27
...
...
@@ -31,9 +31,7 @@ Node API
module
Gargantext.API.Table
where
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Maybe
import
Data.Swagger
import
Data.Swagger
(
ToSchema
(
..
),
genericDeclareNamedSchema
)
import
Data.Text
qualified
as
T
import
Gargantext.API.HashedResponse
import
Gargantext.API.Ngrams.Types
(
TabType
(
..
))
...
...
src/Gargantext/Core/NodeStory.hs
View file @
d3303c27
...
...
@@ -63,7 +63,7 @@ module Gargantext.Core.NodeStory
,
getParentsChildren
)
where
import
Control.Lens
((
^.
),
(
.~
),
(
%~
),
non
,
_Just
,
at
,
over
,
view
)
import
Control.Lens
((
%~
),
non
,
_Just
,
at
,
over
,
view
)
import
Data.Map.Strict
qualified
as
Map
import
Data.Pool
(
Pool
,
withResource
)
import
Data.Set
qualified
as
Set
...
...
src/Gargantext/Core/NodeStory/DB.hs
View file @
d3303c27
...
...
@@ -25,7 +25,6 @@ module Gargantext.Core.NodeStory.DB
,
updateNodeStoryVersion
)
where
import
Control.Lens
((
^.
))
import
Data.HashMap.Strict
(
HashMap
)
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.Map.Strict
qualified
as
Map
...
...
@@ -41,7 +40,7 @@ import Gargantext.Database.Admin.Types.Node ( NodeId(..), NodeType )
import
Gargantext.Database.Admin.Config
()
import
Gargantext.Database.Schema.Ngrams
()
import
Gargantext.Prelude
hiding
(
to
)
import
Gargantext.Prelude.Database
import
Gargantext.Prelude.Database
(
runPGSExecute
,
runPGSExecuteMany
,
runPGSQuery
,
runPGSReturning
)
nodeExists
::
PGS
.
Connection
->
NodeId
->
IO
Bool
...
...
src/Gargantext/Core/NodeStory/Types.hs
View file @
d3303c27
...
...
@@ -48,7 +48,7 @@ module Gargantext.Core.NodeStory.Types
where
import
Codec.Serialise.Class
(
Serialise
)
import
Control.Lens
(
makeLenses
,
Getter
,
(
^.
)
)
import
Control.Lens
(
Getter
)
import
Data.Aeson
hiding
((
.=
),
decode
)
import
Data.Map.Strict
qualified
as
Map
import
Data.Profunctor.Product.TH
(
makeAdaptorAndInstance
)
...
...
src/Gargantext/Core/Text/Corpus/Parsers/Date.hs
View file @
d3303c27
...
...
@@ -22,7 +22,7 @@ module Gargantext.Core.Text.Corpus.Parsers.Date
{-(parse, parseRaw, dateSplit, Year, Month, Day)-}
where
import
Data.Aeson
(
toJSON
,
Value
)
import
Data.Aeson
(
Value
)
import
Data.Aeson
qualified
as
Json
import
Data.Aeson.KeyMap
as
KM
hiding
(
map
)
import
Data.HashSet
qualified
as
HashSet
...
...
@@ -30,16 +30,14 @@ import Data.List qualified as List
import
Data.Text
(
unpack
,
splitOn
,
replace
)
import
Data.Time
(
defaultTimeLocale
,
iso8601DateFormat
,
parseTimeM
,
toGregorian
)
import
Data.Time.Calendar
qualified
as
DTC
import
Data.Time.Clock
(
secondsToDiffTime
)
import
Data.Time.Clock
(
UTCTime
(
..
))
-- , getCurrentTime)
import
Data.Time.Clock
(
UTCTime
(
..
),
secondsToDiffTime
)
-- , getCurrentTime)
import
Data.Time.LocalTime
(
utc
)
import
Data.Time.LocalTime.TimeZone.Series
(
zonedTimeToZoneSeriesTime
)
import
Duckling.Api
(
analyze
)
import
Duckling.Core
(
makeLocale
,
Dimension
(
Time
))
import
Duckling.Core
qualified
as
DC
import
Duckling.Resolve
(
fromUTC
,
Context
(
Context
,
referenceTime
,
locale
),
DucklingTime
(
DucklingTime
),
Options
(
..
))
import
Duckling.Types
(
ResolvedToken
(
..
),
ResolvedVal
(
..
))
import
Duckling.Types
(
Seal
(
..
))
import
Duckling.Types
(
ResolvedToken
(
..
),
ResolvedVal
(
..
),
Seal
(
..
))
import
Gargantext.Core
(
Lang
(
FR
,
EN
))
-- import Gargantext.Core.Types (DebugMode(..), withDebugMode)
import
Gargantext.Prelude
hiding
(
replace
)
...
...
src/Gargantext/Core/Text/Corpus/Parsers/Gitlab.hs
View file @
d3303c27
...
...
@@ -13,7 +13,7 @@ module Gargantext.Core.Text.Corpus.Parsers.Gitlab (
Issue
(
..
),
gitlabIssue2hyperdataDocument
,
readFile_Issues
,
readFile_IssuesAsDocs
)
where
import
Data.Aeson
(
FromJSON
(
parseJSON
),
decode
,
(
.:
),
(
.:?
),
withObject
)
import
Data.Aeson
(
decode
,
(
.:
),
(
.:?
),
withObject
)
import
Data.ByteString.Lazy
qualified
as
DBL
import
Data.Text
qualified
as
DT
import
Data.Time
...
...
src/Gargantext/Core/Text/Corpus/Parsers/GrandDebat.hs
View file @
d3303c27
...
...
@@ -26,7 +26,6 @@ _flowCorpusDebat u n l fp = do
module
Gargantext.Core.Text.Corpus.Parsers.GrandDebat
where
import
Data.Aeson
(
ToJSON
,
FromJSON
)
import
Data.ByteString.Lazy
qualified
as
DBL
import
Data.JsonStream.Parser
qualified
as
P
import
Data.Text
qualified
as
Text
...
...
src/Gargantext/Core/Text/Corpus/Parsers/Isidore.hs
View file @
d3303c27
...
...
@@ -20,7 +20,6 @@ TODO:
module
Gargantext.Core.Text.Corpus.Parsers.Isidore
where
import
Control.Lens
(
(
^.
),
(
.~
)
)
import
Data.ByteString.Lazy
(
ByteString
)
import
Data.RDF
(
Node
(
LNode
,
UNode
),
LValue
(
PlainLL
,
TypedL
,
PlainL
)
)
import
Data.Text
qualified
as
T
...
...
src/Gargantext/Core/Text/Corpus/Parsers/Json2Csv.hs
View file @
d3303c27
...
...
@@ -17,8 +17,7 @@ Json parser to export towoard CSV GargV3 format.
module
Gargantext.Core.Text.Corpus.Parsers.Json2Csv
(
json2csv
,
readPatents
)
where
import
Data.Aeson
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Aeson
(
decode
)
import
Data.ByteString.Lazy
(
readFile
)
import
Data.Text
(
unpack
)
import
Data.Vector
(
fromList
)
...
...
src/Gargantext/Core/Text/Corpus/Parsers/Wikidata.hs
View file @
d3303c27
...
...
@@ -18,7 +18,6 @@ Portability : POSIX
module
Gargantext.Core.Text.Corpus.Parsers.Wikidata
where
import
Control.Lens
(
makeLenses
,
(
^.
)
)
import
Data.List
qualified
as
List
import
Data.Text
(
concat
)
import
Database.HSparql.Connection
(
BindingValue
,
EndPoint
,
selectQueryRaw
)
...
...
src/Gargantext/Core/Text/List/Group/Prelude.hs
View file @
d3303c27
...
...
@@ -16,11 +16,10 @@ Portability : POSIX
module
Gargantext.Core.Text.List.Group.Prelude
where
import
Control.Lens
(
makeLenses
,
view
,
set
,
over
)
import
Control.Lens
(
view
,
set
,
over
)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.List
qualified
as
List
import
Data.Monoid
import
Data.Semigroup
import
Data.Set
qualified
as
Set
import
Gargantext.API.Ngrams.Types
(
NgramsElement
,
mkNgramsElement
,
NgramsTerm
(
..
),
RootParent
(
..
),
mSetFromList
)
...
...
src/Gargantext/Core/Text/List/Group/WithStem.hs
View file @
d3303c27
...
...
@@ -17,7 +17,6 @@ Portability : POSIX
module
Gargantext.Core.Text.List.Group.WithStem
where
import
Control.Lens
(
makeLenses
)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.HashSet
(
HashSet
)
...
...
src/Gargantext/Core/Text/Metrics.hs
View file @
d3303c27
...
...
@@ -16,7 +16,6 @@ Mainly reexport functions in @Data.Text.Metrics@
module
Gargantext.Core.Text.Metrics
where
import
Control.Lens
(
makeLenses
)
import
Data.Array.Accelerate
qualified
as
DAA
import
Data.Array.Accelerate.Interpreter
qualified
as
DAA
import
Data.HashMap.Strict
(
HashMap
)
...
...
src/Gargantext/Core/Text/Metrics/Count.hs
View file @
d3303c27
...
...
@@ -32,7 +32,7 @@ import Data.List qualified as List
import
Data.Map.Strict
(
empty
,
singleton
,
insertWith
,
unionWith
,
unionsWith
,
mapKeys
)
import
Data.Map.Strict
qualified
as
DMS
import
Data.Text
(
pack
)
import
Gargantext.Core.Types
import
Gargantext.Core.Types
(
Terms
(
..
),
Stems
)
import
Gargantext.Prelude
hiding
(
empty
)
------------------------------------------------------------------------
...
...
src/Gargantext/Core/Text/Ngrams.hs
View file @
d3303c27
...
...
@@ -20,7 +20,7 @@ module Gargantext.Core.Text.Ngrams
import
Codec.Serialise
(
Serialise
())
import
Control.Lens
(
over
)
import
Data.Aeson
(
ToJSON
(
..
),
FromJSON
(
..
),
FromJSONKey
(
..
),
FromJSONKeyFunction
(
..
),
Value
(
String
),
ToJSONKey
(
..
)
)
import
Data.Aeson
(
FromJSONKey
(
..
),
FromJSONKeyFunction
(
..
),
Value
(
String
),
ToJSONKey
(
..
)
)
import
Data.Aeson.Types
(
toJSONKeyText
)
import
Data.Text
(
pack
)
import
Database.PostgreSQL.Simple
qualified
as
PGS
...
...
src/Gargantext/Core/Text/Terms.hs
View file @
d3303c27
...
...
@@ -37,7 +37,7 @@ compute graph
module
Gargantext.Core.Text.Terms
where
import
Control.Lens
(
(
^.
),
view
,
over
,
makeLenses
)
import
Control.Lens
(
view
,
over
)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.List
qualified
as
List
...
...
src/Gargantext/Core/Text/Terms/Multi/PosTagging/Types.hs
View file @
d3303c27
...
...
@@ -15,8 +15,7 @@ Portability : POSIX
module
Gargantext.Core.Text.Terms.Multi.PosTagging.Types
where
import
Data.Aeson.TH
(
deriveJSON
)
import
Gargantext.Core.Types
import
Gargantext.Core.Types
(
NER
,
POS
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
)
import
Gargantext.Prelude
...
...
src/Gargantext/Core/Types.hs
View file @
d3303c27
...
...
@@ -31,19 +31,12 @@ module Gargantext.Core.Types ( module Gargantext.Core.Types.Main
,
TODO
(
..
)
)
where
import
Control.Lens
(
Prism
'
,
(
#
),
makeLenses
,
over
)
import
Data.Aeson
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Maybe
import
Data.Monoid
import
Data.Semigroup
import
Control.Lens
(
Prism
'
,
(
#
),
over
)
import
Data.Aeson
(
withText
)
import
Data.Set
(
empty
)
import
Data.String
import
Data.Swagger
(
ToParamSchema
)
import
Data.Swagger
(
ToSchema
(
..
))
import
Data.Swagger
(
ToParamSchema
,
ToSchema
(
..
))
import
Data.Text
(
unpack
)
import
Data.Validity
import
GHC.Generics
import
Data.Validity
(
validationIsValid
,
Validation
)
import
Gargantext.Core.Types.Main
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
wellNamedSchema
)
import
Gargantext.Database.Admin.Types.Node
...
...
src/Gargantext/Core/Types/Main.hs
View file @
d3303c27
...
...
@@ -17,12 +17,10 @@ Portability : POSIX
module
Gargantext.Core.Types.Main
where
------------------------------------------------------------------------
import
Data.Aeson
(
FromJSON
,
ToJSON
)
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Bimap
(
Bimap
)
import
Data.Swagger
import
Data.Swagger
(
ToSchema
(
..
),
ToParamSchema
,
genericDeclareNamedSchema
)
import
Data.Text
(
unpack
,
pack
)
import
Gargantext.Core
import
Gargantext.Core
(
HasDBid
(
..
)
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
,
wellNamedSchema
)
import
Gargantext.Database.Admin.Types.Node
-- (NodeType(..), Node, Hyperdata(..))
import
Gargantext.Prelude
...
...
src/Gargantext/Core/Types/Phylo.hs
View file @
d3303c27
...
...
@@ -27,22 +27,17 @@ Phylomemy was first described in Chavalarias, D., Cointet, J.-P., 2013. Phylomem
module
Gargantext.Core.Types.Phylo
where
import
Control.DeepSeq
import
Control.Lens
(
makeLenses
)
import
Control.Monad.Fail
(
fail
)
import
Data.Aeson
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Aeson.Types
import
Data.Maybe
import
Data.Monoid
import
Data.Swagger
import
Data.Aeson
(
Value
(
..
),
(
.:
),
(
.:?
),
withObject
,
object
,
KeyValue
((
.=
))
)
import
Data.Aeson.Types
(
parseMaybe
)
import
Data.Swagger
(
NamedSchema
(
..
),
ToSchema
(
..
),
genericDeclareNamedSchema
,
defaultSchemaOptions
)
import
Data.Text
qualified
as
T
import
Data.Time.Clock.POSIX
(
POSIXTime
)
import
Data.TreeDiff
(
ToExpr
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Prelude
import
Test.QuickCheck
import
Test.QuickCheck
(
Arbitrary
(
arbitrary
),
oneof
,
vectorOf
)
import
Test.QuickCheck.Instances.Text
()
import
Data.TreeDiff
------------------------------------------------------------------------
-- | Phylo datatype descriptor of a phylomemy
...
...
src/Gargantext/Core/Viz/Graph/API.hs
View file @
d3303c27
...
...
@@ -18,8 +18,7 @@ Portability : POSIX
module
Gargantext.Core.Viz.Graph.API
where
import
Control.Lens
(
set
,
(
^.
),
_Just
,
(
^?
),
at
)
import
Data.Aeson
(
ToJSON
,
FromJSON
)
import
Control.Lens
(
set
,
_Just
,
(
^?
),
at
)
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.Swagger
(
ToSchema
)
import
Gargantext.API.Admin.EnvTypes
(
GargJob
(
..
),
Env
)
...
...
src/Gargantext/Core/Viz/Graph/Tools.hs
View file @
d3303c27
...
...
@@ -17,7 +17,6 @@ Portability : POSIX
module
Gargantext.Core.Viz.Graph.Tools
where
import
Data.Aeson
(
ToJSON
,
FromJSON
)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.HashSet
qualified
as
HashSet
...
...
src/Gargantext/Core/Viz/Graph/Types.hs
View file @
d3303c27
...
...
@@ -14,9 +14,6 @@ Portability : POSIX
module
Gargantext.Core.Viz.Graph.Types
where
import
Control.Lens
(
makeLenses
)
import
Data.Aeson
(
FromJSON
,
ToJSON
)
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.HashSet
(
HashSet
)
import
Data.HashSet
qualified
as
HashSet
import
Data.Swagger
(
ToSchema
(
..
),
genericDeclareNamedSchema
)
...
...
src/Gargantext/Core/Viz/LegacyPhylo.hs
View file @
d3303c27
...
...
@@ -27,9 +27,7 @@ one 8, e54847.
module
Gargantext.Core.Viz.LegacyPhylo
where
import
Control.DeepSeq
import
Control.Lens
(
makeLenses
)
import
Data.Aeson.TH
(
deriveJSON
,
defaultOptions
)
import
Data.Aeson.TH
(
defaultOptions
)
import
Data.Swagger
import
Data.Vector
(
Vector
)
import
Gargantext.Core.Text.Context
(
TermList
)
...
...
src/Gargantext/Core/Viz/Phylo.hs
View file @
d3303c27
...
...
@@ -26,17 +26,12 @@ one 8, e54847.
module
Gargantext.Core.Viz.Phylo
where
import
Control.DeepSeq
import
Control.Lens
(
makeLenses
)
import
Data.Aeson
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Swagger
import
Data.Text
(
pack
)
import
Data.Text.Lazy
qualified
as
TextLazy
import
Data.TreeDiff
import
Data.TreeDiff
(
ToExpr
)
import
Data.Vector
(
Vector
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
)
import
Gargantext.Core.Utils.Prefix
(
unPrefixSwagger
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Prelude
import
Test.QuickCheck
import
Test.QuickCheck.Instances.Text
()
...
...
src/Gargantext/Database/Action/Delete.hs
View file @
d3303c27
...
...
@@ -17,23 +17,21 @@ TODO: NodeError
module
Gargantext.Database.Action.Delete
where
import
Control.Lens
(
view
,
(
^.
))
import
Data.Text
import
Servant
import
Gargantext.Core
import
Control.Lens
(
view
)
import
Data.Text
(
unpack
)
import
Gargantext.Core
(
HasDBid
(
..
))
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Database.Action.Share
(
delFolderTeam
)
import
Gargantext.Database.Action.User
(
getUserId
)
import
Gargantext.Database.Admin.Types.Hyperdata.File
import
Gargantext.Database.Admin.Types.Node
-- (NodeType(..))
import
Gargantext.Database.Admin.Types.Hyperdata.File
(
HyperdataFile
(
..
)
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
NodeType
(
..
)
)
-- (NodeType(..))
import
Gargantext.Database.GargDB
qualified
as
GargDB
import
Gargantext.Database.Prelude
(
Cmd
'
,
CmdCommon
)
import
Gargantext.Database.Query.Table.Node
(
getNodeWith
)
import
Gargantext.Database.Query.Table.Node
qualified
as
N
(
getNode
,
deleteNode
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
)
import
Gargantext.Database.Schema.Node
import
Gargantext.Prelude
import
qualified
Gargantext.Database.GargDB
as
GargDB
import
qualified
Gargantext.Database.Query.Table.Node
as
N
(
getNode
,
deleteNode
)
------------------------------------------------------------------------
-- TODO
...
...
src/Gargantext/Database/Action/Flow.hs
View file @
d3303c27
...
...
@@ -51,7 +51,7 @@ module Gargantext.Database.Action.Flow -- (flowDatabase, ngrams2list)
where
import
Conduit
import
Control.Lens
(
(
^.
),
to
,
view
,
over
)
import
Control.Lens
(
to
,
view
,
over
)
import
Data.Bifunctor
qualified
as
B
import
Data.Conduit
qualified
as
C
import
Data.Conduit.Internal
(
zipSources
)
...
...
src/Gargantext/Database/Action/Flow/Extract.hs
View file @
d3303c27
...
...
@@ -17,7 +17,7 @@ Portability : POSIX
module
Gargantext.Database.Action.Flow.Extract
where
import
Control.Lens
(
(
^.
),
_Just
,
view
)
import
Control.Lens
(
_Just
,
view
)
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.Map.Strict
qualified
as
DM
import
Gargantext.Core
(
Lang
,
NLPServerConfig
(
server
))
...
...
src/Gargantext/Database/Action/Flow/List.hs
View file @
d3303c27
...
...
@@ -15,8 +15,7 @@ Portability : POSIX
module
Gargantext.Database.Action.Flow.List
where
import
Control.Lens
((
^.
),
(
+~
),
(
%~
),
at
,
(
.~
))
import
Control.Monad.Reader
import
Control.Lens
((
+~
),
(
%~
),
at
)
import
Data.List
qualified
as
List
import
Data.Map.Strict
(
toList
)
import
Data.Map.Strict
qualified
as
Map
...
...
@@ -28,7 +27,7 @@ import Gargantext.Core.NodeStory (HasNodeStory, a_history, a_state, a_version)
import
Gargantext.Core.Text.Ngrams
(
NgramsType
(
..
))
import
Gargantext.Core.Types
(
HasValidationError
(
..
),
assertValid
)
import
Gargantext.Core.Types.Main
(
ListType
(
CandidateTerm
))
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Node
(
ListId
,
NodeId
)
import
Gargantext.Database.Query.Table.NodeNgrams
(
NodeNgramsPoly
(
..
),
NodeNgramsW
,
listInsertDb
,
{- getCgramsId -}
)
import
Gargantext.Prelude
hiding
(
toList
)
...
...
src/Gargantext/Database/Action/Flow/Pairing.hs
View file @
d3303c27
...
...
@@ -17,7 +17,7 @@ module Gargantext.Database.Action.Flow.Pairing
-- (pairing)
where
import
Control.Lens
(
_Just
,
(
^.
),
view
)
import
Control.Lens
(
_Just
,
view
)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.HashMap.Strict
qualified
as
HM
import
Data.HashMap.Strict
qualified
as
HashMap
...
...
src/Gargantext/Database/Action/Flow/Types.hs
View file @
d3303c27
...
...
@@ -18,9 +18,6 @@ module Gargantext.Database.Action.Flow.Types
where
import
Conduit
(
ConduitT
)
import
Control.Lens
(
makeLenses
)
import
Data.Aeson
(
ToJSON
)
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.Swagger
(
ToSchema
(
..
),
genericDeclareNamedSchema
)
import
Gargantext.Core.Flow.Types
(
UniqId
)
...
...
src/Gargantext/Database/Action/Flow/Utils.hs
View file @
d3303c27
...
...
@@ -19,7 +19,6 @@ module Gargantext.Database.Action.Flow.Utils
,
mapNodeIdNgrams
)
where
import
Control.Lens
((
^.
))
import
Data.HashMap.Strict
(
HashMap
)
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.List
qualified
as
List
...
...
@@ -37,7 +36,7 @@ import Gargantext.Database.Action.Flow.Types (DocumentIdWithNgrams(..), FlowInse
import
Gargantext.Database.Admin.Types.Hyperdata.Document
(
HyperdataDocument
,
hd_abstract
,
hd_title
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Prelude
(
DBCmd
,
DbCmd
'
)
import
Gargantext.Database.Query.Table.ContextNodeNgrams
import
Gargantext.Database.Query.Table.ContextNodeNgrams
(
ContextNodeNgramsPoly
(
..
),
insertContextNodeNgrams
)
import
Gargantext.Database.Query.Table.Node.Document.Add
qualified
as
Doc
(
add
)
import
Gargantext.Database.Query.Table.Node.Document.Insert
(
ReturnId
,
addUniqId
,
insertDb
,
reId
,
reInserted
,
reUniqId
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
(
..
))
...
...
src/Gargantext/Database/Action/Search.hs
View file @
d3303c27
...
...
@@ -22,7 +22,7 @@ module Gargantext.Database.Action.Search (
)
where
import
Control.Arrow
(
returnA
)
import
Control.Lens
(
(
^.
),
view
)
import
Control.Lens
(
view
)
import
Data.BoolExpr
(
BoolExpr
(
..
),
Signed
(
Negative
,
Positive
)
)
import
Data.List
qualified
as
List
import
Data.Map.Strict
qualified
as
Map
...
...
src/Gargantext/Database/Action/Share.hs
View file @
d3303c27
...
...
@@ -17,12 +17,12 @@ module Gargantext.Database.Action.Share
where
import
Control.Arrow
(
returnA
)
import
Control.Lens
(
view
,
(
^.
)
)
import
Control.Lens
(
view
)
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Database
import
Gargantext.Database.Action.User
(
getUserId
)
import
Gargantext.Database.Admin.Config
(
hasNodeType
,
isInNodeTypes
)
import
Gargantext.Database.Admin.Types.Hyperdata
(
HyperdataAny
(
..
))
import
Gargantext.Database.Admin.Types.Hyperdata
.Any
(
HyperdataAny
(
..
))
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Query.Table.Node
(
getNode
,
getNodesWith
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
,
errorWith
)
...
...
src/Gargantext/Database/Action/User/New.hs
View file @
d3303c27
...
...
@@ -96,15 +96,15 @@ mkNewUser emailAddress pass' =
let
username
=
case
guessUserName
emailAddress
of
Just
(
u'
,
_m
)
->
u'
Nothing
->
panic
"[G.D.A.U.N.newUserQuick]: Email invalid"
in
(
NewUser
username
(
Text
.
toLower
emailAddress
)
pass'
)
in
NewUser
username
(
Text
.
toLower
emailAddress
)
pass'
------------------------------------------------------------------------
-- | guessUserName
-- guess username and normalize it (Text.toLower)
guessUserName
::
Text
->
Maybe
(
Text
,
Text
)
guessUserName
n
=
case
splitOn
"@"
n
of
[
u'
,
m'
]
->
if
m'
/=
""
then
Just
(
Text
.
toLower
u'
,
m'
)
else
Nothing
[
_u'
,
""
]
->
Nothing
[
u'
,
m'
]
->
Just
(
Text
.
toLower
u'
,
m'
)
_
->
Nothing
------------------------------------------------------------------------
...
...
src/Gargantext/Database/Admin/Types/Node.hs
View file @
d3303c27
...
...
@@ -12,7 +12,6 @@ Portability : POSIX
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
...
...
@@ -23,22 +22,20 @@ module Gargantext.Database.Admin.Types.Node
where
import
Codec.Serialise
(
Serialise
())
import
Data.Aeson
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Aeson
(
FromJSONKey
,
ToJSONKey
)
import
Data.Csv
qualified
as
Csv
import
Data.Either
import
Data.Morpheus.Kind
(
SCALAR
)
import
Data.Morpheus.Types
import
Data.Morpheus.Types
(
DecodeScalar
(
..
),
EncodeScalar
(
..
),
GQLType
(
KIND
)
)
import
Data.Swagger
import
Data.Text
(
unpack
,
pack
)
import
Data.Time
(
UTCTime
)
import
Database.PostgreSQL.Simple.FromField
(
FromField
,
fromField
,
fromJSONField
)
import
Database.PostgreSQL.Simple.ToField
(
ToField
,
toField
,
toJSONField
)
import
Database.PostgreSQL.Simple.ToRow
(
ToRow
,
toRow
)
import
Fmt
import
Fmt
(
Buildable
(
..
)
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
,
wellNamedSchema
)
import
Gargantext.Database.Schema.Context
import
Gargantext.Database.Schema.Node
import
Gargantext.Database.Schema.Node
(
NodePoly
(
Node
),
NodePolySearch
(
NodeSearch
)
)
import
Gargantext.Prelude
import
Gargantext.Prelude.Crypto.Hash
(
Hash
)
import
Opaleye
(
DefaultFromField
,
defaultFromField
,
SqlInt4
,
SqlText
,
SqlTSVector
,
Nullable
,
fromPGSFromField
)
...
...
@@ -46,7 +43,7 @@ import Opaleye qualified as O
import
Prelude
qualified
import
Servant
hiding
(
Context
)
import
Test.QuickCheck
(
elements
,
Positive
(
getPositive
))
import
Test.QuickCheck.Arbitrary
import
Test.QuickCheck.Arbitrary
(
Arbitrary
(
arbitrary
)
)
import
Test.QuickCheck.Instances.Text
()
import
Test.QuickCheck.Instances.Time
()
import
Text.Read
(
read
)
...
...
src/Gargantext/Database/GargDB.hs
View file @
d3303c27
...
...
@@ -12,23 +12,20 @@ TODO_2: quantitative tests (coded)
-}
{-# LANGUAGE QuasiQuotes #-}
module
Gargantext.Database.GargDB
where
import
Control.Lens
(
view
)
import
Data.Aeson
(
ToJSON
,
toJSON
)
import
Data.Text
qualified
as
Text
import
Data.Tuple.Extra
(
both
)
import
Gargantext.Database.Prelude
(
HasConfig
(
..
))
import
Gargantext.Prelude
hiding
(
hash
)
import
Gargantext.Prelude.Config
import
Gargantext.Prelude.Crypto.Hash
import
Gargantext.Prelude.Config
(
gc_datafilepath
)
import
Gargantext.Prelude.Crypto.Hash
(
IsHashable
(
hash
)
)
import
Prelude
qualified
import
System.Directory
(
createDirectoryIfMissing
)
import
System.Directory
qualified
as
SD
import
System.IO.Error
import
System.IO.Error
(
isDoesNotExistError
)
import
System.Random
(
newStdGen
)
-------------------------------------------------------------------
...
...
src/Gargantext/Database/Prelude.hs
View file @
d3303c27
...
...
@@ -9,19 +9,16 @@ Portability : POSIX
-}
{-# LANGUAGE Arrows #-}
{-# LANGUAGE ConstraintKinds, ScopedTypeVariables #-}
{-# LANGUAGE LambdaCase #-}
module
Gargantext.Database.Prelude
where
import
Control.Exception
import
Control.Exception
(
throw
)
import
Control.Lens
(
Getter
,
view
)
import
Control.Monad.Except
import
Control.Monad.Random
import
Control.Monad.Reader
import
Control.Monad.Random
(
MonadRandom
)
import
Control.Monad.Trans.Control
(
MonadBaseControl
)
import
Data.Aeson
(
Result
(
Error
,
Success
),
fromJSON
,
FromJSON
)
import
Data.Aeson
(
Result
(
..
)
)
import
Data.ByteString
qualified
as
DB
import
Data.List
qualified
as
DL
import
Data.Pool
(
Pool
,
withResource
)
...
...
src/Gargantext/Database/Query/Table/Ngrams.hs
View file @
d3303c27
...
...
@@ -23,7 +23,6 @@ module Gargantext.Database.Query.Table.Ngrams
)
where
import
Control.Lens
((
^.
))
import
Data.HashMap.Strict
(
HashMap
)
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.List
qualified
as
List
...
...
src/Gargantext/Database/Query/Table/NgramsPostag.hs
View file @
d3303c27
...
...
@@ -18,7 +18,7 @@ TODO use Opaleye for the queries.
module
Gargantext.Database.Query.Table.NgramsPostag
where
import
Control.Lens
(
view
,
(
^.
)
)
import
Control.Lens
(
view
)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.List
qualified
as
List
...
...
src/Gargantext/Database/Query/Table/Node.hs
View file @
d3303c27
...
...
@@ -22,7 +22,7 @@ module Gargantext.Database.Query.Table.Node
import
Control.Arrow
(
returnA
)
import
Control.Lens
(
set
,
view
)
import
Data.Aeson
(
encode
,
Value
,
ToJSON
)
import
Data.Aeson
(
encode
,
Value
)
import
Database.PostgreSQL.Simple
qualified
as
PGS
import
Database.PostgreSQL.Simple.SqlQQ
(
sql
)
import
Gargantext.Core
(
HasDBid
(
toDBid
)
)
...
...
src/Gargantext/Database/Query/Table/Node/Document/Insert.hs
View file @
d3303c27
...
...
@@ -57,7 +57,6 @@ the concatenation of the parameters defined by @shaParameters@.
module
Gargantext.Database.Query.Table.Node.Document.Insert
where
import
Data.Aeson
(
toJSON
,
ToJSON
)
import
Data.Text
qualified
as
DT
(
pack
,
concat
,
take
,
filter
,
toLower
)
import
Data.Time.Segment
(
jour
)
import
Database.PostgreSQL.Simple
(
FromRow
,
Query
,
Only
(
..
))
...
...
src/Gargantext/Database/Query/Table/Node/Error.hs
View file @
d3303c27
...
...
@@ -27,7 +27,7 @@ module Gargantext.Database.Query.Table.Node.Error (
)
where
import
Control.Lens
(
Prism
'
,
(
#
),
(
^?
))
import
Data.Aeson
(
object
,
ToJSON
(
toJSON
)
)
import
Data.Aeson
(
object
)
import
Data.Text
qualified
as
T
import
Gargantext.Core.Types.Individu
(
renderUser
,
User
,
Username
)
import
Gargantext.Database.Admin.Types.Node
(
ListId
,
NodeId
(
..
),
ContextId
,
UserId
,
ParentId
)
...
...
src/Gargantext/Database/Query/Table/NodeContext.hs
View file @
d3303c27
...
...
@@ -44,7 +44,7 @@ module Gargantext.Database.Query.Table.NodeContext
where
import
Control.Arrow
(
returnA
)
import
Control.Lens
(
view
,
(
^.
)
)
import
Control.Lens
(
view
)
import
Data.Text
(
splitOn
)
import
Data.Time
(
UTCTime
)
import
Database.PostgreSQL.Simple
qualified
as
PGS
(
In
(
..
),
Query
,
Only
(
..
))
...
...
src/Gargantext/Database/Query/Table/NodeNode.hs
View file @
d3303c27
...
...
@@ -33,7 +33,7 @@ module Gargantext.Database.Query.Table.NodeNode
where
import
Control.Arrow
(
returnA
)
import
Control.Lens
(
(
^.
),
view
)
import
Control.Lens
(
view
)
import
Data.Text
(
splitOn
)
import
Database.PostgreSQL.Simple
qualified
as
PGS
import
Database.PostgreSQL.Simple.SqlQQ
(
sql
)
...
...
src/Gargantext/Database/Query/Table/User.hs
View file @
d3303c27
...
...
@@ -48,7 +48,7 @@ module Gargantext.Database.Query.Table.User
where
import
Control.Arrow
(
returnA
)
import
Control.Lens
((
^.
),
(
?~
))
import
Control.Lens
((
?~
))
import
Data.List.NonEmpty
qualified
as
NE
import
Data.Time
(
UTCTime
)
import
Data.UUID
qualified
as
UUID
...
...
src/Gargantext/Database/Query/Tree.hs
View file @
d3303c27
...
...
@@ -43,15 +43,14 @@ module Gargantext.Database.Query.Tree
)
where
import
Control.Lens
(
view
,
toListOf
,
at
,
each
,
_Just
,
to
,
set
,
makeLenses
)
import
Control.Lens
(
view
,
toListOf
,
at
,
each
,
_Just
,
to
,
set
)
import
Data.List
(
tail
,
nub
)
import
Data.List
qualified
as
List
import
Data.Map.Strict
(
fromListWith
,
lookup
)
import
Data.Proxy
import
Data.Text
qualified
as
Text
import
Database.PostgreSQL.Simple
import
Database.PostgreSQL.Simple.SqlQQ
import
Gargantext.Core
import
Database.PostgreSQL.Simple
(
Only
(
Only
),
In
(
In
)
)
import
Database.PostgreSQL.Simple.SqlQQ
(
sql
)
import
Gargantext.Core
(
fromDBid
,
HasDBid
(
toDBid
)
)
import
Gargantext.Core.Types.Main
(
NodeTree
(
..
),
Tree
(
..
))
import
Gargantext.Database.Admin.Config
()
import
Gargantext.Database.Admin.Types.Hyperdata.Any
(
HyperdataAny
)
...
...
src/Gargantext/Database/Schema/NgramsPostag.hs
View file @
d3303c27
...
...
@@ -20,7 +20,6 @@ ngrams in NgramsTerm Lists.
module
Gargantext.Database.Schema.NgramsPostag
where
import
Control.Lens
(
makeLenses
)
import
Database.PostgreSQL.Simple
qualified
as
PGS
import
Gargantext.Database.Schema.Prelude
(
Column
,
SqlInt4
,
SqlText
,
ToField
(
toField
),
toRow
)
import
Gargantext.Prelude
...
...
src/Gargantext/Database/Schema/User.hs
View file @
d3303c27
...
...
@@ -21,7 +21,6 @@ Functions to deal with users, database side.
module
Gargantext.Database.Schema.User
where
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Morpheus.Types
(
GQLType
(
typeOptions
))
import
Data.Time
(
UTCTime
)
import
Database.PostgreSQL.Simple.FromField
(
FromField
,
fromField
)
...
...
src/Gargantext/Utils/JohnSnowNLP.hs
View file @
d3303c27
...
...
@@ -13,13 +13,12 @@ Portability : POSIX
module
Gargantext.Utils.JohnSnowNLP
where
import
Control.Lens
import
Data.Aeson
(
encode
,
ToJSON
,
toJSON
,
FromJSON
,
parseJSON
,
Value
(
..
),
(
.:
),
(
.:?
))
import
Data.Aeson.TH
(
deriveJSON
)
import
Control.Lens
(
FunctorWithIndex
(
imap
)
)
import
Data.Aeson
(
encode
,
Value
(
..
),
(
.:
),
(
.:?
))
import
Data.Aeson.Types
(
prependFailure
,
typeMismatch
)
import
Data.List.Safe
qualified
as
LS
import
Data.Map.Strict
qualified
as
Map
import
Data.Text
hiding
(
map
,
group
,
filter
,
concat
,
zip
)
import
Data.Text
(
unpack
)
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Core.Text.Terms.Multi.PosTagging.Types
import
Gargantext.Core.Types
(
POS
(
..
))
...
...
src/Gargantext/Utils/SpacyNLP/Types.hs
View file @
d3303c27
...
...
@@ -17,9 +17,6 @@ Server to be used: https://gitlab.iscpif.fr/gargantext/spacy-server
module
Gargantext.Utils.SpacyNLP.Types
where
import
Control.Lens
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Text
hiding
(
map
,
group
,
filter
,
concat
,
zip
)
import
Gargantext.Core.Types
(
POS
(
..
),
NER
(
..
))
import
Gargantext.Core.Utils.Prefix
(
unPrefix
)
import
Gargantext.Prelude
...
...
src/Gargantext/Utils/UTCTime.hs
View file @
d3303c27
...
...
@@ -16,7 +16,6 @@ Portability : POSIX
module
Gargantext.Utils.UTCTime
where
import
Data.Aeson
(
FromJSON
,
ToJSON
)
import
Data.Morpheus.Kind
(
SCALAR
)
import
Data.Morpheus.Types
(
GQLType
(
..
),
DecodeScalar
(
..
),
EncodeScalar
(
..
))
import
Data.Morpheus.Types
qualified
as
DMT
...
...
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