On 12-11-18 17:59, Thomas Beale wrote:
On 12/11/2018 16:04, Bert Verhees wrote:
On 12-11-18 16:13, Thomas Beale wrote:
you can, it's called a Template Data Schema (TDS), and is generated
from the Template Designer and I think the new Marand ADL-designer.
Its intended exactly for checking data sets...
Of course you can write any validation tool you want, but you cannot
do this and still conform to the XML Schema standard, that is why
Schematron became important. With Schematron you can validate
anything. As I wrote this morning, LinkEhr also generates Schematron
for validation purpose.
this already works (for nearly 10 years) and it validates against the
XML schema standard. What it doesn't do is validate everything you
want to validate, i.e. not all things in the archetypes. But it's good
enough most of the time.
I am in the proud possession of the book, "Definitive XML Schema 1.1" by
Priscilla Walmsley. We had this discussion a few times already
I quote from
https://www.mail-archive.com/search?q=walmsley&l=openehr-technical%40lists.openehr.org
https://www.mail-archive.com/openehr-technical@lists.openehr.org/msg07405.html
Another very important restriction for using XML Schema, in my opinion,
is that you cannot have two or more elements with the same name but a
different data type. This data type must be in detail the same. XML Schema
regards an Element with a Dv_Text as a different datatype from an Element
with a Dv_CodedText.
Both elements will be called "items" in an XML schema representing an
OpenEhr data structure, and thus is not allowed having them different
details in data types.
Sorry for the funny font,
To do things properly, I agree, you would probably use Schematron +
XSD, or personally I have always thought that Schematron + Relax-NG
would be better.
Also I went through that path, with Relax NG, I struggled quite some
time with this, and not me alone. Ask Diego why LinkEhr does not export
RelaxNG or XML Schema but Schematron as validation files (although, it
was like this a few years ago, it still is so in the version I have).
The XSD standard-constraint mentioned above also becomes visible with
standard XML libraries. If I would have time I would proof it to you in
a simple way.
whether this is the real requirement being talked about here may be
another question.
You are right, it was not what was asked, still I thought it would be
interesting for others to know that there is a JSON Schematron parser
(instead of an XML Schematron-parser), which can be used to validate
JSON OpenEhr-datasets against archetypes/templates.
that might be an interesting thing to have in the openEHR toolkit. We
are just now revising and re-organising all the openEHR XSDs, and also
adding in some JSON-schemas. Any related artefacts that anyone wants
to contribute, or fragments that could be used in something larger
would be appreciated - it will all get posted in the
specifications-ITS-XML git repo under the usual CC licence.
OpenEhr uses XSD schemas for class descriptions, there is no problem at
all. It is even an often used methodology in the Java world to
describe/generate class-interfaces. The problem is when using XML Schema
for validation of archetyped XML-data. But again, this was not the
problem the question was initially about. Sorry for the confusion.
Bert
_______________________________________________
openEHR-technical mailing list
openEHR-technical@lists.openehr.org
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org