NCEAS / metacatui

MetacatUI: A client-side web interface for DataONE data repositories
https://nceas.github.io/metacatui
Apache License 2.0
42 stars 27 forks source link

Media type is being inserted into ./otherEntity/entityType element #1951

Open gothub opened 2 years ago

gothub commented 2 years ago

The media type for data files newly added via the editor is being inserted into the EML //otherEntity/entityType element.

The media type could be entered instead into the EML element //otherEntity/physical/dataFormat/externallyDefinedFormat/formatName

For an example, see

Here is the section inserted by MetacatUI:

<otherEntity id="urn-uuid-bb476d98-f762-41d9-9509-3fca430887a7">
  <entityName>Scooter_blanket.jpg</entityName>
  <entityDescription>Cute dog photo</entityDescription>
  <entityType>image/jpeg</entityType>
</otherEntity>

which instead could be written as:

<otherEntity id="urn-uuid-bb476d98-f762-41d9-9509-3fca430887a7>
  <entityName>Scooter_blanket.jpg</entityName>
  <entityDescription>Cute dog photo</entityDescription>
  <entityType>JPEG Image</entityType>
  <physical>
    <objectName>Scooter_blanket.jpg</objectName>
    <size unit="byte">87616</size>
    <dataFormat>
      <externallyDefinedFormat>
        <formatName>image/jpeg</formatName>
      </externallyDefinedFormat>
    </dataFormat>
  </physical>
</otherEntity>

For further context on how this issue originated, see https://github.com/NCEAS/metadig-checks/issues/64#issuecomment-1020675795

jeanetteclark commented 2 years ago

I believe entityType is required for otherEntity elements so something has to go there.

A more broad issue to create physical sections is https://github.com/NCEAS/metacatui/issues/450, which I would still love to see implemented

vchendrix commented 2 years ago

@vchendrix adding the <physcial> element seems fine but to make it backwards compatible <entityType/> should still be the mime type. and not a human friendly description.