Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in
haskell-gargantext
haskell-gargantext
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 159
    • Issues 159
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 7
    • Merge Requests 7
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • gargantext
  • haskell-gargantexthaskell-gargantext
  • Issues
  • #441

Closed
Open
Opened Jan 10, 2025 by Przemyslaw Kaminski@cgenie
  • Report abuse
  • New issue
Report abuse New issue

Sort out `WithQuery` structure, especially `database`/`datafield`

In G.A.N.Types we have the WithQuery structure: https://gitlab.iscpif.fr/gargantext/haskell-gargantext/blob/13457ca8b7db29f178a4001ce9cac0e849473cef/src/Gargantext/API/Node/Types.hs#L84

In particular, it contains fields named databases and datafield.

Thing is, this seems somewhat duplicated info.

The search dialog has multiple datafield options: External (for Arxiv, Pubmed, etc APIs), Web (for searx search). The Datafield datatype (in G.A.N.Corpus.Types we see it also allows for Gargantext and Files).

Anyways, the External Database seems to be a duplicate of the WithQuery -> database field.

And I think (database, datafield) = (Empty, Web) seems the only option. So using database2origin in G.A.N.Corpus.New seems unnecessary (this is the only place that this function is used).

I think the best way is to remove the database field altogether. Leave only Web, Gargantext, Files and External (Database) in datafield.

Also, it would be nice to refactor things and insert pubmed_api_key in to the PubMed constructor and epo_api_user/epo_api_token into the EPO construtor.

Moreover, we have very similar db structures in G.A.N.C.Types -> Database and G.A.A.O.Types -> ExternalAPIs. We could unify them. Also, add to/from JSON tests.

Edited Jan 10, 2025 by Przemyslaw Kaminski
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: gargantext/haskell-gargantext#441