Skip to content

Commit

Permalink
feat(datasets): Add datasets from BSO publications index
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Nov 19, 2023
1 parent d38a05b commit 9e480d6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/src/routes/works.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ router.route('/works')
res.status(400).json({ message: 'You must provide at least one affiliation.' });
} else {
const results = await Promise.all([
getBsoWorks({ options, index: process.env.VITE_BSO_PUBLICATIONS_INDEX }),
getBsoWorks({ options, index: process.env.VITE_BSO_PUBLICATIONS_INDEX, filter: 'q=genre_raw:!dataset' }),
getOpenAlexPublications(options),
getBsoWorks({ options, index: process.env.VITE_BSO_DATASETS_INDEX, filter: 'q=genre:dataset' }),
getBsoWorks({ options, index: process.env.VITE_BSO_PUBLICATIONS_INDEX, filter: 'q=genre_raw:dataset' }),
]);
const data = {};
data.publications = [...results[0].results, ...results[1].results];
data.datasets = results[2].results;
data.datasets = [...results[2].results, ...results[3].results];
// Deduplicate publications by DOI or by hal_id
const deduplicatedPublications = {};
data.publications.forEach((publication) => {
Expand Down

0 comments on commit 9e480d6

Please sign in to comment.