master #59

Closed
claudio.atzori wants to merge 3221 commits from master into stable_ids
1 changed files with 11 additions and 14 deletions
Showing only changes of commit d28b7085f6 - Show all commits

View File

@ -136,13 +136,9 @@ public class VocabularyGroup implements Serializable {
} }
public Qualifier lookupTermBySynonym(final String vocId, final String syn) { public Qualifier lookupTermBySynonym(final String vocId, final String syn) {
if (StringUtils.isBlank(vocId)) { return find(vocId)
return OafMapperUtils.unknown("", ""); .map(
} vocabulary -> Optional
final Vocabulary vocabulary = vocs.get(vocId.toLowerCase());
return Optional
.ofNullable(vocabulary.getTerm(syn)) .ofNullable(vocabulary.getTerm(syn))
.map( .map(
term -> OafMapperUtils term -> OafMapperUtils
@ -153,7 +149,8 @@ public class VocabularyGroup implements Serializable {
.map( .map(
term -> OafMapperUtils term -> OafMapperUtils
.qualifier(term.getId(), term.getName(), vocabulary.getId(), vocabulary.getName())) .qualifier(term.getId(), term.getName(), vocabulary.getId(), vocabulary.getName()))
.orElse(null)); .orElse(null)))
.orElse(null);
} }
/** /**