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
149
Issues
149
List
Board
Labels
Milestones
Merge Requests
8
Merge Requests
8
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
b6abd151
Commit
b6abd151
authored
Oct 25, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FLOW][DB][LIST] creating subflow for list
[FLOW][TEXT] mv file in Text folder
parent
2996a7df
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
28 deletions
+38
-28
Node.hs
src/Gargantext/API/Node.hs
+1
-1
Flow.hs
src/Gargantext/Database/Flow.hs
+35
-25
Flow.hs
src/Gargantext/Text/Flow.hs
+2
-2
No files found.
src/Gargantext/API/Node.hs
View file @
b6abd151
...
...
@@ -62,7 +62,7 @@ import Gargantext.Database.Facet (FacetDoc , runViewDocuments', OrderBy(..)
import
Gargantext.Database.Tree
(
treeDB
,
HasTreeError
(
..
),
TreeError
(
..
))
import
Gargantext.Database.NodeNode
(
nodesToFavorite
,
nodesToTrash
)
-- Graph
import
Gargantext.TextFlow
import
Gargantext.Text
.
Flow
import
Gargantext.Viz.Graph
(
Graph
)
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Core.Types
(
Offset
,
Limit
)
...
...
src/Gargantext/Database/Flow.hs
View file @
b6abd151
...
...
@@ -35,7 +35,7 @@ import Gargantext.Core.Types (NodePoly(..))
import
Gargantext.Prelude
import
Gargantext.Database.Bashql
(
runCmd'
,
del
)
import
Gargantext.Database.Types.Node
(
Node
(
..
),
HyperdataDocument
(
..
))
import
Gargantext.Database.Node
(
getRoot
,
mkRoot
,
mkCorpus
,
Cmd
(
..
))
import
Gargantext.Database.Node
(
getRoot
,
mkRoot
,
mkCorpus
,
Cmd
(
..
)
,
mkList
)
import
Gargantext.Database.User
(
getUser
,
UserLight
(
..
),
Username
)
import
Gargantext.Database.Node.Document.Insert
(
insertDocuments
,
ReturnId
(
..
),
addUniqIds
)
import
Gargantext.Database.Node.Document.Add
(
add
)
...
...
@@ -47,6 +47,26 @@ type UserId = Int
type
RootId
=
Int
type
CorpusId
=
Int
flow
::
FilePath
->
IO
Int
flow
fp
=
do
(
masterUserId
,
_
,
corpusId
)
<-
subFlow
"gargantua"
docs
<-
map
addUniqIds
<$>
parseDocs
WOS
fp
ids
<-
runCmd'
$
insertDocuments
masterUserId
corpusId
docs
printDebug
"Docs IDs : "
ids
idsRepeat
<-
runCmd'
$
insertDocuments
masterUserId
corpusId
docs
printDebug
"Docs IDs : "
idsRepeat
(
_
,
_
,
corpusId2
)
<-
subFlow
"alexandre"
inserted
<-
runCmd'
$
add
corpusId2
(
map
reId
ids
)
printDebug
"Inserted : "
inserted
runCmd'
$
del
[
corpusId2
,
corpusId
]
subFlow
::
Username
->
IO
(
UserId
,
RootId
,
CorpusId
)
subFlow
username
=
do
maybeUserId
<-
runCmd'
(
getUser
username
)
...
...
@@ -72,29 +92,10 @@ subFlow username = do
(
username
,
userId
,
rootId
,
corpusId
)
pure
(
userId
,
rootId
,
corpusId
)
flow
::
FilePath
->
IO
Int
flow
fp
=
do
(
masterUserId
,
_
,
corpusId
)
<-
subFlow
"gargantua"
docs
<-
map
addUniqIds
<$>
parseDocs
WOS
fp
ids
<-
runCmd'
$
insertDocuments
masterUserId
corpusId
docs
printDebug
"Docs IDs : "
ids
idsRepeat
<-
runCmd'
$
insertDocuments
masterUserId
corpusId
docs
printDebug
"Docs IDs : "
idsRepeat
(
_
,
_
,
corpusId2
)
<-
subFlow
"alexandre"
inserted
<-
runCmd'
$
add
corpusId2
(
map
reId
ids
)
printDebug
"Inserted : "
inserted
runCmd'
$
del
[
corpusId2
,
corpusId
]
----------------------------------------------------------------
type
HashId
=
Text
type
NodeId
=
Int
type
ListId
=
Int
type
ToInsert
=
Map
HashId
HyperdataDocument
type
Inserted
=
Map
HashId
ReturnId
...
...
@@ -148,14 +149,23 @@ insertToNodeNgrams m = insertNodeNgrams $ [ NodeNgram Nothing nId ((_ngramsId
,
(
nId
,
n
)
<-
DM
.
toList
nId2int
]
-- mk ListGroup
-- groupBy fun
-- insertInto NodeNgramsNgrams
listFlow
::
UserId
->
CorpusId
->
Map
(
NgramsT
NgramsIndexed
)
(
Map
NodeId
Int
)
->
Cmd
[
ListId
]
listFlow
uId
cId
ng
=
do
lId
<-
mkList
cId
uId
-- groupNgramsBy fun
-- insertGroups = NodeNgramsNgrams
pure
lId
-- compute Candidate / Map
-- ALTER TABLE nodes_nodes_ngrams ADD COLUMN typelist int;
-- insertNodeNodeNgram
-- insertLists = NodeNodeNgram
-- | TODO ask on meeting
-- get data of NgramsTable
-- post :: update NodeNodeNgrams
-- group ngrams
...
...
src/Gargantext/TextFlow.hs
→
src/Gargantext/Text
/
Flow.hs
View file @
b6abd151
{-|
Module : Gargantext.TextFlow
Module : Gargantext.Text
.
Flow
Description : Server API
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
...
...
@@ -14,7 +14,7 @@ From text to viz, all the flow of texts in Gargantext.
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# LANGUAGE NoImplicitPrelude #-}
module
Gargantext.TextFlow
module
Gargantext.Text
.
Flow
where
import
GHC.IO
(
FilePath
)
...
...
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