USEPA / EPA_Non-geo_Metadata_Editor

3 stars 0 forks source link

Load metadata: handle unexpected elements #67

Closed aergul closed 5 years ago

torrin47 commented 5 years ago

These will simply be preserved, carried along unchanged. They won't appear in the editor UI, but will be saved and submitted.

aergul commented 5 years ago

Implemented for non-repeating elements. Does anyone see utility of implementing this for repeating elements?

jzichichi commented 5 years ago

@torrin47 - passing along for your review

torrin47 commented 5 years ago

Can you be more clear about the definition of an unexpected occurrence of a repeating element? Is that when the same key appears twice in the JSON? Or an expected key has repeating items in an array?

aergul commented 5 years ago

@torrin47 sorry for the confusion. These would be unexpected elements inside repeating elements such as distribution. No rush, we can discuss on weekly if unclear.

torrin47 commented 5 years ago

Ok, got it. Uploaded this:

"distribution" : [{ "@type" : "dcat:Distribution", "title" : "U.S. EPA Enterprise Data Inventory", "downloadURL" : "https://www.epa.gov/data.json", "mediaType" : "application/json", "conformsTo" : "https://project-open-data.cio.gov/v1.1/schema/", "format" : "Project Open Data Schema 1.1 JSON" },{ "reallyUnexpectedElement":"what is this doing here?" } ]

and the result was this:

"distribution": [ { "@type": "dcat:Distribution", "downloadURL": "https://www.epa.gov/data.json", "format": "Project Open Data Schema 1.1 JSON", "title": "U.S. EPA Enterprise Data Inventory", "mediaType": "application/json", "conformsTo": "https://project-open-data.cio.gov/v1.1/schema/" }, { "@type": "dcat:Distribution", "accessURL": "" } ]

Which seems perfectly acceptable to me.

torrin47 commented 5 years ago

👍