ropensci / datapack

An R package to handle data packages
https://docs.ropensci.org/datapack
44 stars 9 forks source link

sysmeta 'mediaType' not handled properly #67

Closed gothub closed 7 years ago

gothub commented 7 years ago

serializeSystemMetadata() and parseSystemMetadata() both incorrectly assume that the mediaType is the xml value of the element <mediaType> of a system metadata xml document. The correct structure follows:

<xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema" name="MediaType">
   <xs:sequence>
      <xs:element name="property" type="d1_v2.0:MediaTypeProperty" minOccurs="0" maxOccurs="unbounded">
      </xs:element>
   </xs:sequence>
   <xs:attribute name="name" type="xs:string" use="required">
   </xs:attribute>
</xs:complex>

Also, in order to support this structure, we may need to add an additional property to DataObject(), which currently only has an argument for mediaType. We need to accommodate the properties that can be a list. The D1 solr index uses the names 'mediaType' and 'mediaTypeProperty'.

I propose that we add the argument mediaTypeProperty to DataObject initialize() and update parseSystemMetadata() and serializeSystemMetadata() to handel the correct XML structure.

gothub commented 7 years ago

This was addressed in commit 40a1531ea4b986f487bd19256403fe3ce0b06db9