private TemplateResult updateRelation(
      DataAccess access, DataTemplate template, Map<String, String> param) throws BaseException {
    DataSource dataSource = getDataSource(access, param.get(Helper.Keys.SourceId));
    if (dataSource.getState() != DataInformation.DataState.READY)
      throw new NotReadyException("The datasource %s is not yet ready.", dataSource.getId());

    String relationId = param.get(Helper.Keys.RelationId);
    if (relationId == null)
      throw new MissingArgumentException("The argument %s is missing!", Helper.Keys.RelationId);

    String fromId = param.get(Helper.Keys.FromId);
    if (fromId == null)
      throw new MissingArgumentException("The argument %s is missing!", Helper.Keys.FromId);

    String toId = param.get(Helper.Keys.ToId);
    if (toId == null)
      throw new MissingArgumentException("The argument %s is missing!", Helper.Keys.ToId);

    String type = param.get(Helper.Keys.Type);
    if (type == null)
      throw new MissingArgumentException("The argument %s is missing!", Helper.Keys.Type);

    Relation relation = dataSource.updateRelation(relationId, fromId, toId, type, param);
    return template.transform(relation);
  }