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
3a7a4e60
Commit
3a7a4e60
authored
Feb 18, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[missing file]
parent
6b9e677d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
0 deletions
+84
-0
NodeNodeNgrams.hs
src/Gargantext/Database/Schema/NodeNodeNgrams.hs
+84
-0
No files found.
src/Gargantext/Database/Schema/NodeNodeNgrams.hs
0 → 100644
View file @
3a7a4e60
{-|
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
-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE Arrows #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module
Gargantext.Database.Schema.NodeNodeNgrams
where
import
Prelude
import
Data.Maybe
(
Maybe
)
import
Data.Profunctor.Product.TH
(
makeAdaptorAndInstance
)
import
Control.Lens.TH
(
makeLensesWith
,
abbreviatedFields
)
import
Gargantext.Database.Utils
(
Cmd
,
runOpaQuery
)
import
Opaleye
data
NodeNodeNgramsPoly
node1_id
node2_id
ngram_id
score
=
NodeNodeNgrams
{
nnng_node1_id
::
node1_id
,
nnng_node2_id
::
node2_id
,
nnng_ngrams_id
::
ngram_id
,
nnng_score
::
score
}
deriving
(
Show
)
type
NodeNodeNgramsWrite
=
NodeNodeNgramsPoly
(
Column
PGInt4
)
(
Column
PGInt4
)
(
Column
PGInt4
)
(
Maybe
(
Column
PGFloat8
))
type
NodeNodeNgramsRead
=
NodeNodeNgramsPoly
(
Column
PGInt4
)
(
Column
PGInt4
)
(
Column
PGInt4
)
(
Column
PGFloat8
)
type
NodeNodeNgramsReadNull
=
NodeNodeNgramsPoly
(
Column
(
Nullable
PGInt4
))
(
Column
(
Nullable
PGInt4
))
(
Column
(
Nullable
PGInt4
))
(
Column
(
Nullable
PGFloat8
))
type
NodeNodeNgrams
=
NodeNodeNgramsPoly
Int
Int
Int
(
Maybe
Double
)
$
(
makeAdaptorAndInstance
"pNodeNodeNgrams"
''
N
odeNodeNgramsPoly
)
$
(
makeLensesWith
abbreviatedFields
''
N
odeNodeNgramsPoly
)
nodeNodeNgramsTable
::
Table
NodeNodeNgramsWrite
NodeNodeNgramsRead
nodeNodeNgramsTable
=
Table
"nodes_nodes_ngrams"
(
pNodeNodeNgrams
NodeNodeNgrams
{
nnng_node1_id
=
required
"node1_id"
,
nnng_node2_id
=
required
"node2_id"
,
nnng_ngrams_id
=
required
"ngram_id"
,
nnng_score
=
optional
"score"
}
)
queryNodeNodeNgramsTable
::
Query
NodeNodeNgramsRead
queryNodeNodeNgramsTable
=
queryTable
nodeNodeNgramsTable
-- | not optimized (get all ngrams without filters)
nodeNodeNgrams
::
Cmd
err
[
NodeNodeNgrams
]
nodeNodeNgrams
=
runOpaQuery
queryNodeNodeNgramsTable
instance
QueryRunnerColumnDefault
PGFloat8
(
Maybe
Double
)
where
queryRunnerColumnDefault
=
fieldQueryRunnerColumn
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