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
141
Issues
141
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
0d5d6390
Commit
0d5d6390
authored
Apr 29, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DB/FACT] Schema NodeNodeNgrams -> Query (with warnings)
parent
37d8ac18
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
123 additions
and
56 deletions
+123
-56
Flow.hs
src/Gargantext/Database/Action/Flow.hs
+1
-1
Utils.hs
src/Gargantext/Database/Action/Flow/Utils.hs
+1
-1
Search.hs
src/Gargantext/Database/Action/Search.hs
+1
-1
Facet.hs
src/Gargantext/Database/Query/Facet.hs
+1
-1
Ngrams.hs
src/Gargantext/Database/Query/Table/Ngrams.hs
+1
-1
NodeNodeNgrams.hs
src/Gargantext/Database/Query/Table/NodeNodeNgrams.hs
+62
-0
NodeNodeNgrams2.hs
src/Gargantext/Database/Query/Table/NodeNodeNgrams2.hs
+56
-0
NodeNodeNgrams.hs
src/Gargantext/Database/Schema/NodeNodeNgrams.hs
+0
-28
NodeNodeNgrams2.hs
src/Gargantext/Database/Schema/NodeNodeNgrams2.hs
+0
-23
No files found.
src/Gargantext/Database/Action/Flow.hs
View file @
0d5d6390
...
...
@@ -77,7 +77,7 @@ import Gargantext.Database.Admin.Types.Node -- (HyperdataDocument(..), NodeType(
import
Gargantext.Database.Admin.Utils
(
Cmd
)
import
Gargantext.Database.Query.Table.Ngrams
import
Gargantext.Database.Query.Table.NodeNgrams
(
listInsertDb
,
getCgramsId
)
import
Gargantext.Database.
Schema.NodeNodeNgrams2
-- (NodeNodeNgrams2, insertNodeNodeNgrams2)
import
Gargantext.Database.
Query.Table.NodeNodeNgrams2
import
Gargantext.Ext.IMT
(
toSchoolName
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Ext.IMTUser
(
deserialiseImtUsersFromFile
)
...
...
src/Gargantext/Database/Action/Flow/Utils.hs
View file @
0d5d6390
...
...
@@ -26,7 +26,7 @@ import Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Utils
(
Cmd
)
import
Gargantext.Database.Schema.Ngrams
import
Gargantext.Database.Schema.Node
import
Gargantext.Database.
Schema
.NodeNodeNgrams
import
Gargantext.Database.
Query.Table
.NodeNodeNgrams
import
Gargantext.Prelude
import
qualified
Data.Map
as
DM
...
...
src/Gargantext/Database/Action/Search.hs
View file @
0d5d6390
...
...
@@ -32,12 +32,12 @@ import Gargantext.Database.Query.Facet
import
Gargantext.Database.Query.Join
(
leftJoin6
)
import
Gargantext.Database.Query.Table.Node
import
Gargantext.Database.Query.Table.NodeNode
import
Gargantext.Database.Query.Table.NodeNodeNgrams
import
Gargantext.Database.Query.Table.Ngrams
import
Gargantext.Database.Admin.Config
(
nodeTypeId
)
import
Gargantext.Database.Admin.Types.Node
(
NodeType
(
..
))
import
Gargantext.Database.Admin.Utils
(
Cmd
,
runPGSQuery
,
runOpaQuery
,
runCountOpaQuery
)
import
Gargantext.Database.Schema.Node
import
Gargantext.Database.Schema.NodeNodeNgrams
import
Gargantext.Prelude
import
Gargantext.Text.Terms.Mono.Stem.En
(
stemIt
)
import
Opaleye
hiding
(
Query
,
Order
)
...
...
src/Gargantext/Database/Query/Facet.hs
View file @
0d5d6390
...
...
@@ -62,7 +62,7 @@ import Gargantext.Database.Admin.Utils
import
Gargantext.Database.Schema.Ngrams
import
Gargantext.Database.Schema.Node
import
Gargantext.Database.Query.Table.NodeNode
import
Gargantext.Database.
Schema
.NodeNodeNgrams
import
Gargantext.Database.
Query.Table
.NodeNodeNgrams
import
Opaleye
import
Prelude
hiding
(
null
,
id
,
map
,
sum
,
not
,
read
)
import
Servant.API
...
...
src/Gargantext/Database/Query/Table/Ngrams.hs
View file @
0d5d6390
...
...
@@ -33,7 +33,7 @@ import Gargantext.Database.Admin.Types.Node (pgNodeId)
import
Gargantext.Database.Admin.Utils
(
runOpaQuery
,
Cmd
)
import
Gargantext.Database.Schema.Ngrams
import
Gargantext.Database.Admin.Utils
(
Cmd
,
runPGSQuery
,
runOpaQuery
,
formatPGSQuery
)
import
Gargantext.Database.
Schema
.NodeNodeNgrams
import
Gargantext.Database.
Query.Table
.NodeNodeNgrams
import
Gargantext.Prelude
import
Gargantext.Database.Schema.Prelude
import
Data.ByteString.Internal
(
ByteString
)
...
...
src/Gargantext/Database/Query/Table/NodeNodeNgrams.hs
0 → 100644
View file @
0d5d6390
{-|
Module : Gargantext.Database.Schema.NodeNodeNgrams
Description : TODO: remove this module and table in database
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE Arrows #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
module
Gargantext.Database.Query.Table.NodeNodeNgrams
(
module
Gargantext
.
Database
.
Schema
.
NodeNodeNgrams
,
queryNodeNodeNgramsTable
,
insertNodeNodeNgrams
)
where
import
Prelude
import
Gargantext.Database.Admin.Utils
(
Cmd
,
mkCmd
)
import
Gargantext.Database.Schema.Prelude
import
Gargantext.Database.Schema.Ngrams
(
NgramsTypeId
,
pgNgramsTypeId
,
NgramsId
)
import
Gargantext.Database.Schema.NodeNodeNgrams
import
Gargantext.Database.Admin.Types.Node
(
pgNodeId
)
import
Gargantext.Database.Admin.Types.Node
queryNodeNodeNgramsTable
::
Query
NodeNodeNgramsRead
queryNodeNodeNgramsTable
=
queryTable
nodeNodeNgramsTable
-- | Insert utils
insertNodeNodeNgrams
::
[
NodeNodeNgrams
]
->
Cmd
err
Int
insertNodeNodeNgrams
=
insertNodeNodeNgramsW
.
map
(
\
(
NodeNodeNgrams
n1
n2
ng
nt
w
)
->
NodeNodeNgrams
(
pgNodeId
n1
)
(
pgNodeId
n2
)
(
pgInt4
ng
)
(
pgNgramsTypeId
nt
)
(
pgDouble
w
)
)
insertNodeNodeNgramsW
::
[
NodeNodeNgramsWrite
]
->
Cmd
err
Int
insertNodeNodeNgramsW
nnnw
=
mkCmd
$
\
c
->
fromIntegral
<$>
runInsert_
c
insertNothing
where
insertNothing
=
(
Insert
{
iTable
=
nodeNodeNgramsTable
,
iRows
=
nnnw
,
iReturning
=
rCount
,
iOnConflict
=
(
Just
DoNothing
)
})
src/Gargantext/Database/Query/Table/NodeNodeNgrams2.hs
0 → 100644
View file @
0d5d6390
{-|
Module : Gargantext.Database.Schema.NodeNodeNgrams
Description : TODO: remove this module and table in database
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE Arrows #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
module
Gargantext.Database.Query.Table.NodeNodeNgrams2
(
module
Gargantext
.
Database
.
Schema
.
NodeNodeNgrams2
,
insertNodeNodeNgrams2
)
where
import
Gargantext.Database.Schema.Prelude
import
Gargantext.Database.Schema.NodeNodeNgrams2
import
Gargantext.Database.Admin.Types.Node
(
pgNodeId
)
import
Gargantext.Database.Admin.Utils
(
Cmd
,
mkCmd
)
import
Prelude
queryNodeNodeNgrams2Table
::
Query
NodeNodeNgrams2Read
queryNodeNodeNgrams2Table
=
queryTable
nodeNodeNgrams2Table
-- | Insert utils
insertNodeNodeNgrams2
::
[
NodeNodeNgrams2
]
->
Cmd
err
Int
insertNodeNodeNgrams2
=
insertNodeNodeNgrams2W
.
map
(
\
(
NodeNodeNgrams2
n1
n2
w
)
->
NodeNodeNgrams2
(
pgNodeId
n1
)
(
pgInt4
n2
)
(
pgDouble
w
)
)
insertNodeNodeNgrams2W
::
[
NodeNodeNgrams2Write
]
->
Cmd
err
Int
insertNodeNodeNgrams2W
nnnw
=
mkCmd
$
\
c
->
fromIntegral
<$>
runInsert_
c
insertNothing
where
insertNothing
=
Insert
{
iTable
=
nodeNodeNgrams2Table
,
iRows
=
nnnw
,
iReturning
=
rCount
,
iOnConflict
=
(
Just
DoNothing
)
}
src/Gargantext/Database/Schema/NodeNodeNgrams.hs
View file @
0d5d6390
...
...
@@ -24,10 +24,8 @@ module Gargantext.Database.Schema.NodeNodeNgrams
where
import
Prelude
import
Gargantext.Database.Admin.Utils
(
Cmd
,
mkCmd
)
import
Gargantext.Database.Schema.Prelude
import
Gargantext.Database.Schema.Ngrams
(
NgramsTypeId
,
pgNgramsTypeId
,
NgramsId
)
import
Gargantext.Database.Admin.Types.Node
(
pgNodeId
)
import
Gargantext.Database.Admin.Types.Node
data
NodeNodeNgramsPoly
n1
n2
ngrams_id
ngt
w
...
...
@@ -77,29 +75,3 @@ nodeNodeNgramsTable = Table "node_node_ngrams"
}
)
------------------------------------------------
queryNodeNodeNgramsTable
::
Query
NodeNodeNgramsRead
queryNodeNodeNgramsTable
=
queryTable
nodeNodeNgramsTable
-- | Insert utils
insertNodeNodeNgrams
::
[
NodeNodeNgrams
]
->
Cmd
err
Int
insertNodeNodeNgrams
=
insertNodeNodeNgramsW
.
map
(
\
(
NodeNodeNgrams
n1
n2
ng
nt
w
)
->
NodeNodeNgrams
(
pgNodeId
n1
)
(
pgNodeId
n2
)
(
pgInt4
ng
)
(
pgNgramsTypeId
nt
)
(
pgDouble
w
)
)
insertNodeNodeNgramsW
::
[
NodeNodeNgramsWrite
]
->
Cmd
err
Int
insertNodeNodeNgramsW
nnnw
=
mkCmd
$
\
c
->
fromIntegral
<$>
runInsert_
c
insertNothing
where
insertNothing
=
(
Insert
{
iTable
=
nodeNodeNgramsTable
,
iRows
=
nnnw
,
iReturning
=
rCount
,
iOnConflict
=
(
Just
DoNothing
)
})
src/Gargantext/Database/Schema/NodeNodeNgrams2.hs
View file @
0d5d6390
...
...
@@ -27,7 +27,6 @@ import Gargantext.Database.Schema.Prelude
import
Gargantext.Database.Schema.NodeNgrams
(
NodeNgramsId
)
import
Gargantext.Database.Admin.Types.Node
(
pgNodeId
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Utils
(
Cmd
,
mkCmd
)
import
Prelude
data
NodeNodeNgrams2Poly
node_id
nodengrams_id
w
...
...
@@ -57,7 +56,6 @@ type NodeNodeNgrams2 =
$
(
makeAdaptorAndInstance
"pNodeNodeNgrams2"
''
N
odeNodeNgrams2Poly
)
makeLenses
''
N
odeNodeNgrams2Poly
nodeNodeNgrams2Table
::
Table
NodeNodeNgrams2Write
NodeNodeNgrams2Read
nodeNodeNgrams2Table
=
Table
"node_node_ngrams2"
(
pNodeNodeNgrams2
NodeNodeNgrams2
...
...
@@ -67,24 +65,3 @@ nodeNodeNgrams2Table = Table "node_node_ngrams2"
}
)
queryNodeNodeNgrams2Table
::
Query
NodeNodeNgrams2Read
queryNodeNodeNgrams2Table
=
queryTable
nodeNodeNgrams2Table
-- | Insert utils
insertNodeNodeNgrams2
::
[
NodeNodeNgrams2
]
->
Cmd
err
Int
insertNodeNodeNgrams2
=
insertNodeNodeNgrams2W
.
map
(
\
(
NodeNodeNgrams2
n1
n2
w
)
->
NodeNodeNgrams2
(
pgNodeId
n1
)
(
pgInt4
n2
)
(
pgDouble
w
)
)
insertNodeNodeNgrams2W
::
[
NodeNodeNgrams2Write
]
->
Cmd
err
Int
insertNodeNodeNgrams2W
nnnw
=
mkCmd
$
\
c
->
fromIntegral
<$>
runInsert_
c
insertNothing
where
insertNothing
=
Insert
{
iTable
=
nodeNodeNgrams2Table
,
iRows
=
nnnw
,
iReturning
=
rCount
,
iOnConflict
=
(
Just
DoNothing
)
}
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