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
1dbd9392
Commit
1dbd9392
authored
Jul 16, 2024
by
mzheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renaming Corpus to Document for clarification
parent
3665ccda
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
59 deletions
+59
-59
Main.hs
app/Main.hs
+13
-13
crawlerHAL.cabal
crawlerHAL.cabal
+1
-1
HAL.hs
src/HAL.hs
+13
-13
Doc.hs
src/HAL/Doc.hs
+2
-2
Document.hs
src/HAL/Doc/Document.hs
+30
-30
No files found.
app/Main.hs
View file @
1dbd9392
...
@@ -8,7 +8,7 @@ import Data.Text qualified as T
...
@@ -8,7 +8,7 @@ import Data.Text qualified as T
import
HAL
(
getMetadataWithCursorOptsC
,
countResultsOpts'
,
HalCrawlerOptions
(
..
),
defaultHalOptions
,
getMetadataWith
,
generateRequestByStructID
)
import
HAL
(
getMetadataWithCursorOptsC
,
countResultsOpts'
,
HalCrawlerOptions
(
..
),
defaultHalOptions
,
getMetadataWith
,
generateRequestByStructID
)
import
HAL.Types
import
HAL.Types
import
HAL.Doc
import
HAL.Doc
import
HAL.Doc.
Corpus
(
Corpus
(
..
))
import
HAL.Doc.
Document
(
Document
(
..
))
import
Network.HTTP.Client
(
newManager
)
import
Network.HTTP.Client
(
newManager
)
import
Network.HTTP.Client.TLS
(
tlsManagerSettings
)
import
Network.HTTP.Client.TLS
(
tlsManagerSettings
)
import
Options.Applicative
import
Options.Applicative
...
@@ -63,13 +63,13 @@ main = do run =<< execParser opts
...
@@ -63,13 +63,13 @@ main = do run =<< execParser opts
-- case res of
-- case res of
-- (Left err) -> print err
-- (Left err) -> print err
-- (Right val) -> do
-- (Right val) -> do
-- mapM_ print
Corpus
$ _docs val
-- mapM_ print
Document
$ _docs val
--
t
his function is for debug purpose
--
| T
his function is for debug purpose
print
Corpus
::
MonadIO
m
=>
Corpus
->
m
()
print
Document
::
Document
->
IO
()
print
Corpus
Corpus
{
..
}
=
do
print
Document
Document
{
..
}
=
do
putText
$
"StructId: ["
<>
T
.
intercalate
", "
(
map
(
T
.
pack
.
show
)
_
corpus
_struct_id
)
<>
"]"
putText
$
"StructId: ["
<>
T
.
intercalate
", "
(
map
(
T
.
pack
.
show
)
_
document
_struct_id
)
<>
"]"
putText
$
"Authors affiliations: ["
<>
T
.
intercalate
", "
_
corpus
_authors_affiliations
<>
"]"
putText
$
"Authors affiliations: ["
<>
T
.
intercalate
", "
_
document
_authors_affiliations
<>
"]"
putText
"------------"
putText
"------------"
...
@@ -88,16 +88,16 @@ run (Fetch (FetchParams { fp_query, fp_limit, fp_lang })) = do
...
@@ -88,16 +88,16 @@ run (Fetch (FetchParams { fp_query, fp_limit, fp_lang })) = do
Right
(
_cnt
,
docsC
)
->
do
Right
(
_cnt
,
docsC
)
->
do
_
<-
runConduit
$
_
<-
runConduit
$
docsC
docsC
.|
mapM_C
print
Corpus
.|
mapM_C
print
Document
.|
sinkList
.|
sinkList
pure
()
pure
()
where
where
opts
=
defaultHalOptions
{
_hco_debugLogs
=
True
}
opts
=
defaultHalOptions
{
_hco_debugLogs
=
True
}
print
Corpus
Corpus
{
..
}
=
do
print
Document
Document
{
..
}
=
do
putText
$
"docid: "
<>
_
corpus_docid
<>
" ["
<>
(
T
.
intercalate
" "
_corpus
_title
)
<>
"]"
putText
$
"docid: "
<>
_
document_docid
<>
" ["
<>
(
T
.
intercalate
" "
_document
_title
)
<>
"]"
putText
$
" "
<>
(
T
.
intercalate
" "
_
corpus
_abstract
)
putText
$
" "
<>
(
T
.
intercalate
" "
_
document
_abstract
)
putText
$
" "
<>
show
_
corpus
_abstract_lang_map
putText
$
" "
<>
show
_
document
_abstract_lang_map
putText
$
" "
<>
show
_
corpus
_original
putText
$
" "
<>
show
_
document
_original
putText
"------------"
putText
"------------"
...
...
crawlerHAL.cabal
View file @
1dbd9392
...
@@ -29,7 +29,7 @@ library
...
@@ -29,7 +29,7 @@ library
HAL
HAL
HAL.Client
HAL.Client
HAL.Doc
HAL.Doc
HAL.Doc.
Corpus
HAL.Doc.
Document
HAL.Doc.EntityTree
HAL.Doc.EntityTree
HAL.Doc.Struct
HAL.Doc.Struct
HAL.Types
HAL.Types
...
...
src/HAL.hs
View file @
1dbd9392
...
@@ -6,7 +6,7 @@ import Data.Aeson ( FromJSON )
...
@@ -6,7 +6,7 @@ import Data.Aeson ( FromJSON )
import
Data.LanguageCodes
(
ISO639_1
(
..
))
import
Data.LanguageCodes
(
ISO639_1
(
..
))
import
Data.Text
qualified
as
T
import
Data.Text
qualified
as
T
import
HAL.Client
(
SortField
(
Asc
),
search
,
structure
,
searchCursor
)
import
HAL.Client
(
SortField
(
Asc
),
search
,
structure
,
searchCursor
)
import
HAL.Doc.
Corpus
(
Corpus
)
import
HAL.Doc.
Document
(
Document
)
import
HAL.Doc.Struct
(
Struct
)
import
HAL.Doc.Struct
(
Struct
)
import
HAL.Types
(
Response
(
..
))
import
HAL.Types
(
Response
(
..
))
import
HAL.Utils
(
langAbstractS
,
toText
)
import
HAL.Utils
(
langAbstractS
,
toText
)
...
@@ -48,7 +48,7 @@ getMetadataWithCursorC :: Query
...
@@ -48,7 +48,7 @@ getMetadataWithCursorC :: Query
-- rows returned.
-- rows returned.
->
Maybe
ISO639_1
->
Maybe
ISO639_1
-- ^ An optional language for the search.
-- ^ An optional language for the search.
->
IO
(
Either
ClientError
(
Maybe
Count
,
ConduitT
()
Corpus
IO
()
))
->
IO
(
Either
ClientError
(
Maybe
Count
,
ConduitT
()
Document
IO
()
))
getMetadataWithCursorC
=
getMetadataWithCursorOptsC
defaultHalOptions
getMetadataWithCursorC
=
getMetadataWithCursorOptsC
defaultHalOptions
-- | Fetch metadata using cursors
-- | Fetch metadata using cursors
...
@@ -62,7 +62,7 @@ getMetadataWithCursorOptsC :: HalCrawlerOptions
...
@@ -62,7 +62,7 @@ getMetadataWithCursorOptsC :: HalCrawlerOptions
-- rows returned.
-- rows returned.
->
Maybe
ISO639_1
->
Maybe
ISO639_1
-- ^ An optional language for the search.
-- ^ An optional language for the search.
->
IO
(
Either
ClientError
(
Maybe
Count
,
ConduitT
()
Corpus
IO
()
))
->
IO
(
Either
ClientError
(
Maybe
Count
,
ConduitT
()
Document
IO
()
))
getMetadataWithCursorOptsC
opts
@
HalCrawlerOptions
{
..
}
q
mb_limit
lang
=
do
getMetadataWithCursorOptsC
opts
@
HalCrawlerOptions
{
..
}
q
mb_limit
lang
=
do
-- Basically this works as follows:
-- Basically this works as follows:
-- - fetch first page with cursor = "*"
-- - fetch first page with cursor = "*"
...
@@ -78,7 +78,7 @@ getMetadataWithCursorOptsC opts@HalCrawlerOptions { .. } q mb_limit lang = do
...
@@ -78,7 +78,7 @@ getMetadataWithCursorOptsC opts@HalCrawlerOptions { .. } q mb_limit lang = do
fq
=
queryWithLang
lang
fq
=
queryWithLang
lang
get'
::
Count
get'
::
Count
->
(
Maybe
Count
,
ConduitT
()
Corpus
IO
()
)
->
(
Maybe
Count
,
ConduitT
()
Document
IO
()
)
get'
numFound'
=
get'
numFound'
=
(
Just
numResults
(
Just
numResults
,
producer
"*"
,
producer
"*"
...
@@ -89,7 +89,7 @@ getMetadataWithCursorOptsC opts@HalCrawlerOptions { .. } q mb_limit lang = do
...
@@ -89,7 +89,7 @@ getMetadataWithCursorOptsC opts@HalCrawlerOptions { .. } q mb_limit lang = do
limit
=
min
numFound'
$
fromMaybe
numFound'
mb_limit
limit
=
min
numFound'
$
fromMaybe
numFound'
mb_limit
numResults
=
limit
numResults
=
limit
producer
::
Text
->
ConduitT
()
Corpus
IO
()
producer
::
Text
->
ConduitT
()
Document
IO
()
producer
cursor
=
do
producer
cursor
=
do
let
endpoint
=
searchCursor
(
Just
q
)
(
Just
$
requestedFields
lang
)
fq
sort_
(
Just
$
fromIntegral
_hco_batchSize
)
(
Just
cursor
)
let
endpoint
=
searchCursor
(
Just
q
)
(
Just
$
requestedFields
lang
)
fq
sort_
(
Just
$
fromIntegral
_hco_batchSize
)
(
Just
cursor
)
liftIO
$
debugLog
opts
$
"[getMetadataWithCursorLangC] producer: "
<>
show
cursor
liftIO
$
debugLog
opts
$
"[getMetadataWithCursorLangC] producer: "
<>
show
cursor
...
@@ -116,7 +116,7 @@ countResultsOpts' opts q lang = do
...
@@ -116,7 +116,7 @@ countResultsOpts' opts q lang = do
-- Set rows=0 to query number of results
-- Set rows=0 to query number of results
-- https://api.archives-ouvertes.fr/docs/search#rows
-- https://api.archives-ouvertes.fr/docs/search#rows
-- First, estimate the total number of documents
-- First, estimate the total number of documents
eRes
<-
runHalAPIClient
opts
$
search
(
Just
q
)
(
Just
$
requestedFields
Nothing
)
fq
Nothing
(
Just
0
)
(
Just
0
)
::
IO
(
Either
ClientError
(
Response
Corpus
))
eRes
<-
runHalAPIClient
opts
$
search
(
Just
q
)
(
Just
$
requestedFields
Nothing
)
fq
Nothing
(
Just
0
)
(
Just
0
)
::
IO
(
Either
ClientError
(
Response
Document
))
pure
(
fromIntegral
.
_numFound
<$>
eRes
)
pure
(
fromIntegral
.
_numFound
<$>
eRes
)
where
where
fq
=
queryWithLang
lang
fq
=
queryWithLang
lang
...
@@ -135,7 +135,7 @@ getMetadataWith :: [Query]
...
@@ -135,7 +135,7 @@ getMetadataWith :: [Query]
-- rows returned.
-- rows returned.
->
Maybe
ISO639_1
->
Maybe
ISO639_1
-- ^ An optional language for the search.
-- ^ An optional language for the search.
->
IO
(
Either
ClientError
(
Response
Corpus
))
->
IO
(
Either
ClientError
(
Response
Document
))
getMetadataWith
qs
start_
limit
lang
=
do
getMetadataWith
qs
start_
limit
lang
=
do
runHalAPIClient
defaultHalOptions
$
search
(
Just
q
)
(
Just
$
requestedFields
lang
)
[]
Nothing
start_
(
fromIntegral
<$>
limit
)
runHalAPIClient
defaultHalOptions
$
search
(
Just
q
)
(
Just
$
requestedFields
lang
)
[]
Nothing
start_
(
fromIntegral
<$>
limit
)
where
where
...
@@ -152,7 +152,7 @@ getMetadataWithC :: [Query]
...
@@ -152,7 +152,7 @@ getMetadataWithC :: [Query]
-- rows returned.
-- rows returned.
->
Maybe
ISO639_1
->
Maybe
ISO639_1
-- ^ An optional language for the search.
-- ^ An optional language for the search.
->
IO
(
Either
ClientError
(
Maybe
Count
,
ConduitT
()
Corpus
IO
()
))
->
IO
(
Either
ClientError
(
Maybe
Count
,
ConduitT
()
Document
IO
()
))
getMetadataWithC
qs
start_
limit
lang
=
getMetadataWithOptsC
defaultHalOptions
(
qs
<>
queryWithLang
lang
)
start_
limit
lang
getMetadataWithC
qs
start_
limit
lang
=
getMetadataWithOptsC
defaultHalOptions
(
qs
<>
queryWithLang
lang
)
start_
limit
lang
getMetadataWithOptsC
::
HalCrawlerOptions
getMetadataWithOptsC
::
HalCrawlerOptions
...
@@ -166,14 +166,14 @@ getMetadataWithOptsC :: HalCrawlerOptions
...
@@ -166,14 +166,14 @@ getMetadataWithOptsC :: HalCrawlerOptions
-- rows returned.
-- rows returned.
->
Maybe
ISO639_1
->
Maybe
ISO639_1
-- ^ An optional language for the search.
-- ^ An optional language for the search.
->
IO
(
Either
ClientError
(
Maybe
Count
,
ConduitT
()
Corpus
IO
()
))
->
IO
(
Either
ClientError
(
Maybe
Count
,
ConduitT
()
Document
IO
()
))
getMetadataWithOptsC
opts
@
HalCrawlerOptions
{
..
}
qs
mb_offset
mb_limit
lang
=
do
getMetadataWithOptsC
opts
@
HalCrawlerOptions
{
..
}
qs
mb_offset
mb_limit
lang
=
do
-- First, estimate the total number of documents
-- First, estimate the total number of documents
eCount
<-
countResults
qs
eCount
<-
countResults
qs
pure
$
get'
<$>
eCount
pure
$
get'
<$>
eCount
where
where
get'
::
Count
get'
::
Count
->
(
Maybe
Count
,
ConduitT
()
Corpus
IO
()
)
->
(
Maybe
Count
,
ConduitT
()
Document
IO
()
)
get'
numFound'
=
get'
numFound'
=
(
Just
numResults
(
Just
numResults
,
yieldMany
[
0
..
]
,
yieldMany
[
0
..
]
...
@@ -188,7 +188,7 @@ getMetadataWithOptsC opts@HalCrawlerOptions { .. } qs mb_offset mb_limit lang =
...
@@ -188,7 +188,7 @@ getMetadataWithOptsC opts@HalCrawlerOptions { .. } qs mb_offset mb_limit lang =
numResults
=
limit
-
fromIntegral
offset
numResults
=
limit
-
fromIntegral
offset
numPages
=
numResults
`
div
`
fromIntegral
_hco_batchSize
+
1
numPages
=
numResults
`
div
`
fromIntegral
_hco_batchSize
+
1
getPage
::
Start
->
Int
->
IO
[
Corpus
]
getPage
::
Start
->
Int
->
IO
[
Document
]
getPage
start'
pageNum
=
do
getPage
start'
pageNum
=
do
let
offset
=
start'
+
pageNum
*
_hco_batchSize
let
offset
=
start'
+
pageNum
*
_hco_batchSize
debugLog
opts
$
"[getMetadataWithLangC] getPage: "
<>
show
offset
debugLog
opts
$
"[getMetadataWithLangC] getPage: "
<>
show
offset
...
@@ -208,7 +208,7 @@ countResults qs = do
...
@@ -208,7 +208,7 @@ countResults qs = do
-- Set rows=0 to query number of results
-- Set rows=0 to query number of results
-- https://api.archives-ouvertes.fr/docs/search#rows
-- https://api.archives-ouvertes.fr/docs/search#rows
-- First, estimate the total number of documents
-- First, estimate the total number of documents
eRes
<-
runHalAPIClient
defaultHalOptions
$
search
(
Just
q
)
(
Just
$
requestedFields
Nothing
)
[]
Nothing
(
Just
0
)
(
Just
0
)
::
IO
(
Either
ClientError
(
Response
Corpus
))
eRes
<-
runHalAPIClient
defaultHalOptions
$
search
(
Just
q
)
(
Just
$
requestedFields
Nothing
)
[]
Nothing
(
Just
0
)
(
Just
0
)
::
IO
(
Either
ClientError
(
Response
Document
))
pure
(
fromIntegral
.
_numFound
<$>
eRes
)
pure
(
fromIntegral
.
_numFound
<$>
eRes
)
where
where
q
=
joinQueries
qs
q
=
joinQueries
qs
...
@@ -258,7 +258,7 @@ runStructureRequest :: Maybe Text -> IO (Either ClientError (Response Struct))
...
@@ -258,7 +258,7 @@ runStructureRequest :: Maybe Text -> IO (Either ClientError (Response Struct))
runStructureRequest
rq
=
runStructureRequest
rq
=
runHalAPIClient
defaultHalOptions
$
structure
(
Just
structFields
)
rq
(
Just
10000
)
runHalAPIClient
defaultHalOptions
$
structure
(
Just
structFields
)
rq
(
Just
10000
)
runSearchRequest
::
[
Text
]
->
IO
(
Either
ClientError
(
Response
Corpus
))
runSearchRequest
::
[
Text
]
->
IO
(
Either
ClientError
(
Response
Document
))
runSearchRequest
rq
=
runSearchRequest
rq
=
runHalAPIClient
defaultHalOptions
$
search
(
Just
q
)
(
Just
$
requestedFields
Nothing
)
[]
Nothing
Nothing
Nothing
runHalAPIClient
defaultHalOptions
$
search
(
Just
q
)
(
Just
$
requestedFields
Nothing
)
[]
Nothing
Nothing
Nothing
where
where
...
...
src/HAL/Doc.hs
View file @
1dbd9392
module
HAL.Doc
module
HAL.Doc
(
module
HAL
.
Doc
.
EntityTree
(
module
HAL
.
Doc
.
EntityTree
,
module
HAL
.
Doc
.
Corpus
)
,
module
HAL
.
Doc
.
Document
)
where
where
import
HAL.Doc.EntityTree
import
HAL.Doc.EntityTree
import
HAL.Doc.
Corpus
import
HAL.Doc.
Document
src/HAL/Doc/
Corpus
.hs
→
src/HAL/Doc/
Document
.hs
View file @
1dbd9392
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveGeneric #-}
module
HAL.Doc.
Corpus
where
module
HAL.Doc.
Document
where
import
Control.Lens
qualified
as
L
import
Control.Lens
qualified
as
L
import
Data.Aeson
(
(
.:
),
(
.:?
),
withObject
,
FromJSON
(
parseJSON
),
Object
)
import
Data.Aeson
(
(
.:
),
(
.:?
),
withObject
,
FromJSON
(
parseJSON
),
Object
)
...
@@ -17,50 +17,50 @@ import qualified Data.Text as T
...
@@ -17,50 +17,50 @@ import qualified Data.Text as T
import
Data.Aeson.Types
(
Parser
)
import
Data.Aeson.Types
(
Parser
)
import
Prelude
qualified
as
P
import
Prelude
qualified
as
P
data
Corpus
=
Corpus
data
Document
=
Document
{
_
corpus
_docid
::
Text
{
_
document
_docid
::
Text
,
_
corpus
_title
::
[
Text
]
,
_
document
_title
::
[
Text
]
,
_
corpus
_abstract
::
[
Text
]
,
_
document
_abstract
::
[
Text
]
,
_
corpus
_abstract_lang_map
::
Map
ISO639_1
[
Text
]
,
_
document
_abstract_lang_map
::
Map
ISO639_1
[
Text
]
,
_
corpus
_date
::
Maybe
Text
,
_
document
_date
::
Maybe
Text
,
_
corpus
_source
::
Maybe
Text
,
_
document
_source
::
Maybe
Text
,
_
corpus
_authors_names
::
[
Text
]
,
_
document
_authors_names
::
[
Text
]
,
_
corpus
_authors_affiliations
::
[
Text
]
,
_
document
_authors_affiliations
::
[
Text
]
,
_
corpus
_struct_id
::
[
Int
]
,
_
document
_struct_id
::
[
Int
]
,
_
corpus
_original
::
Object
,
_
document
_original
::
Object
}
deriving
(
Show
,
Generic
)
}
deriving
(
Show
,
Generic
)
L
.
makeLenses
''
C
orpus
L
.
makeLenses
''
D
ocument
instance
Default
Corpus
where
instance
Default
Document
where
def
=
Corpus
"default Id"
def
def
def
def
def
def
def
def
mempty
def
=
Document
"default Id"
def
def
def
def
def
def
def
def
mempty
instance
FromJSON
Corpus
where
instance
FromJSON
Document
where
parseJSON
=
withObject
"
Corpus
"
$
\
o
->
do
parseJSON
=
withObject
"
Document
"
$
\
o
->
do
_
corpus
_docid
<-
o
.:
"docid"
_
document
_docid
<-
o
.:
"docid"
_
corpus
_title
<-
o
.:
"title_s"
<|>
return
[]
_
document
_title
<-
o
.:
"title_s"
<|>
return
[]
_
corpus
_abstract
<-
o
.:
"en_abstract_s"
<|>
return
[]
_
document
_abstract
<-
o
.:
"en_abstract_s"
<|>
return
[]
_
corpus
_date
<-
o
.:?
"submittedDate_s"
_
document
_date
<-
o
.:?
"submittedDate_s"
_
corpus
_source
<-
o
.:?
"source_s"
_
document
_source
<-
o
.:?
"source_s"
_
corpus
_authors_names
<-
o
.:
"authFullName_s"
<|>
return
[]
_
document
_authors_names
<-
o
.:
"authFullName_s"
<|>
return
[]
idsNames
<-
o
.:?
"structIdName_fs"
::
Parser
(
Maybe
[
Text
])
--unsparsed (contains a _FacetSep_)
idsNames
<-
o
.:?
"structIdName_fs"
::
Parser
(
Maybe
[
Text
])
--unsparsed (contains a _FacetSep_)
let
structIdname
=
getStructIdsNames
idsNames
let
structIdname
=
getStructIdsNames
idsNames
let
_
corpus
_struct_id
=
map
fst
structIdname
let
_
document
_struct_id
=
map
fst
structIdname
let
_
corpus
_authors_affiliations
=
map
snd
structIdname
let
_
document
_authors_affiliations
=
map
snd
structIdname
abstracts
<-
abstracts
<-
mapM
(
\
lang
->
do
mapM
(
\
lang
->
do
ma
<-
o
.:?
fromString
(
T
.
unpack
$
langAbstractS
lang
)
ma
<-
o
.:?
fromString
(
T
.
unpack
$
langAbstractS
lang
)
pure
$
(
\
a
->
(
lang
,
a
))
<$>
ma
)
allLangs
pure
$
(
\
a
->
(
lang
,
a
))
<$>
ma
)
allLangs
let
_
corpus
_abstract_lang_map
=
Map
.
fromList
$
catMaybes
abstracts
let
_
document
_abstract_lang_map
=
Map
.
fromList
$
catMaybes
abstracts
let
_
corpus
_original
=
o
let
_
document
_original
=
o
pure
$
Corpus
{
..
}
pure
$
Document
{
..
}
-- |
this function p
arses the field structIdName_fs that looks like :
-- |
P
arses the field structIdName_fs that looks like :
-- > StructId_FacetSep_StructName
-- > StructId_FacetSep_StructName
--
--
-- returns [(StructId, StructName)]
-- returns [(StructId, StructName)]
...
@@ -71,5 +71,5 @@ getStructIdsNames (Just idsNames) = map (\tab -> (P.read (T.unpack (P.head tab))
...
@@ -71,5 +71,5 @@ getStructIdsNames (Just idsNames) = map (\tab -> (P.read (T.unpack (P.head tab))
splitInstitutes
=
P
.
map
(
T
.
splitOn
(
T
.
pack
"_FacetSep_"
))
splitInstitutes
=
P
.
map
(
T
.
splitOn
(
T
.
pack
"_FacetSep_"
))
getStructIdsNames
Nothing
=
[]
getStructIdsNames
Nothing
=
[]
instance
ToHttpApiData
Corpus
where
instance
ToHttpApiData
Document
where
toUrlPiece
_
=
"docid,title_s,en_abstract_s,fr_abstract_s,submittedDate_s,source_s,authFullName_s,structId_i,structIdName_fs"
toUrlPiece
_
=
"docid,title_s,en_abstract_s,fr_abstract_s,submittedDate_s,source_s,authFullName_s,structId_i,structIdName_fs"
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