]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Schema/NodeNgrams.hs
Merge branch 'dev-phylo' of ssh://gitlab.iscpif.fr:20022/gargantext/haskell-gargantex...
[gargantext.git] / src / Gargantext / Database / Schema / NodeNgrams.hs
1 {-|
2 Module : Gargantext.Database.Schema.NodeNgrams
3 Description :
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 NodeNgrams register Context of Ngrams (named Cgrams then)
11
12 -}
13
14 {-# OPTIONS_GHC -fno-warn-orphans #-}
15
16 {-# LANGUAGE Arrows #-}
17 {-# LANGUAGE FunctionalDependencies #-}
18 {-# LANGUAGE QuasiQuotes #-}
19 {-# LANGUAGE TemplateHaskell #-}
20
21 module Gargantext.Database.Schema.NodeNgrams where
22
23 import Data.Text (Text)
24 import Gargantext.Core.Types
25 import Gargantext.Database.Schema.Ngrams (NgramsType)
26 import Gargantext.Prelude
27
28
29 data NodeNgramsPoly id
30 node_id'
31 node_subtype
32 ngrams_id
33 ngrams_type
34 ngrams_field
35 ngrams_tag
36 ngrams_class
37 weight
38 = NodeNgrams { _nng_id :: !id
39 , _nng_node_id :: !node_id'
40 , _nng_node_subtype :: !node_subtype
41 , _nng_ngrams_id :: !ngrams_id
42 , _nng_ngrams_type :: !ngrams_type
43 , _nng_ngrams_field :: !ngrams_field
44 , _nng_ngrams_tag :: !ngrams_tag
45 , _nng_ngrams_class :: !ngrams_class
46 , _nng_ngrams_weight :: !weight
47 } deriving (Show, Eq, Ord)
48
49 {-
50 type NodeNgramsWrite = NodeNgramsPoly (Maybe (Column (PGInt4)))
51 (Column (PGInt4))
52 (Maybe (Column (PGInt4)))
53 (Column (PGInt4))
54 (Maybe (Column (PGInt4)))
55 (Maybe (Column (PGInt4)))
56 (Maybe (Column (PGInt4)))
57 (Maybe (Column (PGInt4)))
58 (Maybe (Column (PGFloat8)))
59
60 type NodeNodeRead = NodeNgramsPoly (Column PGInt4)
61 (Column PGInt4)
62 (Column PGInt4)
63 (Column PGInt4)
64 (Column PGInt4)
65 (Column PGInt4)
66 (Column PGInt4)
67 (Column PGInt4)
68 (Column PGFloat8)
69
70 type NodeNgramsReadNull = NodeNgramsPoly (Column (Nullable PGInt4))
71 (Column (Nullable PGInt4))
72 (Column (Nullable PGInt4))
73 (Column (Nullable PGInt4))
74
75 (Column (Nullable PGInt4))
76 (Column (Nullable PGInt4))
77 (Column (Nullable PGInt4))
78 (Column (Nullable PGInt4))
79 (Column (Nullable PGFloat8))
80 -}
81 type NodeNgramsId = Int
82 type NgramsId = Int
83 type NgramsField = Int
84 type NgramsTag = Int
85 type NgramsClass = Int
86 type NgramsText = Text
87
88 -- Example of list Ngrams
89 -- type ListNgrams = NodeNgramsPoly (Maybe Int) ListType Text
90
91 type NodeNgramsW =
92 NodeNgramsPoly (Maybe NodeNgramsId) NodeId ListType NgramsText
93 NgramsType (Maybe NgramsField) (Maybe NgramsTag) (Maybe NgramsClass)
94 Double
95