toDatasetSummary function

Convert dataset to dataset summary (internal method).