Skip to content

Commit a7025ba

Browse files
committed
Make SHACL regex patterns follow Java
We included the regex pattern as-is from the input. Instead, with this patch, we parse it from the input and re-render it into the form that we also use in Java. We pick Java regex dialect as most SHACL validators in the wild rely on Java as platform, so we decide to serve this user base with priority. 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. Now, the pattern is correctly rendered with an explicit 0 (``{0,4}``). Discovered in [aas-core-meta issue 342]. [aas-core-meta issue 342]: aas-core-works/aas-core-meta#342
1 parent 0f7345e commit a7025ba

File tree

4 files changed

+73
-36
lines changed

4 files changed

+73
-36
lines changed

aas_core_codegen/java/verification/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44

55
verify = _generate.verify
66
generate = _generate.generate
7+
REGEX_RENDERER = _generate.REGEX_RENDERER

aas_core_codegen/java/verification/_generate.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ def char_to_str_and_escape_or_encode_if_necessary(
105105
return [f"\\x{{{code:02x}}}"]
106106

107107

108-
_REGEX_RENDERER = RegexRenderer()
108+
# NOTE (mristin):
109+
# We use this renderer not only for the Java SDK, but also for all the schemas and
110+
# other artefacts which heavily rely on Java such as, *e.g.*, SHACL.
111+
REGEX_RENDERER = RegexRenderer()
109112

110113

111114
class _PatternVerificationTranspiler(
@@ -193,7 +196,7 @@ def transform_constant(
193196
assert regex is not None
194197

195198
return self._transform_joined_str_values(
196-
values=parse_retree.render(regex=regex, renderer=_REGEX_RENDERER)
199+
values=parse_retree.render(regex=regex, renderer=REGEX_RENDERER)
197200
)
198201
else:
199202
raise AssertionError(f"Unexpected {node=}")
@@ -227,7 +230,7 @@ def transform_joined_str(
227230
assert regex is not None
228231

229232
return self._transform_joined_str_values(
230-
values=parse_retree.render(regex=regex, renderer=_REGEX_RENDERER)
233+
values=parse_retree.render(regex=regex, renderer=REGEX_RENDERER)
231234
)
232235

233236
def transform_assignment(

aas_core_codegen/rdf_shacl/shacl.py

+34-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77

88
from aas_core_codegen import intermediate, specific_implementations, infer_for_schema
99
from aas_core_codegen.common import Stripped, Error, assert_never, Identifier
10+
from aas_core_codegen.parse import retree as parse_retree
1011
from aas_core_codegen.rdf_shacl import (
1112
naming as rdf_shacl_naming,
1213
common as rdf_shacl_common,
1314
)
1415
from aas_core_codegen.rdf_shacl.common import INDENT as I, INDENT2 as II, INDENT3 as III
16+
from aas_core_codegen.java import verification as java_verification
1517

1618

1719
@require(lambda prop, cls: id(prop) in cls.property_id_set)
@@ -214,7 +216,38 @@ def _define_property_shape(
214216
# region Define patterns
215217

216218
for pattern_constraint in pattern_constraints:
217-
pattern_literal = rdf_shacl_common.string_literal(pattern_constraint.pattern)
219+
# NOTE (mristin):
220+
# We need to render the regular expression so that the pattern appears in
221+
# the canonical form. The original pattern in the specification might be written
222+
# in Python dialect, which does not translate directly to many Regex Engines.
223+
#
224+
# For example, repetition bounds can be given with 0 omitted (*e.g.*, ``{,4}``),
225+
# while SHACL and Java need an explicit zero (``{0, 4}``). Our standard renderer
226+
# puts an explicit zero.
227+
228+
regex, parse_error = parse_retree.parse([pattern_constraint.pattern])
229+
if parse_error is not None:
230+
return None, Error(
231+
prop.parsed.node,
232+
f"(mristin): "
233+
f"The pattern could not be parsed: {pattern_constraint.pattern}",
234+
)
235+
assert regex is not None
236+
237+
# NOTE (mristin):
238+
# We render the pattern exactly as the Java would render it since most
239+
# SHACL validators in the wild run on Java.
240+
rendered_pattern = parse_retree.render(
241+
regex=regex, renderer=java_verification.REGEX_RENDERER
242+
)
243+
244+
assert len(rendered_pattern) == 1 and isinstance(rendered_pattern[0], str), (
245+
"Expected strictly only a string output from rendering "
246+
f"a string pattern (*e.g.*, no FormattedValues), "
247+
f"but got: {rendered_pattern}"
248+
)
249+
250+
pattern_literal = rdf_shacl_common.string_literal(rendered_pattern[0])
218251

219252
stmts.append(Stripped(f"sh:pattern {pattern_literal} ;"))
220253

test_data/rdf_shacl/test_main/expected/aas_core_meta.v3/expected_output/shacl-schema.ttl

+32-32
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ aas:AbstractLangStringShape a sh:NodeShape ;
3636
sh:datatype xs:string ;
3737
sh:minCount 1 ;
3838
sh:maxCount 1 ;
39-
sh:pattern "^(([a-zA-Z]{2,3}(-[a-zA-Z]{3}(-[a-zA-Z]{3}){,2})?|[a-zA-Z]{4}|[a-zA-Z]{5,8})(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-(([a-zA-Z0-9]){5,8}|[0-9]([a-zA-Z0-9]){3}))*(-[0-9A-WY-Za-wy-z](-([a-zA-Z0-9]){2,8})+)*(-[xX](-([a-zA-Z0-9]){1,8})+)?|[xX](-([a-zA-Z0-9]){1,8})+|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" ;
39+
sh:pattern "^(([a-zA-Z]{2,3}(-[a-zA-Z]{3}(-[a-zA-Z]{3}){0,2})?|[a-zA-Z]{4}|[a-zA-Z]{5,8})(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-(([a-zA-Z0-9]){5,8}|[0-9]([a-zA-Z0-9]){3}))*(-[0-9A-WY-Za-wy-z](-([a-zA-Z0-9]){2,8})+)*(-[xX](-([a-zA-Z0-9]){1,8})+)?|[xX](-([a-zA-Z0-9]){1,8})+|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" ;
4040
] ;
4141
sh:property [
4242
a sh:PropertyShape ;
@@ -45,7 +45,7 @@ aas:AbstractLangStringShape a sh:NodeShape ;
4545
sh:minCount 1 ;
4646
sh:maxCount 1 ;
4747
sh:minLength 1 ;
48-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
48+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
4949
] ;
5050
.
5151

@@ -60,7 +60,7 @@ aas:AdministrativeInformationShape a sh:NodeShape ;
6060
sh:maxCount 1 ;
6161
sh:minLength 1 ;
6262
sh:maxLength 4 ;
63-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
63+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
6464
sh:pattern "^(0|[1-9][0-9]*)$" ;
6565
] ;
6666
sh:property [
@@ -71,7 +71,7 @@ aas:AdministrativeInformationShape a sh:NodeShape ;
7171
sh:maxCount 1 ;
7272
sh:minLength 1 ;
7373
sh:maxLength 4 ;
74-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
74+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
7575
sh:pattern "^(0|[1-9][0-9]*)$" ;
7676
] ;
7777
sh:property [
@@ -89,7 +89,7 @@ aas:AdministrativeInformationShape a sh:NodeShape ;
8989
sh:maxCount 1 ;
9090
sh:minLength 1 ;
9191
sh:maxLength 2000 ;
92-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
92+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
9393
] ;
9494
.
9595

@@ -147,7 +147,7 @@ aas:AssetInformationShape a sh:NodeShape ;
147147
sh:maxCount 1 ;
148148
sh:minLength 1 ;
149149
sh:maxLength 2000 ;
150-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
150+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
151151
] ;
152152
sh:property [
153153
a sh:PropertyShape ;
@@ -163,7 +163,7 @@ aas:AssetInformationShape a sh:NodeShape ;
163163
sh:maxCount 1 ;
164164
sh:minLength 1 ;
165165
sh:maxLength 2000 ;
166-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
166+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
167167
] ;
168168
sh:property [
169169
a sh:PropertyShape ;
@@ -206,7 +206,7 @@ aas:BasicEventElementShape a sh:NodeShape ;
206206
sh:maxCount 1 ;
207207
sh:minLength 1 ;
208208
sh:maxLength 255 ;
209-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
209+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
210210
] ;
211211
sh:property [
212212
a sh:PropertyShape ;
@@ -259,8 +259,8 @@ aas:BlobShape a sh:NodeShape ;
259259
sh:maxCount 1 ;
260260
sh:minLength 1 ;
261261
sh:maxLength 100 ;
262-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
263-
sh:pattern "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ ]*;[ ]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([ !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([ !-~]|[\\x80-\\xff]))*\"))*$" ;
262+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
263+
sh:pattern "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\\x{80}-\\x{ff}])|\\\\([\\t !-~]|[\\x{80}-\\x{ff}]))*\"))*$" ;
264264
] ;
265265
.
266266

@@ -336,7 +336,7 @@ aas:DataSpecificationIec61360Shape a sh:NodeShape ;
336336
sh:minCount 0 ;
337337
sh:maxCount 1 ;
338338
sh:minLength 1 ;
339-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
339+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
340340
] ;
341341
sh:property [
342342
a sh:PropertyShape ;
@@ -352,7 +352,7 @@ aas:DataSpecificationIec61360Shape a sh:NodeShape ;
352352
sh:minCount 0 ;
353353
sh:maxCount 1 ;
354354
sh:minLength 1 ;
355-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
355+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
356356
] ;
357357
sh:property [
358358
a sh:PropertyShape ;
@@ -361,7 +361,7 @@ aas:DataSpecificationIec61360Shape a sh:NodeShape ;
361361
sh:minCount 0 ;
362362
sh:maxCount 1 ;
363363
sh:minLength 1 ;
364-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
364+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
365365
] ;
366366
sh:property [
367367
a sh:PropertyShape ;
@@ -383,7 +383,7 @@ aas:DataSpecificationIec61360Shape a sh:NodeShape ;
383383
sh:minCount 0 ;
384384
sh:maxCount 1 ;
385385
sh:minLength 1 ;
386-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
386+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
387387
] ;
388388
sh:property [
389389
a sh:PropertyShape ;
@@ -400,7 +400,7 @@ aas:DataSpecificationIec61360Shape a sh:NodeShape ;
400400
sh:maxCount 1 ;
401401
sh:minLength 1 ;
402402
sh:maxLength 2000 ;
403-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
403+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
404404
] ;
405405
sh:property [
406406
a sh:PropertyShape ;
@@ -453,7 +453,7 @@ aas:EntityShape a sh:NodeShape ;
453453
sh:maxCount 1 ;
454454
sh:minLength 1 ;
455455
sh:maxLength 2000 ;
456-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
456+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
457457
] ;
458458
sh:property [
459459
a sh:PropertyShape ;
@@ -540,7 +540,7 @@ aas:EventPayloadShape a sh:NodeShape ;
540540
sh:maxCount 1 ;
541541
sh:minLength 1 ;
542542
sh:maxLength 255 ;
543-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
543+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
544544
] ;
545545
sh:property [
546546
a sh:PropertyShape ;
@@ -577,7 +577,7 @@ aas:ExtensionShape a sh:NodeShape ;
577577
sh:maxCount 1 ;
578578
sh:minLength 1 ;
579579
sh:maxLength 128 ;
580-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
580+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
581581
] ;
582582
sh:property [
583583
a sh:PropertyShape ;
@@ -612,7 +612,7 @@ aas:FileShape a sh:NodeShape ;
612612
sh:maxCount 1 ;
613613
sh:minLength 1 ;
614614
sh:maxLength 2000 ;
615-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
615+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
616616
] ;
617617
sh:property [
618618
a sh:PropertyShape ;
@@ -622,8 +622,8 @@ aas:FileShape a sh:NodeShape ;
622622
sh:maxCount 1 ;
623623
sh:minLength 1 ;
624624
sh:maxLength 100 ;
625-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
626-
sh:pattern "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ ]*;[ ]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([ !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([ !-~]|[\\x80-\\xff]))*\"))*$" ;
625+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
626+
sh:pattern "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\\x{80}-\\x{ff}])|\\\\([\\t !-~]|[\\x{80}-\\x{ff}]))*\"))*$" ;
627627
] ;
628628
.
629629

@@ -753,7 +753,7 @@ aas:IdentifiableShape a sh:NodeShape ;
753753
sh:maxCount 1 ;
754754
sh:minLength 1 ;
755755
sh:maxLength 2000 ;
756-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
756+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
757757
] ;
758758
.
759759

@@ -774,7 +774,7 @@ aas:KeyShape a sh:NodeShape ;
774774
sh:maxCount 1 ;
775775
sh:minLength 1 ;
776776
sh:maxLength 2000 ;
777-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
777+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
778778
] ;
779779
.
780780

@@ -993,7 +993,7 @@ aas:QualifierShape a sh:NodeShape ;
993993
sh:maxCount 1 ;
994994
sh:minLength 1 ;
995995
sh:maxLength 128 ;
996-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
996+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
997997
] ;
998998
sh:property [
999999
a sh:PropertyShape ;
@@ -1067,7 +1067,7 @@ aas:ReferableShape a sh:NodeShape ;
10671067
sh:maxCount 1 ;
10681068
sh:minLength 1 ;
10691069
sh:maxLength 128 ;
1070-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
1070+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
10711071
] ;
10721072
sh:property [
10731073
a sh:PropertyShape ;
@@ -1077,7 +1077,7 @@ aas:ReferableShape a sh:NodeShape ;
10771077
sh:maxCount 1 ;
10781078
sh:minLength 1 ;
10791079
sh:maxLength 128 ;
1080-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
1080+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
10811081
sh:pattern "^[a-zA-Z][a-zA-Z0-9_]*$" ;
10821082
] ;
10831083
sh:property [
@@ -1159,7 +1159,7 @@ aas:ResourceShape a sh:NodeShape ;
11591159
sh:maxCount 1 ;
11601160
sh:minLength 1 ;
11611161
sh:maxLength 2000 ;
1162-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
1162+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
11631163
] ;
11641164
sh:property [
11651165
a sh:PropertyShape ;
@@ -1169,8 +1169,8 @@ aas:ResourceShape a sh:NodeShape ;
11691169
sh:maxCount 1 ;
11701170
sh:minLength 1 ;
11711171
sh:maxLength 100 ;
1172-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
1173-
sh:pattern "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ ]*;[ ]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([ !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([ !-~]|[\\x80-\\xff]))*\"))*$" ;
1172+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
1173+
sh:pattern "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\\x{80}-\\x{ff}])|\\\\([\\t !-~]|[\\x{80}-\\x{ff}]))*\"))*$" ;
11741174
] ;
11751175
.
11761176

@@ -1185,7 +1185,7 @@ aas:SpecificAssetIdShape a sh:NodeShape ;
11851185
sh:maxCount 1 ;
11861186
sh:minLength 1 ;
11871187
sh:maxLength 64 ;
1188-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
1188+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
11891189
] ;
11901190
sh:property [
11911191
a sh:PropertyShape ;
@@ -1195,7 +1195,7 @@ aas:SpecificAssetIdShape a sh:NodeShape ;
11951195
sh:maxCount 1 ;
11961196
sh:minLength 1 ;
11971197
sh:maxLength 2000 ;
1198-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
1198+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
11991199
] ;
12001200
sh:property [
12011201
a sh:PropertyShape ;
@@ -1311,7 +1311,7 @@ aas:ValueReferencePairShape a sh:NodeShape ;
13111311
sh:maxCount 1 ;
13121312
sh:minLength 1 ;
13131313
sh:maxLength 2000 ;
1314-
sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ;
1314+
sh:pattern "^[\\x{09}\\x{0a}\\x{0d}\\x{20}-\\x{d7ff}\\x{e000}-\\x{fffd}\\x{10000}-\\x{10ffff}]*$" ;
13151315
] ;
13161316
sh:property [
13171317
a sh:PropertyShape ;

0 commit comments

Comments
 (0)