Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
145
Issues
145
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
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
gargantext
haskell-gargantext
Commits
aaf48a73
Commit
aaf48a73
authored
Nov 08, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
[Merge]
parents
1b1b4a07
d63bc5be
Pipeline
#2044
failed with stage
in 10 minutes and 6 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
43 additions
and
26 deletions
+43
-26
package.yaml
package.yaml
+1
-0
Mail.hs
src/Gargantext/Core/Mail.hs
+1
-1
Parsers.hs
src/Gargantext/Core/Text/Corpus/Parsers.hs
+5
-8
Date.hs
src/Gargantext/Core/Text/Corpus/Parsers/Date.hs
+1
-1
Wikidata.hs
src/Gargantext/Core/Text/Corpus/Parsers/Wikidata.hs
+6
-5
Bridgeness.hs
src/Gargantext/Core/Viz/Graph/Bridgeness.hs
+1
-1
Tools.hs
src/Gargantext/Core/Viz/Graph/Tools.hs
+4
-4
IGraph.hs
src/Gargantext/Core/Viz/Graph/Tools/IGraph.hs
+1
-4
stack.yaml
stack.yaml
+23
-2
No files found.
package.yaml
View file @
aaf48a73
...
...
@@ -158,6 +158,7 @@ library:
-
full-text-search
-
fullstop
-
gargantext-prelude
-
gargantext-graph >= 0.1.0.0
-
graphviz
-
hashable
-
haskell-igraph
...
...
src/Gargantext/Core/Mail.hs
View file @
aaf48a73
...
...
@@ -64,7 +64,7 @@ email_to' (NewUser u m _) = (m,u)
------------------------------------------------------------------------
bodyWith
::
ServerAddress
->
MailModel
->
[
Text
]
bodyWith
server
(
Invitation
u
)
=
[
"Congratulation, you have been granted a
beta
user account to test the"
bodyWith
server
(
Invitation
u
)
=
[
"Congratulation, you have been granted a user account to test the"
,
"new GarganText platform!"
]
<>
(
email_credentials
server
u
)
...
...
src/Gargantext/Core/Text/Corpus/Parsers.hs
View file @
aaf48a73
...
...
@@ -25,9 +25,8 @@ module Gargantext.Core.Text.Corpus.Parsers (FileFormat(..), clean, parseFile, cl
import
"zip"
Codec.Archive.Zip
(
withArchive
,
getEntry
,
getEntries
)
import
Control.Concurrent.Async
as
CCA
(
mapConcurrently
)
import
Control.Monad
(
join
,
sequence
)
import
Control.Monad.IO.Class
(
liftIO
)
import
Data.Attoparsec.ByteString
(
parseOnly
,
Parser
)
import
Control.Monad
(
join
)
import
Data.Either
(
Either
(
..
))
import
Data.Either.Extra
(
partitionEithers
)
import
Data.List
(
concat
,
lookup
)
...
...
@@ -98,13 +97,11 @@ parseFormat WOS bs = do
$
[
runParser'
WOS
bs
]
pure
$
Right
docs
parseFormat
ZIP
bs
=
do
path
<-
emptySystemTempFile
"parsed
.
zip"
path
<-
emptySystemTempFile
"parsed
-
zip"
DB
.
writeFile
path
bs
withArchive
path
$
do
files
<-
DM
.
keys
<$>
getEntries
filesContents
<-
mapM
getEntry
files
ddocs
<-
liftIO
$
mapM
(
parseFormat
CsvGargV3
)
filesContents
pure
$
concat
<$>
sequence
ddocs
parsedZip
<-
withArchive
path
$
do
DM
.
keys
<$>
getEntries
pure
$
Left
$
"Not implemented for ZIP, parsedZip"
<>
show
parsedZip
parseFormat
_
_
=
undefined
-- | Parse file into documents
...
...
src/Gargantext/Core/Text/Corpus/Parsers/Date.hs
View file @
aaf48a73
...
...
@@ -119,7 +119,7 @@ getTimeValue rt = case head rt of
Nothing
Just
x
->
case
rval
x
of
RVal
Time
t
->
Just
$
toJSON
t
_
->
do
_
->
do
Nothing
extractValue
::
Maybe
Value
->
Maybe
Text
...
...
src/Gargantext/Core/Text/Corpus/Parsers/Wikidata.hs
View file @
aaf48a73
{-|
Module : Gargantext.Core.Text.Corpus.Parsers.Wikidata
<<<<<<< HEAD
Description : To query Wikidata
=======
Description : To query Wikidata
>>>>>>> dev-clustering
Copyright : (c) CNRS, 2019-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
...
...
@@ -29,7 +33,7 @@ import Gargantext.Core.Text.Corpus.Parsers.Date (dateSplit)
data
WikiResult
=
WikiResult
{
_wr_cid
::
Maybe
Text
data
WikiResult
=
WikiResult
{
_wr_cid
::
Maybe
Text
,
_wr_title
::
Maybe
Text
,
_wr_url
::
Maybe
Text
,
_wr_yearStart
::
Maybe
Text
...
...
@@ -48,10 +52,9 @@ wikidataGet n m = do
wikiPageToDocument
::
NumberOfSections
->
WikiResult
->
IO
HyperdataDocument
wikiPageToDocument
m
wr
=
do
sections
<-
case
wr
^.
wr_url
of
Nothing
->
pure
[]
Just
u
->
crawlPage
u
Just
u
->
crawlPage
u
let
bdd
=
Just
"wikidata"
doi
=
Nothing
...
...
@@ -129,5 +132,3 @@ wikidataQuery n = List.unlines
,
" LIMIT "
<>
(
cs
$
show
n
)
]
src/Gargantext/Core/Viz/Graph/Bridgeness.hs
View file @
aaf48a73
...
...
@@ -24,7 +24,7 @@ import Data.Maybe (catMaybes)
import
Data.Ord
(
Down
(
..
))
import
Gargantext.Prelude
import
qualified
Data.Map
as
DM
import
G
argantext.Core.Viz.Graph.Tools.IGraph
(
ClusterNode
(
..
))
import
G
raph.Types
(
ClusterNode
(
..
))
----------------------------------------------------------------------
type
Partitions
a
=
Map
(
Int
,
Int
)
Double
->
IO
[
a
]
...
...
src/Gargantext/Core/Viz/Graph/Tools.hs
View file @
aaf48a73
...
...
@@ -27,8 +27,10 @@ import Gargantext.Core.Statistics
import
Gargantext.Core.Viz.Graph
import
Gargantext.Core.Viz.Graph.Bridgeness
(
bridgeness
,
Partitions
,
ToComId
(
..
))
import
Gargantext.Core.Viz.Graph.Index
(
createIndices
,
toIndex
,
map2mat
,
mat2map
,
Index
,
MatrixShape
(
..
))
import
Gargantext.Core.Viz.Graph.Tools.IGraph
(
mkGraphUfromEdges
,
spinglass
,
ClusterNode
)
import
Gargantext.Core.Viz.Graph.Tools.IGraph
(
mkGraphUfromEdges
,
spinglass
)
import
Gargantext.Prelude
import
Graph.Types
(
ClusterNode
)
import
qualified
Graph.BAC.ProxemyOptim
as
BAC
import
IGraph.Random
-- (Gen(..))
import
qualified
Data.HashMap.Strict
as
HashMap
import
qualified
Data.List
as
List
...
...
@@ -40,12 +42,10 @@ import qualified IGraph.Algorithms.Layout as Layout
-------------------------------------------------------------
defaultClustering
::
Map
(
Int
,
Int
)
Double
->
IO
[
ClusterNode
]
defaultClustering
=
spinglass
1
defaultClustering
x
=
pure
$
BAC
.
defaultClustering
x
-------------------------------------------------------------
type
Threshold
=
Double
cooc2graph'
::
Ord
t
=>
Distance
...
...
src/Gargantext/Core/Viz/Graph/Tools/IGraph.hs
View file @
aaf48a73
...
...
@@ -20,6 +20,7 @@ import Data.Singletons (SingI)
import
IGraph
hiding
(
mkGraph
,
neighbors
,
edges
,
nodes
,
Node
,
Graph
)
import
Protolude
import
Gargantext.Core.Viz.Graph.Index
import
Graph.Types
import
qualified
Data.List
as
List
import
qualified
IGraph
as
IG
import
qualified
IGraph.Algorithms.Clique
as
IG
...
...
@@ -82,10 +83,6 @@ partitions_spinglass' s g = do
IG
.
findCommunity
g
Nothing
Nothing
IG
.
spinglass
gen
data
ClusterNode
=
ClusterNode
{
cl_node_id
::
Int
,
cl_community_id
::
Int
}
toClusterNode
::
[[
Int
]]
->
[
ClusterNode
]
toClusterNode
ns
=
List
.
concat
$
map
(
\
(
cId
,
ns'
)
->
map
(
\
n
->
ClusterNode
n
cId
)
ns'
)
...
...
stack.yaml
View file @
aaf48a73
...
...
@@ -4,7 +4,7 @@ flags: {}
extra-package-dbs
:
[]
packages
:
-
.
#- 'deps/patches-class
'
#- 'deps/gargantext-graph
'
#- 'deps/patches-map'
#- 'deps/accelerate'
#- 'deps/accelerate-utility'
...
...
@@ -30,6 +30,9 @@ extra-deps:
-
#git: https://gitlab.iscpif.fr/gargantext/haskell-gargantext-prelude.git
git
:
https://gitlab.iscpif.fr/cgenie/haskell-gargantext-prelude.git
commit
:
35b09629a658fc16cc9ff63e7591e58511cd98a7
#git: ssh://git@gitlab.iscpif.fr:20022/gargantext/gargantext-graph.git
-
git
:
ssh://gitolite3@delanoe.org/gargantext-graph
commit
:
294887a220460bd0c114638fff9ea53306cd2f18
# Data Mining Libs
-
git
:
https://github.com/delanoe/data-time-segment.git
commit
:
10a416b9f6c443866b36479c3441ebb3bcdeb7ef
...
...
@@ -88,7 +91,18 @@ extra-deps:
-
git
:
https://github.com/rspeer/wikiparsec.git
commit
:
9637a82344bb70f7fa8f02e75db3c081ccd434ce
# Others dependencies (using stack resolver)
# Gargantext-graph
-
eigen-3.3.7.0@sha256:7c24a86426b238e02ba0ac2179cc44997518b443a13828ed7a791fe49a6dffa5,82060
-
git
:
https://github.com/alpmestan/sparse-linear.git
commit
:
bc6ca8058077b0b5702ea4b88bd4189cfcad267a
subdirs
:
-
sparse-linear
-
git
:
https://github.com/alpmestan/hmatrix.git
commit
:
b9fca8beee0f23c17a6b2001ec834d071709e6e7
subdirs
:
-
packages/base
# Others dependencies (using stack resolver)
-
constraints-extras-0.3.1.0@sha256:12016ebb91ad5ed2c82bf7e48c6bd6947d164d33c9dca5ac3965de1bb6c780c0,1777
-
KMP-0.2.0.0@sha256:6dfbac03ef00ebd9347234732cb86a40f62ab5a80c0cc6bedb8eb51766f7df28,2562
-
Unique-0.4.7.8@sha256:9661f45aa31dde119a2114566166ea38b011a45653337045ee4ced75636533c0,2067
...
...
@@ -122,3 +136,10 @@ extra-deps:
-
taggy-0.2.1@sha256:7bc55ddba178971dc6052163597f0445a0a2b5b0ca0e84ce651d53d722e3c265,4662
-
servant-ekg-0.3.1@sha256:19bd9dc3943983da8e79d6f607614c68faea4054fb889d508c8a2b67b6bdd448,2203
# For the graph clustering
ghc-options
:
hmatrix
:
-O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
sparse-linear
:
-O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
gargantext-graph
:
-O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
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