use of com.bakdata.conquery.models.identifiable.ids.specific.ConceptElementId in project conquery by bakdata.
the class ConceptsProcessor method resolveConceptElements.
public ResolvedConceptsResult resolveConceptElements(TreeConcept concept, List<String> conceptCodes) {
List<ConceptElementId<?>> resolvedCodes = new ArrayList<>();
List<String> unknownCodes = new ArrayList<>();
if (concept == null) {
return new ResolvedConceptsResult(null, null, conceptCodes);
}
for (String conceptCode : conceptCodes) {
ConceptTreeChild child;
try {
child = concept.findMostSpecificChild(conceptCode, new CalculatedValue<>(Collections::emptyMap));
if (child != null) {
resolvedCodes.add(child.getId());
} else {
unknownCodes.add(conceptCode);
}
} catch (ConceptConfigurationException e) {
log.error("Error while trying to resolve " + conceptCode, e);
}
}
return new ResolvedConceptsResult(resolvedCodes, null, unknownCodes);
}
Aggregations