def METHOD_NAME(dataset, trait_id=None):
    resource_ob = {
        'owner_id': "none",  # webqtlConfig.DEFAULT_OWNER_ID,
        'default_mask': webqtlConfig.DEFAULT_PRIVILEGES,
        'group_masks': {}
    }
    if dataset.type == "Publish":
        group_code = get_group_code(dataset)
        if group_code is None:
            group_code = ""
        resource_ob['name'] = group_code + "_" + str(trait_id)
        resource_ob['data'] = {
            'dataset': dataset.id,
            'trait': trait_id
        }
        resource_ob['type'] = 'dataset-publish'
    elif dataset.type == "Geno":
        resource_ob['name'] = dataset.name
        resource_ob['data'] = {
            'dataset': dataset.id
        }
        resource_ob['type'] = 'dataset-geno'
    else:
        resource_ob['name'] = dataset.name
        resource_ob['data'] = {
            'dataset': dataset.id
        }
        resource_ob['type'] = 'dataset-probeset'
    resource_info = add_resource(resource_ob, update=False)
    return resource_info