DictionaryEditor: Jupyter Notebook to Check and Validate Dictionaries
ShweataNHegde opened this issue · comments
Here is the link to the Juypter Notebook: https://github.com/petermr/dictionary/blob/main/update.ipynb
This Jupyter Notebook contains code to:
- validate dictionaries against the schema (https://github.com/petermr/dictionary/blob/main/openVirus/openVirus_schema.xsd).
- check if dictionaries have a given set of attributes for each entry
This is the output of the last cell:
file: C:\Users\shweata\dictionary\openVirus\country.xml
root C:\Users\shweata\dictionary\openVirus\country.xml : dictionary ~ {'title': 'country'}
entries 264
False
file: C:\Users\shweata\dictionary\openVirus\bad.xml
root C:\Users\shweata\dictionary\openVirus\bad.xml : dictionary ~ {'title': 'simple'}
unknown: unknownatt
entries 2
False
file: C:\Users\shweata\dictionary\openVirus\country.xml
root C:\Users\shweata\dictionary\openVirus\country.xml : dictionary ~ {'title': 'country'}
entries 264
False
file: C:\Users\shweata\dictionary\openVirus\disease.xml
root C:\Users\shweata\dictionary\openVirus\disease.xml : dictionary ~ {'title': 'disease'}
entries 13836
False
file: C:\Users\shweata\dictionary\openVirus\drug.xml
root C:\Users\shweata\dictionary\openVirus\drug.xml : dictionary ~ {'title': 'drug'}
entries 1505
True
file: C:\Users\shweata\dictionary\openVirus\funder.xml
root C:\Users\shweata\dictionary\openVirus\funder.xml : dictionary ~ {'title': 'funder'}
entries 13110
False
file: C:\Users\shweata\dictionary\openVirus\npi.xml
root C:\Users\shweata\dictionary\openVirus\npi.xml : dictionary ~ {'title': 'npi'}
entries 40
True
file: C:\Users\shweata\dictionary\openVirus\simple.xml
root C:\Users\shweata\dictionary\openVirus\simple.xml : dictionary ~ {'title': 'simple'}
entries 2
True
file: C:\Users\shweata\dictionary\openVirus\testTrace.xml
root C:\Users\shweata\dictionary\openVirus\testTrace.xml : dictionary ~ {'title': 'testTrace'}
entries 37
False
file: C:\Users\shweata\dictionary\openVirus\virus.xml
root C:\Users\shweata\dictionary\openVirus\virus.xml : dictionary ~ {'title': 'virus'}
entries 118
False
file: C:\Users\shweata\dictionary\openVirus\zoonosis.xml
root C:\Users\shweata\dictionary\openVirus\zoonosis.xml : dictionary ~ {'title': 'zoonosis'}
entries 30
True
' \ndeletedIds = set(["Q123", "Q234"])\nfile = os.path.join(OPEN_VIRUS, "country.xml")\nfile1 = os.path.join(OPEN_VIRUS, "bad_country.xml")\nnewroot= edit(file, deletedIds)\nxml = ET.tostring(newroot, encoding="UTF-8")\nprint("X "+xml)\n'
Some of our dictionaries aren't validate against the schema. We'll need to find out why.