unitsml / schemas

UnitsML schemas
4 stars 3 forks source link

Change schema namespace #4

Closed Intelligent2013 closed 3 years ago

Intelligent2013 commented 3 years ago

Current schema (unitsml-v1.0-csd04.xsd ) namespace is urn:oasis:names:tc:unitsml:schema:xsd:UnitsMLSchema-1.0.

ronaldtse commented 3 years ago

We can change it to something like "https://www.unitsml.org/schema/1.0" or something like that. What is best practice?

Intelligent2013 commented 3 years ago

@ronaldtse it's not simple question. It depends on design rules that accepted by task force that developed UnitsML standard. What does mean that new schema has new namespace? It means that old XMLs (which validated against old schema) will be non-valid against new schema, even they contain the same structure, element, values, etc. For example, between unitsml-v0.9.19.xsd and unitsml-v1.0-csd03.xsd there aren't significant differences, but they have different namespaces:

If user will check old xml (developed for xsd 0.9.19) against v1.0-csd03, it will be non-valid, but formally it has the same structure and contains identical tags. It is very non convenient and looks strange...

Actually, change namespace for each version - is a bad practice.

I've found some information in 'XML DESIGN RULES ANDCONVENTIONS' by WIPO XML4IP Task Force (https://www.wipo.int/standards/en/st96/v4-0/annex-i/03-96-i.pdf):

32.Backward compatibility is an issue when existing schemas need to be changed. In general, backward compatibility exists if an XML instance document that validates against a previous version will continue to validate against the new version of the schema.

33.Changes to schemas are defined as major changes and minor changes. Major changes to schemas are those that are not backward compatible with previous versions of schemas whereas minor changes are backward compatible. New minor versions of schemas MUST be able to validate instance documents created with preceding minor versions of that schema with the same major version. However, instance documents should not be expected to validate against versions of a schema preceding the one they were created with. In addition, revisions are allowed for schema whilethe schema is at the draft stage.

So, I propose to fix namespace to "http://www.unitsml.org/XMLSchema" and specify version in the attribute version: version="1.0" In future, if we need significant changes, which will be non-compatible with previous version, then we change namespace to something like "http://www.unitsml.org/XMLSchema/2.0".

opoudjis commented 3 years ago

FWIW at my day job, we change schema name space only on major versions, for that reason

ronaldtse commented 3 years ago

Then how about we settle on something like “https://schema.unitsml.org/unitsml/1.0”?

The path “/unitsml/“ because there is also a “lite” schema called “unitsml-lite”. I imagine we will also have other schemas in the future.

Intelligent2013 commented 3 years ago

Just for info, I've found here https://www.oasis-open.org/committees/download.php/43529/UnitsML-Guide-v1.0-wd01.pdf. I don't sure that we should to follow it, but for any case: [NMS2] Every UnitsML schema version MUST have its own unique namespace.For interoperability and reusability of UnitsML in other schemata, and the use of external schemata within UnitsML , a consistent approach to namespacedeclarations is necessary. [NMS4] The namespace names for UnitsML Schemas holding committee draftstatus MUST be of the form:urn:oasis:names:tc:unitsml:schema:<subtype>:<document-id>[F] The namespace names for UnitsML Schemas holding OASIS Standard statusMUST be of the form:urn:oasis:names:specification:unitsml:schema:<subtype>:<document-id>

Then how about we settle on something like “https://schema.unitsml.org/unitsml/1.0”?

No objections.

ronaldtse commented 3 years ago

We don’t need to follow that guide anymore because it’s obsolete and the group never completed 1.0. The UnitsML work was originally done at NIST, progressed to OASIS but did not materialize, and we are restarting the effort with the NIST team.

We will need to update that Guide.

opoudjis commented 3 years ago

Currently the namespace in asciimath2unitsml is http://unitsml.nist.gov/2005. Am I updating this yet?

ronaldtse commented 3 years ago

Yes, let’s update.