Fix bugs in XSD and SHACL schema files (v3.0.1) #464
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes two bugs found in schema files:
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 Javaregex 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 onlyprovided it directly as
xs:complexType
.This created issues with several XML Schema
validator engines.
Fix #457.