code: function resolveKey(key, attrNode, options, context) {
      const resolvedKey = {};
  
      key.forEach(keyAttrPath => {
          const keyAttrNode = getLocalAttribute(keyAttrPath, attrNode, context);
  
          if (keyAttrNode.multiValued) {
              if (!options.allowMultiValued) {
                  throw new ImplementationError(
                      `Key attribute "${keyAttrPath.join('.')}" ` + `must not be multiValued${context.errorContext}`
                  );
              }
              if (key.length > 1) {
                  throw new ImplementationError(
                      `Composite key attribute "${keyAttrPath.join('.')}" ` +
                          `must not be multiValued${context.errorContext}`
                  );
              }
          }
  
          if (keyAttrNode.map) {
              Object.keys(keyAttrNode.map.default).forEach(dataSourceName => {
                  if (!resolvedKey[dataSourceName]) resolvedKey[dataSourceName] = [];
                  resolvedKey[dataSourceName].push(keyAttrNode.map.default[dataSourceName]);
              });
          }
  
          if (options.neededDataSources) {
              options.neededDataSources.forEach(neededDataSource => {
                  if (!keyAttrNode.map || !keyAttrNode.map.default[neededDataSource]) {
                      throw new ImplementationError(
                          `Key attribute "${keyAttrPath.join('.')}" ` +
                              `is not mapped to "${neededDataSource}" DataSource${context.errorContext}`
                      );
                  }
              });
          }
      });
  
      // remove DataSources with incomplete keys:
      Object.keys(resolvedKey).forEach(dataSourceName => {
          if (resolvedKey[dataSourceName].length !== key.length) {
              delete resolvedKey[dataSourceName];
          }
      });
  
      if (Object.keys(resolvedKey).length < 1) {
          throw new ImplementationError('Key is not mappable to a single DataSource' + context.errorContext);
      }
  
      return resolvedKey;
  }
docs: Resolve key attributes per DataSource.
  
  @private