Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
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
Przemyslaw Kaminski
haskell-gargantext
Commits
168d6ce6
Commit
168d6ce6
authored
Jul 21, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] warnings
parent
25f2808e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
19 deletions
+14
-19
Pairing.hs
src/Gargantext/Database/Action/Flow/Pairing.hs
+3
-5
Search.hs
src/Gargantext/Database/Action/Search.hs
+7
-11
Share.hs
src/Gargantext/Database/Action/Share.hs
+1
-1
Node.hs
src/Gargantext/Database/Query/Table/Node.hs
+3
-2
No files found.
src/Gargantext/Database/Action/Flow/Pairing.hs
View file @
168d6ce6
...
...
@@ -24,7 +24,6 @@ import Data.Text (Text, toLower)
import
Database.PostgreSQL.Simple.SqlQQ
(
sql
)
import
Gargantext.Core.Types
(
TableResult
(
..
))
import
Gargantext.Database
import
Gargantext.Database.Action.Flow.Utils
import
Gargantext.Database.Admin.Types.Hyperdata
-- (HyperdataContact(..))
import
Gargantext.Database.Admin.Types.Node
-- (AnnuaireId, CorpusId, ListId, DocId, ContactId, NodeId)
import
Gargantext.Database.Prelude
(
Cmd
,
runPGSQuery
)
...
...
@@ -34,7 +33,6 @@ import Gargantext.Database.Schema.Node
import
Gargantext.Prelude
hiding
(
sum
)
import
Safe
(
lastMay
)
import
qualified
Data.List
as
List
import
qualified
Data.Map
as
DM
import
qualified
Data.Map
as
Map
import
qualified
Data.Text
as
DT
import
qualified
Data.Set
as
Set
...
...
@@ -151,7 +149,7 @@ align mc ma md = fromListWith (<>)
fusion
::
Map
ContactName
(
Set
ContactId
)
->
Map
ContactName
(
Set
DocId
)
->
Map
ContactId
(
Set
DocId
)
fusion
mc
md
=
undefined
fusion
_mc
_
md
=
undefined
{- fromListWith (<>)
$ catMaybes
$ map (\c -> case Map.lookup c mc of
...
...
@@ -179,10 +177,10 @@ getNgramsDocId :: CorpusId
->
ListId
->
NgramsType
->
Cmd
err
(
Map
DocAuthor
(
Set
NodeId
))
getNgramsDocId
corpusId
listId
n
gramsType
getNgramsDocId
corpusId
listId
n
t
=
fromListWith
(
<>
)
<$>
map
(
\
(
t
,
nId
)
->
(
t
,
Set
.
singleton
(
NodeId
nId
)))
<$>
selectNgramsDocId
corpusId
listId
n
gramsType
<$>
selectNgramsDocId
corpusId
listId
n
t
selectNgramsDocId
::
CorpusId
...
...
src/Gargantext/Database/Action/Search.hs
View file @
168d6ce6
...
...
@@ -15,32 +15,28 @@ module Gargantext.Database.Action.Search where
import
Control.Arrow
(
returnA
)
import
Control.Lens
((
^.
))
import
Data.Aeson
import
Data.List
(
intersperse
,
take
,
drop
)
import
Data.Map.Strict
hiding
(
map
,
drop
,
take
)
import
Data.List
(
intersperse
)
import
Data.Maybe
import
Data.String
(
IsString
(
..
))
import
Data.Text
(
Text
,
words
,
unpack
,
intercalate
)
import
Data.Time
(
UTCTime
)
import
Database.PostgreSQL.Simple
(
Query
)
import
Database.PostgreSQL.Simple.ToField
import
Opaleye
hiding
(
Query
,
Order
)
import
qualified
Opaleye
as
O
hiding
(
Order
)
import
Gargantext.Core.Types
import
Gargantext.Database.Query.Filter
import
Gargantext.Database.Admin.Config
(
nodeTypeId
)
import
Gargantext.Database.Admin.Types.Hyperdata
(
HyperdataDocument
(
..
),
HyperdataContact
(
..
))
import
Gargantext.Database.Admin.Types.Node
(
NodeType
(
..
))
import
Gargantext.Database.Prelude
(
Cmd
,
runPGSQuery
,
runOpaQuery
,
runCountOpaQuery
)
import
Gargantext.Database.Query.Facet
import
Gargantext.Database.Query.Join
(
leftJoin6
,
leftJoin5
)
import
Gargantext.Database.Query.Filter
import
Gargantext.Database.Query.Join
(
leftJoin5
)
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.Prelude
(
Cmd
,
runPGSQuery
,
runOpaQuery
,
runCountOpaQuery
)
import
Gargantext.Database.Schema.Node
import
Gargantext.Prelude
import
Gargantext.Text.Terms.Mono.Stem.En
(
stemIt
)
import
Opaleye
hiding
(
Query
,
Order
)
import
qualified
Opaleye
as
O
hiding
(
Order
)
------------------------------------------------------------------------
searchDocInDatabase
::
ParentId
...
...
@@ -129,7 +125,7 @@ selectContactViaDoc
->
Text
->
O
.
Query
FacetPairedReadNull
selectContactViaDoc
cId
aId
q
=
proc
()
->
do
(
doc
,
(
corpus_doc
,
(
contact_doc
,
(
annuaire_contact
,
contact
))))
<-
queryContactViaDoc
-<
()
(
doc
,
(
corpus_doc
,
(
_
contact_doc
,
(
annuaire_contact
,
contact
))))
<-
queryContactViaDoc
-<
()
restrict
-<
(
doc
^.
ns_search
)
@@
(
pgTSQuery
$
unpack
q
)
restrict
-<
(
doc
^.
ns_typename
)
.==
(
pgInt4
$
nodeTypeId
NodeDocument
)
restrict
-<
(
corpus_doc
^.
nn_node1_id
)
.==
(
toNullable
$
pgNodeId
cId
)
...
...
src/Gargantext/Database/Action/Share.hs
View file @
168d6ce6
...
...
@@ -24,7 +24,7 @@ import Gargantext.Database.Admin.Types.Node -- (NodeType(..))
import
Gargantext.Database.Prelude
(
Cmd
)
import
Gargantext.Database.Query.Table.Node
(
getNode
,
getNodesWith
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
,
errorWith
)
import
Gargantext.Database.Query.Table.NodeNode
(
insertNodeNode
,
deleteNodeNode
)
import
Gargantext.Database.Query.Table.NodeNode
(
deleteNodeNode
)
import
Gargantext.Database.Query.Tree.Root
(
getRootId
)
import
Gargantext.Database.Schema.Node
import
Gargantext.Database.Schema.NodeNode
(
NodeNodePoly
(
..
))
...
...
src/Gargantext/Database/Query/Table/Node.hs
View file @
168d6ce6
...
...
@@ -190,7 +190,8 @@ node nodeType name hyperData parentId userId =
insertNodes
::
[
NodeWrite
]
->
Cmd
err
Int64
insertNodes
ns
=
mkCmd
$
\
conn
->
runInsert_
conn
$
Insert
nodeTable
ns
rCount
Nothing
-- insertNodes' :: [Node a] -> Cmd err Int64
{-
insertNodes' :: [Node a] -> Cmd err Int64
insertNodes' ns = mkCmd $ \conn -> runInsert_ conn
$ Insert nodeTable ns' rCount Nothing
where
...
...
@@ -204,7 +205,7 @@ insertNodes' ns = mkCmd $ \conn -> runInsert_ conn
(pgUTCTime <$> d)
(pgJSONB $ cs $ encode h)
) ns
-}
insertNodesR
::
[
NodeWrite
]
->
Cmd
err
[
NodeId
]
insertNodesR
ns
=
mkCmd
$
\
conn
->
...
...
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