Skip to content

Commit de35c75

Browse files
BUGFIX Grammar 3-1-2 (#549)
* fixed grammar * update changelog * align with secuity spec * fix patterns * adjust datetime & time pattern * update changelog * fix modelstringpattern in api * align time pattern to api * align time pattern to api * added missing parantheses * fix additional bugs * fix typo in changelog --------- Co-authored-by: sebbader-sap <107036549+sebbader-sap@users.noreply.github.com>
1 parent dab9924 commit de35c75

File tree

6 files changed

+182
-109
lines changed

6 files changed

+182
-109
lines changed

Part2-API-Schemas/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ components:
628628
modelStringPattern:
629629
type: string
630630
pattern: >-
631-
^((?:\$aas#(?:idShort|id|assetInformation\.assetKind|assetInformation\.assetType|assetInformation\.globalAssetId|assetInformation\.(?:specificAssetIds(\[[0-9]*\])(?:\.(?:name|value|externalSubjectId(?:\.type|\.keys\[\d*\](?:\.(?:type|value))?)?)?)|submodels\.(?:type|keys\[\d*\](?:\.(?:type|value))?))|submodels\.(type|keys\[\d*\](?:\.(type|value))?)))|(?:\$sm#(?:semanticId(?:\.type|\.keys\[\d*\](?:\.(type|value))?)?|idShort|id))|(?:\$sme(?:\.[a-zA-Z][a-zA-Z0-9_]*(\[[0-9]*\])?(?:\.[a-zA-Z][a-zA-Z0-9_]*(\[[0-9]*\])?)*)?#(?:semanticId(?:\.type|\.keys\[\d*\](?:\.(type|value))?)?|idShort|value|valueType|language))|(?:\$cd#(?:idShort|id))|(?:\$aasdesc#(?:idShort|id|assetKind|assetType|globalAssetId|specificAssetIds(\[[0-9]*\])?(?:\.(name|value|externalSubjectId(?:\.type|\.keys\[\d*\](?:\.(type|value))?)?)?)|endpoints(\[[0-9]*\])\.(interface|protocolinformation\.href)|submodelDescriptors(\[[0-9]*\])\.(semanticId(?:\.type|\.keys\[\d*\](?:\.(type|value))?)?|idShort|id|endpoints(\[[0-9]*\])\.(interface|protocolinformation\.href))))|(?:\$smdesc#(?:semanticId(?:\.type|\.keys\[\d*\](?:\.(type|value))?)?|idShort|id|endpoints(\[[0-9]*\])\.(interface|protocolinformation\.href))))$
631+
^(?:\$aas#(?:idShort|id|assetInformation\.assetKind|assetInformation\.assetType|assetInformation\.globalAssetId|assetInformation\.specificAssetIds\[[0-9]*\]\.(?:name|value|externalSubjectId(?:\.(?:type|keys\[[0-9]*\]\.(?:type|value)))?)|submodels\[[0-9]*\]\.(?:type|keys\[[0-9]*\]\.(?:type|value)))|\$sm#(?:semanticId(?:\.(?:type|keys\[[0-9]*\]\.(?:type|value)))?|idShort|id)|\$sme(?:\.[A-Za-z](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?(?:\[[0-9]*\])*(?:\.[A-Za-z](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?(?:\[[0-9]*\])*)*)?#(?:semanticId(?:\.(?:type|keys\[[0-9]*\]\.(?:type|value)))?|idShort|value|valueType|language)|\$cd#(?:idShort|id)|\$aasdesc#(?:idShort|id|assetKind|assetType|globalAssetId|specificAssetIds\[[0-9]*\]\.(?:name|value|externalSubjectId(?:\.(?:type|keys\[[0-9]*\]\.(?:type|value)))?)|endpoints\[[0-9]*\]\.(?:interface|protocolinformation\.href)|submodelDescriptors\[[0-9]*\]\.(?:semanticId(?:\.(?:type|keys\[[0-9]*\]\.(?:type|value)))?|idShort|id|endpoints\[[0-9]*\]\.(?:interface|protocolinformation\.href)))|\$smdesc#(?:semanticId(?:\.(?:type|keys\[[0-9]*\]\.(?:type|value)))?|idShort|id|endpoints\[[0-9]*\]\.(?:interface|protocolinformation\.href)))$
632632
MultiLanguagePropertyMetadata:
633633
allOf:
634634
- $ref: "#/components/schemas/SubmodelElementAttributes"

documentation/IDTA-01002-3/modules/ROOT/pages/changelog.adoc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,14 @@ Major Changes:
6262
Minor Changes:
6363

6464
* fix: Wrong ServiceSpecificationProfileEnum values for v3.0 profiles. (https://github.com/admin-shell-io/aas-specs-api/issues/526[#526])
65-
* remove: Remove TREE. (https://github.com/admin-shell-io/aas-specs-api/issues/537)
66-
67-
65+
* removed: Remove TREE. (https://github.com/admin-shell-io/aas-specs-api/issues/537)
66+
* fix: fixed FILTER object in json schema & fixed inconsistencies in BNF (https://github.com/admin-shell-io/aas-specs-api/issues/547)
67+
* fix: naming inconsistencies inside BNF and json schema (https://github.com/admin-shell-io/aas-specs-api/issues/547)
68+
* fix: aligned BNF and json schema to api spec (https://github.com/admin-shell-io/aas-specs-api/issues/547)
69+
* fix: BNF did not compile (https://github.com/admin-shell-io/aas-specs-security/issues/62)
70+
* fix: BNF used incorrectly plural for USEACL & USEFORMULA (https://github.com/admin-shell-io/aas-specs-security/issues/61)
71+
* fix: Regex FieldIdentifier was incorrect (https://github.com/admin-shell-io/aas-specs-security/issues/60)
72+
* fix: Incorrect FieldIdentifier AAS Submodel References (https://github.com/admin-shell-io/aas-specs-security/issues/59)
6873

6974
=== Operation Changes w.r.t. V3.1 to V3.1.1
7075

documentation/IDTA-01002-3/modules/ROOT/pages/json-grammar.txt

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,15 @@
136136
| ( "," <ws> "\"USEOBJECTS\":" <ws> <string_array> <ws> ) )
137137
( ( "," <ws> "\"FORMULA\":" <ws> <logical_expression> <ws> )
138138
| ("," <ws> "\"USEFORMULA\":" <ws> <StringLiteral> <ws> ) )
139-
("," <ws> "\"FRAGMENT\":" <ws> <StringLiteral> <ws> )?
140-
( ( "," <ws> "\"FILTER\":" <ws> <logical_expression> <ws> )
141-
| ("," <ws> "\"USEFILTER\":" <ws> <StringLiteral> <ws> ) )?
139+
( "," <ws> "\"FILTER\":" <ws> <security_query_filter> <ws> )?
142140
"}"
143141

142+
<security_query_filter> ::= "{" <ws>
143+
( ( "\"FRAGMENT\":" <ws> <StringLiteral> <ws>
144+
"," <ws> "\"CONDITION\":" <ws> <logical_expression> <ws> )
145+
| ( "\"USEFORMULA\":" <ws> <StringLiteral> <ws> ) )
146+
"}"
147+
144148
<acl> ::= "{" <ws>
145149
( ( "\"ATTRIBUTES\":" <ws> <attribute_array> <ws> )
146150
| ( "\"USEATTRIBUTES\":" <ws> <string_array> <ws> ) )
@@ -200,20 +204,20 @@
200204
<boolean> ::= ("true" | "false")
201205
<DateTimeLiteral> ::= "\"" <datetime> "\"" <ws>
202206
<TimeLiteral> ::= "\"" <time> "\"" <ws>
203-
<datetime> ::= <date> <ws> ( "T" | " " ) <ws> <time> <ws> ( <timezone> <ws> )?
204-
<date> ::= <year> <ws> "-" <ws> <month> <ws> "-" <ws> <day> <ws>
205-
<year> ::= <digit> <ws> <digit> <ws> <digit> <ws> <digit> <ws>
206-
<month> ::= <digit> <ws> <digit> <ws>
207-
<day> ::= <digit> <ws> <digit> <ws>
208-
<time> ::= <hour> <ws> ":" <ws> <minute> <ws> ( ":" <ws> <second> <ws> )? ( "." <ws> <fraction> <ws> )?
209-
<timezone> ::= ( "Z" | ( "+" | "-" ) <ws> <hour> <ws> ":" <ws> <minute> <ws> )
210-
<hour> ::= <digit> <ws> <digit> <ws>
211-
<minute> ::= <digit> <ws> <digit> <ws>
212-
<second> ::= <digit> <ws> <digit> <ws>
213-
<fraction> ::= <digit>+ <ws>
214-
215-
<digit> ::= [0-9] <ws>
216-
<StringLiteral> ::= "\"" ( [A-Z] | [a-z] | [0-9] | "/" | "*" | "[" | "]" | "(" | ")" | " " | "_" | "@" | "#" | "\\" | "+" | "-" | "." | "," | ":" | "$" | "^" | "*" )+ "\""
207+
<datetime> ::= <date> ( "T" )? <time> ( <timezone> )?
208+
<date> ::= <year> "-" <month> "-" <day>
209+
<year> ::= <digit> <digit> <digit> <digit>
210+
<month> ::= <digit> <digit>
211+
<day> ::= <digit> <digit>
212+
<time> ::= <hour> ":" <minute> ( ":" <second> )? ( "." <fraction> )?
213+
<timezone> ::= ( "Z" | ( "+" | "-" ) <hour> ":" <minute> )
214+
<hour> ::= <digit> <digit>
215+
<minute> ::= <digit> <digit>
216+
<second> ::= <digit> <digit>
217+
<fraction> ::= <digit>+
218+
219+
<digit> ::= [0-9]
220+
<StringLiteral> ::= "\"" ( [A-Z] | [a-z] | [0-9] | "/" | "*" | "[" | "]" | "(" | ")" | " " | "_" | "@" | "#" | "\\" | "+" | "-" | "." | "," | ":" | "$" | "^" )+ "\""
217221
<ClaimLiteral> ::= <StringLiteral>
218222
<ReferenceLiteral> ::= <StringLiteral>
219223
<RouteLiteral> ::= <StringLiteral>
@@ -225,20 +229,19 @@
225229
<HexLiteral> ::= "\"" "16#" ( [0-9] | [A-F] )+ "\""
226230
<BoolLiteral> ::= "true" | "false"
227231

228-
<FieldIdentifier> ::= "\"" <FieldIdentifierString> "\""
229-
<FieldIdentifierString> ::= <FieldIdentifierAAS> | <FieldIdentifierSM> | <FieldIdentifierSME> | <FieldIdentifierCD> | <FieldIdentifierAasDescriptor> | <FieldIdentifierSmDescriptor>
230-
<FieldIdentifierAAS> ::= "$aas#" ( "idShort" | "id" | "assetInformation.assetKind" | "assetInformation.assetType" | "assetInformation.globalAssetId" | "assetInformation." <SpecificAssetIdsClause> | "submodels." <ReferenceClause> )
232+
<FieldIdentifier> ::= "\"" ( <FieldIdentifierAAS> | <FieldIdentifierSM> | <FieldIdentifierSME> | <FieldIdentifierCD> | <FieldIdentifierAasDescriptor> | <FieldIdentifierSmDescriptor> ) "\""
233+
<FieldIdentifierAAS> ::= "$aas#" ( "idShort" | "id" | "assetInformation.assetKind" | "assetInformation.assetType" | "assetInformation.globalAssetId" | "assetInformation." <SpecificAssetIdsClause> | "submodels" ( "[" ( [0-9]* ) "]" ) "." <ReferenceClause> )
231234
<FieldIdentifierSM> ::= "$sm#" ( <SemanticIdClause> | "idShort" | "id" )
232235
<FieldIdentifierSME> ::= "$sme" ( "." <idShortPath> )? "#" ( <SemanticIdClause> | "idShort" | "value" | "valueType" | "language" )
233236
<FieldIdentifierCD> ::= "$cd#" ( "idShort" | "id" ) <ws>
234-
<FieldIdentifierAasDescriptor> ::= "$aasdesc#" ( "idShort" | "id" | "assetKind" | "assetType" | "globalAssetId" | <SpecificAssetIdsClause> | "endpoints" ( "[" ( [0-9]* ) "]" )? "." <EndpointClause> | "submodelDescriptors" ( "[" ( [0-9]* ) "]" )? "." <SmDescriptorClause> )
237+
<FieldIdentifierAasDescriptor> ::= "$aasdesc#" ( "idShort" | "id" | "assetKind" | "assetType" | "globalAssetId" | <SpecificAssetIdsClause> | "endpoints" ( "[" ( [0-9]* ) "]" ) "." <EndpointClause> | "submodelDescriptors" ( "[" ( [0-9]* ) "]" ) "." <SmDescriptorClause> )
235238
<FieldIdentifierSmDescriptor> ::= "$smdesc#" <SmDescriptorClause>
236-
<SmDescriptorClause> ::= ( <SemanticIdClause> | "idShort" | "id" | "endpoints" ( "[" ( [0-9]* ) "]" )? "." <EndpointClause> )
239+
<SmDescriptorClause> ::= ( <SemanticIdClause> | "idShort" | "id" | "endpoints" ( "[" ( [0-9]* ) "]" ) "." <EndpointClause> )
237240
<EndpointClause> ::= "interface" | "protocolinformation.href"
238-
<ReferenceClause> ::= ( "type" | "keys" ( "[" ( [0-9]* ) "]" )? ( ".type" | ".value" ) )
241+
<ReferenceClause> ::= ( "type" | "keys" ( "[" ( [0-9]* ) "]" ) ( ".type" | ".value" ) )
239242
<SemanticIdClause> ::= ( "semanticId" | "semanticId." <ReferenceClause> )
240-
<SpecificAssetIdsClause> ::= ( "specificAssetIds" ( "[" ( [0-9]* ) "]" )? ( ".name" | ".value" | ".externalSubjectId" | ".externalSubjectId." <ReferenceClause> ) )
241-
<idShortPath> ::= ( <idShort> ("[" ( [0-9]* ) "]" )? ( "." <idShortPath> )* )
242-
<idShort> ::= ( ( [a-z] | [A-Z] ) ( [a-z] | [A-Z] | [0-9] | "_" )* )
243+
<SpecificAssetIdsClause> ::= ( "specificAssetIds" ( "[" ( [0-9]* ) "]" ) ( ".name" | ".value" | ".externalSubjectId" | ".externalSubjectId." <ReferenceClause> ) )
244+
<idShortPath> ::= ( <idShort> ("[" ( [0-9]* ) "]" )* ( "." <idShortPath> )* )
245+
<idShort> ::= ( ( [a-z] | [A-Z] ) (( [a-z] | [A-Z] | [0-9] | "_" | "-" )* ( [a-z] | [A-Z] | [0-9] | "_" ) )? )
243246

244247
<ws> ::= ( " " | "\t" | "\r" | "\n" )*

documentation/IDTA-01002-3/modules/ROOT/pages/schema.adoc

Lines changed: 55 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"modelStringPattern": {
1212
"type": "string",
13-
"pattern": "^((?:\\$aas#(?:idShort|id|assetInformation\\.assetKind|assetInformation\\.assetType|assetInformation\\.globalAssetId|assetInformation\\.(?:specificAssetIds(\\[[0-9]*\\])(?:\\.(?:name|value|externalSubjectId(?:\\.type|\\.keys\\[\\d*\\](?:\\.(?:type|value))?)?)?)|submodels\\.(?:type|keys\\[\\d*\\](?:\\.(?:type|value))?))|submodels\\.(type|keys\\[\\d*\\](?:\\.(type|value))?)))|(?:\\$sm#(?:semanticId(?:\\.type|\\.keys\\[\\d*\\](?:\\.(type|value))?)?|idShort|id))|(?:\\$sme(?:\\.[a-zA-Z][a-zA-Z0-9_]*(\\[[0-9]*\\])?(?:\\.[a-zA-Z][a-zA-Z0-9_]*(\\[[0-9]*\\])?)*)?#(?:semanticId(?:\\.type|\\.keys\\[\\d*\\](?:\\.(type|value))?)?|idShort|value|valueType|language))|(?:\\$cd#(?:idShort|id))|(?:\\$aasdesc#(?:idShort|id|assetKind|assetType|globalAssetId|specificAssetIds(\\[[0-9]*\\])?(?:\\.(name|value|externalSubjectId(?:\\.type|\\.keys\\[\\d*\\](?:\\.(type|value))?)?)?)|endpoints(\\[[0-9]*\\])\\.(interface|protocolinformation\\.href)|submodelDescriptors(\\[[0-9]*\\])\\.(semanticId(?:\\.type|\\.keys\\[\\d*\\](?:\\.(type|value))?)?|idShort|id|endpoints(\\[[0-9]*\\])\\.(interface|protocolinformation\\.href))))|(?:\\$smdesc#(?:semanticId(?:\\.type|\\.keys\\[\\d*\\](?:\\.(type|value))?)?|idShort|id|endpoints(\\[[0-9]*\\])\\.(interface|protocolinformation\\.href))))$"
13+
"pattern": "^(?:\\$aas#(?:idShort|id|assetInformation\\.assetKind|assetInformation\\.assetType|assetInformation\\.globalAssetId|assetInformation\\.specificAssetIds\\[[0-9]*\\]\\.(?:name|value|externalSubjectId(?:\\.(?:type|keys\\[[0-9]*\\]\\.(?:type|value)))?)|submodels\\[[0-9]*\\]\\.(?:type|keys\\[[0-9]*\\]\\.(?:type|value)))|\\$sm#(?:semanticId(?:\\.(?:type|keys\\[[0-9]*\\]\\.(?:type|value)))?|idShort|id)|\\$sme(?:\\.[A-Za-z](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?(?:\\[[0-9]*\\])*(?:\\.[A-Za-z](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?(?:\\[[0-9]*\\])*)*)?#(?:semanticId(?:\\.(?:type|keys\\[[0-9]*\\]\\.(?:type|value)))?|idShort|value|valueType|language)|\\$cd#(?:idShort|id)|\\$aasdesc#(?:idShort|id|assetKind|assetType|globalAssetId|specificAssetIds\\[[0-9]*\\]\\.(?:name|value|externalSubjectId(?:\\.(?:type|keys\\[[0-9]*\\]\\.(?:type|value)))?)|endpoints\\[[0-9]*\\]\\.(?:interface|protocolinformation\\.href)|submodelDescriptors\\[[0-9]*\\]\\.(?:semanticId(?:\\.(?:type|keys\\[[0-9]*\\]\\.(?:type|value)))?|idShort|id|endpoints\\[[0-9]*\\]\\.(?:interface|protocolinformation\\.href)))|\\$smdesc#(?:semanticId(?:\\.(?:type|keys\\[[0-9]*\\]\\.(?:type|value)))?|idShort|id|endpoints\\[[0-9]*\\]\\.(?:interface|protocolinformation\\.href)))$"
1414
},
1515
"hexLiteralPattern": {
1616
"type": "string",
@@ -650,45 +650,77 @@
650650
"USEFORMULA": {
651651
"type": "string"
652652
},
653-
"FRAGMENT": {
654-
"type": "string"
655-
},
656653
"FILTER": {
657-
"$ref": "#/definitions/logicalExpression",
654+
"$ref": "#/definitions/SecurityQueryFilter",
658655
"additionalProperties": false
659-
},
660-
"USEFILTER": {
661-
"type": "string"
662656
}
663657
},
664-
"oneOf": [
658+
"allOf": [
665659
{
666-
"required": [
667-
"ACL"
660+
"oneOf": [
661+
{
662+
"required": [
663+
"ACL"
664+
]
665+
},
666+
{
667+
"required": [
668+
"USEACL"
669+
]
670+
}
668671
]
669672
},
670673
{
671-
"required": [
672-
"USEACL"
673-
]
674-
}
675-
],
676-
"oneOf": [
677-
{
678-
"required": [
679-
"OBJECTS"
674+
"oneOf": [
675+
{
676+
"required": [
677+
"OBJECTS"
678+
]
679+
},
680+
{
681+
"required": [
682+
"USEOBJECTS"
683+
]
684+
}
680685
]
681686
},
682687
{
683-
"required": [
684-
"USEOBJECTS"
688+
"oneOf": [
689+
{
690+
"required": [
691+
"FORMULA"
692+
]
693+
},
694+
{
695+
"required": [
696+
"USEFORMULA"
697+
]
698+
}
685699
]
686700
}
687701
],
702+
"additionalProperties": false
703+
},
704+
"SecurityQueryFilter": {
705+
"type": "object",
706+
"properties": {
707+
"FRAGMENT": {
708+
"type": "string"
709+
},
710+
"CONDITION": {
711+
"$ref": "#/definitions/logicalExpression"
712+
},
713+
"USEFORMULA": {
714+
"type": "string"
715+
}
716+
},
717+
"required": [
718+
"FRAGMENT"
719+
],
688720
"oneOf": [
689721
{
690722
"required": [
691-
"FORMULA"
723+
"CONDITION"
692724
]
693725
},
694726
{

0 commit comments

Comments
 (0)