Merge branch 'dmp-refactoring' of code-repo.d4science.org:MaDgiK-CITE/argos into dmp-refactoring

This commit is contained in:
Efstratios Giannopoulos 2024-02-20 10:12:38 +02:00
commit d50613f416
2 changed files with 4 additions and 4 deletions

View File

@ -905,11 +905,11 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
//region
@Override
public List<String> getSemantics(String query) throws IOException {
public List<String> getSemantics(String like) throws IOException {
List<Semantic> semantics = this.getSemantics();
List<String> filteredSemantics = semantics.stream().map(Semantic::getName).collect(Collectors.toList());
if (query != null && !query.isEmpty()) {
filteredSemantics = semantics.stream().filter(x -> x.getCategory().contains(query) || x.getName().contains(query)).map(Semantic::getName).collect(Collectors.toList());
if (like != null && !like.isEmpty()) {
filteredSemantics = semantics.stream().filter(x -> x.getCategory().contains(like.replaceAll("%", "")) || x.getName().contains(like.replaceAll("%", ""))).map(Semantic::getName).collect(Collectors.toList());
}
return filteredSemantics;
}

View File

@ -10,7 +10,7 @@ storage:
basePath: ${TRANSFORMER_BASE_PATH}
static-files:
externalUrls: dmp-backend/web/src/main/resources/externalUrls/ExternalUrls.xml
semantics: Semantics.json
semantics: dmp-backend/web/src/main/resources/Semantics.json
h2020Template: documents/h2020.docx
h2020DescriptionTemplate: documents/h2020_dataset.docx
pidLinks: pidLinks.json