Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs in IDTA-01001-3-0-1 schemas #464

Merged
merged 4 commits into from
Nov 15, 2024

Conversation

s-heppner
Copy link
Collaborator

@s-heppner s-heppner commented Aug 30, 2024

This fixes bugs found in schema files in preparation of a v3.0.9 release of the schema files:

Fix order of EmbeddedDataSpecification attributes

Previously, the order of the attributes in class
EmbeddedDataSpecification got mixed up, making
the schemas of Release 3.0.8 not backward
compatible, as found out in #477.

This reverts the change of the order of attributes
back to the state of v3.0, so that the schemas are
properly backward compatible.

Fixes #477

SHACL

Make SHACL regex patterns follow JSON Schema ones

We included the regex pattern as-is from the
input which caused problems with the
regex engines as the patterns in the meta-model
are written in a Python dialect
(and assuming that the regex engine works on
UTF-32 characters). However, most regex engines
in the wild operating on SHACL
(e.g., Java SHACL validators) use UTF-16
to represent the text and do not support
some parts of the Python regex dialect.
For example, in the input meta-model
specification, we omit the minimum bound 0
(e.g., {,4}), which breaks with the Java
regex engine beneath the SHACL validator.

Instead, with this patch, we parse the pattern
from the specification and re-render it into the
form that we also use in JSON Schema. We pick
JSON Schema regex dialect as most
SHACL validators in the wild can deal with it,
in particular those based on Java as a platform.
Hence, we decide to serve this
user base with priority.

Discovered in aas-core-meta issue 342.
Fixed in aas-core-codegen commit e22cc.

XSD

Adapt XML Schema for some schema validators

Previously we did not define aas:environment
directly via an xs:element tag, rather only
provided it directly as xs:complexType.
This created issues with several XML Schema
validator engines.

Fixes #457.

Lastly, we also update the generated examples.

We included the regex pattern as-is from the input which caused problems
with the regex engines as the patterns in the meta-model are written in
a Python dialect (and assuming that the regex engine works on UTF-32
characters). However, most regex engines in the wild operating on SHACL
(*e.g.*, Java SHACL validators) use UTF-16 to represent the text and do
not support some parts of the Python regex dialect. For example, in
the input meta-model specification, we omit the minimum bound 0
(*e.g.*, ``{,4}``), which breaks with the Java regex engine beneath
the SHACL validator.

Instead, with this patch, we parse the pattern from the specification
and re-render it into the form that we also use in JSON Schema. We pick
JSON Schema regex dialect as most SHACL validators in the wild can deal
with it, in particular those based on Java as a platform. Hence, we
decide to serve this user base with priority.

Discovered in [aas-core-meta issue 342].
Fixed in [aas-core-codegen commit e22cc].

[aas-core-meta issue 342]: aas-core-works/aas-core-meta#342
[aas-core-codegen commit e22cc]: aas-core-works/aas-core-codegen@e22ccae
Previously we did not define `aas:environment`
directly via an `xs:element` tag, rather only
provided it directly as `xs:complexType`.
This created issues with several XML Schema
validator engines.

This commit fixes this problem,
discovered in #457.
@s-heppner s-heppner changed the title [v3.0.1] Fix bugs in schema files Fix bugs in XSD and SHACL schema files (v3.0.1) Aug 30, 2024
s-heppner added a commit to s-heppner/aas-core-schemagen that referenced this pull request Aug 30, 2024
@BirgitBoss BirgitBoss added this to the V3.0.1 milestone Oct 25, 2024
@BirgitBoss BirgitBoss self-requested a review October 25, 2024 07:42
@BirgitBoss
Copy link
Collaborator

Please update README.md#releases after making an updated release

@BirgitBoss
Copy link
Collaborator

see bug issue: #477

@BirgitBoss BirgitBoss self-requested a review October 27, 2024 17:01
Copy link
Collaborator

@BirgitBoss BirgitBoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#477 needs to be fixed as well

Previously, the order of the attributes in class
`EmbeddedDataSpecification` got mixed up, making
the schemas of Release 3.0.8 not backward
compatible, as found out in #477.

This reverts the change of the order of attributes
back to the state of v3.0, so that the schemas are
properly backward compatible.

Fixes #477
@s-heppner s-heppner changed the title Fix bugs in XSD and SHACL schema files (v3.0.1) Fix bugs in IDTA-01001-3-0-1 schemas Oct 30, 2024
@s-heppner s-heppner added the Schemas generated schemata for xml, JSON and rdf or XMI label Nov 4, 2024
@BirgitBoss
Copy link
Collaborator

The *OverPatternsExamples seem to be new. May you please explain what they are covering?

@s-heppner s-heppner merged commit b11bbab into master Nov 15, 2024
3 of 5 checks passed
@s-heppner s-heppner deleted the SeHe/IDTA-01001-3-0-1_schema_bug_fixes branch November 15, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Schemas generated schemata for xml, JSON and rdf or XMI
Projects
None yet
2 participants