adiwg / mdEditor

Web application for writing metadata, an ADIwg project
https://www.mdeditor.org
GNU General Public License v3.0
44 stars 25 forks source link

CSDGM Import Failing #614

Open dwalt opened 10 months ago

dwalt commented 10 months ago

Issue

mdEditor Version (find version under settings): 1.0.1+97c42afc

mdEditor Web Address (enter the URL): https://go.mdeditor.org/, https://dev.mdeditor.org/

Issue Description:

Provide a general description of the problem. If issue is a feature request, tell us why this feature is useful. Import of CSDGM to mdJSON will not translate to any writer, both prod and dev

Steps to reproduce (Bug reports only):

  1. _____Import valid CSDGM record
  2. _____Add required fields to make a valid mdJSON file (no errors)
  3. _____Translated: tested translation on ScienceBase prod, dev-mdtranslator and port 3002

Observed Results (Bug reports only):

Error message of Schema Validation failed, mdjson reader Created new mdJSON record from scratch and it translated successfully, confirming it is not the mdJSON reader, at least not directly. Appears to be the translation from CSDGM to mdJSON. Note: the CSDGM import ran without error.

Expected Results (Bug reports only):

An error free mdJSON file should translate to any format supported by the content Note: cannot test CSDGM Translation bugs as a result

What did you expect to happen?

jwaspin commented 9 months ago

@dwalt The error is related to data quality but I'm not sure I understand what this error is saying so I was hoping you might have some insight:

The property '#/metadata/dataQuality/0/report/3/evaluationMethod' of type object did not match the following type: array in schema dataQualityReport.json#

I was able to import the CSDGM file and then export it in mdJson, so I was able to see that the format of the file does indeed look correct, but something about validation for data quality seems to think evaluationMethod is supposed to be an array instead of the object it found. That error also mentions the type, which looks like it's a string representing the code 000 for Data Quality types, so that's also a valid type. The only other thing I see in there is the methodDescription which is also a string and appears to be valid.

This appears to be an issue with the validation, but the validation incorrectly seems to think the object it found should be an array.

jwaspin commented 9 months ago

@dwalt I think the issue is in the dataQualityReport.json file in mdJson-schemas. It indicates evalutaionMethod should be an array, so either that schema definition is wrong or the schema visible in mdTools is wrong.

dwalt commented 9 months ago

@jwaspin That definition is incorrect, it is not an array. report is an array, and each report may have one and only one evaluationMethod, see: https://github.com/adiwg/mdJson-schemas/issues/226

jwaspin commented 8 months ago

@dwalt I just came across this again in the process of trying to close out Data Quality. We will need to fix the schema in mdJson-schemas then I need to update the readers/writers in mdTranslator to look at evaluation method as an object and not an array.

dwalt commented 8 months ago

@jwaspin Review the schema issue here: https://github.com/adiwg/mdJson-schemas/issues/224

jwaspin commented 6 months ago

Update: This should be fixed as part of mdTranslator v2.19.5 (then mdEditor updated to use that new version). Some testing of the mdTranslator may be necessary but this should fix the import errors.