From 88937b3b0cd0dde443e14d8ef3c0211ffc937c5d Mon Sep 17 00:00:00 2001 From: Milos Jakubicek Date: Thu, 4 Apr 2024 09:52:40 +0200 Subject: [PATCH] added XML schema and JSON schema, examples fixed accordingly --- dmlex-v1.0/specification/Makefile | 2 +- dmlex-v1.0/specification/dmlex.xml | 50 +- .../examples/examples/source/0.xml.xml | 3 +- .../examples/examples/source/10.xml.xml | 3 +- .../examples/examples/source/14.xml.xml | 2 +- .../examples/examples/source/20.xml.xml | 2 +- .../examples/examples/source/21.xml.xml | 4 +- .../examples/examples/source/24.xml.xml | 12 +- .../examples/examples/source/5.xml.xml | 12 +- .../examples/examples/source/7.xml.xml | 3 +- .../examples/examples/source/8.xml.xml | 8 +- .../examples/examples/source/9.xml.xml | 6 +- .../schemas/JSON/dmlex.schema.json | 946 ++++++++++++++++++ .../JSON/dmlex_no-crosslingual.schema.json | 786 +++++++++++++++ .../specification/schemas/XML/dmlex.xsd | 674 +++++++++++++ .../schemas/XML/dmlex_no-crosslingual.xsd | 572 +++++++++++ .../NVH}/dmlex.nvh | 0 dmlex-v1.0/specification/validate_json.py | 11 + dmlex-v1.0/specification/validate_xml.py | 8 + 19 files changed, 3059 insertions(+), 45 deletions(-) create mode 100644 dmlex-v1.0/specification/schemas/JSON/dmlex.schema.json create mode 100644 dmlex-v1.0/specification/schemas/JSON/dmlex_no-crosslingual.schema.json create mode 100644 dmlex-v1.0/specification/schemas/XML/dmlex.xsd create mode 100644 dmlex-v1.0/specification/schemas/XML/dmlex_no-crosslingual.xsd rename dmlex-v1.0/specification/{ => schemas/informativeCopiesOf3rdPartySchemas/NVH}/dmlex.nvh (100%) create mode 100755 dmlex-v1.0/specification/validate_json.py create mode 100755 dmlex-v1.0/specification/validate_xml.py diff --git a/dmlex-v1.0/specification/Makefile b/dmlex-v1.0/specification/Makefile index 67c177b..98ad446 100644 --- a/dmlex-v1.0/specification/Makefile +++ b/dmlex-v1.0/specification/Makefile @@ -25,7 +25,7 @@ dmlex_uml.svg: dmlex.dot dmlex.dot: dmlex.dot.m4 dmlex.dot.content m4 $< > $@ -dmlex.dot.content: dmlex.nvh nvh2dot.py +dmlex.dot.content: schemas/informativeCopiesOf3rdPartySchemas/NVH/dmlex.nvh nvh2dot.py awk '//,/<\/programlisting>/' $< | tail -n+2 | head -n-1 | ./nvh2dot.py > $@ Makefile.dep: dmlex.xml $(SOURCE_XML) makedep.sh diff --git a/dmlex-v1.0/specification/dmlex.xml b/dmlex-v1.0/specification/dmlex.xml index 67e50d8..4ffc775 100644 --- a/dmlex-v1.0/specification/dmlex.xml +++ b/dmlex-v1.0/specification/dmlex.xml @@ -96,21 +96,25 @@ Additional artifacts - - [All normative machine readable artifacts provided have to be listed here as parts of - the multipart product bfeore csd03 progression] + + XML schema excluding the cross-lingual module + + + JSON schema + + + JSON schema excluding the cross-lingual module + + + NVH schema (informative) + + Related Work @@ -792,9 +796,25 @@ - Machine Readable Validation Artifacts - [This appendix will list all validation artifact references before progression to - csd03] + Machine Readable Validation Artifacts + + + XML schema + + + XML schema excluding the cross-lingual module + + + JSON schema + + + JSON schema excluding the cross-lingual module + + + NVH schema (informative) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dmlex-v1.0/specification/schemas/XML/dmlex_no-crosslingual.xsd b/dmlex-v1.0/specification/schemas/XML/dmlex_no-crosslingual.xsd new file mode 100644 index 0000000..f73eefa --- /dev/null +++ b/dmlex-v1.0/specification/schemas/XML/dmlex_no-crosslingual.xsd @@ -0,0 +1,572 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dmlex-v1.0/specification/dmlex.nvh b/dmlex-v1.0/specification/schemas/informativeCopiesOf3rdPartySchemas/NVH/dmlex.nvh similarity index 100% rename from dmlex-v1.0/specification/dmlex.nvh rename to dmlex-v1.0/specification/schemas/informativeCopiesOf3rdPartySchemas/NVH/dmlex.nvh diff --git a/dmlex-v1.0/specification/validate_json.py b/dmlex-v1.0/specification/validate_json.py new file mode 100755 index 0000000..3df0bca --- /dev/null +++ b/dmlex-v1.0/specification/validate_json.py @@ -0,0 +1,11 @@ +#!/usr/bin/python3 +import json +from jsonschema import validate +import glob +schema = json.load(open('dmlex.schema.json')) +for file in glob.glob("*.json"): + if file.endswith('.schema.json'): + continue + print(file) + validate(json.load(open(file)), schema) + diff --git a/dmlex-v1.0/specification/validate_xml.py b/dmlex-v1.0/specification/validate_xml.py new file mode 100755 index 0000000..c3af065 --- /dev/null +++ b/dmlex-v1.0/specification/validate_xml.py @@ -0,0 +1,8 @@ +#!/usr/bin/python3 +import xmlschema +import glob +schema = xmlschema.XMLSchema11('dmlex.xsd') +for file in glob.glob("*.xml"): + print(file) + schema.validate(file) +