code: function addItem(resource, rootCkanGroup, itemData, extras, parent) {
    var item =
      rootCkanGroup.terria.catalog.shareKeyIndex[
        parent.uniqueId + "/" + resource.id
      ];
    var alreadyExists = defined(item);
  
    if (!alreadyExists) {
      item = createItemFromResource(
        resource,
        rootCkanGroup,
        itemData,
        extras,
        parent
      );
  
      if (item) {
        parent.add(item);
      }
    }
  
    return item;
  }
docs: Creates a catalog item from the supplied resource and adds it to the supplied parent if necessary..
  @private
  @param resource The Ckan resource
  @param rootCkanGroup The root group of all items in this Ckan hierarchy
  @param itemData The data of the item to build the catalog item from
  @param extras
  @param parent The parent group to add the item to once it's constructed - set this to rootCkanGroup for flat hierarchies.
  @returns {CatalogItem} The catalog item added, or undefined if no catalog item was added.