Skip to content

Commit

Permalink
update code lists for associated doi types
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaeng72 committed Oct 30, 2024
1 parent 43180f1 commit 0cd68cd
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,18 @@
<gml:identifier codeSpace="gov.nasa.esdis.umm">Other</gml:identifier>
</gmx:CodeDefinition>
</gmx:codeEntry>
<gmx:codeEntry>
<gmx:CodeDefinition gml:id="EOS_AssociationTypeCode_isPreviousVersionOf">
<gml:description>This collection has been superseded by the Associated DOI.</gml:description>
<gml:identifier codeSpace="gov.nasa.esdis.umm">Is_Previous_Version_Of</gml:identifier>
</gmx:CodeDefinition>
</gmx:codeEntry>
<gmx:codeEntry>
<gmx:CodeDefinition gml:id="EOS_AssociationTypeCode_isNewVersionOf">
<gml:description>The collection supersedes the Associated DOI. </gml:description>
<gml:identifier codeSpace="gov.nasa.esdis.umm">Is_New_Version_Of</gml:identifier>
</gmx:CodeDefinition>
</gmx:codeEntry>
<gmx:codeEntry>
<gmx:CodeDefinition gml:id="EOS_AssociationTypeCode_doiPreviousVersion">
<gml:description>part of a set of larger works that is identified by a digital object identifier.</gml:description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,18 @@
<gml:identifier codeSpace="gov.nasa.esdis.umm">Other</gml:identifier>
</gmx:CodeDefinition>
</gmx:codeEntry>
<gmx:codeEntry>
<gmx:CodeDefinition gml:id="EOS_AssociationTypeCode_isPreviousVersionOf">
<gml:description>This collection has been superseded by the Associated DOI.</gml:description>
<gml:identifier codeSpace="gov.nasa.esdis.umm">Is_Previous_Version_Of</gml:identifier>
</gmx:CodeDefinition>
</gmx:codeEntry>
<gmx:codeEntry>
<gmx:CodeDefinition gml:id="EOS_AssociationTypeCode_isNewVersionOf">
<gml:description>The collection supersedes the Associated DOI. </gml:description>
<gml:identifier codeSpace="gov.nasa.esdis.umm">Is_New_Version_Of</gml:identifier>
</gmx:CodeDefinition>
</gmx:codeEntry>
<gmx:codeEntry>
<gmx:CodeDefinition gml:id="EOS_AssociationTypeCode_doiPreviousVersion">
<gml:description>part of a set of larger works that is identified by a digital object identifier.</gml:description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,18 @@
<gml:identifier codeSpace="gov.nasa.esdis.umm">Other</gml:identifier>
</gmx:CodeDefinition>
</gmx:codeEntry>
<gmx:codeEntry>
<gmx:CodeDefinition gml:id="EOS_AssociationTypeCode_isPreviousVersionOf">
<gml:description>This collection has been superseded by the Associated DOI.</gml:description>
<gml:identifier codeSpace="gov.nasa.esdis.umm">Is_Previous_Version_Of</gml:identifier>
</gmx:CodeDefinition>
</gmx:codeEntry>
<gmx:codeEntry>
<gmx:CodeDefinition gml:id="EOS_AssociationTypeCode_isNewVersionOf">
<gml:description>The collection supersedes the Associated DOI.</gml:description>
<gml:identifier codeSpace="gov.nasa.esdis.umm">Is_New_Version_Of</gml:identifier>
</gmx:CodeDefinition>
</gmx:codeEntry>
<gmx:codeEntry>
<gmx:CodeDefinition gml:id="EOS_AssociationTypeCode_doiPreviousVersion">
<gml:description>part of a set of larger works that is identified by a digital object identifier.</gml:description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,18 @@
<gml:identifier codeSpace="gov.nasa.esdis.umm">Other</gml:identifier>
</gmx:CodeDefinition>
</gmx:codeEntry>
<gmx:codeEntry>
<gmx:CodeDefinition gml:id="EOS_AssociationTypeCode_isPreviousVersionOf">
<gml:description>This collection has been superseded by the Associated DOI.</gml:description>
<gml:identifier codeSpace="gov.nasa.esdis.umm">Is_Previous_Version_Of</gml:identifier>
</gmx:CodeDefinition>
</gmx:codeEntry>
<gmx:codeEntry>
<gmx:CodeDefinition gml:id="EOS_AssociationTypeCode_isNewVersionOf">
<gml:description>The collection supersedes the Associated DOI.</gml:description>
<gml:identifier codeSpace="gov.nasa.esdis.umm">Is_New_Version_Of</gml:identifier>
</gmx:CodeDefinition>
</gmx:codeEntry>
<gmx:codeEntry>
<gmx:CodeDefinition gml:id="EOS_AssociationTypeCode_doiPreviousVersion">
<gml:description>part of a set of larger works that is identified by a digital object identifier.</gml:description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

(def non-associated-metadata-types
"A list of other associated Types other than associated-metadata used to find associated-metadata data."
["crossreference" "associateddoi" "childdataset" "collaborativeotheragency" "fieldcampaign" "parentdataset" "relateddataset" "other" "doipreviousversion"])
["crossreference" "associateddoi" "childdataset" "collaborativeotheragency" "fieldcampaign" "parentdataset" "relateddataset" "other" "ispreviousversionof" "isnewversionof" "doipreviousversion"])

(defn xml-elem->metadata-associations
"Returns the metadata associations by parsing the given xml element"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

(def associated-doi-types
"A list of other associated Types other than associated-metadata used to find associated-metadata data."
["associateddoi" "childdataset" "collaborativeotheragency" "fieldcampaign" "parentdataset" "relateddataset" "other"])
["associateddoi" "childdataset" "collaborativeotheragency" "fieldcampaign" "parentdataset" "relateddataset" "other" "ispreviousversionof" "isnewversionof"])

(def associated-doi-code-umm-map
"Map of associated DOI codes with their English names for the ISO code types."
Expand Down
10 changes: 1 addition & 9 deletions umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@
;; expected output with the result of the actual conversions. This test runs a record
;; through all of the supported formats.
(declare umm-record metadata-format)
;; TODO This test is failing
(deftest roundtrip-generated-collection-records
(checking "collection round tripping" 100
[umm-record (gen/no-shrink umm-gen/umm-c-generator)
Expand All @@ -229,7 +228,6 @@
;; 3. SwathWidthUnit doesn't exist in dif10 and echo10. Assumed unit is Kilometer
;; so we have to convert the value and unit in umm-record to kilometer before round-trip comparison.
;; 4. SwathWidth can be 1.0E-1 in umm, translating to other formats it could be changed to 0.1
_ (println "metadata-format is " metadata-format)
umm-record (update-in umm-record [:SpatialExtent] dissoc :OrbitParameters)
umm-record (js/parse-umm-c
(assoc umm-record
Expand All @@ -252,12 +250,7 @@
actual (util/remove-nil-keys actual)
;; Change fields to sets for comparison
expected (convert-to-sets expected)
actual (convert-to-sets actual)
;_ (println "EXPECTED RECORD")
;_ (println expected)
;_ (println "ACTUAL RECORD")
;_ (println actual)
]
actual (convert-to-sets actual)]

(is (= expected actual)
(str "Unable to roundtrip with format " metadata-format)))))
Expand All @@ -272,7 +265,6 @@
;; to UMM and then back to the other format then compares the
;; expected output with the result of the actual conversions. This test runs a record
;; through all of the supported formats.
;;TODO this test is failing
(deftest roundtrip-generated-collection-records-with-seed
(checking-with-seed "collection round tripping seed" 100 1496683985472
[umm-record (gen/no-shrink umm-gen/umm-c-generator)
Expand Down

0 comments on commit 0cd68cd

Please sign in to comment.