def add_dataset_to_collection(dataset_id, collection_id, **kwargs):
    """
        Add a single dataset to a dataset collection.
    """
    collection_i = _get_collection(collection_id)
    collection_item = _get_collection_item(collection_id, dataset_id)
    if collection_item is not None:
        raise HydraError("Dataset Collection %s already contains dataset %s", collection_id, dataset_id)

    new_item = DatasetCollectionItem()
    new_item.dataset_id=dataset_id
    new_item.collection_id=collection_id

    collection_i.items.append(new_item)

    db.DBSession.flush()

    return 'OK'
Add a single dataset to a dataset collection.