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

ODATA-1583 #106

Merged
merged 21 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 39 additions & 9 deletions abnf/odata-abnf-construction-rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,23 @@ keyPredicate = simpleKey / compoundKey / keyPathSegments
simpleKey = OPEN ( parameterAlias / keyPropertyValue ) CLOSE
compoundKey = OPEN keyValuePair *( COMMA keyValuePair ) CLOSE
keyValuePair = ( primitiveKeyProperty / keyPropertyAlias ) EQ ( parameterAlias / keyPropertyValue )
keyPropertyValue = primitiveLiteral
keyPropertyAlias = odataIdentifier
keyPathSegments = 1*( "/" keyPathLiteral )
keyPathLiteral = *pchar
keyPropertyValue = booleanValue
/ guidValue
/ dateTimeOffsetValueInUrl
/ dateValue
/ timeOfDayValueInUrl
/ decimalValue
/ sbyteValue
/ byteValue
/ int16Value
/ int32Value
/ int64Value
/ string ; single-quoted
/ duration
/ enum

singleNavigation = singleNavPath
/ "/" optionallyQualifiedEntityTypeName [ singleNavPath ]
Expand Down Expand Up @@ -429,13 +442,30 @@ 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 ]
ralfhandl marked this conversation as resolved.
Show resolved Hide resolved
/ entitySet [ selectList ] [ %s"/$entity" / %s"/$delta" ]

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

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

contextKeyPredicate = OPEN ( contextKeyValue / contextKeyValuePair *( COMMA contextKeyValuePair ) ) CLOSE
contextKeyValuePair = ( primitiveKeyProperty / keyPropertyAlias ) EQ contextKeyValue
contextKeyValue = booleanValue
/ guidValue
/ dateTimeOffsetValue ; TODO: no percent-encoding in SIGN
/ dateValue
/ timeOfDayValue
/ decimalValue ; TODO: no percent-encoding in SIGN
/ sbyteValue ; TODO: no percent-encoding in SIGN
/ byteValue
/ int16Value ; TODO: no percent-encoding in SIGN
/ int32Value ; TODO: no percent-encoding in SIGN
/ int64Value ; TODO: no percent-encoding in SIGN
/ string ; TODO: no percent-encoding
ralfhandl marked this conversation as resolved.
Show resolved Hide resolved
/ duration ; TODO: no percent-encoding in SIGN
/ enum ; TODO: no percent-encoding in SIGN

selectList = OPEN [ selectListItem *( COMMA selectListItem ) ] CLOSE
selectListItem = STAR ; all structural properties
Expand Down Expand Up @@ -893,7 +923,7 @@ primitiveLiteral = nullValue ; plain values up to int64Value
/ string ; single-quoted
/ duration
/ enum
/ binary ; all others are quoted and prefixed
/ binary ; all others are quoted and prefixed
/ geographyCollection
/ geographyLineString
/ geographyMultiLineString
Expand All @@ -908,8 +938,8 @@ primitiveLiteral = nullValue ; plain values up to int64Value
/ geometryMultiPolygon
/ geometryPoint
/ geometryPolygon
; in Atom and JSON message bodies and CSDL DefaultValue attributes

; in Atom and JSON message bodies and CSDL DefaultValue attributes
primitiveValue = booleanValue
/ guidValue
/ durationValue
Expand Down Expand Up @@ -937,9 +967,9 @@ primitiveValue = booleanValue
; - any XML string for strings in Atom and CSDL documents
; - any JSON string for JSON documents

nullValue = %s"null"
nullValue = %s"null"

; base64url encoding according to http://tools.ietf.org/html/rfc4648#section-5
; base64url encoding according to http://tools.ietf.org/html/rfc4648#section-5
binary = "binary" SQUOTE binaryValue SQUOTE
binaryValue = *(4base64char) [ base64b16 / base64b8 ]
base64b16 = 2base64char ( %s"A" / %s"E" / %s"I" / %s"M" / %s"Q" / %s"U" / %s"Y" / %s"c" / %s"g" / %s"k" / %s"o" / %s"s" / %s"w" / %s"0" / %s"4" / %s"8" ) [ "=" ]
Expand Down
9 changes: 9 additions & 0 deletions abnf/odata-abnf-testcases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Constraints:
- ProductsByCustomer
- ProductsOrderedBy
entityColNavigationProperty:
- Details
- DirectReports
- Items
- Orders
Expand Down Expand Up @@ -3375,10 +3376,18 @@ TestCases:
Rule: context
Input: "#Customers('ALFKI')/Orders"

- Name: Context URL - collection with containment, key value without percent-encoding
Rule: context
Input: "#Customers('ALF/KI')/Orders"
ralfhandl marked this conversation as resolved.
Show resolved Hide resolved

- Name: Context URL - containment
Rule: context
Input: "#Customers('ALFKI')/Orders/$entity"

- Name: Context URL - containment - multi-part key
Rule: context
Input: "#OrderItems(OrderID=1,ItemID='a')/Details/$entity"

- Name: Context URL - collection with containment - multi-level
Rule: context
Input: "#Customers('ALFKI')/Orders(1)/Items"
Expand Down