NCEAS / metadig-rake

MetaDIG rake, a cross-domain QA/QC library
Apache License 2.0
2 stars 0 forks source link

Helper: add function to parse sysmeta #10

Closed jeanetteclark closed 1 year ago

jeanetteclark commented 1 year ago

Purpose

A sysmeta argument was just added to metadig-r, to better mimic what the java engine does. The sysmeta is made available to check code as a string literal, which would benefit from a helper to parse when writing an R check that looks in sysmeta.

A few options for implementation, we could just parse it to XML, or to a named list. The latter would probably be the most helpful for check code, and I don't think we'd lose anything since sysmeta is flat anyway.

mbjones commented 1 year ago

FYI, the datapack R library has a SystemMetadata class that knows how to parse and serialize sysmeta to and from XML, validate it, and has some helpful accessor methods. See https://github.com/ropensci/datapack/blob/main/R/SystemMetadata.R

jeanetteclark commented 1 year ago

Oh right - in that case we don't actually need a helper. datapack::parseSystemMetadata can just be used within check code as long as we are okay with the check being dependent on that library.

mbjones commented 1 year ago

I'm 👍 on the dependency -- we don't really want to maintain multiple SystemMetadata parsing libraries -- its hard enough to do right once!