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
155
Issues
155
List
Board
Labels
Milestones
Merge Requests
8
Merge Requests
8
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
82ffefa1
Commit
82ffefa1
authored
1 month ago
by
Yoelis Acourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add _hd_from_country to hyperdata
parent
13457ca8
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
19 additions
and
3 deletions
+19
-3
Searx.hs
src/Gargantext/API/Node/Corpus/Searx.hs
+1
-0
DocumentUpload.hs
src/Gargantext/API/Node/DocumentUpload.hs
+1
-0
DocumentsFromWriteNodes.hs
src/Gargantext/API/Node/DocumentsFromWriteNodes.hs
+1
-0
Arxiv.hs
src/Gargantext/Core/Text/Corpus/API/Arxiv.hs
+1
-0
EPO.hs
src/Gargantext/Core/Text/Corpus/API/EPO.hs
+1
-0
Hal.hs
src/Gargantext/Core/Text/Corpus/API/Hal.hs
+1
-0
Isidore.hs
src/Gargantext/Core/Text/Corpus/API/Isidore.hs
+1
-0
OpenAlex.hs
src/Gargantext/Core/Text/Corpus/API/OpenAlex.hs
+1
-0
Pubmed.hs
src/Gargantext/Core/Text/Corpus/API/Pubmed.hs
+1
-0
Parsers.hs
src/Gargantext/Core/Text/Corpus/Parsers.hs
+1
-0
GrandDebat.hs
src/Gargantext/Core/Text/Corpus/Parsers/GrandDebat.hs
+1
-0
Isidore.hs
src/Gargantext/Core/Text/Corpus/Parsers/Isidore.hs
+1
-0
Istex.hs
src/Gargantext/Core/Text/Corpus/Parsers/JSON/Istex.hs
+1
-0
TSV.hs
src/Gargantext/Core/Text/Corpus/Parsers/TSV.hs
+2
-0
Document.hs
src/Gargantext/Database/Admin/Types/Hyperdata/Document.hs
+4
-3
No files found.
src/Gargantext/API/Node/Corpus/Searx.hs
View file @
82ffefa1
...
@@ -215,6 +215,7 @@ hyperdataDocumentFromSearxResult l (SearxResult { _sr_content, _sr_engine, _sr_p
...
@@ -215,6 +215,7 @@ hyperdataDocumentFromSearxResult l (SearxResult { _sr_content, _sr_engine, _sr_p
,
_hd_doi
=
Nothing
,
_hd_doi
=
Nothing
,
_hd_url
=
Nothing
,
_hd_url
=
Nothing
,
_hd_page
=
Nothing
,
_hd_page
=
Nothing
,
_hd_from_country
=
Nothing
,
_hd_title
=
Just
_sr_title
,
_hd_title
=
Just
_sr_title
,
_hd_authors
=
Nothing
,
_hd_authors
=
Nothing
,
_hd_institutes
=
Nothing
,
_hd_institutes
=
Nothing
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/API/Node/DocumentUpload.hs
View file @
82ffefa1
...
@@ -73,6 +73,7 @@ documentUpload nId doc = do
...
@@ -73,6 +73,7 @@ documentUpload nId doc = do
,
_hd_doi
=
Nothing
,
_hd_doi
=
Nothing
,
_hd_url
=
Nothing
,
_hd_url
=
Nothing
,
_hd_page
=
Nothing
,
_hd_page
=
Nothing
,
_hd_from_country
=
Nothing
,
_hd_title
=
Just
$
if
view
du_title
doc
==
""
then
T
.
take
50
(
view
du_abstract
doc
)
else
view
du_title
doc
,
_hd_title
=
Just
$
if
view
du_title
doc
==
""
then
T
.
take
50
(
view
du_abstract
doc
)
else
view
du_title
doc
,
_hd_authors
=
Just
$
view
du_authors
doc
,
_hd_authors
=
Just
$
view
du_authors
doc
,
_hd_institutes
=
Nothing
,
_hd_institutes
=
Nothing
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/API/Node/DocumentsFromWriteNodes.hs
View file @
82ffefa1
...
@@ -148,6 +148,7 @@ hyperdataDocumentFromFrameWrite lang paragraphSize (node, contents) =
...
@@ -148,6 +148,7 @@ hyperdataDocumentFromFrameWrite lang paragraphSize (node, contents) =
,
_hd_url
=
Nothing
,
_hd_url
=
Nothing
,
_hd_page
=
Nothing
,
_hd_page
=
Nothing
,
_hd_title
=
Just
t
,
_hd_title
=
Just
t
,
_hd_from_country
=
Nothing
,
_hd_authors
=
Just
authors'
,
_hd_authors
=
Just
authors'
,
_hd_institutes
=
Nothing
,
_hd_institutes
=
Nothing
,
_hd_source
=
Just
$
node
^.
node_name
,
_hd_source
=
Just
$
node
^.
node_name
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Text/Corpus/API/Arxiv.hs
View file @
82ffefa1
...
@@ -113,6 +113,7 @@ toDoc l (Arxiv.Result { abstract
...
@@ -113,6 +113,7 @@ toDoc l (Arxiv.Result { abstract
,
_hd_source
=
Just
$
Text
.
pack
journal
,
_hd_source
=
Just
$
Text
.
pack
journal
,
_hd_abstract
=
Just
$
Text
.
pack
abstract
,
_hd_abstract
=
Just
$
Text
.
pack
abstract
,
_hd_publication_date
=
Just
$
Text
.
pack
publication_date
,
_hd_publication_date
=
Just
$
Text
.
pack
publication_date
,
_hd_from_country
=
Nothing
,
_hd_publication_year
=
fromIntegral
<$>
year
,
_hd_publication_year
=
fromIntegral
<$>
year
,
_hd_publication_month
=
Nothing
-- TODO parse publication_date
,
_hd_publication_month
=
Nothing
-- TODO parse publication_date
,
_hd_publication_day
=
Nothing
,
_hd_publication_day
=
Nothing
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Text/Corpus/API/EPO.hs
View file @
82ffefa1
...
@@ -50,6 +50,7 @@ toDoc lang (EPO.HyperdataDocument { .. }) =
...
@@ -50,6 +50,7 @@ toDoc lang (EPO.HyperdataDocument { .. }) =
,
_hd_url
=
Nothing
,
_hd_url
=
Nothing
,
_hd_page
=
Nothing
,
_hd_page
=
Nothing
,
_hd_title
=
Map
.
lookup
lang
titles
,
_hd_title
=
Map
.
lookup
lang
titles
,
_hd_from_country
=
Nothing
,
_hd_authors
=
authors_
,
_hd_authors
=
authors_
,
_hd_institutes
=
Nothing
,
_hd_institutes
=
Nothing
,
_hd_source
=
Nothing
,
_hd_source
=
Nothing
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Text/Corpus/API/Hal.hs
View file @
82ffefa1
...
@@ -55,6 +55,7 @@ toDoc' la (HAL.Document { .. }) = do
...
@@ -55,6 +55,7 @@ toDoc' la (HAL.Document { .. }) = do
,
_hd_title
=
Just
$
unwords
_document_title
,
_hd_title
=
Just
$
unwords
_document_title
,
_hd_authors
=
Just
$
nonemptyIntercalate
", "
_document_authors_names
,
_hd_authors
=
Just
$
nonemptyIntercalate
", "
_document_authors_names
,
_hd_institutes
=
Just
$
nonemptyIntercalate
", "
$
zipWith
(
\
affialition
structId
->
affialition
<>
" | "
<>
structId
)
_document_authors_affiliations
$
map
show
_document_struct_id
,
_hd_institutes
=
Just
$
nonemptyIntercalate
", "
$
zipWith
(
\
affialition
structId
->
affialition
<>
" | "
<>
structId
)
_document_authors_affiliations
$
map
show
_document_struct_id
,
_hd_from_country
=
Nothing
,
_hd_source
=
Just
$
maybe
"Nothing"
identity
_document_source
,
_hd_source
=
Just
$
maybe
"Nothing"
identity
_document_source
,
_hd_abstract
=
Just
abstract
,
_hd_abstract
=
Just
abstract
,
_hd_publication_date
=
fmap
show
utctime
,
_hd_publication_date
=
fmap
show
utctime
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Text/Corpus/API/Isidore.hs
View file @
82ffefa1
...
@@ -83,6 +83,7 @@ isidoreToDoc lang (IsidoreDoc t a d u s as) = do
...
@@ -83,6 +83,7 @@ isidoreToDoc lang (IsidoreDoc t a d u s as) = do
,
_hd_page
=
Nothing
,
_hd_page
=
Nothing
,
_hd_title
=
Just
$
cleanText
$
langText
t
,
_hd_title
=
Just
$
cleanText
$
langText
t
,
_hd_authors
=
creator2text
<$>
as
,
_hd_authors
=
creator2text
<$>
as
,
_hd_from_country
=
Nothing
,
_hd_institutes
=
Nothing
,
_hd_institutes
=
Nothing
,
_hd_source
=
Just
$
maybe
"Nothing"
(
identity
.
_sourceName
)
s
,
_hd_source
=
Just
$
maybe
"Nothing"
(
identity
.
_sourceName
)
s
,
_hd_abstract
=
cleanText
.
langText
<$>
a
,
_hd_abstract
=
cleanText
.
langText
<$>
a
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Text/Corpus/API/OpenAlex.hs
View file @
82ffefa1
...
@@ -38,6 +38,7 @@ toDoc (OA.Work { .. } ) =
...
@@ -38,6 +38,7 @@ toDoc (OA.Work { .. } ) =
,
_hd_doi
=
doi
,
_hd_doi
=
doi
,
_hd_url
=
url
,
_hd_url
=
url
,
_hd_page
=
firstPage
biblio
,
_hd_page
=
firstPage
biblio
,
_hd_from_country
=
Nothing
,
_hd_title
=
title
,
_hd_title
=
title
,
_hd_authors
=
authors
authorships
,
_hd_authors
=
authors
authorships
,
_hd_institutes
=
institutes
authorships
,
_hd_institutes
=
institutes
authorships
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Text/Corpus/API/Pubmed.hs
View file @
82ffefa1
...
@@ -120,6 +120,7 @@ toDoc l (PubMedDoc.PubMed { pubmed_article = PubMedDoc.PubMedArticle t j as aus
...
@@ -120,6 +120,7 @@ toDoc l (PubMedDoc.PubMed { pubmed_article = PubMedDoc.PubMedArticle t j as aus
,
_hd_url
=
Nothing
,
_hd_url
=
Nothing
,
_hd_page
=
Nothing
,
_hd_page
=
Nothing
,
_hd_title
=
t
,
_hd_title
=
t
,
_hd_from_country
=
Nothing
,
_hd_authors
=
authors
aus
,
_hd_authors
=
authors
aus
,
_hd_institutes
=
institutes
aus
,
_hd_institutes
=
institutes
aus
,
_hd_source
=
j
,
_hd_source
=
j
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Text/Corpus/Parsers.hs
View file @
82ffefa1
...
@@ -259,6 +259,7 @@ toDoc ff d = do
...
@@ -259,6 +259,7 @@ toDoc ff d = do
,
_hd_authors
=
lookup
"authors"
d
,
_hd_authors
=
lookup
"authors"
d
,
_hd_institutes
=
lookup
"institutes"
d
,
_hd_institutes
=
lookup
"institutes"
d
,
_hd_source
=
lookup
"source"
d
,
_hd_source
=
lookup
"source"
d
,
_hd_from_country
=
Nothing
,
_hd_abstract
=
lookup
"abstract"
d
,
_hd_abstract
=
lookup
"abstract"
d
,
_hd_publication_date
=
fmap
(
DT
.
pack
.
show
)
utcTime
,
_hd_publication_date
=
fmap
(
DT
.
pack
.
show
)
utcTime
,
_hd_publication_year
=
pub_year
,
_hd_publication_year
=
pub_year
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Text/Corpus/Parsers/GrandDebat.hs
View file @
82ffefa1
...
@@ -80,6 +80,7 @@ instance ToHyperdataDocument GrandDebatReference
...
@@ -80,6 +80,7 @@ instance ToHyperdataDocument GrandDebatReference
,
_hd_title
=
title
,
_hd_title
=
title
,
_hd_authors
=
authorType
,
_hd_authors
=
authorType
,
_hd_institutes
=
authorType
,
_hd_institutes
=
authorType
,
_hd_from_country
=
Nothing
,
_hd_source
=
authorZipCode
,
_hd_source
=
authorZipCode
,
_hd_abstract
=
toAbstract
<$>
responses
,
_hd_abstract
=
toAbstract
<$>
responses
,
_hd_publication_date
=
publishedAt
,
_hd_publication_date
=
publishedAt
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Text/Corpus/Parsers/Isidore.hs
View file @
82ffefa1
...
@@ -126,6 +126,7 @@ bind2doc l [ link', date, langDoc, authors, _source, publisher, title, abstract
...
@@ -126,6 +126,7 @@ bind2doc l [ link', date, langDoc, authors, _source, publisher, title, abstract
,
_hd_title
=
unbound
l
title
,
_hd_title
=
unbound
l
title
,
_hd_authors
=
unbound
l
authors
,
_hd_authors
=
unbound
l
authors
,
_hd_institutes
=
Nothing
,
_hd_institutes
=
Nothing
,
_hd_from_country
=
Nothing
,
_hd_source
=
unbound
l
publisher
,
_hd_source
=
unbound
l
publisher
,
_hd_abstract
=
unbound
l
abstract
,
_hd_abstract
=
unbound
l
abstract
,
_hd_publication_date
=
unbound
l
date
,
_hd_publication_date
=
unbound
l
date
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Text/Corpus/Parsers/JSON/Istex.hs
View file @
82ffefa1
...
@@ -43,6 +43,7 @@ toDoc la (ISTEX.Document i t a ab d s) = do
...
@@ -43,6 +43,7 @@ toDoc la (ISTEX.Document i t a ab d s) = do
,
_hd_institutes
=
Just
$
nonemptyIntercalate
", "
(
concatMap
ISTEX
.
_author_affiliations
a
)
,
_hd_institutes
=
Just
$
nonemptyIntercalate
", "
(
concatMap
ISTEX
.
_author_affiliations
a
)
,
_hd_source
=
Just
$
nonemptyIntercalate
", "
$
maybeToList
$
join
(
ISTEX
.
_source_title
<$>
s
)
,
_hd_source
=
Just
$
nonemptyIntercalate
", "
$
maybeToList
$
join
(
ISTEX
.
_source_title
<$>
s
)
,
_hd_abstract
=
ab
,
_hd_abstract
=
ab
,
_hd_from_country
=
Nothing
,
_hd_publication_date
=
fmap
(
T
.
pack
.
show
)
utctime
,
_hd_publication_date
=
fmap
(
T
.
pack
.
show
)
utctime
,
_hd_publication_year
=
pub_year
,
_hd_publication_year
=
pub_year
,
_hd_publication_month
=
pub_month
,
_hd_publication_month
=
pub_month
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Text/Corpus/Parsers/TSV.hs
View file @
82ffefa1
...
@@ -525,6 +525,7 @@ tsvHal2doc (TsvHal { .. }) =
...
@@ -525,6 +525,7 @@ tsvHal2doc (TsvHal { .. }) =
,
_hd_url
=
Just
tsvHal_url
,
_hd_url
=
Just
tsvHal_url
,
_hd_page
=
Nothing
,
_hd_page
=
Nothing
,
_hd_title
=
Just
tsvHal_title
,
_hd_title
=
Just
tsvHal_title
,
_hd_from_country
=
Nothing
,
_hd_authors
=
Just
tsvHal_authors
,
_hd_authors
=
Just
tsvHal_authors
,
_hd_institutes
=
Just
tsvHal_instStructId_i
,
_hd_institutes
=
Just
tsvHal_instStructId_i
,
_hd_source
=
Just
tsvHal_source
,
_hd_source
=
Just
tsvHal_source
...
@@ -550,6 +551,7 @@ tsv2doc (TsvDoc { .. })
...
@@ -550,6 +551,7 @@ tsv2doc (TsvDoc { .. })
,
_hd_page
=
Nothing
,
_hd_page
=
Nothing
,
_hd_title
=
Just
tsv_title
,
_hd_title
=
Just
tsv_title
,
_hd_authors
=
Just
tsv_authors
,
_hd_authors
=
Just
tsv_authors
,
_hd_from_country
=
Nothing
,
_hd_institutes
=
Nothing
,
_hd_institutes
=
Nothing
,
_hd_source
=
Just
tsv_source
,
_hd_source
=
Just
tsv_source
,
_hd_abstract
=
Just
tsv_abstract
,
_hd_abstract
=
Just
tsv_abstract
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Database/Admin/Types/Hyperdata/Document.hs
View file @
82ffefa1
...
@@ -33,6 +33,7 @@ data HyperdataDocument = HyperdataDocument { _hd_bdd :: !(Maybe T
...
@@ -33,6 +33,7 @@ data HyperdataDocument = HyperdataDocument { _hd_bdd :: !(Maybe T
,
_hd_publication_month
::
!
(
Maybe
Int
)
,
_hd_publication_month
::
!
(
Maybe
Int
)
,
_hd_publication_day
::
!
(
Maybe
Int
)
,
_hd_publication_day
::
!
(
Maybe
Int
)
,
_hd_publication_hour
::
!
(
Maybe
Int
)
,
_hd_publication_hour
::
!
(
Maybe
Int
)
,
_hd_from_country
::
!
(
Maybe
Text
)
,
_hd_publication_minute
::
!
(
Maybe
Int
)
,
_hd_publication_minute
::
!
(
Maybe
Int
)
,
_hd_publication_second
::
!
(
Maybe
Int
)
,
_hd_publication_second
::
!
(
Maybe
Int
)
,
_hd_language_iso2
::
!
(
Maybe
Text
)
,
_hd_language_iso2
::
!
(
Maybe
Text
)
...
@@ -50,7 +51,7 @@ instance HasText HyperdataDocument
...
@@ -50,7 +51,7 @@ instance HasText HyperdataDocument
defaultHyperdataDocument
::
HyperdataDocument
defaultHyperdataDocument
::
HyperdataDocument
defaultHyperdataDocument
=
case
decode
docExample
of
defaultHyperdataDocument
=
case
decode
docExample
of
Just
hp
->
hp
Just
hp
->
hp
Nothing
->
HyperdataDocument
Nothing
Nothing
Nothing
->
HyperdataDocument
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
...
@@ -116,12 +117,13 @@ arbitraryHyperdataDocuments =
...
@@ -116,12 +117,13 @@ arbitraryHyperdataDocuments =
,
(
"Science is magic"
,
"Closed Source review"
)
,
(
"Science is magic"
,
"Closed Source review"
)
,
(
"Open science for all"
,
"No Time"
)
,
(
"Open science for all"
,
"No Time"
)
,
(
"Closed science for me"
,
"No Space"
)
,
(
"Closed science for me"
,
"No Space"
)
]
::
[(
Text
,
Text
)])
]
::
[(
Text
,
Text
)])
where
where
toHyperdataDocument'
(
t1
,
t2
)
=
toHyperdataDocument'
(
t1
,
t2
)
=
HyperdataDocument
Nothing
Nothing
Nothing
Nothing
(
Just
t1
)
HyperdataDocument
Nothing
Nothing
Nothing
Nothing
(
Just
t1
)
Nothing
Nothing
(
Just
t2
)
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
(
Just
t2
)
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
...
@@ -137,7 +139,6 @@ instance ToSchema HyperdataDocument where
...
@@ -137,7 +139,6 @@ instance ToSchema HyperdataDocument where
genericDeclareNamedSchema
(
unPrefixSwagger
"_hd_"
)
proxy
genericDeclareNamedSchema
(
unPrefixSwagger
"_hd_"
)
proxy
&
mapped
.
schema
.
description
?~
"Document Hyperdata"
&
mapped
.
schema
.
description
?~
"Document Hyperdata"
&
mapped
.
schema
.
example
?~
toJSON
defaultHyperdataDocument
&
mapped
.
schema
.
example
?~
toJSON
defaultHyperdataDocument
{-
{-
-- | For now HyperdataDocumentV3 is not exposed with the API
-- | For now HyperdataDocumentV3 is not exposed with the API
instance ToSchema HyperdataDocumentV3 where
instance ToSchema HyperdataDocumentV3 where
...
...
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