2 Module : Gargantext.Viz.AdaptativePhylo
3 Description : Phylomemy definitions and types.
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
10 Specifications of Phylomemy export format.
12 Phylomemy can be described as a Temporal Graph with different scale of
13 granularity of group of ngrams (terms and multi-terms).
15 The main type is Phylo which is synonym of Phylomemy (only difference is
19 Chavalarias, D., Cointet, J.-P., 2013. Phylomemetic patterns
20 in science evolution — the rise and fall of scientific fields. PloS
24 {-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}
25 {-# LANGUAGE NoImplicitPrelude #-}
26 {-# LANGUAGE TemplateHaskell #-}
27 {-# LANGUAGE MultiParamTypeClasses #-}
29 module Gargantext.Viz.AdaptativePhylo where
32 import Data.Aeson.TH (deriveJSON)
33 import Data.Text (Text)
34 import Data.Vector (Vector)
36 import Gargantext.Core.Utils.Prefix (unPrefix)
37 import Gargantext.Prelude
38 import Gargantext.Text.Context (TermList)
41 import GHC.IO (FilePath)
42 import Control.DeepSeq (NFData)
43 import Control.Lens (makeLenses)
51 data CorpusParser = Wos | Csv deriving (Show,Generic)
54 Config { corpusPath :: FilePath
55 , listPath :: FilePath
56 , outputPath :: FilePath
57 , corpusParser :: CorpusParser
67 } deriving (Show,Generic)
69 instance FromJSON Config
70 instance ToJSON Config
71 instance FromJSON CorpusParser
72 instance ToJSON CorpusParser
80 -- | Date : a simple Integer
83 -- | Ngrams : a contiguous sequence of n terms
86 -- | Document : a piece of Text linked to a Date
87 data Document = Document
90 } deriving (Show,Generic,NFData)
98 -- | The Foundations of a Phylo created from a given TermList
99 data PhyloFoundations = PhyloFoundations
100 { _foundations_roots :: !(Vector Ngrams)
101 , _foundations_mapList :: TermList
102 } deriving (Generic, Show, Eq)
109 makeLenses ''PhyloFoundations
111 ------------------------
112 -- | JSON instances | --
113 ------------------------
116 $(deriveJSON (unPrefix "_foundations_" ) ''PhyloFoundations)