Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ec2e164
ODATA-1604 (#105)
ralfhandl Nov 29, 2023
41e6cdc
Merge branch 'main' into v4.02-release-candidate
ralfhandl Dec 7, 2023
e9b721b
Merge branch 'main' into v4.02-release-candidate
ralfhandl Dec 7, 2023
139f473
overload with third parameter for providing regular expression flags
ralfhandl Jan 18, 2024
7952c35
Adjust header comments, add test cases (#114)
ralfhandl Feb 5, 2024
d6cfae3
Merge pull request #113 from oasis-tcs/ODATA-1618
mikepizzo Feb 7, 2024
7c8115f
ODATA-1540 (#109)
ralfhandl Feb 21, 2024
5bb2462
Merge branch 'main' into v4.02-release-candidate
ralfhandl Feb 22, 2024
485c742
Update .gitignore
ralfhandl Feb 26, 2024
9592dde
Update nodejs.yml
ralfhandl Mar 12, 2024
9d6c9eb
Merge branch 'main' into v4.02-release-candidate
ralfhandl Mar 12, 2024
44738ed
Update .gitignore
ralfhandl Mar 12, 2024
7f529f2
ODATA-1583 (#106)
ralfhandl May 22, 2024
c4df667
Request references (#117)
HeikoTheissen May 29, 2024
2568a59
Add $count to select
mikepizzo Feb 12, 2025
db7a2ba
Merge branch 'v4.02-release-candidate' of https://github.com/oasis-tc…
mikepizzo Feb 12, 2025
4513005
Apply review feedback
mikepizzo Feb 13, 2025
a1657c4
Merge remote-tracking branch 'origin/main' into v4.02-release-candidate
HeikoTheissen Feb 14, 2025
b417570
Merge remote-tracking branch 'origin/v4.02-release-candidate' into ab…
HeikoTheissen Feb 14, 2025
5671624
npm audit fix
HeikoTheissen Feb 18, 2025
e8e5768
Revert "npm audit fix"
HeikoTheissen Feb 18, 2025
761628b
Add test case and improve test case descriptions
mikepizzo Feb 18, 2025
cba3866
Merge branch 'abnf2046' of https://github.com/oasis-tcs/odata-abnf
mikepizzo Feb 18, 2025
e0b1196
Merge pull request #123 from oasis-tcs/abnf2046
mikepizzo Feb 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 74 additions & 36 deletions abnf/odata-abnf-construction-rules.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
;------------------------------------------------------------------------------
; OData ABNF Construction Rules Version 4.01 and 4.0
; OData ABNF Construction Rules Version 4.02, 4.01, and 4.0
;------------------------------------------------------------------------------
; 17 September 2020
; 05 February 2024
;
; Latest version: https://github.com/oasis-tcs/odata-abnf/blob/main/abnf/odata-abnf-construction-rules.txt
;------------------------------------------------------------------------------
Expand All @@ -21,18 +21,18 @@
;
; Additional artifacts:
; This grammar is one component of a Work Product which consists of:
; - OData Version 4.01 Part 1: Protocol
; - OData Version 4.01 Part 2: URL Conventions
; - OData ABNF Construction Rules Version 4.01 (this document)
; - OData ABNF Test Cases Version 4.01
; - OData Version 4.02 Part 1: Protocol
; - OData Version 4.02 Part 2: URL Conventions
; - OData ABNF Construction Rules Version 4.02 (this document)
; - OData ABNF Test Cases Version 4.02
;
; Related work:
; This specification replaces or supersedes:
; - OData ABNF Construction Rules Version 4.0
; This work product is related to
; - OData Common Schema Definition Language (CSDL) JSON Representation Version 4.01
; - OData Common Schema Definition Language (CSDL) XML Representation Version 4.01
; - OData JSON Format Version 4.01
; - OData Common Schema Definition Language (CSDL) JSON Representation Version 4.02
; - OData Common Schema Definition Language (CSDL) XML Representation Version 4.02
; - OData JSON Format Version 4.02
;
; Abstract:
; The Open Data Protocol (OData) enables the creation of REST-based data
Expand Down Expand Up @@ -298,27 +298,33 @@ expandItem = "$value"
/ expandPath
/ optionallyQualifiedEntityTypeName "/" expandPath
expandPath = ( STAR [ ref / OPEN levels CLOSE ]
/ ( navigationProperty / entityAnnotationInQuery ) [ "/" optionallyQualifiedEntityTypeName ]
[ ref [ OPEN expandRefOption *( SEMI expandRefOption ) CLOSE ]
/ count [ OPEN expandCountOption *( SEMI expandCountOption ) CLOSE ]
/ ( entityNavigationProperty / entityAnnotationInQuery ) [ "/" optionallyQualifiedEntityTypeName ]
[ ref
/ OPEN entityOption *( SEMI entityOption ) CLOSE
]
/ ( entityColNavigationProperty / entityColAnnotationInQuery ) [ "/" optionallyQualifiedEntityTypeName ]
[ ref [ OPEN colOption *( SEMI colOption ) CLOSE ]
/ count [ OPEN countOption *( SEMI countOption ) CLOSE ]
/ OPEN expandOption *( SEMI expandOption ) CLOSE
]
/ ( complexProperty / complexColProperty / optionallyQualifiedComplexTypeName / complexAnnotationInQuery ) "/" expandPath
/ ( complexProperty / complexColProperty / optionallyQualifiedComplexTypeName / complexAnnotationInQuery / complexColAnnotationInQuery) "/" expandPath
/ streamProperty
)
expandCountOption = filter
countOption = filter
/ search
expandRefOption = expandCountOption
colOption = countOption
/ orderby
/ skip
/ top
/ inlinecount
expandOption = expandRefOption
/ select
/ expand
structOption = select
/ compute
/ levels
/ aliasAndValue
entityOption = structOption
/ expand
/ levels
expandOption = colOption
/ entityOption

levels = ( "$levels" / "levels" ) EQ ( oneToNine *DIGIT / "max" )

Expand All @@ -344,7 +350,7 @@ inlinecount = ( "$count" / "count" ) EQ boolean

schemaversion = ( "$schemaversion" / "schemaversion" ) EQ ( STAR / 1*unreserved )

search = ( "$search" / "search" ) EQ BWS ( searchExpr / searchExpr-incomplete )
search = ( "$search" / "search" ) EQ BWS ( searchExpr / searchExpr-incomplete ) BWS

searchExpr = ( searchParenExpr
/ searchNegateExpr
Expand Down Expand Up @@ -372,7 +378,7 @@ searchPhrase = quotation-mark 1*( qchar-no-AMP-DQUOTE / SP ) quotation-mark
; Expressing this in ABNF is somewhat clumsy, so the following rule is overly generous.
; Note: the words AND, OR, and NOT are sometimes operators, depending on their position within a search expression.
searchWord = searchChar *( searchChar / SQUOTE )
searchChar = unreserved / pct-encoded-no-DQUOTE / "!" / "*" / "+" / "," / ":" / "@" / "/" / "?" / "$" / "="
searchChar = unreserved / pct-encoded-no-SP-DQUOTE / "!" / "*" / "+" / "," / ":" / "@" / "/" / "?" / "$" / "="

searchExpr-incomplete = SQUOTE *( SQUOTE-in-string / qchar-no-AMP-SQUOTE / quotation-mark / SP ) SQUOTE

Expand All @@ -389,15 +395,21 @@ selectItem = STAR
/ optionallyQualifiedFunctionName
)
selectProperty = primitiveProperty / primitiveAnnotationInQuery
/ ( primitiveColProperty / primitiveColAnnotationInQuery ) [ OPEN selectOptionPC *( SEMI selectOptionPC ) CLOSE ]
/ navigationProperty
/ selectPath [ OPEN selectOption *( SEMI selectOption ) CLOSE
/ selectPath [ OPEN structOption *( SEMI structOption ) CLOSE
/ "/" selectProperty
]
selectPath = ( complexProperty / complexColProperty / complexAnnotationInQuery ) [ "/" optionallyQualifiedComplexTypeName ]
selectOptionPC = filter / search / inlinecount / orderby / skip / top
selectOption = selectOptionPC
/ compute / select / aliasAndValue
/ selectColPath [ count [ OPEN countOption *( SEMI countOption ) CLOSE ]
/ OPEN selectOption *( SEMI selectOption ) CLOSE
/ "/" selectProperty
]
/ ( primitiveColProperty / primitiveColAnnotationInQuery )
[ count [ OPEN countOption *( SEMI countOption ) CLOSE ]
/ OPEN colOption *( SEMI colOption ) CLOSE
]
/ navigationProperty
selectPath = ( complexProperty / complexAnnotationInQuery ) [ "/" optionallyQualifiedComplexTypeName ]
selectColPath = ( complexColProperty / complexColAnnotationInQuery ) [ "/" optionallyQualifiedComplexTypeName ]
selectOption = colOption / structOption

allOperationsInSchema = namespace "." STAR

Expand Down Expand Up @@ -425,7 +437,9 @@ customName = qchar-no-AMP-EQ-AT-DOLLAR *( qchar-no-AMP-EQ )
customValue = *( qchar-no-AMP )

complexAnnotationInQuery = annotationInQuery ; complex-valued annotation
complexColAnnotationInQuery = annotationInQuery ; complex collection-valued annotation
entityAnnotationInQuery = annotationInQuery ; entity-valued annotation
entityColAnnotationInQuery = annotationInQuery ; entity collection-valued annotation

primitiveAnnotationInQuery = annotationInQuery ; primitive-valued annotation
primitiveColAnnotationInQuery = annotationInQuery ; primitive collection-valued annotation
Expand All @@ -442,16 +456,34 @@ contextFragment = %s"Collection($ref)"
/ singletonEntity [ navigation *( containmentNavigation ) [ "/" qualifiedEntityTypeName ] ] [ selectList ]
/ qualifiedTypeName [ selectList ]
/ entitySet ( %s"/$deletedEntity" / %s"/$link" / %s"/$deletedLink" )
/ entitySet keyPredicate "/" contextPropertyPath [ selectList ]
/ entitySet contextKeyPredicate "/" contextPropertyPath [ selectList ]
/ entitySet [ selectList ] [ %s"/$entity" / %s"/$delta" ]

entitySet = entitySetName *( containmentNavigation ) [ "/" qualifiedEntityTypeName ]

containmentNavigation = keyPredicate [ "/" qualifiedEntityTypeName ] navigation
containmentNavigation = contextKeyPredicate [ "/" qualifiedEntityTypeName ] navigation
navigation = *( "/" complexProperty [ "/" qualifiedComplexTypeName ] ) "/" navigationProperty

selectList = OPEN [ selectListItem *( COMMA selectListItem ) ] CLOSE
selectListItem = STAR ; all structural properties
contextKeyPredicate = "(" ( contextKeyValue / contextKeyValuePair *( "," contextKeyValuePair ) ) ")"
contextKeyValuePair = ( primitiveKeyProperty / keyPropertyAlias ) EQ contextKeyValue
contextKeyValue = boolean
/ guid
/ dateTimeOffsetValue
/ date
/ timeOfDayValue
/ decimalValue
/ sbyteValue
/ byte
/ int16Value
/ int32Value
/ int64Value
/ stringValue
/ durationValue
/ enumValue
stringValue = %x27 *( %x00-26 / %x27 %x27 / %x28-FF) %x27 ; SQUOTE = %x27

selectList = "(" [ selectListItem *( "," selectListItem ) ] ")"
selectListItem = "*" ; all structural properties
/ allOperationsInSchema
/ [ ( qualifiedEntityTypeName / qualifiedComplexTypeName ) "/" ]
( qualifiedActionName
Expand All @@ -469,7 +501,7 @@ contextPropertyPath = primitiveProperty
/ complexProperty [ [ "/" qualifiedComplexTypeName ] "/" contextPropertyPath ]

qualifiedActionName = namespace "." action
qualifiedFunctionName = namespace "." function [ OPEN parameterNames CLOSE ]
qualifiedFunctionName = namespace "." function [ "(" parameterName *( "," parameterName ) ")" ]

complexAnnotationInFragment = annotationInFragment ; complex-valued annotation
entityAnnotationInFragment = annotationInFragment ; entity-valued annotation
Expand Down Expand Up @@ -525,6 +557,9 @@ rootExpr = %s"$root/" ( entitySetName [ collectionNavigationExpr ]

firstMemberExpr = memberExpr
/ inscopeVariableExpr [ "/" memberExpr ]
/ "$" request-id "/" memberExpr ; reference to single-valued response of earlier request
/ "$" request-id collectionNavigationExpr ; reference to collection-valued response of earlier request
/ "$" request-id

memberExpr = directMemberExpr
/ ( optionallyQualifiedEntityTypeName / optionallyQualifiedComplexTypeName ) "/" directMemberExpr
Expand Down Expand Up @@ -574,7 +609,7 @@ filterExpr = %s"/$filter" OPEN boolCommonExpr CLOSE
complexColPathExpr = collectionPathExpr
/ "/" optionallyQualifiedComplexTypeName [ collectionPathExpr ]

collectionPathExpr = count [ OPEN expandCountOption *( SEMI expandCountOption ) CLOSE ]
collectionPathExpr = count [ OPEN countOption *( SEMI countOption ) CLOSE ]
/ filterExpr [ collectionPathExpr ]
/ "/" anyExpr
/ "/" allExpr
Expand Down Expand Up @@ -647,7 +682,7 @@ containsMethodCallExpr = "contains" OPEN BWS commonExpr BWS COMMA BW
endsWithMethodCallExpr = "endswith" OPEN BWS commonExpr BWS COMMA BWS commonExpr BWS CLOSE
indexOfMethodCallExpr = "indexof" OPEN BWS commonExpr BWS COMMA BWS commonExpr BWS CLOSE
lengthMethodCallExpr = "length" OPEN BWS commonExpr BWS CLOSE
matchesPatternMethodCallExpr = "matchesPattern" OPEN BWS commonExpr BWS COMMA BWS commonExpr BWS CLOSE
matchesPatternMethodCallExpr = "matchesPattern" OPEN BWS commonExpr BWS COMMA BWS commonExpr BWS [ COMMA BWS commonExpr BWS ] CLOSE
startsWithMethodCallExpr = "startswith" OPEN BWS commonExpr BWS COMMA BWS commonExpr BWS CLOSE
substringMethodCallExpr = "substring" OPEN BWS commonExpr BWS COMMA BWS commonExpr BWS [ COMMA BWS commonExpr BWS ] CLOSE
toLowerMethodCallExpr = "tolower" OPEN BWS commonExpr BWS CLOSE
Expand Down Expand Up @@ -1168,7 +1203,7 @@ COLON = ":" / "%3A"
COMMA = "," / "%2C"
EQ = "="
HASH = "%23" ; the # character is not allowed in the query part
SIGN = "+" / "%2B" / "-"
SIGN = "%2B" / "-"
SEMI = ";" / "%3B"
STAR = "*" / "%2A"
SQUOTE = "'" / "%27"
Expand Down Expand Up @@ -1260,6 +1295,9 @@ pct-encoded-unescaped = "%" ( "0" / "1" / "3" / "4" / "6" / "7" / "8" / "9"
pct-encoded-no-DQUOTE = "%" ( "0" / "1" / "3" / "4" / "5" / "6" / "7" / "8" / "9" / A-to-F ) HEXDIG
/ "%" "2" ( "0" / "1" / "3" / "4" / "5" / "6" / "7" / "8" / "9" / A-to-F )

pct-encoded-no-SP-DQUOTE = "%" ( "0" / "1" / "3" / "4" / "5" / "6" / "7" / "8" / "9" / A-to-F ) HEXDIG
/ "%" "2" ( "1" / "3" / "4" / "5" / "6" / "7" / "8" / "9" / A-to-F )


;------------------------------------------------------------------------------
; B. IRI syntax [RFC3987]
Expand Down
Loading