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
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Christian Merten
haskell-gargantext
Commits
b28af36c
Commit
b28af36c
authored
Apr 12, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WIP][REFACT] imports fixed
parent
705f5759
Changes
43
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
215 additions
and
249 deletions
+215
-249
package.yaml
package.yaml
+6
-6
API.hs
src/Gargantext/API.hs
+5
-5
Annuaire.hs
src/Gargantext/API/Annuaire.hs
+2
-2
Auth.hs
src/Gargantext/API/Auth.hs
+8
-9
New.hs
src/Gargantext/API/Corpus/New.hs
+2
-5
File.hs
src/Gargantext/API/Corpus/New/File.hs
+3
-3
Export.hs
src/Gargantext/API/Export.hs
+8
-8
Metrics.hs
src/Gargantext/API/Metrics.hs
+7
-7
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+25
-36
List.hs
src/Gargantext/API/Ngrams/List.hs
+4
-4
Tools.hs
src/Gargantext/API/Ngrams/Tools.hs
+0
-1
Node.hs
src/Gargantext/API/Node.hs
+10
-10
Search.hs
src/Gargantext/API/Search.hs
+9
-10
Settings.hs
src/Gargantext/API/Settings.hs
+26
-29
Table.hs
src/Gargantext/API/Table.hs
+5
-5
Types.hs
src/Gargantext/API/Types.hs
+3
-3
Types.hs
src/Gargantext/Core/Flow/Types.hs
+8
-8
Types.hs
src/Gargantext/Core/Types.hs
+2
-4
Individu.hs
src/Gargantext/Core/Types/Individu.hs
+2
-2
Main.hs
src/Gargantext/Core/Types/Main.hs
+5
-7
Database.hs
src/Gargantext/Database.hs
+1
-1
Node.hs
src/Gargantext/Database/Action/Query/Node.hs
+2
-1
Select.hs
src/Gargantext/Database/Action/Query/Node/Select.hs
+1
-0
UpdateOpaleye.hs
src/Gargantext/Database/Action/Query/Node/UpdateOpaleye.hs
+1
-0
Tree.hs
src/Gargantext/Database/Action/Query/Tree.hs
+3
-3
Root.hs
src/Gargantext/Database/Action/Query/Tree/Root.hs
+1
-1
Bashql.hs
src/Gargantext/Database/Admin/Bashql.hs
+1
-0
Init.hs
src/Gargantext/Database/Admin/Trigger/Init.hs
+3
-3
IMTUser.hs
src/Gargantext/Ext/IMTUser.hs
+4
-4
Utils.hs
src/Gargantext/Prelude/Utils.hs
+10
-10
Hal.hs
src/Gargantext/Text/Corpus/API/Hal.hs
+3
-4
Istex.hs
src/Gargantext/Text/Corpus/API/Istex.hs
+3
-4
Pubmed.hs
src/Gargantext/Text/Corpus/API/Pubmed.hs
+1
-1
Parsers.hs
src/Gargantext/Text/Corpus/Parsers.hs
+2
-3
CSV.hs
src/Gargantext/Text/Corpus/Parsers/CSV.hs
+2
-2
GrandDebat.hs
src/Gargantext/Text/Corpus/Parsers/GrandDebat.hs
+1
-1
Isidore.hs
src/Gargantext/Text/Corpus/Parsers/Isidore.hs
+2
-2
List.hs
src/Gargantext/Text/List.hs
+3
-5
Hetero.purs
src/Gargantext/Text/Metrics/Hetero.purs
+9
-13
Chart.hs
src/Gargantext/Viz/Chart.hs
+13
-15
Graph.hs
src/Gargantext/Viz/Graph.hs
+2
-2
Phylo.hs
src/Gargantext/Viz/Phylo.hs
+6
-9
Main.hs
src/Gargantext/Viz/Phylo/Main.hs
+1
-1
No files found.
package.yaml
View file @
b28af36c
...
...
@@ -42,13 +42,13 @@ library:
-
Gargantext.Core.Types.Main
-
Gargantext.Core.Utils.Prefix
-
Gargantext.Database
-
Gargantext.Database.Init
-
Gargantext.Database.Config
-
Gargantext.Database.Flow
-
Gargantext.Database.
Admin.
Init
-
Gargantext.Database.
Admin.
Config
-
Gargantext.Database.
Action.
Flow
-
Gargantext.Database.Schema.Node
-
Gargantext.Database.Tree
-
Gargantext.Database.Types.Node
-
Gargantext.Database.Utils
-
Gargantext.Database.
Action.
Tree
-
Gargantext.Database.
Admin.
Types.Node
-
Gargantext.Database.
Admin.
Utils
-
Gargantext.Database.Schema.User
-
Gargantext.Prelude
-
Gargantext.Text
...
...
src/Gargantext/API.hs
View file @
b28af36c
...
...
@@ -72,10 +72,10 @@ import Gargantext.API.Search (SearchPairsAPI, searchPairs)
import
Gargantext.API.Settings
import
Gargantext.API.Types
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Database.Node.Contact
(
HyperdataContact
)
import
Gargantext.Database.Types.Node
import
Gargantext.Database.Types.Node
(
NodeId
,
CorpusId
,
AnnuaireId
)
import
Gargantext.Database.Utils
(
HasConnectionPool
)
import
Gargantext.Database.
Action.Query.
Node.Contact
(
HyperdataContact
)
import
Gargantext.Database.
Admin.
Types.Node
import
Gargantext.Database.
Admin.
Types.Node
(
NodeId
,
CorpusId
,
AnnuaireId
)
import
Gargantext.Database.
Admin.
Utils
(
HasConnectionPool
)
import
Gargantext.Prelude
import
Gargantext.Viz.Graph.API
import
Network.HTTP.Types
hiding
(
Query
)
...
...
@@ -92,13 +92,13 @@ import Servant.Job.Async
import
Servant.Swagger
import
Servant.Swagger.UI
import
System.IO
(
FilePath
)
import
qualified
Paths_gargantext
as
PG
-- cabal magic build module
import
qualified
Data.ByteString.Lazy.Char8
as
BL8
import
qualified
Data.Text.IO
as
T
import
qualified
Gargantext.API.Annuaire
as
Annuaire
import
qualified
Gargantext.API.Corpus.New
as
New
import
qualified
Gargantext.API.Export
as
Export
import
qualified
Gargantext.API.Ngrams.List
as
List
import
qualified
Paths_gargantext
as
PG
-- cabal magic build module
showAsServantErr
::
GargError
->
ServerError
showAsServantErr
(
GargServerError
err
)
=
err
...
...
src/Gargantext/API/Annuaire.hs
View file @
b28af36c
...
...
@@ -29,8 +29,8 @@ import qualified Gargantext.API.Corpus.New.File as NewFile
import
Gargantext.API.Orchestrator.Types
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Core.Utils.Prefix
(
unPrefixSwagger
)
import
Gargantext.Database.Flow
(
FlowCmdM
)
-- flowAnnuaire
import
Gargantext.Database.Types.Node
(
AnnuaireId
)
import
Gargantext.Database.
Action.
Flow
(
FlowCmdM
)
-- flowAnnuaire
import
Gargantext.Database.
Admin.
Types.Node
(
AnnuaireId
)
import
Gargantext.Prelude
import
Servant
import
Servant.API.Flatten
(
Flat
)
...
...
src/Gargantext/API/Auth.hs
View file @
b28af36c
...
...
@@ -40,20 +40,19 @@ import Data.Text (Text, reverse)
import
Data.Text.Lazy
(
toStrict
)
import
Data.Text.Lazy.Encoding
(
decodeUtf8
)
import
GHC.Generics
(
Generic
)
import
Servant
import
Servant.Auth.Server
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.API.Settings
import
Gargantext.API.Types
(
HasJoseError
(
..
),
joseError
,
HasServerError
,
GargServerC
)
--import Gargantext.API.Types (HasJoseError(..), joseError, HasServerError, serverError, GargServerC)
import
Gargantext.Database.Root
(
getRoot
)
import
Gargantext.Database.Tree
(
isDescendantOf
,
isIn
)
import
Gargantext.Database.Types.Node
(
NodePoly
(
_node_id
),
NodeId
(
..
),
UserId
,
ListId
,
DocId
)
import
Gargantext.Database.Utils
(
Cmd
'
,
CmdM
,
HasConnectionPool
)
import
Gargantext.Core.Types.Individu
(
User
(
..
),
Username
,
Password
,
arbitraryUsername
,
arbitraryPassword
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Database.Action.Root
(
getRoot
)
import
Gargantext.Database.Action.Tree
(
isDescendantOf
,
isIn
)
import
Gargantext.Database.Admin.Types.Node
(
NodePoly
(
_node_id
),
NodeId
(
..
),
UserId
,
ListId
,
DocId
)
import
Gargantext.Database.Admin.Utils
(
Cmd
'
,
CmdM
,
HasConnectionPool
)
import
Gargantext.Prelude
hiding
(
reverse
)
import
Servant
import
Servant.Auth.Server
import
Test.QuickCheck
(
elements
,
oneof
)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
import
Gargantext.Core.Types.Individu
(
User
(
..
),
Username
,
Password
,
arbitraryUsername
,
arbitraryPassword
)
---------------------------------------------------
...
...
src/Gargantext/API/Corpus/New.hs
View file @
b28af36c
...
...
@@ -25,7 +25,6 @@ New corpus means either:
module
Gargantext.API.Corpus.New
where
--import Gargantext.Text.Corpus.Parsers (parseFile, FileFormat(..))
import
Control.Lens
hiding
(
elements
)
import
Data.Aeson
import
Data.Aeson.TH
(
deriveJSON
)
...
...
@@ -38,10 +37,8 @@ import Gargantext.API.Corpus.New.File
import
Gargantext.API.Orchestrator.Types
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Database.Flow
(
FlowCmdM
,
flowCorpus
)
import
Gargantext.Database.Flow
(
flowCorpusSearchInDatabase
)
import
Gargantext.Database.Types.Node
(
CorpusId
)
import
Gargantext.Database.Types.Node
(
ToHyperdataDocument
(
..
))
import
Gargantext.Database.Action.Flow
(
FlowCmdM
,
flowCorpus
,
flowCorpusSearchInDatabase
)
import
Gargantext.Database.Admin.Types.Node
(
CorpusId
,
ToHyperdataDocument
(
..
))
import
Gargantext.Core.Types.Individu
(
UserId
,
User
(
..
))
import
Gargantext.Prelude
import
qualified
Gargantext.Text.Corpus.Parsers
as
Parser
(
FileFormat
(
..
),
parseFormat
)
...
...
src/Gargantext/API/Corpus/New/File.hs
View file @
b28af36c
...
...
@@ -27,15 +27,15 @@ module Gargantext.API.Corpus.New.File
import
Control.Lens
((
.~
),
(
?~
))
import
Control.Monad
(
forM
)
import
Data.Maybe
import
Data.Aeson
import
Data.Maybe
import
Data.Monoid
(
mempty
)
import
Data.Swagger
import
Data.Text
(
Text
())
import
GHC.Generics
(
Generic
)
import
Gargantext.API.Ngrams
(
TODO
)
import
Gargantext.Database.Types.Node
import
Gargantext.Database.Utils
-- (Cmd, CmdM)
import
Gargantext.Database.
Admin.
Types.Node
import
Gargantext.Database.
Admin.
Utils
-- (Cmd, CmdM)
import
Gargantext.Prelude
import
Gargantext.Prelude.Utils
(
sha
)
import
Servant
...
...
src/Gargantext/API/Export.hs
View file @
b28af36c
...
...
@@ -27,8 +27,8 @@ module Gargantext.API.Export
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Map
(
Map
)
import
Data.Set
(
Set
)
import
Data.Maybe
(
fromMaybe
)
import
Data.Set
(
Set
)
import
Data.Swagger
import
Data.Text
(
Text
)
import
GHC.Generics
(
Generic
)
...
...
@@ -37,21 +37,21 @@ import Gargantext.API.Ngrams.Tools (filterListWithRoot, mapTermListRoot, getRepo
import
Gargantext.API.Types
(
GargNoServer
)
import
Gargantext.Core.Types
--
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Database.Config
(
userMaster
)
import
Gargantext.Database.Metrics.NgramsByNode
(
getNgramsByNodeOnlyUser
)
import
Gargantext.Database.Node.Select
(
selectNodesWithUsername
)
import
Gargantext.Database.Action.Metrics.NgramsByNode
(
getNgramsByNodeOnlyUser
)
import
Gargantext.Database.Action.Query.Node.Select
(
selectNodesWithUsername
)
import
Gargantext.Database.Admin.Config
(
userMaster
)
import
Gargantext.Database.Admin.Types.Errors
(
HasNodeError
)
import
Gargantext.Database.Admin.Types.Node
(
Node
,
HyperdataDocument
(
..
),
NodeId
,
ListId
,
CorpusId
)
import
Gargantext.Database.Admin.Utils
(
Cmd
)
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
(
..
))
import
Gargantext.Database.Schema.Node
(
defaultList
)
import
Gargantext.Database.Types.Errors
(
HasNodeError
)
import
Gargantext.Database.Schema.NodeNode
(
selectDocNodes
)
import
Gargantext.Database.Types.Node
(
Node
,
HyperdataDocument
(
..
),
NodeId
,
ListId
,
CorpusId
)
import
Gargantext.Database.Utils
(
Cmd
)
import
Gargantext.Prelude
import
Gargantext.Prelude.Utils
(
sha
)
import
Servant
import
qualified
Data.List
as
List
import
qualified
Data.Map
as
Map
import
qualified
Data.Set
as
Set
import
qualified
Data.List
as
List
-- Corpus Export
...
...
src/Gargantext/API/Metrics.hs
View file @
b28af36c
...
...
@@ -27,24 +27,24 @@ module Gargantext.API.Metrics
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Swagger
import
Data.Time
(
UTCTime
)
import
Data.Text
(
Text
)
import
Data.Time
(
UTCTime
)
import
GHC.Generics
(
Generic
)
import
Gargantext.API.Ngrams
import
Gargantext.API.Ngrams.NTree
import
Gargantext.Core.Types
(
CorpusId
,
ListId
,
Limit
)
import
Gargantext.Core.Types
(
ListType
(
..
))
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Database.
Utils
import
Gargantext.
Core.Types
(
CorpusId
,
ListId
,
Limit
)
import
Gargantext.Database.
Action.Flow
import
Gargantext.
Database.Admin.Utils
import
Gargantext.Prelude
import
Gargantext.API.Ngrams
import
Gargantext.Text.Metrics
(
Scored
(
..
))
import
Gargantext.API.Ngrams.NTree
import
Gargantext.Database.Flow
import
Gargantext.Viz.Chart
import
Servant
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
import
qualified
Data.Map
as
Map
import
qualified
Gargantext.Database.Metrics
as
Metrics
import
qualified
Gargantext.Database.
Action.
Metrics
as
Metrics
data
Metrics
=
Metrics
{
metrics_data
::
[
Metric
]}
...
...
src/Gargantext/API/Ngrams.hs
View file @
b28af36c
...
...
@@ -96,26 +96,6 @@ module Gargantext.API.Ngrams
)
where
-- import Debug.Trace (trace)
import
Prelude
(
Enum
,
Bounded
,
Semigroup
(
..
),
minBound
,
maxBound
{-, round-}
,
error
)
-- import Gargantext.Database.Schema.User (UserId)
import
Data.Patch.Class
(
Replace
,
replace
,
Action
(
act
),
Applicable
(
..
),
Composable
(
..
),
Transformable
(
..
),
PairPatch
(
..
),
Patched
,
ConflictResolution
,
ConflictResolutionReplace
,
ours
)
import
qualified
Data.Map.Strict.Patch
as
PM
import
Data.Monoid
import
Data.Ord
(
Down
(
..
))
import
Data.Foldable
--import Data.Semigroup
import
Data.Set
(
Set
)
import
qualified
Data.Set
as
S
import
qualified
Data.List
as
List
import
Data.Maybe
(
fromMaybe
)
-- import Data.Tuple.Extra (first)
import
qualified
Data.Map.Strict
as
Map
import
Data.Map.Strict
(
Map
)
import
qualified
Data.Set
as
Set
import
Control.Category
((
>>>
))
import
Control.Concurrent
import
Control.Lens
(
makeLenses
,
makePrisms
,
Getter
,
Iso
'
,
iso
,
from
,
(
.~
),
(
?=
),
(
#
),
to
,
folded
,
{-withIndex, ifolded,-}
view
,
use
,
(
^.
),
(
^..
),
(
^?
),
(
+~
),
(
%~
),
(
.~
),
(
%=
),
sumOf
,
at
,
_Just
,
Each
(
..
),
itraverse_
,
both
,
forOf_
,
(
%%~
),
(
?~
),
mapped
)
...
...
@@ -128,37 +108,46 @@ import Data.Aeson hiding ((.=))
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Either
(
Either
(
Left
))
import
Data.Either.Extra
(
maybeToEither
)
-- import Data.Map (lookup)
import
qualified
Data.HashMap.Strict.InsOrd
as
InsOrdHashMap
import
Data.Foldable
import
Data.Map.Strict
(
Map
)
import
Data.Maybe
(
fromMaybe
)
import
Data.Monoid
import
Data.Ord
(
Down
(
..
))
import
Data.Patch.Class
(
Replace
,
replace
,
Action
(
act
),
Applicable
(
..
),
Composable
(
..
),
Transformable
(
..
),
PairPatch
(
..
),
Patched
,
ConflictResolution
,
ConflictResolutionReplace
,
ours
)
import
Data.Set
(
Set
)
import
Data.Swagger
hiding
(
version
,
patch
)
import
Data.Text
(
Text
,
isInfixOf
,
count
)
import
Data.Validity
import
Database.PostgreSQL.Simple.FromField
(
FromField
,
fromField
)
import
Formatting
(
hprint
,
int
,
(
%
))
import
Formatting.Clock
(
timeSpecs
)
import
GHC.Generics
(
Generic
)
import
Gargantext.Core.Types
(
ListType
(
..
),
NodeId
,
ListId
,
DocId
,
Limit
,
Offset
,
HasInvalidError
,
assertValid
)
import
Gargantext.Core.Types
(
TODO
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
-- import Gargantext.Database.Schema.Ngrams (NgramsTypeId, ngramsTypeId, NgramsTableData(..))
import
Gargantext.Database.Config
(
userMaster
)
import
Gargantext.Database.Metrics.NgramsByNode
(
getOccByNgramsOnlyFast'
)
import
Gargantext.Database.Action.Metrics.NgramsByNode
(
getOccByNgramsOnlyFast'
)
import
Gargantext.Database.Action.Query.Ngrams
import
Gargantext.Database.Action.Query.Node.Select
import
Gargantext.Database.Admin.Config
(
userMaster
)
import
Gargantext.Database.Admin.Types.Errors
(
HasNodeError
)
import
Gargantext.Database.Admin.Types.Node
(
NodeType
(
..
))
import
Gargantext.Database.Admin.Utils
(
fromField'
,
HasConnectionPool
)
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
)
import
Gargantext.Database.Types.Node
(
NodeType
(
..
))
import
Gargantext.Database.Utils
(
fromField'
,
HasConnectionPool
)
import
Gargantext.Database.Node.Select
import
Gargantext.Database.Ngrams
--import Gargantext.Database.Lists (listsWith)
import
Gargantext.Database.Types.Errors
(
HasNodeError
)
import
Database.PostgreSQL.Simple.FromField
(
FromField
,
fromField
)
import
qualified
Gargantext.Database.Schema.Ngrams
as
Ngrams
-- import Gargantext.Database.Schema.NodeNgram hiding (Action)
import
Gargantext.Prelude
import
Gargantext.Core.Types
(
TODO
)
import
Gargantext.Core.Types
(
ListType
(
..
),
NodeId
,
ListId
,
DocId
,
Limit
,
Offset
,
HasInvalidError
,
assertValid
)
import
Prelude
(
Enum
,
Bounded
,
Semigroup
(
..
),
minBound
,
maxBound
{-, round-}
,
error
)
import
Servant
hiding
(
Patch
)
import
System.Clock
(
getTime
,
TimeSpec
,
Clock
(
..
))
import
System.FileLock
(
FileLock
)
import
System.IO
(
stderr
)
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
import
qualified
Data.HashMap.Strict.InsOrd
as
InsOrdHashMap
import
qualified
Data.List
as
List
import
qualified
Data.Map.Strict
as
Map
import
qualified
Data.Map.Strict.Patch
as
PM
import
qualified
Data.Set
as
S
import
qualified
Data.Set
as
Set
import
qualified
Gargantext.Database.Schema.Ngrams
as
Ngrams
------------------------------------------------------------------------
--data FacetFormat = Table | Chart
...
...
src/Gargantext/API/Ngrams/List.hs
View file @
b28af36c
...
...
@@ -35,16 +35,16 @@ import Gargantext.API.Corpus.New.File (FileType(..))
import
Gargantext.API.Ngrams
import
Gargantext.API.Orchestrator.Types
import
Gargantext.API.Types
(
GargServer
)
import
Gargantext.Database.Flow
(
FlowCmdM
)
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
(
..
),
ngramsTypes
)
import
Gargantext.Database.Types.Node
import
Gargantext.Core.Utils.Prefix
(
unPrefixSwagger
)
import
Gargantext.Database.Action.Flow
(
FlowCmdM
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
(
..
),
ngramsTypes
)
import
Gargantext.Prelude
import
Network.HTTP.Media
((
//
),
(
/:
))
import
Servant
import
Servant.Job.Async
import
Web.FormUrlEncoded
(
FromForm
)
import
Servant.Job.Utils
(
jsonOptions
)
import
Web.FormUrlEncoded
(
FromForm
)
------------------------------------------------------------------------
type
NgramsList
=
(
Map
NgramsType
(
Versioned
NgramsTableMap
))
...
...
src/Gargantext/API/Ngrams/Tools.hs
View file @
b28af36c
...
...
@@ -31,7 +31,6 @@ import Gargantext.Prelude
import
qualified
Data.Map.Strict
as
Map
import
qualified
Data.Set
as
Set
type
RootTerm
=
Text
getRepo
::
RepoCmdM
env
err
m
=>
m
NgramsRepo
...
...
src/Gargantext/API/Node.hs
View file @
b28af36c
...
...
@@ -53,18 +53,18 @@ import Gargantext.API.Table
import
Gargantext.API.Types
import
Gargantext.Core.Types
(
NodeTableResult
)
import
Gargantext.Core.Types.Main
(
Tree
,
NodeTree
,
ListType
)
import
Gargantext.Database.Config
(
nodeTypeId
)
import
Gargantext.Database.Flow.Pairing
(
pairing
)
import
Gargantext.Database.Facet
(
FacetDoc
,
OrderBy
(
..
))
import
Gargantext.Database.Node.Children
(
getChildren
)
import
Gargantext.Database.Node.User
(
NodeUser
)
import
Gargantext.Database.Action.Facet
(
FacetDoc
,
OrderBy
(
..
))
import
Gargantext.Database.Action.Flow.Pairing
(
pairing
)
import
Gargantext.Database.Action.Query.Node.Children
(
getChildren
)
import
Gargantext.Database.Action.Query.Node.UpdateOpaleye
(
updateHyperdata
)
import
Gargantext.Database.Action.Query.Node.User
(
NodeUser
)
import
Gargantext.Database.Action.Tree
(
treeDB
)
import
Gargantext.Database.Admin.Config
(
nodeTypeId
)
import
Gargantext.Database.Admin.Types.Errors
(
HasNodeError
(
..
))
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Utils
-- (Cmd, CmdM)
import
Gargantext.Database.Schema.Node
(
getNodesWithParentId
,
getNodeWith
,
getNode
,
deleteNode
,
deleteNodes
,
mkNodeWithParent
,
JSONB
,
getNodeUser
)
import
Gargantext.Database.Schema.NodeNode
-- (nodeNodesCategory, insertNodeNode, NodeNode(..))
import
Gargantext.Database.Node.UpdateOpaleye
(
updateHyperdata
)
import
Gargantext.Database.Tree
(
treeDB
)
import
Gargantext.Database.Types.Errors
(
HasNodeError
(
..
))
import
Gargantext.Database.Types.Node
import
Gargantext.Database.Utils
-- (Cmd, CmdM)
import
Gargantext.Prelude
import
Gargantext.Viz.Chart
import
Gargantext.Viz.Phylo.API
(
PhyloAPI
,
phyloAPI
)
...
...
src/Gargantext/API/Search.hs
View file @
b28af36c
...
...
@@ -25,21 +25,20 @@ Count API part of Gargantext.
module
Gargantext.API.Search
where
import
GHC.Generics
(
Generic
)
import
Data.Time
(
UTCTime
)
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Swagger
import
Data.Text
(
Text
)
import
Servant
import
Test.QuickCheck.Arbitrary
import
Test.QuickCheck
(
elements
)
-- import Control.Applicative ((<*>))
import
Data.Time
(
UTCTime
)
import
GHC.Generics
(
Generic
)
import
Gargantext.API.Types
(
GargServer
)
import
Gargantext.Prelude
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Database.Types.Node
import
Gargantext.Database.TextSearch
import
Gargantext.Database.Facet
import
Gargantext.Database.Action.Facet
import
Gargantext.Database.Action.Search
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Prelude
import
Servant
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
-----------------------------------------------------------------------
data
SearchQuery
=
SearchQuery
...
...
src/Gargantext/API/Settings.hs
View file @
b28af36c
...
...
@@ -26,45 +26,42 @@ TODO-SECURITY: Critical
module
Gargantext.API.Settings
where
import
System.Directory
import
System.Log.FastLogger
import
GHC.Enum
import
GHC.Generics
(
Generic
)
import
Prelude
(
Bounded
(),
fail
)
import
System.Environment
(
lookupEnv
)
import
System.IO
(
FilePath
,
hClose
)
import
System.IO.Temp
(
withTempFile
)
import
System.FileLock
(
tryLockFile
,
unlockFile
,
SharedExclusive
(
Exclusive
))
import
Database.PostgreSQL.Simple
(
Connection
,
connect
,
close
,
ConnectInfo
)
import
Network.HTTP.Client
(
Manager
)
import
Network.HTTP.Client.TLS
(
newTlsManager
)
import
Control.Concurrent
import
Control.Debounce
(
mkDebounce
,
defaultDebounceSettings
,
debounceFreq
,
debounceAction
)
import
Control.Exception
(
finally
)
import
Control.Lens
import
Control.Monad.Logger
import
Control.Monad.Reader
import
Data.Aeson
import
Data.
Maybe
(
fromMaybe
)
import
Data.
ByteString
(
ByteString
)
import
Data.Either
(
either
)
import
Data.Maybe
(
fromMaybe
)
import
Data.Pool
(
Pool
,
createPool
)
import
Data.Text
--import Data.Text.Encoding (encodeUtf8)
import
Data.ByteString
(
ByteString
)
import
qualified
Data.ByteString.Lazy
as
L
import
Database.PostgreSQL.Simple
(
Connection
,
connect
,
close
,
ConnectInfo
)
import
GHC.Enum
import
GHC.Generics
(
Generic
)
import
Gargantext.API.Ngrams
(
NgramsRepo
,
HasRepoVar
(
..
),
HasRepoSaver
(
..
),
HasRepo
(
..
),
RepoEnv
(
..
),
r_version
,
saveRepo
,
initRepo
,
renv_var
,
renv_lock
)
import
Gargantext.API.Orchestrator.Types
import
Gargantext.Database.Admin.Utils
(
databaseParameters
,
HasConnectionPool
(
..
),
Cmd
'
,
runCmd
)
import
Gargantext.Prelude
import
Network.HTTP.Client
(
Manager
)
import
Network.HTTP.Client.TLS
(
newTlsManager
)
import
Prelude
(
Bounded
(),
fail
)
import
Servant
import
Servant.Auth.Server
(
defaultJWTSettings
,
JWTSettings
,
CookieSettings
(
..
),
XsrfCookieSettings
(
..
),
defaultCookieSettings
,
defaultXsrfCookieSettings
,
readKey
,
writeKey
)
import
Servant.Client
(
BaseUrl
,
parseBaseUrl
)
import
qualified
Servant.Job.Core
import
Servant.Job.Async
(
newJobEnv
,
defaultSettings
,
HasJobEnv
(
..
),
Job
)
import
System.Directory
import
System.Environment
(
lookupEnv
)
import
System.FileLock
(
tryLockFile
,
unlockFile
,
SharedExclusive
(
Exclusive
))
import
System.IO
(
FilePath
,
hClose
)
import
System.IO.Temp
(
withTempFile
)
import
System.Log.FastLogger
import
Web.HttpApiData
(
parseUrlPiece
)
import
qualified
Data.ByteString.Lazy
as
L
import
qualified
Servant.Job.Core
import
Control.Concurrent
import
Control.Debounce
(
mkDebounce
,
defaultDebounceSettings
,
debounceFreq
,
debounceAction
)
import
Control.Exception
(
finally
)
import
Control.Monad.Logger
import
Control.Monad.Reader
import
Control.Lens
import
Gargantext.Prelude
import
Gargantext.Database.Utils
(
databaseParameters
,
HasConnectionPool
(
..
),
Cmd
'
,
runCmd
)
import
Gargantext.API.Ngrams
(
NgramsRepo
,
HasRepoVar
(
..
),
HasRepoSaver
(
..
),
HasRepo
(
..
),
RepoEnv
(
..
),
r_version
,
saveRepo
,
initRepo
,
renv_var
,
renv_lock
)
import
Gargantext.API.Orchestrator.Types
type
PortNumber
=
Int
...
...
src/Gargantext/API/Table.hs
View file @
b28af36c
...
...
@@ -46,11 +46,11 @@ import GHC.Generics (Generic)
import
Gargantext.API.Ngrams
(
TabType
(
..
))
import
Gargantext.Core.Types
(
Offset
,
Limit
,
TableResult
(
..
))
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Database.Facet
(
FacetDoc
,
runViewDocuments
,
OrderBy
(
..
),
runViewAuthorsDoc
)
import
Gargantext.Database.Learn
(
FavOrTrash
(
..
),
moreLike
)
import
Gargantext.Database.
Text
Search
import
Gargantext.Database.Types.Node
import
Gargantext.Database.Utils
-- (Cmd, CmdM)
import
Gargantext.Database.
Action.
Facet
(
FacetDoc
,
runViewDocuments
,
OrderBy
(
..
),
runViewAuthorsDoc
)
import
Gargantext.Database.
Action.
Learn
(
FavOrTrash
(
..
),
moreLike
)
import
Gargantext.Database.
Action.
Search
import
Gargantext.Database.
Admin.
Types.Node
import
Gargantext.Database.
Admin.
Utils
-- (Cmd, CmdM)
import
Gargantext.Prelude
import
Servant
import
Test.QuickCheck
(
elements
)
...
...
src/Gargantext/API/Types.hs
View file @
b28af36c
...
...
@@ -41,9 +41,9 @@ import Gargantext.API.Ngrams
import
Gargantext.API.Orchestrator.Types
import
Gargantext.API.Settings
import
Gargantext.Core.Types
import
Gargantext.Database.Tree
import
Gargantext.Database.Types.Errors
(
NodeError
(
..
),
HasNodeError
(
..
))
import
Gargantext.Database.Utils
import
Gargantext.Database.
Action.
Tree
import
Gargantext.Database.
Admin.
Types.Errors
(
NodeError
(
..
),
HasNodeError
(
..
))
import
Gargantext.Database.
Admin.
Utils
import
Gargantext.Prelude
import
Servant
import
Servant.Job.Async
(
HasJobEnv
)
...
...
src/Gargantext/Core/Flow/Types.hs
View file @
b28af36c
...
...
@@ -19,17 +19,17 @@ module Gargantext.Core.Flow.Types where
import
Control.Lens
(
Lens
'
)
import
Data.Map
(
Map
)
import
Data.Text
(
Text
)
import
Data.Maybe
(
Maybe
)
import
Gargantext.Text.Terms
(
TermType
)
import
Data.Text
(
Text
)
import
Gargantext.Core
(
Lang
)
import
Gargantext.Prelude
import
Gargantext.Database.Schema.Ngrams
(
Ngrams
,
NgramsType
)
import
Gargantext.Core.Types.Main
(
HashId
)
import
Gargantext.Database.Types.Node
-- (HyperdataDocument(..))
import
Gargantext.Database.Node.Contact
-- (HyperdataContact(..))
import
Gargantext.Database.Node.Document.Insert
(
AddUniqId
,
InsertDb
)
import
Gargantext.Database.Utils
(
Cmd
)
import
Gargantext.Database.Action.Query.Node.Contact
-- (HyperdataContact(..))
import
Gargantext.Database.Action.Query.Node.Document.Insert
(
AddUniqId
,
InsertDb
)
import
Gargantext.Database.Admin.Types.Node
-- (HyperdataDocument(..))
import
Gargantext.Database.Admin.Utils
(
Cmd
)
import
Gargantext.Database.Schema.Ngrams
(
Ngrams
,
NgramsType
)
import
Gargantext.Prelude
import
Gargantext.Text.Terms
(
TermType
)
type
FlowCorpus
a
=
(
AddUniqId
a
,
UniqId
a
...
...
src/Gargantext/Core/Types.hs
View file @
b28af36c
...
...
@@ -17,7 +17,7 @@ commentary with @some markup@.
{-# LANGUAGE TemplateHaskell #-}
module
Gargantext.Core.Types
(
module
Gargantext
.
Core
.
Types
.
Main
,
module
Gargantext
.
Database
.
Types
.
Node
,
module
Gargantext
.
Database
.
Admin
.
Types
.
Node
,
Term
,
Terms
(
..
)
,
TokenTag
(
..
),
POS
(
..
),
NER
(
..
)
,
Label
,
Stems
...
...
@@ -28,7 +28,6 @@ module Gargantext.Core.Types ( module Gargantext.Core.Types.Main
,
TODO
(
..
)
)
where
--import qualified Data.Set as S
import
Control.Lens
(
Prism
'
,
(
#
))
import
Control.Monad.Error.Class
(
MonadError
,
throwError
)
import
Data.Aeson
...
...
@@ -43,11 +42,10 @@ import Data.Validity
import
GHC.Generics
import
Gargantext.Core.Types.Main
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Database.Types.Node
import
Gargantext.Database.
Admin.
Types.Node
import
Gargantext.Prelude
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
------------------------------------------------------------------------
------------------------------------------------------------------------
type
Name
=
Text
type
Term
=
Text
...
...
src/Gargantext/Core/Types/Individu.hs
View file @
b28af36c
...
...
@@ -18,9 +18,9 @@ Individu defintions
module
Gargantext.Core.Types.Individu
where
import
Gargantext.Prelude
hiding
(
reverse
)
import
Data.Text
(
Text
,
pack
,
reverse
)
import
Gargantext.Database.Types.Node
(
NodeId
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
)
import
Gargantext.Prelude
hiding
(
reverse
)
type
UserId
=
Int
...
...
src/Gargantext/Core/Types/Main.hs
View file @
b28af36c
...
...
@@ -21,21 +21,19 @@ Portability : POSIX
module
Gargantext.Core.Types.Main
where
------------------------------------------------------------------------
import
Prelude
(
Enum
,
Bounded
,
minBound
,
maxBound
)
import
Data.Aeson
(
FromJSON
,
ToJSON
)
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Map
(
fromList
,
lookup
)
import
Data.Either
(
Either
(
..
))
import
Data.Eq
(
Eq
())
import
Data.Map
(
fromList
,
lookup
)
import
Data.Monoid
((
<>
))
import
Data.Text
(
Text
,
unpack
)
import
Data.Swagger
import
G
argantext.Database.Types.Node
-- (NodeType(..), Node, Hyperdata(..)
)
import
Data.Text
(
Text
,
unpack
)
import
G
HC.Generics
(
Generic
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Database.Admin.Types.Node
-- (NodeType(..), Node, Hyperdata(..))
import
Gargantext.Prelude
import
GHC.Generics
(
Generic
)
import
Prelude
(
Enum
,
Bounded
,
minBound
,
maxBound
)
import
Servant.API
(
FromHttpApiData
(
..
))
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
...
...
src/Gargantext/Database.hs
View file @
b28af36c
...
...
@@ -16,7 +16,7 @@ Gargantext's database.
{-# LANGUAGE NoImplicitPrelude #-}
module
Gargantext.Database
(
module
Gargantext
.
Database
.
Utils
module
Gargantext.Database
(
module
Gargantext
.
Database
.
Admin
.
Utils
-- , module Gargantext.Database.Bashql
)
where
...
...
src/Gargantext/Database/Action/Query/Node.hs
View file @
b28af36c
...
...
@@ -43,7 +43,8 @@ import Gargantext.Database.Admin.Config (nodeTypeId)
import
Gargantext.Database.Admin.Types.Errors
import
Gargantext.Database.Admin.Types.Node
(
NodeType
(
..
),
defaultCorpus
,
Hyperdata
,
HyperData
(
..
))
import
Gargantext.Database.Admin.Utils
import
Gargantext.Database.Node.Contact
(
HyperdataContact
(
..
),
arbitraryHyperdataContact
)
import
Gargantext.Database.Action.Query.Node.Contact
(
HyperdataContact
(
..
),
arbitraryHyperdataContact
)
import
Gargantext.Database.Action.Query.Node.User
import
Gargantext.Database.Schema.Node
import
Gargantext.Prelude
hiding
(
sum
,
head
)
import
Gargantext.Viz.Graph
(
HyperdataGraph
(
..
))
...
...
src/Gargantext/Database/Action/Query/Node/Select.hs
View file @
b28af36c
...
...
@@ -24,6 +24,7 @@ import Gargantext.Database.Admin.Config
import
Gargantext.Database.Admin.Utils
import
Gargantext.Database.Schema.Node
import
Gargantext.Database.Schema.User
import
Gargantext.Database.Action.Query.Node
import
Opaleye
selectNodesWithUsername
::
NodeType
->
Username
->
Cmd
err
[
NodeId
]
...
...
src/Gargantext/Database/Action/Query/Node/UpdateOpaleye.hs
View file @
b28af36c
...
...
@@ -26,6 +26,7 @@ import Gargantext.Prelude
import
Gargantext.Database.Schema.Node
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Utils
(
Cmd
,
mkCmd
)
import
Gargantext.Database.Action.Query.Node
(
pgNodeId
)
updateHyperdata
::
ToJSON
a
=>
NodeId
->
a
->
Cmd
err
Int64
updateHyperdata
i
h
=
mkCmd
$
\
c
->
runUpdate_
c
(
updateHyperdataQuery
i
h
)
...
...
src/Gargantext/Database/Action/Query/Tree.hs
View file @
b28af36c
...
...
@@ -37,11 +37,11 @@ import Database.PostgreSQL.Simple.SqlQQ
import
Gargantext.Prelude
import
Gargantext.Core.Types.Main
(
NodeTree
(
..
),
Tree
(
..
))
import
Gargantext.Database.Config
(
fromNodeTypeId
,
nodeTypeId
)
import
Gargantext.Database.
Admin.
Config
(
fromNodeTypeId
,
nodeTypeId
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
NodeType
,
DocId
,
allNodeTypes
)
import
Gargantext.Database.Admin.Utils
(
Cmd
,
runPGSQuery
)
import
Gargantext.Database.A
dmin.Tools
.Node
import
Gargantext.Database.A
dmin.Tools
.User
import
Gargantext.Database.A
ction.Query
.Node
import
Gargantext.Database.A
ction.Query
.User
------------------------------------------------------------------------
-- import Gargantext.Database.Utils (runCmdDev)
...
...
src/Gargantext/Database/Action/Query/Tree/Root.hs
View file @
b28af36c
...
...
@@ -30,7 +30,7 @@ module Gargantext.Database.Action.Query.Tree.Root
import
Control.Arrow
(
returnA
)
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Database.Admin.Config
(
nodeTypeId
)
import
Gargantext.Database.Action.Node.User
(
HyperdataUser
)
import
Gargantext.Database.Action.
Query.
Node.User
(
HyperdataUser
)
import
Gargantext.Database.Schema.Node
(
NodeRead
)
import
Gargantext.Database.Schema.Node
(
queryNodeTable
)
import
Gargantext.Database.Schema.User
(
queryUserTable
,
UserPoly
(
..
))
...
...
src/Gargantext/Database/Admin/Bashql.hs
View file @
b28af36c
...
...
@@ -85,6 +85,7 @@ import Data.List (concat, last)
import
Gargantext.Core.Types
import
Gargantext.Database.Admin.Utils
(
runOpaQuery
,
Cmd
)
import
Gargantext.Database.Schema.Node
import
Gargantext.Database.Action.Query.Node
import
qualified
Gargantext.Database.Action.Query.Node.Update
as
U
(
Update
(
..
),
update
)
import
Gargantext.Prelude
...
...
src/Gargantext/Database/Admin/Trigger/Init.hs
View file @
b28af36c
...
...
@@ -20,9 +20,9 @@ Ngrams by node enable contextual metrics.
module
Gargantext.Database.Admin.Trigger.Init
where
import
Gargantext.Database.Admin.Trigger
s
.NodeNodeNgrams
(
triggerCountInsert
,
triggerCountInsert2
)
import
Gargantext.Database.Admin.Trigger
s
.Nodes
(
triggerSearchUpdate
)
import
Gargantext.Database.Admin.Trigger
s
.NodesNodes
(
triggerDeleteCount
,
triggerInsertCount
,
triggerUpdateAdd
,
triggerUpdateDel
,
MasterListId
)
-- , triggerCoocInsert)
import
Gargantext.Database.Admin.Trigger.NodeNodeNgrams
(
triggerCountInsert
,
triggerCountInsert2
)
import
Gargantext.Database.Admin.Trigger.Nodes
(
triggerSearchUpdate
)
import
Gargantext.Database.Admin.Trigger.NodesNodes
(
triggerDeleteCount
,
triggerInsertCount
,
triggerUpdateAdd
,
triggerUpdateDel
,
MasterListId
)
-- , triggerCoocInsert)
import
Gargantext.Database.Admin.Utils
(
Cmd
)
import
Gargantext.Prelude
...
...
src/Gargantext/Ext/IMTUser.hs
View file @
b28af36c
...
...
@@ -19,17 +19,17 @@ Here is writtent a common interface.
module
Gargantext.Ext.IMTUser
(
deserialiseImtUsersFromFile
)
where
import
System.IO
(
FilePath
)
import
Codec.Serialise
import
Data.Maybe
(
Maybe
,
catMaybes
)
import
Data.Text
(
Text
)
import
GHC.Generics
(
Generic
)
import
Gargantext.Database.Action.Query.Node.Contact
-- (HyperdataContact, ContactWho, ContactWhere, ContactTouch, ContactMetaData)
import
Gargantext.Prelude
import
Gargantext.Database.Admin.Node.Contact
-- (HyperdataContact, ContactWho, ContactWhere, ContactTouch, ContactMetaData)
import
System.IO
(
FilePath
)
import
qualified
Data.ByteString.Lazy
as
BSL
------------------------------------------------------------------------
instance
Serialise
IMTUser
deserialiseImtUsersFromFile
::
FilePath
->
IO
[
HyperdataContact
]
...
...
src/Gargantext/Prelude/Utils.hs
View file @
b28af36c
...
...
@@ -17,24 +17,24 @@ module Gargantext.Prelude.Utils
where
import
Control.Lens
(
view
)
import
Control.Monad.Reader
(
MonadReader
)
import
Control.Monad.Random.Class
(
MonadRandom
)
import
Data.Text
(
Text
)
import
Control.Monad.Reader
(
MonadReader
)
import
Control.Monad.Reader
(
ask
)
import
Crypto.Argon2
as
Crypto
import
Data.ByteString
(
ByteString
)
import
Data.ByteString.Base64.URL
as
URL
import
Data.Either
import
Data.Text
(
Text
)
import
GHC.IO
(
FilePath
)
import
Gargantext.Prelude
import
Gargantext.API.Settings
import
System.Random
(
newStdGen
)
import
qualified
System.Random.Shuffle
as
SRS
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
NodeType
)
import
Gargantext.Prelude
import
System.Directory
(
createDirectoryIfMissing
)
import
System.Random
(
newStdGen
)
import
qualified
Data.ByteString.Lazy.Char8
as
Char
import
qualified
Data.Digest.Pure.SHA
as
SHA
(
sha256
,
showDigest
)
import
qualified
Data.Text
as
Text
import
Gargantext.Database.Types.Node
(
NodeId
,
NodeType
)
import
Data.ByteString
(
ByteString
)
import
Crypto.Argon2
as
Crypto
import
Data.Either
import
Data.ByteString.Base64.URL
as
URL
import
qualified
System.Random.Shuffle
as
SRS
--------------------------------------------------------------------------
shuffle
::
MonadRandom
m
=>
[
a
]
->
m
[
a
]
...
...
src/Gargantext/Text/Corpus/API/Hal.hs
View file @
b28af36c
...
...
@@ -17,14 +17,13 @@ module Gargantext.Text.Corpus.API.Hal
import
Data.Maybe
import
Data.Text
(
Text
,
pack
,
intercalate
)
import
Gargantext.Prelude
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Database.Admin.Types.Node
(
HyperdataDocument
(
..
))
import
Gargantext.Prelude
import
qualified
Gargantext.Text.Corpus.Parsers.Date
as
Date
import
Gargantext.Database.Types.Node
(
HyperdataDocument
(
..
))
import
qualified
HAL
as
HAL
import
qualified
HAL.Doc.Corpus
as
HAL
import
qualified
HAL.Client
as
HAL
import
qualified
HAL.Doc.Corpus
as
HAL
get
::
Lang
->
Text
->
Maybe
Integer
->
IO
[
HyperdataDocument
]
get
la
q
ml
=
do
...
...
src/Gargantext/Text/Corpus/API/Istex.hs
View file @
b28af36c
...
...
@@ -16,15 +16,14 @@ module Gargantext.Text.Corpus.API.Istex
where
import
Data.Either
(
either
)
import
Data.Maybe
import
Data.List
(
concat
)
import
Data.Maybe
import
Data.Maybe
(
catMaybes
)
import
Data.Text
(
Text
,
pack
)
import
Gargantext.Prelude
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Database.Admin.Types.Node
(
HyperdataDocument
(
..
))
import
Gargantext.Prelude
import
qualified
Gargantext.Text.Corpus.Parsers.Date
as
Date
import
Gargantext.Database.Types.Node
(
HyperdataDocument
(
..
))
import
qualified
ISTEX
as
ISTEX
import
qualified
ISTEX.Client
as
ISTEX
...
...
src/Gargantext/Text/Corpus/API/Pubmed.hs
View file @
b28af36c
...
...
@@ -19,7 +19,7 @@ import Data.Maybe
import
Data.Text
(
Text
)
import
Gargantext.Prelude
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Database.Types.Node
(
HyperdataDocument
(
..
))
import
Gargantext.Database.
Admin.
Types.Node
(
HyperdataDocument
(
..
))
import
qualified
Data.Text
as
Text
import
qualified
PUBMED
as
PubMed
...
...
src/Gargantext/Text/Corpus/Parsers.hs
View file @
b28af36c
...
...
@@ -25,7 +25,6 @@ please follow the types.
module
Gargantext.Text.Corpus.Parsers
(
FileFormat
(
..
),
clean
,
parseFile
,
cleanText
,
parseFormat
)
where
--import Data.ByteString (ByteString)
import
"zip"
Codec.Archive.Zip
(
withArchive
,
getEntry
,
getEntries
)
import
Control.Concurrent.Async
as
CCA
(
mapConcurrently
)
import
Control.Monad
(
join
)
...
...
@@ -40,15 +39,15 @@ import Data.Text (Text)
import
Data.Text.Encoding
(
decodeUtf8
)
import
Data.Tuple.Extra
(
both
,
first
,
second
)
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Database.Types.Node
(
HyperdataDocument
(
..
))
import
Gargantext.Database.
Admin.
Types.Node
(
HyperdataDocument
(
..
))
import
Gargantext.Prelude
import
Gargantext.Text.Corpus.Parsers.CSV
(
parseHal
,
parseHal'
,
parseCsv
,
parseCsv'
)
import
Gargantext.Text.Corpus.Parsers.RIS.Presse
(
presseEnrich
)
import
Gargantext.Text.Learn
(
detectLangDefault
)
import
System.FilePath
(
FilePath
(),
takeExtension
)
import
qualified
Data.ByteString
as
DB
import
qualified
Data.ByteString.Lazy
as
DBL
import
qualified
Data.ByteString.Char8
as
DBC
import
qualified
Data.ByteString.Lazy
as
DBL
import
qualified
Data.Map
as
DM
import
qualified
Data.Text
as
DT
import
qualified
Gargantext.Text.Corpus.Parsers.Date
as
Date
...
...
src/Gargantext/Text/Corpus/Parsers/CSV.hs
View file @
b28af36c
...
...
@@ -27,12 +27,12 @@ import Data.Vector (Vector)
import
GHC.IO
(
FilePath
)
import
GHC.Real
(
round
)
import
GHC.Word
(
Word8
)
import
Gargantext.Database.Types.Node
-- (HyperdataDocument(..))
import
Gargantext.Database.
Admin.
Types.Node
-- (HyperdataDocument(..))
import
Gargantext.Prelude
hiding
(
length
)
import
Gargantext.Text
import
Gargantext.Text.Context
import
qualified
Data.ByteString.Lazy
as
BL
import
qualified
Data.ByteString
as
BS
import
qualified
Data.ByteString.Lazy
as
BL
import
qualified
Data.Vector
as
V
---------------------------------------------------------------
...
...
src/Gargantext/Text/Corpus/Parsers/GrandDebat.hs
View file @
b28af36c
...
...
@@ -24,7 +24,7 @@ import Data.Maybe (Maybe())
import
Data.Text
(
Text
)
import
GHC.Generics
(
Generic
)
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Database.Types.Node
import
Gargantext.Database.
Admin.
Types.Node
import
Gargantext.Prelude
import
Gargantext.Prelude.Utils
import
qualified
Data.ByteString.Lazy
as
DBL
...
...
src/Gargantext/Text/Corpus/Parsers/Isidore.hs
View file @
b28af36c
...
...
@@ -27,9 +27,9 @@ import Data.RDF hiding (triple, Query)
import
Data.Text
hiding
(
groupBy
,
map
)
import
Database.HSparql.Connection
import
Database.HSparql.QueryGenerator
import
Gargantext.Database.Types.Node
(
HyperdataDocument
(
..
))
import
Gargantext.Prelude
import
Gargantext.Core
(
Lang
)
import
Gargantext.Database.Admin.Types.Node
(
HyperdataDocument
(
..
))
import
Gargantext.Prelude
import
Network.Wreq
(
getWith
,
Response
,
defaults
,
header
,
param
,
responseStatus
,
responseBody
)
import
Prelude
(
String
)
...
...
src/Gargantext/Text/List.hs
View file @
b28af36c
...
...
@@ -18,7 +18,6 @@ module Gargantext.Text.List
where
import
Data.Either
(
partitionEithers
,
Either
(
..
))
-- import Debug.Trace (trace)
import
Data.Map
(
Map
)
import
Data.Set
(
Set
)
import
Data.Text
(
Text
)
...
...
@@ -26,13 +25,12 @@ import Gargantext.API.Ngrams (NgramsElement, mkNgramsElement, RootParent(..), mS
import
Gargantext.API.Ngrams.Tools
(
getCoocByNgrams'
,
Diagonal
(
..
))
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Core.Types
(
ListType
(
..
),
MasterCorpusId
,
UserCorpusId
,
NodeId
)
import
Gargantext.Database.Metrics.NgramsByNode
(
getTficf'
,
sortTficf
,
ngramsGroup
,
getNodesByNgramsUser
,
groupNodesByNgramsWith
)
import
Gargantext.Database.Action.Metrics.NgramsByNode
(
getTficf'
,
sortTficf
,
ngramsGroup
,
getNodesByNgramsUser
,
groupNodesByNgramsWith
)
import
Gargantext.Database.Admin.Utils
(
Cmd
)
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
(
..
))
import
Gargantext.
Database.Utils
(
Cmd
)
import
Gargantext.
Prelude
import
Gargantext.Text.List.Learn
(
Model
(
..
))
import
Gargantext.Text.Metrics
(
takeScored
)
import
Gargantext.Prelude
--import Gargantext.Text.Terms (TermType(..))
import
qualified
Data.Char
as
Char
import
qualified
Data.List
as
List
import
qualified
Data.Map
as
Map
...
...
src/Gargantext/Text/Metrics/Hetero.purs
View file @
b28af36c
...
...
@@ -13,22 +13,18 @@ commentary with @some markup@.
module Gargantext.Text.Hetero where
import GHC.Real as R
import Data.Set as S
import Data.Map as M
import Data.List.Split as S
import Data.Map as M
import Data.Set as S
import Database.PostgreSQL.Simple as PGS
import Opaleye.PGTypes (PGInt4)
import Opaleye.Internal.Column (Column)
import Gargantext.Database.Gargandb
import Gargantext.Database.Private
--import Gargantext.Utils.Chronos
import Gargantext.Text.Words (cleanText)
import Gargantext.Text.Count (occurrences)
import GHC.Real as R
import Gargantext.Database.Admin.Gargandb
import Gargantext.Database.Admin.Private
import Gargantext.Database.Simple
import Gargantext.Text.Count (occurrences)
import Gargantext.Text.Words (cleanText)
import Opaleye.Internal.Column (Column)
import Opaleye.PGTypes (PGInt4)
--main = do
-- t <- getTextquery
...
...
src/Gargantext/Viz/Chart.hs
View file @
b28af36c
...
...
@@ -18,33 +18,31 @@ Portability : POSIX
module
Gargantext.Viz.Chart
where
import
Data.Text
(
Text
)
import
Data.List
(
unzip
,
sortOn
)
import
Data.Map
(
toList
)
import
Data.Text
(
Text
)
import
GHC.Generics
(
Generic
)
import
Gargantext.Prelude
import
Gargantext.Database.Config
import
Gargantext.Core.Types.Main
import
Gargantext.Database.Action.Query.Node.Select
import
Gargantext.Database.Admin.Config
import
Gargantext.Database.Admin.Types.Node
(
CorpusId
)
import
Gargantext.Database.Admin.Utils
import
Gargantext.Database.Schema.NodeNode
(
selectDocsDates
)
import
Gargantext.Database.Utils
import
Gargantext.Database.Types.Node
(
CorpusId
)
import
Gargantext.Database.Node.Select
import
Gargantext.Prelude
import
Gargantext.Text.Metrics.Count
(
occurrencesWith
)
import
Gargantext.Core.Types.Main
-- Pie Chart
import
Data.Maybe
(
catMaybes
)
import
qualified
Data.Map
as
Map
import
qualified
Data.List
as
List
import
Gargantext.API.Ngrams.Tools
import
Gargantext.API.Ngrams.NTree
import
Gargantext.Database.Metrics.NgramsByNode
import
Gargantext.API.Ngrams.Tools
import
Gargantext.Core.Types
import
Gargantext.Database.Action.Flow
import
Gargantext.Database.Action.Metrics.NgramsByNode
import
Gargantext.Database.Schema.Ngrams
import
Gargantext.Database.Schema.Node
import
Gargantext.Core.Types
import
Gargantext.Database.Flow
import
Servant
import
qualified
Data.List
as
List
import
qualified
Data.Map
as
Map
data
Chart
=
ChartHisto
|
ChartScatter
|
ChartPie
...
...
src/Gargantext/Viz/Graph.hs
View file @
b28af36c
...
...
@@ -25,9 +25,9 @@ import Data.Swagger
import
Data.Text
(
Text
,
pack
)
import
GHC.Generics
(
Generic
)
import
GHC.IO
(
FilePath
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Core.Types
(
ListId
)
import
Gargantext.Database.Types.Node
(
NodeId
,
Hyperdata
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
Hyperdata
)
import
Gargantext.Prelude
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
...
...
src/Gargantext/Viz/Phylo.hs
View file @
b28af36c
...
...
@@ -29,23 +29,20 @@ one 8, e54847.
module
Gargantext.Viz.Phylo
where
import
Prelude
(
Bounded
)
import
Control.DeepSeq
import
Control.Lens
(
makeLenses
)
import
Data.Aeson.TH
(
deriveJSON
,
defaultOptions
)
import
Data.Map
(
Map
)
import
Data.Maybe
(
Maybe
)
import
Data.Text
(
Text
)
import
Data.Set
(
Set
)
import
Data.Map
(
Map
)
import
Data.Vector
(
Vector
)
import
Data.Swagger
--import Data.Time.Clock.POSIX (POSIXTime)
import
Data.Text
(
Text
)
import
Data.Vector
(
Vector
)
import
GHC.Generics
(
Generic
)
--import Gargantext.Database.Schema.Ngrams (NgramsId)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Text.Context
(
TermList
)
import
Gargantext.Prelude
import
Control.DeepSeq
import
Gargantext.Text.Context
(
TermList
)
import
Prelude
(
Bounded
)
--------------------
-- | PhyloParam | --
...
...
src/Gargantext/Viz/Phylo/Main.hs
View file @
b28af36c
...
...
@@ -26,7 +26,7 @@ import Debug.Trace (trace)
import
GHC.IO
(
FilePath
)
import
Gargantext.API.Ngrams.Tools
(
getTermsWith
)
import
Gargantext.Core.Types
import
Gargantext.Database.Flow
import
Gargantext.Database.
Action.
Flow
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
(
..
))
import
Gargantext.Database.Schema.Node
(
defaultList
)
import
Gargantext.Database.Schema.NodeNode
(
selectDocs
)
...
...
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