                 (format "Failed xml schema validation when translating %s to %s for collection %s. %s"
                         (name metadata-format) (name output-format) concept-id validation-errs))))))))
 
+
+(defn- translate-record-to-umm
+  "Translate collection from native format to UMM-C"
+  [record]
+  (let [{:keys [metadata-format metadata concept-id]} record]
+    (umm/parse-metadata context :collection metadata-format metadata {:apply-default? true})))
+
+(defn- get-collection-validation-errors
+  "Perform the following collection validations:
+   * Validate metadata against the XML schema
+   * Validation the UMM collection record against the current UMM JSON schema
+   * Valiadte the UMM collection against UMM collection rules
+  Return a list of validation errors."
+  [record]
+  (remove empty?
+   (concat
+     (umm/validate-xml :collection (:metadata-format record) (:metadata record))
+     (json-schema/validate-umm-json (umm-json/umm->json (:collection record)) :collection)
+     (umm-validation/validate-collection record))))
+
+(defn- translate-and-validation-collection
+  "For a search result record, translate the metadata to UMM, validate the metadata and UMM record
+  and return a validation result record including the concept id, provider id, entry title, and
+  all validation errors for the record."
+  [record]
+  (let [record (assoc record :collection (translate-record-to-umm record))
+        validation-errors (get-collection-validation-errors record)
+        concept-id (:concept-id record)]
+    (when (seq validation-errors)
+      {:concept-id concept-id
+       :provider-id (:provider-id (concepts/parse-concept-id concept-id))
+       :entry-title (get-in record [:collection :EntryTitle])
+       :errors validation-errors})))
+
 (defn get-collections
   "Returns the collections as a list of maps with concept-id, revision-id, metadata-format and metadata."
   [page-size page-num]

    ; "C5862870-LARC_ASDC"
    ; "C5784310-LARC_ASDC"

    })

(def valid-formats
  "Valid metadata formats that is supported by CMR."

    "C1214604063-SCIOPS" ;;Line 291 - cvc-datatype-valid.1.2.1: '<http://pubs.usgs.gov/of/2014/1040/data/undersea_features.zip>' is not a valid value for 'anyURI'.
    "C1214595389-SCIOPS" ;;Line 108 - cvc-datatype-valid.1.2.1: 'IPY  http://ipy.antarcticanz.govt.nz/projects/southern-victoria-land-geology/' is not a valid value for 'anyURI'.
    "C1214608487-SCIOPS" ;;Line 303 - cvc-datatype-valid.1.2.1: 'Scanned images: http://atlas.gc.ca/site/english/maps/archives' is not a valid value for 'anyURI'.
    "C1214603723-SCIOPS"}) ;;Line 132 - cvc-datatype-valid.1.2.1: '<http://sofia.usgs.gov/projects/workplans12/jem.html>' is not a valid value for 'anyURI'.

    ;; The following collections failed ingest validation, but not xml schema validation.
    ;; I have changed the validation from ingest validation to xml validation, so we don't
