Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
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
crawlers
hal
Commits
397fa34f
You need to sign in or sign up before continuing.
Commit
397fa34f
authored
Dec 21, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into hal-fixes
parents
8f47d29c
7b740eee
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
26 deletions
+27
-26
Main.hs
app/Main.hs
+19
-18
Corpus.hs
src/HAL/Doc/Corpus.hs
+2
-2
EntityTree.hs
src/HAL/Doc/EntityTree.hs
+6
-6
No files found.
app/Main.hs
View file @
397fa34f
...
@@ -37,12 +37,27 @@ opts = info (params <**> helper)
...
@@ -37,12 +37,27 @@ opts = info (params <**> helper)
<>
progDesc
"A program to test HAL"
<>
progDesc
"A program to test HAL"
<>
header
"crawlerHAL-exe"
)
<>
header
"crawlerHAL-exe"
)
main
::
IO
()
main
=
run
=<<
execParser
opts
-- res <- getMetadataWith (generateRequestByStructID "artificial intelligence" imt) (Just 0) (Just 55)
-- case res of
-- (Left err) -> print err
-- (Right val) -> print $ _docs val
run
::
Command
->
IO
()
run
(
Count
(
CountParams
{
cp_query
}))
=
do
res
<-
getMetadataWithC
(
cp_query
)
(
Just
0
)
Nothing
case
res
of
Left
err
->
print
err
Right
(
cnt
,
_docsC
)
->
print
$
show
cnt
yearReq
=
[
text
|
yearReq
=
[
text
|
(language_t:en)
(language_t:en)
AND (producedDateY_i:2015
AND (producedDateY_i:2018
OR producedDateY_i:2016
OR producedDateY_i:2019
OR producedDateY_i:2017
OR producedDateY_i:2020
OR producedDateY_i:2018
OR producedDateY_i:2021
OR producedDateY_i:2021
OR producedDateY_i:2022)
OR producedDateY_i:2022)
AND (structId_i:302102
AND (structId_i:302102
...
@@ -82,17 +97,3 @@ imt = [
...
@@ -82,17 +97,3 @@ imt = [
,
"6279"
,
"6279"
,
"29212"
,
"29212"
]
]
main
::
IO
()
main
=
run
=<<
execParser
opts
-- res <- getMetadataWith (generateRequestByStructID "artificial intelligence" imt) (Just 0) (Just 55)
-- case res of
-- (Left err) -> print err
-- (Right val) -> print $ _docs val
run
::
Command
->
IO
()
run
(
Count
(
CountParams
{
cp_query
}))
=
do
res
<-
getMetadataWithC
(
cp_query
)
(
Just
0
)
Nothing
case
res
of
Left
err
->
print
err
Right
(
cnt
,
_docsC
)
->
print
$
show
cnt
src/HAL/Doc/Corpus.hs
View file @
397fa34f
...
@@ -16,7 +16,7 @@ import Servant.API (ToHttpApiData(..))
...
@@ -16,7 +16,7 @@ import Servant.API (ToHttpApiData(..))
data
Corpus
=
Corpus
data
Corpus
=
Corpus
{
{
_corpus_docid
::
In
t
,
_corpus_docid
::
Tex
t
,
_corpus_title
::
[
Text
],
_corpus_title
::
[
Text
],
_corpus_abstract
::
[
Text
],
_corpus_abstract
::
[
Text
],
_corpus_date
::
Maybe
Text
,
_corpus_date
::
Maybe
Text
,
...
@@ -28,7 +28,7 @@ data Corpus = Corpus
...
@@ -28,7 +28,7 @@ data Corpus = Corpus
L
.
makeLenses
''
C
orpus
L
.
makeLenses
''
C
orpus
instance
Default
Corpus
where
instance
Default
Corpus
where
def
=
Corpus
def
def
def
def
def
def
def
def
def
=
Corpus
""
def
def
def
def
def
def
def
instance
FromJSON
Corpus
where
instance
FromJSON
Corpus
where
parseJSON
(
Object
o
)
=
parseJSON
(
Object
o
)
=
...
...
src/HAL/Doc/EntityTree.hs
View file @
397fa34f
...
@@ -11,17 +11,17 @@ import Servant.API (ToHttpApiData(..))
...
@@ -11,17 +11,17 @@ import Servant.API (ToHttpApiData(..))
data
EntityTree
=
EntityTree
data
EntityTree
=
EntityTree
{
{
_docid
::
In
t
,
_docid
::
Tex
t
,
_label_s
::
Maybe
Text
,
_label_s
::
Maybe
Text
,
_parentEntityTreeid_i
::
[
Text
]
_parentEntityTreeid_i
::
[
Text
]
}
deriving
(
Generic
)
}
deriving
(
Generic
)
instance
Default
EntityTree
where
instance
Default
EntityTree
where
def
=
EntityTree
def
def
def
def
=
EntityTree
""
def
def
instance
FromJSON
EntityTree
where
instance
FromJSON
EntityTree
where
parseJSON
(
Object
o
)
=
EntityTree
<$>
parseJSON
(
Object
o
)
=
(
o
.:
"docid"
)
EntityTree
<$>
(
o
.:
"docid"
)
<*>
(
o
.:?
"label_s"
)
<*>
(
o
.:?
"label_s"
)
<*>
(
o
.:?
"parentEntityTreeid_i"
.!=
[]
)
<*>
(
o
.:?
"parentEntityTreeid_i"
.!=
[]
)
...
...
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