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
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
10
Merge Requests
10
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
233539c3
Commit
233539c3
authored
Oct 11, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Hyperdata of Documents
parent
bc39b467
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
11 deletions
+5
-11
Node.hs
src/Gargantext/API/Node.hs
+2
-2
Bashql.hs
src/Gargantext/Database/Bashql.hs
+0
-4
Node.hs
src/Gargantext/Database/Types/Node.hs
+3
-5
No files found.
src/Gargantext/API/Node.hs
View file @
233539c3
...
@@ -141,9 +141,9 @@ graphAPI _ _ = liftIO $ textFlow (Mono EN) (Contexts contextText)
...
@@ -141,9 +141,9 @@ graphAPI _ _ = liftIO $ textFlow (Mono EN) (Contexts contextText)
instance
HasTreeError
ServantErr
where
instance
HasTreeError
ServantErr
where
_TreeError
=
prism'
mk
(
const
Nothing
)
-- Note a prism
_TreeError
=
prism'
mk
(
const
Nothing
)
-- Note a prism
where
where
mk
NoRoot
=
err404
{
errBody
=
"Root node not found"
}
mk
NoRoot
=
err404
{
errBody
=
"Root node not found"
}
mk
EmptyRoot
=
err500
{
errBody
=
"Root node should not be empty"
}
mk
EmptyRoot
=
err500
{
errBody
=
"Root node should not be empty"
}
mk
TooManyRoots
=
err500
{
errBody
=
"Too many root nodes"
}
mk
TooManyRoots
=
err500
{
errBody
=
"Too many root nodes"
}
type
TreeAPI
=
Get
'[
J
SON
]
(
Tree
NodeTree
)
type
TreeAPI
=
Get
'[
J
SON
]
(
Tree
NodeTree
)
treeAPI
::
Connection
->
NodeId
->
Server
TreeAPI
treeAPI
::
Connection
->
NodeId
->
Server
TreeAPI
...
...
src/Gargantext/Database/Bashql.hs
View file @
233539c3
...
@@ -104,14 +104,12 @@ home = map node_id <$> Cmd (ReaderT (getNodesWithParentId 0 Nothing))
...
@@ -104,14 +104,12 @@ home = map node_id <$> Cmd (ReaderT (getNodesWithParentId 0 Nothing))
ls
::
PWD
->
Cmd
[
Node
Value
]
ls
::
PWD
->
Cmd
[
Node
Value
]
ls
=
get
ls
=
get
tree
::
PWD
->
Cmd
[
Node
Value
]
tree
::
PWD
->
Cmd
[
Node
Value
]
tree
p
=
do
tree
p
=
do
ns
<-
get
p
ns
<-
get
p
children
<-
mapM
(
\
n
->
get
[
node_id
n
])
ns
children
<-
mapM
(
\
n
->
get
[
node_id
n
])
ns
pure
$
ns
<>
concat
children
pure
$
ns
<>
concat
children
-- | TODO
-- | TODO
post
::
PWD
->
[
NodeWrite'
]
->
Cmd
Int64
post
::
PWD
->
[
NodeWrite'
]
->
Cmd
Int64
post
[]
_
=
pure
0
post
[]
_
=
pure
0
...
@@ -164,8 +162,6 @@ postAnnuaire corpusName title ns = do
...
@@ -164,8 +162,6 @@ postAnnuaire corpusName title ns = do
--------------------------------------------------------------
--------------------------------------------------------------
-- Tests
-- Tests
--------------------------------------------------------------
--------------------------------------------------------------
get'
::
PWD
->
IO
[
Node
Value
]
get'
::
PWD
->
IO
[
Node
Value
]
get'
=
runCmd'
.
get
get'
=
runCmd'
.
get
...
...
src/Gargantext/Database/Types/Node.hs
View file @
233539c3
...
@@ -70,23 +70,22 @@ $(deriveJSON (unPrefix "status_") ''Status)
...
@@ -70,23 +70,22 @@ $(deriveJSON (unPrefix "status_") ''Status)
instance
Arbitrary
Status
where
instance
Arbitrary
Status
where
arbitrary
=
Status
<$>
arbitrary
<*>
arbitrary
<*>
arbitrary
arbitrary
=
Status
<$>
arbitrary
<*>
arbitrary
<*>
arbitrary
------------------------------------------------------------------------
------------------------------------------------------------------------
data
StatusV3
=
StatusV3
{
statusV3_error
::
Maybe
Text
data
StatusV3
=
StatusV3
{
statusV3_error
::
Maybe
Text
,
statusV3_action
::
Maybe
Text
,
statusV3_action
::
Maybe
Text
}
deriving
(
Show
,
Generic
)
}
deriving
(
Show
,
Generic
)
$
(
deriveJSON
(
unPrefix
"statusV3_"
)
''
S
tatusV3
)
$
(
deriveJSON
(
unPrefix
"statusV3_"
)
''
S
tatusV3
)
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
data
HyperdataDocumentV3
=
HyperdataDocumentV3
{
hyperdataDocumentV3_publication_day
::
Maybe
Int
data
HyperdataDocumentV3
=
HyperdataDocumentV3
{
hyperdataDocumentV3_publication_day
::
Maybe
Int
,
hyperdataDocumentV3_language_iso2
::
Maybe
Text
,
hyperdataDocumentV3_language_iso2
::
Maybe
Text
,
hyperdataDocumentV3_publication_second
::
Maybe
Int
,
hyperdataDocumentV3_publication_minute
::
Maybe
Int
,
hyperdataDocumentV3_publication_minute
::
Maybe
Int
,
hyperdataDocumentV3_error
::
Maybe
Text
,
hyperdataDocumentV3_publication_month
::
Maybe
Int
,
hyperdataDocumentV3_publication_month
::
Maybe
Int
,
hyperdataDocumentV3_publication_hour
::
Maybe
Int
,
hyperdataDocumentV3_error
::
Maybe
Text
,
hyperdataDocumentV3_language_iso3
::
Maybe
Text
,
hyperdataDocumentV3_language_iso3
::
Maybe
Text
,
hyperdataDocumentV3_publication_second
::
Maybe
Int
,
hyperdataDocumentV3_authors
::
Maybe
Text
,
hyperdataDocumentV3_authors
::
Maybe
Text
,
hyperdataDocumentV3_publication_year
::
Maybe
Int
,
hyperdataDocumentV3_publication_year
::
Maybe
Int
,
hyperdataDocumentV3_publication_date
::
Maybe
Text
,
hyperdataDocumentV3_publication_date
::
Maybe
Text
...
@@ -96,7 +95,6 @@ data HyperdataDocumentV3 = HyperdataDocumentV3 { hyperdataDocumentV3_publication
...
@@ -96,7 +95,6 @@ data HyperdataDocumentV3 = HyperdataDocumentV3 { hyperdataDocumentV3_publication
,
hyperdataDocumentV3_source
::
Maybe
Text
,
hyperdataDocumentV3_source
::
Maybe
Text
,
hyperdataDocumentV3_abstract
::
Maybe
Text
,
hyperdataDocumentV3_abstract
::
Maybe
Text
,
hyperdataDocumentV3_title
::
Maybe
Text
,
hyperdataDocumentV3_title
::
Maybe
Text
,
hyperdataDocumentV3_publication_hour
::
Maybe
Int
}
deriving
(
Show
,
Generic
)
}
deriving
(
Show
,
Generic
)
$
(
deriveJSON
(
unPrefix
"hyperdataDocumentV3_"
)
''
H
yperdataDocumentV3
)
$
(
deriveJSON
(
unPrefix
"hyperdataDocumentV3_"
)
''
H
yperdataDocumentV3
)
...
...
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