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
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
d85cdd3d
Verified
Commit
d85cdd3d
authored
Aug 08, 2023
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[search] add pubmed api key to corpus query
parent
bec99432
Pipeline
#4492
passed with stages
in 15 minutes and 48 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
New.hs
src/Gargantext/API/Node/Corpus/New.hs
+5
-3
UpdateOpaleye.hs
src/Gargantext/Database/Query/Table/Node/UpdateOpaleye.hs
+2
-2
No files found.
src/Gargantext/API/Node/Corpus/New.hs
View file @
d85cdd3d
...
@@ -59,7 +59,6 @@ import Gargantext.Database.Admin.Types.Node (CorpusId, NodeType(..))
...
@@ -59,7 +59,6 @@ import Gargantext.Database.Admin.Types.Node (CorpusId, NodeType(..))
import
Gargantext.Database.Prelude
(
hasConfig
)
import
Gargantext.Database.Prelude
(
hasConfig
)
import
Gargantext.Database.Query.Table.Node
(
getNodeWith
)
import
Gargantext.Database.Query.Table.Node
(
getNodeWith
)
import
Gargantext.Database.Query.Table.Node.UpdateOpaleye
(
updateHyperdata
)
import
Gargantext.Database.Query.Table.Node.UpdateOpaleye
(
updateHyperdata
)
import
Gargantext.Database.Query.Table.User
(
getUserPubmedAPIKey
)
import
Gargantext.Database.Schema.Node
(
node_hyperdata
)
import
Gargantext.Database.Schema.Node
(
node_hyperdata
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.Prelude.Config
(
gc_max_docs_parsers
)
import
Gargantext.Prelude.Config
(
gc_max_docs_parsers
)
...
@@ -145,6 +144,7 @@ data WithQuery = WithQuery
...
@@ -145,6 +144,7 @@ data WithQuery = WithQuery
,
_wq_lang
::
!
Lang
,
_wq_lang
::
!
Lang
,
_wq_node_id
::
!
Int
,
_wq_node_id
::
!
Int
,
_wq_flowListWith
::
!
FlowSocialListWith
,
_wq_flowListWith
::
!
FlowSocialListWith
,
_wq_pubmedAPIKey
::
!
(
Maybe
Text
)
}
}
deriving
(
Show
,
Eq
,
Generic
)
deriving
(
Show
,
Eq
,
Generic
)
...
@@ -163,6 +163,7 @@ instance Arbitrary WithQuery where
...
@@ -163,6 +163,7 @@ instance Arbitrary WithQuery where
<*>
arbitrary
<*>
arbitrary
<*>
arbitrary
<*>
arbitrary
<*>
arbitrary
<*>
arbitrary
<*>
arbitrary
------------------------------------------------------------------------
------------------------------------------------------------------------
...
@@ -200,7 +201,8 @@ addToCorpusWithQuery user cid (WithQuery { _wq_query = q
...
@@ -200,7 +201,8 @@ addToCorpusWithQuery user cid (WithQuery { _wq_query = q
,
_wq_databases
=
dbs
,
_wq_databases
=
dbs
,
_wq_datafield
=
datafield
,
_wq_datafield
=
datafield
,
_wq_lang
=
l
,
_wq_lang
=
l
,
_wq_flowListWith
=
flw
})
maybeLimit
jobHandle
=
do
,
_wq_flowListWith
=
flw
,
_wq_pubmedAPIKey
=
mPubmedAPIKey
})
maybeLimit
jobHandle
=
do
-- TODO ...
-- TODO ...
-- printDebug "[addToCorpusWithQuery] (cid, dbs)" (cid, dbs)
-- printDebug "[addToCorpusWithQuery] (cid, dbs)" (cid, dbs)
-- printDebug "[addToCorpusWithQuery] datafield" datafield
-- printDebug "[addToCorpusWithQuery] datafield" datafield
...
@@ -227,7 +229,7 @@ addToCorpusWithQuery user cid (WithQuery { _wq_query = q
...
@@ -227,7 +229,7 @@ addToCorpusWithQuery user cid (WithQuery { _wq_query = q
-- if cid is root -> create corpus in Private
-- if cid is root -> create corpus in Private
-- printDebug "[G.A.N.C.New] getDataText with query" q
-- printDebug "[G.A.N.C.New] getDataText with query" q
let
db
=
database2origin
dbs
let
db
=
database2origin
dbs
mPubmedAPIKey
<-
getUserPubmedAPIKey
user
--
mPubmedAPIKey <- getUserPubmedAPIKey user
-- printDebug "[addToCorpusWithQuery] mPubmedAPIKey" mPubmedAPIKey
-- printDebug "[addToCorpusWithQuery] mPubmedAPIKey" mPubmedAPIKey
eTxt
<-
getDataText
db
(
Multi
l
)
q
mPubmedAPIKey
maybeLimit
eTxt
<-
getDataText
db
(
Multi
l
)
q
mPubmedAPIKey
maybeLimit
...
...
src/Gargantext/Database/Query/Table/Node/UpdateOpaleye.hs
View file @
d85cdd3d
...
@@ -26,7 +26,7 @@ import Gargantext.Database.Prelude (Cmd, mkCmd, DBCmd)
...
@@ -26,7 +26,7 @@ import Gargantext.Database.Prelude (Cmd, mkCmd, DBCmd)
import
Gargantext.Database.Query.Table.Node
import
Gargantext.Database.Query.Table.Node
import
Gargantext.Database.Query.Table.Node.Error
import
Gargantext.Database.Query.Table.Node.Error
import
Debug.Trace
(
trace
)
--
import Debug.Trace (trace)
updateHyperdata
::
HyperdataC
a
=>
NodeId
->
a
->
DBCmd
err
Int64
updateHyperdata
::
HyperdataC
a
=>
NodeId
->
a
->
DBCmd
err
Int64
updateHyperdata
i
h
=
mkCmd
$
\
c
->
putStrLn
"before runUpdate_"
>>
updateHyperdata
i
h
=
mkCmd
$
\
c
->
putStrLn
"before runUpdate_"
>>
...
@@ -34,7 +34,7 @@ updateHyperdata i h = mkCmd $ \c -> putStrLn "before runUpdate_" >>
...
@@ -34,7 +34,7 @@ updateHyperdata i h = mkCmd $ \c -> putStrLn "before runUpdate_" >>
putStrLn
"after runUpdate_"
>>
return
res
putStrLn
"after runUpdate_"
>>
return
res
updateHyperdataQuery
::
HyperdataC
a
=>
NodeId
->
a
->
Update
Int64
updateHyperdataQuery
::
HyperdataC
a
=>
NodeId
->
a
->
Update
Int64
updateHyperdataQuery
i
h
=
seq
h'
$
trace
"updateHyperdataQuery: encoded JSON"
$
Update
updateHyperdataQuery
i
h
=
seq
h'
$
{- trace "updateHyperdataQuery: encoded JSON" $ -}
Update
{
uTable
=
nodeTable
{
uTable
=
nodeTable
,
uUpdateWith
=
updateEasy
(
\
(
Node
{
..
})
,
uUpdateWith
=
updateEasy
(
\
(
Node
{
..
})
->
Node
{
_node_hyperdata
=
h'
,
..
}
->
Node
{
_node_hyperdata
=
h'
,
..
}
...
...
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