]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Schema/NodeNgrams.hs
[REPL sugar] runCmdReplEasy
[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 FlexibleContexts #-}
18 {-# LANGUAGE FlexibleInstances #-}
19 {-# LANGUAGE FunctionalDependencies #-}
20 {-# LANGUAGE QuasiQuotes #-}
21 {-# LANGUAGE MultiParamTypeClasses #-}
22 {-# LANGUAGE NoImplicitPrelude #-}
23 {-# LANGUAGE OverloadedStrings #-}
24 {-# LANGUAGE RankNTypes #-}
25 {-# LANGUAGE TemplateHaskell #-}
26
27 module Gargantext.Database.Schema.NodeNgrams where
28
29 import Data.Maybe (Maybe)
30 import Data.Text (Text)
31 import Gargantext.Core.Types
32 import Gargantext.Database.Schema.Ngrams (NgramsType)
33 import Gargantext.Prelude
34
35
36 data NodeNgramsPoly id
37 node_id'
38 node_subtype
39 ngrams_id
40 ngrams_type
41 ngrams_field
42 ngrams_tag
43 ngrams_class
44 weight
45 = NodeNgrams { _nng_id :: !id
46 , _nng_node_id :: !node_id'
47 , _nng_node_subtype :: !node_subtype
48 , _nng_ngrams_id :: !ngrams_id
49 , _nng_ngrams_type :: !ngrams_type
50 , _nng_ngrams_field :: !ngrams_field
51 , _nng_ngrams_tag :: !ngrams_tag
52 , _nng_ngrams_class :: !ngrams_class
53 , _nng_ngrams_weight :: !weight
54 } deriving (Show, Eq, Ord)
55
56 {-
57 type NodeNgramsWrite = NodeNgramsPoly (Maybe (Column (PGInt4)))
58 (Column (PGInt4))
59 (Maybe (Column (PGInt4)))
60 (Column (PGInt4))
61 (Maybe (Column (PGInt4)))
62 (Maybe (Column (PGInt4)))
63 (Maybe (Column (PGInt4)))
64 (Maybe (Column (PGInt4)))
65 (Maybe (Column (PGFloat8)))
66
67 type NodeNodeRead = NodeNgramsPoly (Column PGInt4)
68 (Column PGInt4)
69 (Column PGInt4)
70 (Column PGInt4)
71 (Column PGInt4)
72 (Column PGInt4)
73 (Column PGInt4)
74 (Column PGInt4)
75 (Column PGFloat8)
76
77 type NodeNgramsReadNull = NodeNgramsPoly (Column (Nullable PGInt4))
78 (Column (Nullable PGInt4))
79 (Column (Nullable PGInt4))
80 (Column (Nullable PGInt4))
81
82 (Column (Nullable PGInt4))
83 (Column (Nullable PGInt4))
84 (Column (Nullable PGInt4))
85 (Column (Nullable PGInt4))
86 (Column (Nullable PGFloat8))
87 -}
88 type NodeNgramsId = Int
89 type NgramsId = Int
90 type NgramsField = Int
91 type NgramsTag = Int
92 type NgramsClass = Int
93 type NgramsText = Text
94
95 -- Example of list Ngrams
96 -- type ListNgrams = NodeNgramsPoly (Maybe Int) ListType Text
97
98 type NodeNgramsW =
99 NodeNgramsPoly (Maybe NodeNgramsId) NodeId ListType NgramsText
100 NgramsType (Maybe NgramsField) (Maybe NgramsTag) (Maybe NgramsClass)
101 Double
102