throw new CatalogDBException("Unable to query variable " + split[0]); if (variable.getVariableSet() != null) { Map<String, Variable> subVariableMap = variable.getVariableSet().stream() .collect(Collectors.toMap(Variable::getId, Function.<Variable>identity())); if (subVariableMap.containsKey(r)) {
private void removeAnnotation(Map<String, Object> annotations, String annotation, Set<Variable> variables) throws CatalogException { String[] split = StringUtils.split(annotation, ".", 2); if (split.length > 1) { if (annotations.containsKey(split[0])) { Set<Variable> nestedVariables = null; for (Variable tmpVariable : variables) { if (tmpVariable.getId().equals(split[0])) { nestedVariables = tmpVariable.getVariableSet(); break; } } if (nestedVariables == null) { throw new CatalogException("Internal error. Could not validate removal of variable."); } removeAnnotation((Map<String, Object>) annotations.get(split[0]), split[1], nestedVariables); } } else { for (Variable variable : variables) { if (variable.getId().equals(annotation)) { // We check if the annotation to be remove is mandatory if (variable.isRequired()) { throw new CatalogException("Cannot remove required variable."); } break; } } annotations.remove(annotation); } }
throw new CatalogDBException("Unable to query variable " + annotationKey); if (variable.getVariableSet() != null) { Map<String, Variable> subVariableMap = variable.getVariableSet().stream() .collect(Collectors.toMap(Variable::getId, Function.<Variable>identity())); if (subVariableMap.containsKey(r)) {
for (Variable tmpVariable : variables) { if (tmpVariable.getId().equals(split[0])) { nestedVariables = tmpVariable.getVariableSet(); break;
if (variable.getVariableSet() != null) { for (Variable tmpVariable : variable.getVariableSet()) { List<Integer> arrayLevel = new ArrayList<>(variableLevel.getArrayLevel()); if (tmpVariable.isMultiValue()) {
if (variable.getVariableSet() != null) { for (Variable nestedVariable : variable.getVariableSet()) { List<String> keys = new ArrayList<>(variableDepthMap.getKeys()); keys.add(variable.getId());
if (variable.getVariableSet() != null && !variable.getVariableSet().isEmpty()) { Map objectMap = (Map) object; checkAnnotationSet(new VariableSet(variable.getId(), variable.getId(), false, false, variable.getDescription(), variable.getVariableSet(), 1, null), new AnnotationSet("", variable.getId(), objectMap, null, 1, null), null, true);
throw new CatalogException("VariableType is null"); if (variable.getVariableSet() != null && variable.getType() != Variable.VariableType.OBJECT) { throw new CatalogException("Only variables with type \"OBJECT\" can define an internal variableSet"); break; case OBJECT: if (variable.getVariableSet() != null) { for (Variable v : variable.getVariableSet()) { checkVariable(v);
break; case OBJECT: if (variable.getVariableSet() != null && !variable.getVariableSet().isEmpty()) { for (Variable nestedVariable : variable.getVariableSet()) { ObjectMap nestedAuxiliarVariable = new ObjectMap() .append("variable", nestedVariable)