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
150
Issues
150
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
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
c7205fd3
Commit
c7205fd3
authored
May 24, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev-forgot-password
parents
2e060925
d03768cd
Pipeline
#2852
failed with stage
in 37 minutes and 18 seconds
Changes
17
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
58 additions
and
49 deletions
+58
-49
CHANGELOG.md
CHANGELOG.md
+7
-0
CONTRIBUTING.md
CONTRIBUTING.md
+7
-10
gargantext.cabal
gargantext.cabal
+1
-1
package.yaml
package.yaml
+1
-1
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+1
-1
Tools.hs
src/Gargantext/API/Ngrams/Tools.hs
+14
-12
Export.hs
src/Gargantext/API/Node/Corpus/Export.hs
+2
-2
Date.hs
src/Gargantext/Core/Text/Corpus/Parsers/Date.hs
+3
-0
WOS.hs
src/Gargantext/Core/Text/Corpus/Parsers/WOS.hs
+8
-8
List.hs
src/Gargantext/Core/Text/List.hs
+1
-1
Social.hs
src/Gargantext/Core/Text/List/Social.hs
+1
-1
Chart.hs
src/Gargantext/Core/Viz/Chart.hs
+2
-2
API.hs
src/Gargantext/Core/Viz/Graph/API.hs
+3
-3
Tools.hs
src/Gargantext/Core/Viz/Phylo/API/Tools.hs
+2
-2
Pairing.hs
src/Gargantext/Database/Action/Flow/Pairing.hs
+1
-1
Metrics.hs
src/Gargantext/Database/Action/Metrics.hs
+2
-2
Node.hs
src/Gargantext/Database/Admin/Types/Node.hs
+2
-2
No files found.
CHANGELOG.md
View file @
c7205fd3
## Version 0.0.5.8.9.1
*
[
FE
]
[
DESIGN
]
NoteBook, UI/UX Improvements
*
[
FE
]
[
FEAT
]
Automatic Sync when adding a new ngrams
*
[
FE
]
Frame Page
## Version 0.0.5.8.9
*
[
COUNTS
]
Chart update when docs are deleted or added
*
[
ERGO
]
Plane navigation improved
*
[
ERGO
]
Mouse misalignemnt fixed
*
[
FIX
]
Date parser WOS
*
[
FIX
]
Node names: List -> Terms
## Version 0.0.5.8.8.2
*
[
FE
]
Fix Contact Page
...
...
CONTRIBUTING.md
View file @
c7205fd3
# Contributing
##
Main repo
##
Code contribution
https://gitlab.iscpif.fr/gargantext/haskell-gargantext
We use Git to share and merge our code.
## Style
## Stack by default
We are using the common Haskell Style:
https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
stack install
## REPL
stack ghci at the root of the project (it will load right paths of
static resources).
## Code Of Conduct
Be constructive as sharing our code of conduct
gargantext.cabal
View file @
c7205fd3
...
...
@@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack
name: gargantext
version: 0.0.5.8.9
version: 0.0.5.8.9
.1
synopsis: Search, map, share
description: Please see README.md
category: Data
...
...
package.yaml
View file @
c7205fd3
...
...
@@ -6,7 +6,7 @@ name: gargantext
# | | | +----- Layers * : New versions with API additions
# | | | | +--- Layers * : New versions without API breaking changes
# | | | | |
version
:
'
0.0.5.8.9'
version
:
'
0.0.5.8.9
.1
'
synopsis
:
Search, map, share
description
:
Please see README.md
category
:
Data
...
...
src/Gargantext/API/Ngrams.hs
View file @
c7205fd3
...
...
@@ -261,7 +261,7 @@ setListNgrams listId ngramsType ns = do
currentVersion
::
HasNodeStory
env
err
m
=>
ListId
->
m
Version
currentVersion
listId
=
do
nls
<-
getRepo
'
[
listId
]
nls
<-
getRepo
[
listId
]
pure
$
nls
^.
unNodeStory
.
at
listId
.
_Just
.
a_version
...
...
src/Gargantext/API/Ngrams/Tools.hs
View file @
c7205fd3
...
...
@@ -35,22 +35,26 @@ mergeNgramsElement _neOld neNew = neNew
type
RootTerm
=
NgramsTerm
{-
getRepo :: RepoCmdM env err m => m NgramsRepo
getRepo = do
v <- view repoVar
liftBase $ readMVar v
-}
getRepo
'
::
HasNodeStory
env
err
m
getRepo
::
HasNodeStory
env
err
m
=>
[
ListId
]
->
m
NodeListStory
getRepo
'
listIds
=
do
getRepo
listIds
=
do
f
<-
getNodeListStory
v
<-
liftBase
$
f
listIds
v'
<-
liftBase
$
readMVar
v
pure
$
v'
repoSize
::
Ord
k1
=>
NodeStory
(
Map
.
Map
k1
(
Map
.
Map
k2
a
))
p
->
NodeId
->
Map
.
Map
k1
Int
repoSize
repo
node_id
=
Map
.
map
Map
.
size
state
where
state
=
repo
^.
unNodeStory
.
at
node_id
.
_Just
.
a_state
getNodeStoryVar
::
HasNodeStory
env
err
m
=>
[
ListId
]
->
m
(
MVar
NodeListStory
)
getNodeStoryVar
l
=
do
...
...
@@ -83,8 +87,6 @@ listNgramsFromRepo nodeIds ngramsType repo =
|
nodeId
<-
nodeIds
]
-- TODO-ACCESS: We want to do the security check before entering here.
-- Add a static capability parameter would be nice.
-- Ideally this is the access to `repoVar` which needs to
...
...
@@ -93,7 +95,7 @@ getListNgrams :: HasNodeStory env err m
=>
[
ListId
]
->
NgramsType
->
m
(
HashMap
NgramsTerm
NgramsRepoElement
)
getListNgrams
nodeIds
ngramsType
=
listNgramsFromRepo
nodeIds
ngramsType
<$>
getRepo
'
nodeIds
<$>
getRepo
nodeIds
getTermsWith
::
(
HasNodeStory
env
err
m
,
Eq
a
,
Hashable
a
)
...
...
@@ -105,7 +107,7 @@ getTermsWith f ls ngt lts = HM.fromListWith (<>)
<$>
HM
.
toList
<$>
HM
.
filter
(
\
f'
->
Set
.
member
(
fst
f'
)
lts
)
<$>
mapTermListRoot
ls
ngt
<$>
getRepo
'
ls
<$>
getRepo
ls
where
toTreeWith
(
t
,
(
_lt
,
maybeRoot
))
=
case
maybeRoot
of
Nothing
->
(
f
t
,
[]
)
...
...
src/Gargantext/API/Node/Corpus/Export.hs
View file @
c7205fd3
...
...
@@ -28,7 +28,7 @@ import qualified Data.HashMap.Strict as HashMap
import
Gargantext.API.Node.Corpus.Export.Types
import
qualified
Gargantext.API.Node.Document.Export.Types
as
DocumentExport
import
Gargantext.API.Ngrams.Types
import
Gargantext.API.Ngrams.Tools
(
filterListWithRoot
,
mapTermListRoot
,
getRepo
'
)
import
Gargantext.API.Ngrams.Tools
(
filterListWithRoot
,
mapTermListRoot
,
getRepo
)
import
Gargantext.API.Prelude
(
GargNoServer
)
import
Gargantext.Prelude.Crypto.Hash
(
hash
)
import
Gargantext.Core.Types
...
...
@@ -66,7 +66,7 @@ getCorpus cId lId nt' = do
<$>
map
(
\
n
->
(
_context_id
n
,
n
))
<$>
selectDocNodes
cId
repo
<-
getRepo
'
[
listId
]
repo
<-
getRepo
[
listId
]
ngs
<-
getContextNgrams
cId
listId
MapTerm
nt
repo
let
-- uniqId is hash computed already for each document imported in database
r
=
Map
.
intersectionWith
...
...
src/Gargantext/Core/Text/Corpus/Parsers/Date.hs
View file @
c7205fd3
...
...
@@ -105,6 +105,9 @@ dateFlow (DucklingFailure txt) = case readDate $ replace " " "T" txt of
Nothing
->
dateFlow
(
ReadFailure1
txt
)
Just
ok
->
DateFlowSuccess
ok
dateFlow
(
ReadFailure1
txt
)
=
case
readDate
txt
of
Nothing
->
dateFlow
$
ReadFailure2
txt
Just
ok
->
DateFlowSuccess
ok
dateFlow
(
ReadFailure2
txt
)
=
case
readDate
$
replace
" "
""
txt
<>
"-01-01T00:00:00"
of
Nothing
->
DateFlowFailure
Just
ok
->
DateFlowSuccess
ok
dateFlow
_
=
DateFlowFailure
...
...
src/Gargantext/Core/Text/Corpus/Parsers/WOS.hs
View file @
c7205fd3
...
...
@@ -47,11 +47,11 @@ notice = start *> many (fieldWith field) <* end
keys
::
ByteString
->
ByteString
keys
champs
|
champs
==
"AF"
=
"authors"
|
champs
==
"TI"
=
"title"
|
champs
==
"SO"
=
"source"
|
champs
==
"DI"
=
"doi"
|
champs
==
"PD
"
=
"publication_date"
|
champs
==
"AB"
=
"abstract"
|
otherwise
=
champs
keys
field
|
field
==
"AF"
=
"authors"
|
field
==
"TI"
=
"title"
|
field
==
"SO"
=
"source"
|
field
==
"DI"
=
"doi"
|
field
==
"PY
"
=
"publication_date"
|
field
==
"AB"
=
"abstract"
|
otherwise
=
field
src/Gargantext/Core/Text/List.hs
View file @
c7205fd3
...
...
@@ -124,7 +124,7 @@ buildNgramsOthersList user uCid mfslw _groupParams (nt, MapListSize mapListSize,
$
HashMap
.
toList
tailTerms'
pure
$
Map
.
fromList
[(
nt
,
(
toNgramsElement
stopTerms
)
pure
$
Map
.
fromList
[(
nt
,
List
.
take
maxListSize
$
(
toNgramsElement
stopTerms
)
<>
(
toNgramsElement
mapTerms
)
<>
(
toNgramsElement
$
setListType
(
Just
MapTerm
)
mapTerms'
)
<>
(
toNgramsElement
$
setListType
(
Just
CandidateTerm
)
candiTerms
)
...
...
src/Gargantext/Core/Text/List/Social.hs
View file @
c7205fd3
...
...
@@ -168,5 +168,5 @@ getHistory :: ( HasNodeStory env err m
->
[
ListId
]
->
m
(
Map
ListId
(
Map
NgramsType
[
HashMap
NgramsTerm
NgramsPatch
]))
getHistory
hist
nt
listes
=
history
hist
[
nt
]
listes
<$>
getRepo
'
listes
history
hist
[
nt
]
listes
<$>
getRepo
listes
src/Gargantext/Core/Viz/Chart.hs
View file @
c7205fd3
...
...
@@ -59,7 +59,7 @@ chartData :: FlowCmdM env err m
chartData
cId
nt
lt
=
do
ls'
<-
selectNodesWithUsername
NodeList
userMaster
ls
<-
map
(
_node_id
)
<$>
getListsWithParentId
cId
ts
<-
mapTermListRoot
ls
nt
<$>
getRepo
'
ls
ts
<-
mapTermListRoot
ls
nt
<$>
getRepo
ls
let
dico
=
filterListWithRoot
[
lt
]
ts
terms
=
catMaybes
$
List
.
concat
$
map
(
\
(
a
,
b
)
->
[
Just
a
,
b
])
$
HashMap
.
toList
dico
...
...
@@ -83,7 +83,7 @@ treeData :: FlowCmdM env err m
treeData
cId
nt
lt
=
do
ls'
<-
selectNodesWithUsername
NodeList
userMaster
ls
<-
map
(
_node_id
)
<$>
getListsWithParentId
cId
ts
<-
mapTermListRoot
ls
nt
<$>
getRepo
'
ls
ts
<-
mapTermListRoot
ls
nt
<$>
getRepo
ls
let
dico
=
filterListWithRoot
[
lt
]
ts
...
...
src/Gargantext/Core/Viz/Graph/API.hs
View file @
c7205fd3
...
...
@@ -96,7 +96,7 @@ getGraph _uId nId = do
-- printDebug "[getGraph] getting list for cId" cId
listId
<-
defaultList
cId
repo
<-
getRepo
'
[
listId
]
repo
<-
getRepo
[
listId
]
-- TODO Distance in Graph params
case
graph
of
...
...
@@ -142,7 +142,7 @@ recomputeGraph _uId nId method maybeDistance force = do
let
cId
=
maybe
(
panic
"[G.V.G.API] Node has no parent"
)
identity
mcId
listId
<-
defaultList
cId
repo
<-
getRepo
'
[
listId
]
repo
<-
getRepo
[
listId
]
let
v
=
repo
^.
unNodeStory
.
at
listId
.
_Just
.
a_version
let
computeG
mt
=
do
...
...
@@ -286,7 +286,7 @@ graphVersions n nId = do
else
panic
"[G.V.G.API] list not found after iterations"
Just
listId
->
do
repo
<-
getRepo
'
[
listId
]
repo
<-
getRepo
[
listId
]
let
v
=
repo
^.
unNodeStory
.
at
listId
.
_Just
.
a_version
-- printDebug "graphVersions" v
...
...
src/Gargantext/Core/Viz/Phylo/API/Tools.hs
View file @
c7205fd3
...
...
@@ -21,7 +21,7 @@ import Data.Text (Text, pack)
import
Data.Time.Calendar
(
fromGregorian
,
diffGregorianDurationClip
,
cdMonths
,
diffDays
,
showGregorian
)
import
Data.Time.Clock.POSIX
(
posixSecondsToUTCTime
)
import
Gargantext.API.Ngrams.Prelude
(
getTermList
)
import
Gargantext.API.Ngrams.Tools
(
getRepo
'
)
import
Gargantext.API.Ngrams.Tools
(
getRepo
)
import
Gargantext.API.Ngrams.Types
(
NgramsTerm
(
..
))
import
Gargantext.API.Node.Corpus.Export
(
getContextNgrams
)
import
Gargantext.API.Prelude
(
GargNoServer
)
...
...
@@ -96,7 +96,7 @@ corpusIdtoDocuments :: TimeUnit -> CorpusId -> GargNoServer (TermList, [Document
corpusIdtoDocuments
timeUnit
corpusId
=
do
docs
<-
selectDocNodes
corpusId
lId
<-
defaultList
corpusId
repo
<-
getRepo
'
[
lId
]
repo
<-
getRepo
[
lId
]
ngs_terms
<-
getContextNgrams
corpusId
lId
MapTerm
NgramsTerms
repo
ngs_sources
<-
getContextNgrams
corpusId
lId
MapTerm
Sources
repo
...
...
src/Gargantext/Database/Action/Flow/Pairing.hs
View file @
c7205fd3
...
...
@@ -190,7 +190,7 @@ getNgramsDocId :: CorpusId
->
GargNoServer
(
HashMap
DocAuthor
(
Set
NodeId
))
getNgramsDocId
cId
lId
nt
=
do
lIds
<-
selectNodesWithUsername
NodeList
userMaster
repo
<-
getRepo
'
(
lId
:
lIds
)
repo
<-
getRepo
(
lId
:
lIds
)
let
ngs
=
filterListWithRoot
[
MapTerm
,
CandidateTerm
]
$
mapTermListRoot
(
lId
:
lIds
)
nt
repo
-- printDebug "getNgramsDocId" ngs
...
...
src/Gargantext/Database/Action/Metrics.hs
View file @
c7205fd3
...
...
@@ -23,7 +23,7 @@ import Database.PostgreSQL.Simple (Query, Only(..))
import
Database.PostgreSQL.Simple.Types
(
Values
(
..
),
QualifiedIdentifier
(
..
))
import
Data.Vector
(
Vector
)
import
Gargantext.Core
(
HasDBid
(
toDBid
))
import
Gargantext.API.Ngrams.Tools
(
filterListWithRoot
,
groupNodesByNgrams
,
Diagonal
(
..
),
getCoocByNgrams
,
mapTermListRoot
,
RootTerm
,
getRepo
'
)
import
Gargantext.API.Ngrams.Tools
(
filterListWithRoot
,
groupNodesByNgrams
,
Diagonal
(
..
),
getCoocByNgrams
,
mapTermListRoot
,
RootTerm
,
getRepo
)
import
Gargantext.Database.Prelude
(
runPGSQuery
{-, formatPGSQuery-}
)
import
Gargantext.API.Ngrams.Types
(
TabType
(
..
),
ngramsTypeFromTabType
,
NgramsTerm
(
..
))
import
Gargantext.Core.Mail.Types
(
HasMail
)
...
...
@@ -233,7 +233,7 @@ getNgrams :: (HasMail env, HasNodeStory env err m)
)
getNgrams
lId
tabType
=
do
lists
<-
mapTermListRoot
[
lId
]
(
ngramsTypeFromTabType
tabType
)
<$>
getRepo
'
[
lId
]
lists
<-
mapTermListRoot
[
lId
]
(
ngramsTypeFromTabType
tabType
)
<$>
getRepo
[
lId
]
-- TODO filterListWithRoot [MapTerm, StopTerm, CandidateTerm] lists
let
maybeSyn
=
HM
.
unions
$
map
(
\
t
->
filterListWithRoot
t
lists
)
[[
MapTerm
],
[
StopTerm
],
[
CandidateTerm
]]
...
...
src/Gargantext/Database/Admin/Types/Node.hs
View file @
c7205fd3
...
...
@@ -372,7 +372,7 @@ defaultName NodeAnnuaire = "Annuaire"
defaultName
NodeDocument
=
"Doc"
defaultName
NodeTexts
=
"Docs"
defaultName
NodeList
=
"
List
"
defaultName
NodeList
=
"
Terms
"
defaultName
NodeListCooc
=
"List"
defaultName
NodeModel
=
"Model"
...
...
@@ -386,7 +386,7 @@ defaultName NodeDashboard = "Board"
defaultName
NodeGraph
=
"Graph"
defaultName
NodePhylo
=
"Phylo"
defaultName
NodeFrameWrite
=
"
Wri
te"
defaultName
NodeFrameWrite
=
"
No
te"
defaultName
NodeFrameCalc
=
"Calc"
defaultName
NodeFrameVisio
=
"Visio"
defaultName
NodeFrameNotebook
=
"Code"
...
...
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