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
154
Issues
154
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
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
3d4b9b63
Verified
Commit
3d4b9b63
authored
2 years ago
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev-hackathon-fixes
parents
6631fad8
c00418cc
Pipeline
#3568
canceled with stage
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
42 deletions
+43
-42
CHANGELOG.md
CHANGELOG.md
+2
-0
FrameWrite.hs
src/Gargantext/Core/Text/Corpus/Parsers/FrameWrite.hs
+0
-1
Bridgeness.hs
src/Gargantext/Core/Viz/Graph/Bridgeness.hs
+8
-4
Types.hs
src/Gargantext/Database/Action/Flow/Types.hs
+2
-0
Insert.hs
src/Gargantext/Database/Query/Table/Node/Document/Insert.hs
+31
-37
No files found.
CHANGELOG.md
View file @
3d4b9b63
## Version 0.0.6.9.0
*
[
FRONT
][
FIX
]
Ngrams Table, removing useless columns
*
[
BACK
][
FIX
]
Duplicates
*
[
FRONT
][
FIX
]
Node Selection Indicator
*
[
FRONT
][
FIX
]
Just a little warning specifying a bug on
<ReactTooltip>
*
[
FRONT
][
FEAT
]
Graph Explorer fixes (labels, Sigma JS parameters)
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Text/Corpus/Parsers/FrameWrite.hs
View file @
3d4b9b63
...
...
@@ -28,7 +28,6 @@ import qualified Data.List as List
-- https://gitlab.iscpif.fr/gargantext/purescript-gargantext/issues/331
-- title : everything above the first ==
-- Authors : default : anonymous ; except if the following line is encountered ^@@authors: FirstName1, LastName1 ; FirstName2, LastName2 ; etc.
-- date : default : date of last change except if the following line is encountered ^@@date: 2021-09-10
-- source: Name of the root node except if the following line is encountered ^@@source:
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Viz/Graph/Bridgeness.hs
View file @
3d4b9b63
...
...
@@ -34,7 +34,7 @@ import Graph.Types (ClusterNode(..))
-- import qualified Data.IntMap as IntMap
import
qualified
Data.List
as
List
import
qualified
Data.Map
as
Map
import
qualified
Data.Set
as
Set
--
import qualified Data.Set as Set
----------------------------------------------------------------------
...
...
@@ -61,13 +61,15 @@ type Confluence = Map (NodeId, NodeId) Double
bridgeness
::
Bridgeness
->
Map
(
NodeId
,
NodeId
)
Double
->
Map
(
NodeId
,
NodeId
)
Double
bridgeness
(
Bridgeness_Advanced
sim
c
)
m
=
Map
.
fromList
bridgeness
(
Bridgeness_Advanced
_
sim
c
)
m
=
Map
.
fromList
$
map
(
\
(
ks
,
(
v1
,
_v2
))
->
(
ks
,
v1
))
$
List
.
take
(
if
sim
==
Conditional
then
2
*
n
else
3
*
n
)
--
$ List.take (if sim == Conditional then 2*n else 3*n)
$
List
.
sortOn
(
Down
.
(
snd
.
snd
))
$
Map
.
toList
$
trace
(
"bridgeness3 m c"
<>
show
(
m
,
c
))
$
Map
.
intersectionWithKey
(
\
k
v1
v2
->
trace
(
"intersectionWithKey "
<>
(
show
(
k
,
v1
,
v2
)))
(
v1
,
v2
))
m
c
where
{-
where
!m' = Map.toList m
n :: Int
!n = trace ("bridgeness m size: " <> (show $ List.length m'))
...
...
@@ -78,6 +80,8 @@ bridgeness (Bridgeness_Advanced sim c) m = Map.fromList
nodesNumber = Set.size $ Set.fromList $ as <> bs
where
(as, bs) = List.unzip $ Map.keys m
-}
bridgeness
(
Bridgeness_Basic
ns
b
)
m
=
Map
.
fromList
$
List
.
concat
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Database/Action/Flow/Types.hs
View file @
3d4b9b63
...
...
@@ -41,6 +41,7 @@ type FlowCmdM env err m =
type
FlowCorpus
a
=
(
AddUniqId
a
,
UniqId
a
,
UniqParameters
a
,
InsertDb
a
,
ExtractNgramsT
a
,
HasText
a
...
...
@@ -50,5 +51,6 @@ type FlowCorpus a = ( AddUniqId a
type
FlowInsertDB
a
=
(
AddUniqId
a
,
UniqId
a
,
UniqParameters
a
,
InsertDb
a
)
This diff is collapsed.
Click to expand it.
src/Gargantext/Database/Query/Table/Node/Document/Insert.hs
View file @
3d4b9b63
...
...
@@ -57,7 +57,7 @@ module Gargantext.Database.Query.Table.Node.Document.Insert
import
Control.Lens
(
set
,
view
)
import
Control.Lens.Cons
import
Control.Lens.Prism
import
Data.Aeson
(
toJSON
,
encode
,
ToJSON
)
import
Data.Aeson
(
toJSON
,
ToJSON
)
import
Data.Char
(
isAlpha
)
import
Data.Maybe
(
fromMaybe
)
import
Data.Text
(
Text
)
...
...
@@ -111,7 +111,7 @@ instance InsertDb HyperdataDocument
,
toField
p
,
toField
$
maybe
"No Title"
(
DT
.
take
255
)
(
_hd_title
h
)
,
toField
$
_hd_publication_date
h
-- TODO USE UTCTime
,
(
toField
.
toJSON
)
h
,
(
toField
.
toJSON
)
(
addUniqId
h
)
]
instance
InsertDb
HyperdataContact
...
...
@@ -122,7 +122,7 @@ instance InsertDb HyperdataContact
,
toField
p
,
toField
$
maybe
"Contact"
(
DT
.
take
255
)
(
Just
"Name"
)
-- (_hc_name h)
,
toField
$
jour
0
1
1
-- TODO put default date
,
(
toField
.
toJSON
)
h
,
(
toField
.
toJSON
)
(
addUniqId
h
)
]
instance
ToJSON
a
=>
InsertDb
(
Node
a
)
...
...
@@ -197,6 +197,10 @@ class AddUniqId a
where
addUniqId
::
a
->
a
class
UniqParameters
a
where
uniqParameters
::
ParentId
->
a
->
Text
instance
AddUniqId
HyperdataDocument
where
addUniqId
=
addUniqIdsDoc
...
...
@@ -208,46 +212,36 @@ instance AddUniqId HyperdataDocument
shaUni
=
hash
$
DT
.
concat
$
map
(
$
doc
)
shaParametersDoc
shaBdd
=
hash
$
DT
.
concat
$
map
(
$
doc
)
([(
\
d
->
maybeText
(
_hd_bdd
d
))]
<>
shaParametersDoc
)
shaParametersDoc
::
[(
HyperdataDocument
->
Text
)]
shaParametersDoc
=
[
\
d
->
filterText
$
maybeText
(
_hd_title
d
)
,
\
d
->
filterText
$
maybeText
(
_hd_abstract
d
)
,
\
d
->
filterText
$
maybeText
(
_hd_source
d
)
,
\
d
->
maybeText
(
_hd_publication_date
d
)
]
shaParametersDoc
::
[(
HyperdataDocument
->
Text
)]
shaParametersDoc
=
[
\
d
->
filterText
$
maybeText
(
_hd_title
d
)
,
\
d
->
filterText
$
maybeText
(
_hd_abstract
d
)
,
\
d
->
filterText
$
maybeText
(
_hd_source
d
)
-- , \d -> maybeText (_hd_publication_date d)
]
instance
UniqParameters
HyperdataDocument
where
uniqParameters
_
h
=
filterText
$
DT
.
concat
$
map
maybeText
$
[
_hd_title
h
,
_hd_abstract
h
,
_hd_source
h
]
instance
UniqParameters
HyperdataContact
where
uniqParameters
_
_
=
""
instance
UniqParameters
(
Node
a
)
where
uniqParameters
_
_
=
undefined
filterText
::
Text
->
Text
filterText
=
DT
.
toLower
.
(
DT
.
filter
isAlpha
)
-- TODO put this elsewhere (fix bin/gargantext-init/Main.hs too)
secret
::
Text
secret
=
"Database secret to change"
instance
(
AddUniqId
a
,
ToJSON
a
,
HasDBid
NodeType
)
=>
AddUniqId
(
Node
a
)
instance
(
UniqParameters
a
,
ToJSON
a
,
HasDBid
NodeType
)
=>
AddUniqId
(
Node
a
)
where
addUniqId
(
Node
nid
_
t
u
p
n
d
h
)
=
Node
nid
hashId
t
u
p
n
d
h
where
hashId
=
Just
$
"
\\
x"
<>
(
hash
$
DT
.
concat
params
)
params
=
[
secret
,
cs
$
show
$
toDBid
NodeDocument
,
n
,
cs
$
show
p
,
cs
$
encode
h
]
{-
addUniqId n@(Node nid _ t u p n d h) =
case n of
Node HyperdataDocument -> Node nid hashId t u p n d h
where
hashId = "\\x" <> (hash $ DT.concat params)
params = [ secret
, cs $ show $ toDBid NodeDocument
, n
, cs $ show p
, cs $ encode h
]
_ -> undefined
-}
addUniqId
(
Node
nid
_
t
u
p
n
d
h
)
=
Node
nid
(
Just
newHash
)
t
u
p
n
d
h
where
newHash
=
"
\\
x"
<>
(
hash
$
uniqParameters
(
fromMaybe
0
p
)
h
)
---------------------------------------------------------------------------
-- * Uniqueness of document definition
...
...
This diff is collapsed.
Click to expand it.
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