diff --git a/.github/workflows/pdf.yml b/.github/workflows/pdf.yml index 65dddd807..42054800b 100644 --- a/.github/workflows/pdf.yml +++ b/.github/workflows/pdf.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - node-version: [18.x] + node-version: [20.x] steps: - uses: actions/checkout@v3 diff --git a/.vscode/settings.json b/.vscode/settings.json index 84e8e54ef..8ff1b738e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,6 +4,7 @@ "asec", "CSDL", "ETag", + "matchespattern", "odata", "pandoc", "subasec", diff --git a/README.md b/README.md index 038cb9cd6..8c382cb0e 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,18 @@ Documents are generated from Markdown sources using Node.js modules described [h 3. Download and install [git](https://git-scm.com/), verify via `git -v` 4. Optionally download and install [GitHub Desktop](https://desktop.github.com/) 5. Clone this repository -6. In the local repository folder run `npm install`, verify via `npm test` +6. In the local repository folder run `npm install`, verify via `npm test` + Repeat this step if the test fails with an error message like the following after upgrading to a new Chrome version: + ``` + 1 failing + + 1) OASIS doc build + Puppeteer: + Error: Could not find Chrome (ver. 116.0.5845.96). This can occur if either + 1. you did not perform an installation before running the script (e.g. `npm install`) or + 2. your cache path is incorrectly configured (which is: C:\Users\D024504\.cache\puppeteer). + For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration. + ``` ### Document preparation @@ -42,3 +53,9 @@ Documents are generated from Markdown sources using Node.js modules described [h - `npm run pdf` converts the HTML files to PDF - This is only necessary for publication to the [OASIS Library](https://www.oasis-open.org/standards/) + +## Published documents + +Title|Stage|Files|Published at +-----|-----|-----|------------ +OData Extension for Data Aggregation Version 4.0|Committee Specification 03|[Specification](https://github.com/oasis-tcs/odata-specs/tree/odata-data-aggregation-ext/V4.0_CS03/docs/odata-data-aggregation-ext) [Vocabulary](https://github.com/oasis-tcs/odata-vocabularies/tree/odata-data-aggregation-ext/V4.0_CS03/vocabularies) [ABNF](https://github.com/oasis-tcs/odata-abnf/tree/odata-data-aggregation-ext/V4.0_CS03/abnf)|[OASIS](https://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/cs03/) diff --git a/docs/odata-csdl-json/odata-csdl-json.html b/docs/odata-csdl-json/odata-csdl-json.html index 4f252c0b0..4eb79932b 100644 --- a/docs/odata-csdl-json/odata-csdl-json.html +++ b/docs/odata-csdl-json/odata-csdl-json.html @@ -142,12 +142,12 @@

Abstract:

OData services are described by an Entity Model (EDM). The Common Schema Definition Language (CSDL) defines specific representations of the entity data model exposed by an OData service, using XML, JSON, and other formats. This document (OData CSDL JSON Representation) specifically defines the JSON representation of CSDL.

Status:

-

This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical.

-

TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/.

-

This specification is provided under the RF on RAND Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php).

-

Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product's prose narrative document(s), the content in the separate plain text file prevails.

+

This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the “Latest stage” location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical.

+

TC members should send comments on this specification to the TC’s email list. Others should send comments to the TC’s public comment list, after subscribing to it by following the instructions at the “Send A Comment” button on the TC’s web page at https://www.oasis-open.org/committees/odata/.

+

This specification is provided under the RF on RAND Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC’s web page (https://www.oasis-open.org/committees/odata/ipr.php).

+

Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product’s prose narrative document(s), the content in the separate plain text file prevails.

Key words:

-

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

+

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

Citation format:

When referencing this specification the following citation format should be used:

[OData-CSDL-JSON-v4.02]

@@ -155,7 +155,7 @@

Citation format:

Notices

Copyright © OASIS Open 2023. All Rights Reserved.

Distributed under the terms of the OASIS IPR Policy.

-

The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs.

+

The name “OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs.

For complete copyright information please see the full Notices section in an Appendix below.


Table of Contents

@@ -191,9 +191,17 @@

Table of Contents

  • 3.1 Nominal Types
  • 3.2 Structured Types
  • 3.3 Primitive Types
  • -
  • 3.4 Built-In Abstract Types
  • -
  • 3.5 Built-In Types for defining Vocabulary Terms
  • -
  • 3.6 Annotations
  • +
  • 3.4 Type Facets +
  • +
  • 3.5 Built-In Abstract Types
  • +
  • 3.6 Built-In Types for defining Vocabulary Terms
  • +
  • 3.7 Annotations
  • 4 CSDL JSON Document
    -

    Example 88: Target expressions

    +

    Example 89: Target expressions

    MySchema.MyEntityContainer/MyEntitySet
     MySchema.MyEntityContainer/MySingleton
     MySchema.MyEntityContainer/MySingleton/MyContainmentNavigationProperty
    @@ -3213,272 +3299,271 @@ 

    16 CSDL Ex

    Following are two basic examples of valid EDM models as represented in CSDL JSON. These examples demonstrate many of the topics covered above.

    16.1 Products and Categories Example

    -

    Example 89:

    -
    {
    -  "$Version": "4.0",
    -  "$EntityContainer": "ODataDemo.DemoService",
    -  "$Reference": {
    -    "https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.json": {
    -      "$Include": [
    -        {
    -          "$Namespace": "Org.OData.Core.V1",
    -          "$Alias": "Core",
    -          "@Core.DefaultNamespace": true
    -        }
    -      ]
    -    },
    -    "https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Measures.V1.json": {
    -      "$Include": [
    -        {
    -          "$Namespace": "Org.OData.Measures.V1",
    -          "$Alias": "Measures"
    -        }
    -      ]
    -    }
    -  },
    -  "ODataDemo": {
    -    "$Alias": "self",
    -    "@Core.DefaultNamespace": true,
    -    "Product": {
    -      "$Kind": "EntityType",
    -      "$HasStream": true,
    -      "$Key": [
    -        "ID"
    -      ],
    -      "ID": {},
    -      "Description": {
    -        "$Nullable": true,
    -        "@Core.IsLanguageDependent": true
    -      },
    -      "ReleaseDate": {
    -        "$Nullable": true,
    -        "$Type": "Edm.Date"
    -      },
    -      "DiscontinuedDate": {
    -        "$Nullable": true,
    -        "$Type": "Edm.Date"
    -      },
    -      "Rating": {
    -        "$Nullable": true,
    -        "$Type": "Edm.Int32"
    -      },
    -      "Price": {
    -        "$Nullable": true,
    -        "$Type": "Edm.Decimal",
    -        "@Measures.ISOCurrency": {
    -          "$Path": "Currency"
    -        }
    -      },
    -      "Currency": {
    -        "$Nullable": true,
    -        "$MaxLength": 3
    -      },
    -      "Category": {
    -        "$Kind": "NavigationProperty",
    -        "$Type": "self.Category",
    -        "$Partner": "Products"
    -      },
    -      "Supplier": {
    -        "$Kind": "NavigationProperty",
    -        "$Nullable": true,
    -        "$Type": "self.Supplier",
    -        "$Partner": "Products"
    -      }
    -    },
    -    "Category": {
    -      "$Kind": "EntityType",
    -      "$Key": [
    -        "ID"
    -      ],
    -      "ID": {
    -        "$Type": "Edm.Int32"
    -      },
    -      "Name": {
    -        "@Core.IsLanguageDependent": true
    -      },
    -      "Products": {
    -        "$Kind": "NavigationProperty",
    -        "$Partner": "Category",
    -        "$Collection": true,
    -        "$Type": "self.Product",
    -        "$OnDelete": "Cascade"
    -      }
    -    },
    -    "Supplier": {
    -      "$Kind": "EntityType",
    -      "$Key": [
    -        "ID"
    -      ],
    -      "ID": {},
    -      "Name": {
    -        "$Nullable": true
    -      },
    -      "Address": {
    -        "$Type": "self.Address"
    -      },
    -      "Concurrency": {
    -        "$Type": "Edm.Int32"
    -      },
    -      "Products": {
    -        "$Kind": "NavigationProperty",
    -        "$Partner": "Supplier",
    -        "$Collection": true,
    -        "$Type": "self.Product"
    -      }
    -    },
    -    "Country": {
    -      "$Kind": "EntityType",
    -      "$Key": [
    -        "Code"
    -      ],
    -      "Code": {
    -        "$MaxLength": 2
    -      },
    -      "Name": {
    -        "$Nullable": true
    -      }
    -    },
    -    "Address": {
    -      "$Kind": "ComplexType",
    -      "Street": {
    -        "$Nullable": true
    -      },
    -      "City": {
    -        "$Nullable": true
    -      },
    -      "State": {
    -        "$Nullable": true
    -      },
    -      "ZipCode": {
    -        "$Nullable": true
    -      },
    -      "CountryName": {
    -        "$Nullable": true
    -      },
    -      "Country": {
    -        "$Kind": "NavigationProperty",
    -        "$Nullable": true,
    -        "$Type": "self.Country",
    -        "$ReferentialConstraint": {
    -          "CountryName": "Name"
    -        }
    -      }
    -    },
    -    "ProductsByRating": [
    -      {
    -        "$Kind": "Function",
    -        "$Parameter": [
    -          {
    -            "$Name": "Rating",
    -            "$Nullable": true,
    -            "$Type": "Edm.Int32"
    -          }
    -        ],
    -        "$ReturnType": {
    -          "$Collection": true,
    -          "$Type": "self.Product"
    -        }
    -      }
    -    ],
    -    "DemoService": {
    -      "$Kind": "EntityContainer",
    -      "Products": {
    -        "$Collection": true,
    -        "$Type": "self.Product",
    -        "$NavigationPropertyBinding": {
    -          "Category": "Categories"
    -        }
    -      },
    -      "Categories": {
    -        "$Collection": true,
    -        "$Type": "self.Category",
    -        "$NavigationPropertyBinding": {
    -          "Products": "Products"
    -        },
    -        "@Core.Description": "Product Categories"
    -      },
    -      "Suppliers": {
    -        "$Collection": true,
    -        "$Type": "self.Supplier",
    -        "$NavigationPropertyBinding": {
    -          "Products": "Products",
    -          "Address/Country": "Countries"
    -        },
    -        "@Core.OptimisticConcurrency": [
    -          "Concurrency"
    -        ]
    -      },
    -      "Countries": {
    -        "$Collection": true,
    -        "$Type": "self.Country"
    -      },
    -      "MainSupplier": {
    -        "$Type": "self.Supplier",
    -        "$NavigationPropertyBinding": {
    -          "Products": "Products"
    -        },
    -        "@Core.Description": "Primary Supplier"
    -      },
    -      "ProductsByRating": {
    -        "$EntitySet": "Products",
    -        "$Function": "self.ProductsByRating"
    -      }
    -    }
    -  }
    -}
    +

    Example 90:

    +
    {
    +  "$Version": "4.0",
    +  "$EntityContainer": "ODataDemo.DemoService",
    +  "$Reference": {
    +    "https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.json": {
    +      "$Include": [
    +        {
    +          "$Namespace": "Org.OData.Core.V1",
    +          "$Alias": "Core",
    +          "@Core.DefaultNamespace": true
    +        }
    +      ]
    +    },
    +    "https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Measures.V1.json": {
    +      "$Include": [
    +        {
    +          "$Namespace": "Org.OData.Measures.V1",
    +          "$Alias": "Measures"
    +        }
    +      ]
    +    }
    +  },
    +  "ODataDemo": {
    +    "$Alias": "self",
    +    "@Core.DefaultNamespace": true,
    +    "Product": {
    +      "$Kind": "EntityType",
    +      "$Key": [
    +        "ID"
    +      ],
    +      "ID": {},
    +      "Description": {
    +        "$Nullable": true,
    +        "@Core.IsLanguageDependent": true
    +      },
    +      "ReleaseDate": {
    +        "$Nullable": true,
    +        "$Type": "Edm.Date"
    +      },
    +      "DiscontinuedDate": {
    +        "$Nullable": true,
    +        "$Type": "Edm.Date"
    +      },
    +      "Rating": {
    +        "$Nullable": true,
    +        "$Type": "Edm.Int32"
    +      },
    +      "Price": {
    +        "$Nullable": true,
    +        "$Type": "Edm.Decimal",
    +        "@Measures.ISOCurrency": {
    +          "$Path": "Currency"
    +        }
    +      },
    +      "Currency": {
    +        "$Nullable": true,
    +        "$MaxLength": 3
    +      },
    +      "Category": {
    +        "$Kind": "NavigationProperty",
    +        "$Type": "self.Category",
    +        "$Partner": "Products"
    +      },
    +      "Supplier": {
    +        "$Kind": "NavigationProperty",
    +        "$Nullable": true,
    +        "$Type": "self.Supplier",
    +        "$Partner": "Products"
    +      }
    +    },
    +    "Category": {
    +      "$Kind": "EntityType",
    +      "$Key": [
    +        "ID"
    +      ],
    +      "ID": {
    +        "$Type": "Edm.Int32"
    +      },
    +      "Name": {
    +        "@Core.IsLanguageDependent": true
    +      },
    +      "Products": {
    +        "$Kind": "NavigationProperty",
    +        "$Partner": "Category",
    +        "$Collection": true,
    +        "$Type": "self.Product",
    +        "$OnDelete": "Cascade"
    +      }
    +    },
    +    "Supplier": {
    +      "$Kind": "EntityType",
    +      "$Key": [
    +        "ID"
    +      ],
    +      "ID": {},
    +      "Name": {
    +        "$Nullable": true
    +      },
    +      "Address": {
    +        "$Type": "self.Address"
    +      },
    +      "Concurrency": {
    +        "$Type": "Edm.Int32"
    +      },
    +      "Products": {
    +        "$Kind": "NavigationProperty",
    +        "$Partner": "Supplier",
    +        "$Collection": true,
    +        "$Type": "self.Product"
    +      }
    +    },
    +    "Country": {
    +      "$Kind": "EntityType",
    +      "$Key": [
    +        "Code"
    +      ],
    +      "Code": {
    +        "$MaxLength": 2
    +      },
    +      "Name": {
    +        "$Nullable": true
    +      }
    +    },
    +    "Address": {
    +      "$Kind": "ComplexType",
    +      "Street": {
    +        "$Nullable": true
    +      },
    +      "City": {
    +        "$Nullable": true
    +      },
    +      "State": {
    +        "$Nullable": true
    +      },
    +      "ZipCode": {
    +        "$Nullable": true
    +      },
    +      "CountryName": {
    +        "$Nullable": true
    +      },
    +      "Country": {
    +        "$Kind": "NavigationProperty",
    +        "$Nullable": true,
    +        "$Type": "self.Country",
    +        "$ReferentialConstraint": {
    +          "CountryName": "Name"
    +        }
    +      }
    +    },
    +    "ProductsByRating": [
    +      {
    +        "$Kind": "Function",
    +        "$Parameter": [
    +          {
    +            "$Name": "Rating",
    +            "$Nullable": true,
    +            "$Type": "Edm.Int32"
    +          }
    +        ],
    +        "$ReturnType": {
    +          "$Collection": true,
    +          "$Type": "self.Product"
    +        }
    +      }
    +    ],
    +    "DemoService": {
    +      "$Kind": "EntityContainer",
    +      "Products": {
    +        "$Collection": true,
    +        "$Type": "self.Product",
    +        "$NavigationPropertyBinding": {
    +          "Category": "Categories"
    +        }
    +      },
    +      "Categories": {
    +        "$Collection": true,
    +        "$Type": "self.Category",
    +        "$NavigationPropertyBinding": {
    +          "Products": "Products"
    +        },
    +        "@Core.Description": "Product Categories"
    +      },
    +      "Suppliers": {
    +        "$Collection": true,
    +        "$Type": "self.Supplier",
    +        "$NavigationPropertyBinding": {
    +          "Products": "Products",
    +          "Address/Country": "Countries"
    +        },
    +        "@Core.OptimisticConcurrency": [
    +          "Concurrency"
    +        ]
    +      },
    +      "Countries": {
    +        "$Collection": true,
    +        "$Type": "self.Country"
    +      },
    +      "MainSupplier": {
    +        "$Type": "self.Supplier",
    +        "$NavigationPropertyBinding": {
    +          "Products": "Products"
    +        },
    +        "@Core.Description": "Primary Supplier"
    +      },
    +      "ProductsByRating": {
    +        "$EntitySet": "Products",
    +        "$Function": "self.ProductsByRating"
    +      }
    +    }
    +  }
    +}

    16.2 Annotations for Products and Categories Example

    -

    Example 90:

    -
    {
    -  "$Version": "4.01",
    -  "$Reference": {
    -    "http://host/service/$metadata": {
    -      "$Include": [
    -        {
    -          "$Namespace": "ODataDemo",
    -          "$Alias": "target"
    -        }
    -      ]
    -    },
    -    "http://somewhere/Vocabulary/V1": {
    -      "$Include": [
    -        {
    -          "$Namespace": "Some.Vocabulary.V1",
    -          "$Alias": "Vocabulary1"
    -        }
    -      ]
    -    }
    -  },
    -  "External.Annotations": {
    -    "$Annotations": {
    -      "target.Supplier": {
    -        "@Vocabulary1.EMail": null,
    -        "@Vocabulary1.AccountID": {
    -          "$Path": "ID"
    -        },
    -        "@Vocabulary1.Title": "Supplier Info",
    -        "@Vocabulary1.DisplayName": {
    -          "$Apply": [
    -            {
    -              "$Path": "Name"
    -            },
    -            " in ",
    -            {
    -              "$Path": "Address/CountryName"
    -            }
    -          ],
    -          "$Function": "odata.concat"
    -        }
    -      },
    -      "target.Product": {
    -        "@Vocabulary1.Tags": [
    -          "MasterData"
    -        ]
    -      }
    -    }
    -  }
    -} ```
    +

    Example 91:

    +
    {
    +  "$Version": "4.01",
    +  "$Reference": {
    +    "http://host/service/$metadata": {
    +      "$Include": [
    +        {
    +          "$Namespace": "ODataDemo",
    +          "$Alias": "target"
    +        }
    +      ]
    +    },
    +    "http://somewhere/Vocabulary/V1": {
    +      "$Include": [
    +        {
    +          "$Namespace": "Some.Vocabulary.V1",
    +          "$Alias": "Vocabulary1"
    +        }
    +      ]
    +    }
    +  },
    +  "External.Annotations": {
    +    "$Annotations": {
    +      "target.Supplier": {
    +        "@Vocabulary1.EMail": null,
    +        "@Vocabulary1.AccountID": {
    +          "$Path": "ID"
    +        },
    +        "@Vocabulary1.Title": "Supplier Info",
    +        "@Vocabulary1.DisplayName": {
    +          "$Apply": [
    +            {
    +              "$Path": "Name"
    +            },
    +            " in ",
    +            {
    +              "$Path": "Address/CountryName"
    +            }
    +          ],
    +          "$Function": "odata.concat"
    +        }
    +      },
    +      "target.Product": {
    +        "@Vocabulary1.Tags": [
    +          "MasterData"
    +        ]
    +      }
    +    }
    +  }
    +}

    17 Conformance

    @@ -3515,207 +3600,211 @@
    [EPSG]

    European Petroleum Survey Group (EPSG). http://www.epsg.org/.

    [OData-ABNF]

    OData ABNF Construction Rules Version 4.02.
    -See link in "Additional artifacts" section on cover page.

    +See link in “Additional artifacts” section on cover page.

    [OData-CSDL]

    OData Common Schema Definition Language (CSDL) JSON Representation Version 4.02. This document.

    -

    OData Common Schema Definition Language (CSDL) XML Representation Version 4.02. See link in "Related work" section on cover page.

    +

    OData Common Schema Definition Language (CSDL) XML Representation Version 4.02. See link in “Related work” section on cover page.

    [OData-CSDL-Schema]

    OData CSDL JSON Schema.
    -See link in "Additional artifacts" section on cover page.

    +See link in “Additional artifacts” section on cover page.

    [OData-JSON]

    OData JSON Format Version 4.02.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-Protocol]

    OData Version 4.02 Part 1: Protocol.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-URL]

    OData Version 4.02 Part 2: URL Conventions.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-VocCore]

    OData Vocabularies Version 4.0: Core Vocabulary.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-VocMeasures]

    OData Vocabularies Version 4.0: Measures Vocabulary.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-VocValidation]

    OData Vocabularies Version 4.0: Validation Vocabulary.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [RFC2119]
    -

    Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.
    +

    Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels”, BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.
    https://www.rfc-editor.org/info/rfc2119.

    [RFC6570]
    -

    Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., and D. Orchard, “URI Template”, RFC 6570, March 2012.
    -http://tools.ietf.org/html/rfc6570.

    +

    Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., and D. Orchard, “URI Template”, RFC 6570, DOI 10.17487/RFC6570, March 2012.
    +https://www.rfc-editor.org/info/rfc6570.

    [RFC7493]
    -

    Bray, T., Ed., "The I-JSON Message Format", RFC7493, March 2015.
    -https://tools.ietf.org/html/rfc7493.

    +

    The I-JSON Message Format“, RFC 7493, DOI 10.17487/RFC7493, March 2015.
    +https://www.rfc-editor.org/info/rfc7493.

    [RFC8174]
    -

    Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017.
    -http://www.rfc-editor.org/info/rfc8174.

    +

    Leiba, B., “Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words”, BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017.
    +https://www.rfc-editor.org/info/rfc8174.

    [RFC8259]
    -

    Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", RFC 8259, December 2017.
    -http://tools.ietf.org/html/rfc8259.

    +

    Bray, T., Ed., “The JavaScript Object Notation (JSON) Data Interchange Format”, STD 90, RFC 8259, DOI 10.17487/RFC8259, December 2017.
    +https://www.rfc-editor.org/info/rfc8259.

    [XML-Schema-2]

    W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes. D. Peterson, S. Gao, C. M. Sperberg-McQueen, H. S. Thompson, P. V. Biron, A. Malhotra, Editors, W3C Recommendation, 5 April 2012.
    http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/. Latest version available at http://www.w3.org/TR/xmlschema11-2/.

    A.2 Informative References

    [OpenUI5]
    -

    OpenUI5 Version 1.40.10 - OData V4 Metadata JSON Format.
    +

    OpenUI5 Version 1.40.10 — OData V4 Metadata JSON Format.
    https://openui5.hana.ondemand.com/1.40.10/#docs/guide/87aac894a40640f89920d7b2a414499b.html.


    Appendix B. Table of JSON Objects and Members

    @@ -3828,14 +3917,14 @@

    Appendix E. Notices

    Copyright © OASIS Open 2023. All Rights Reserved.

    -

    All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The full Policy may be found at the OASIS website.

    +

    All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the “OASIS IPR Policy”). The full Policy may be found at the OASIS website.

    This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published, and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this section are included on all such copies and derivative works. However, this document itself may not be modified in any way, including by removing the copyright notice or references to OASIS, except as needed for the purpose of developing any document or deliverable produced by an OASIS Technical Committee (in which case the rules applicable to copyrights, as set forth in the OASIS IPR Policy, must be followed) or as required to translate it into languages other than English.

    The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.

    -

    This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

    +

    This document and the information contained herein is provided on an “AS IS” basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

    As stated in the OASIS IPR Policy, the following three paragraphs in brackets apply to OASIS Standards Final Deliverable documents (Committee Specification, Candidate OASIS Standard, OASIS Standard, or Approved Errata).

    [OASIS requests that any OASIS Party or any other party that believes it has patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable, to notify OASIS TC Administrator and provide an indication of its willingness to grant patent licenses to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this deliverable.]

    [OASIS invites any party to contact the OASIS TC Administrator if it is aware of a claim of ownership of any patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable by a patent holder that is not willing to provide a license to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this OASIS Standards Final Deliverable. OASIS may include such claims on its website, but disclaims any obligation to do so.]

    -

    [OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS' procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

    -

    The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark/ for above guidance.

    +

    [OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS’ procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

    +

    The name “OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark/ for above guidance.

    diff --git a/docs/odata-csdl-json/odata-csdl-json.md b/docs/odata-csdl-json/odata-csdl-json.md index a42be97a4..40502e256 100644 --- a/docs/odata-csdl-json/odata-csdl-json.md +++ b/docs/odata-csdl-json/odata-csdl-json.md @@ -61,7 +61,7 @@ OData services are described by an Entity Model (EDM). The Common Schema Definit #### Status: This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical. -TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "[Send A Comment](https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=odata)" button on the TC's web page at https://www.oasis-open.org/committees/odata/. +TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/. This specification is provided under the [RF on RAND Terms Mode](https://www.oasis-open.org/policies-guidelines/ipr/#RF-on-RAND-Mode) of the [OASIS IPR Policy](https://www.oasis-open.org/policies-guidelines/ipr/), the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php). @@ -113,9 +113,15 @@ For complete copyright information please see the full Notices section in an App - [3.1 Nominal Types](#NominalTypes) - [3.2 Structured Types](#StructuredTypes) - [3.3 Primitive Types](#PrimitiveTypes) - - [3.4 Built-In Abstract Types](#BuiltInAbstractTypes) - - [3.5 Built-In Types for defining Vocabulary Terms](#BuiltInTypesfordefiningVocabularyTerms) - - [3.6 Annotations](#Annotations) + - [3.4 Type Facets](#TypeFacets) + - [3.4.1 MaxLength](#MaxLength) + - [3.4.2 Precision](#Precision) + - [3.4.3 Scale](#Scale) + - [3.4.4 Unicode](#Unicode) + - [3.4.5 SRID](#SRID) + - [3.5 Built-In Abstract Types](#BuiltInAbstractTypes) + - [3.6 Built-In Types for defining Vocabulary Terms](#BuiltInTypesfordefiningVocabularyTerms) + - [3.7 Annotations](#Annotations) - [4 CSDL JSON Document](#CSDLJSONDocument) - [4.1 Reference](#Reference) - [4.2 Included Schema](#IncludedSchema) @@ -131,14 +137,8 @@ For complete copyright information please see the full Notices section in an App - [6.5 Key](#Key) - [7 Structural Property](#StructuralProperty) - [7.1 Type](#Type) - - [7.2 Type Facets](#TypeFacets) - - [7.2.1 Nullable](#Nullable) - - [7.2.2 MaxLength](#MaxLength) - - [7.2.3 Precision](#Precision) - - [7.2.4 Scale](#Scale) - - [7.2.5 Unicode](#Unicode) - - [7.2.6 SRID](#SRID) - - [7.2.7 Default Value](#DefaultValue) + - [7.2 Nullable](#Nullable) + - [7.3 Default Value](#DefaultValue) - [8 Navigation Property](#NavigationProperty) - [8.1 Navigation Property Type](#NavigationPropertyType) - [8.2 Nullable Navigation Property](#NullableNavigationProperty) @@ -257,6 +257,10 @@ modifications made necessary to fully cover OData CSDL Version 4.01. ## 1.1 Changes from Earlier Versions +Section | Feature / Change | Issue +--------|------------------|------ +[Section 14.4.1.2](#PathEvaluation)| New path evaluation rules for annotations targeting annotations and external targeting via container| [ODATA-1420](https://issues.oasis-open.org/browse/ODATA-1420) + ## 1.2 Glossary ### 1.2.1 Definitions of Terms @@ -294,7 +298,7 @@ All other text is normative unless otherwise labeled. Here is a customized command line which will generate HTML from this markdown file (named `odata-csdl-json-v4.02-csd01.md`). Line breaks are added for readability only: ``` -pandoc -f gfm+tex_math_dollars+fenced_divs +pandoc -f gfm+tex_math_dollars+fenced_divs+smart -t html -o odata-csdl-json-v4.02-csd01.html -c styles/markdown-styles-v1.7.3b.css @@ -559,17 +563,17 @@ Type|Meaning `Edm.Date` |Date without a time-zone offset `Edm.DateTimeOffset` |Date and time with a time-zone offset, no leap seconds `Edm.Decimal` |Numeric values with decimal representation -`Edm.Double` |IEEE 754 binary64 floating-point number (15-17 decimal digits) +`Edm.Double` |IEEE 754 binary64 floating-point number (15--17 decimal digits) `Edm.Duration` |Signed duration in days, hours, minutes, and (sub)seconds `Edm.Guid` |16-byte (128-bit) unique identifier `Edm.Int16` |Signed 16-bit integer `Edm.Int32` |Signed 32-bit integer `Edm.Int64` |Signed 64-bit integer `Edm.SByte` |Signed 8-bit integer -`Edm.Single` |IEEE 754 binary32 floating-point number (6-9 decimal digits) +`Edm.Single` |IEEE 754 binary32 floating-point number (6--9 decimal digits) `Edm.Stream` |Binary data stream `Edm.String` |Sequence of characters -`Edm.TimeOfDay` |Clock time 00:00-23:59:59.999999999999 +`Edm.TimeOfDay` |Clock time 00:00--23:59:59.999999999999 `Edm.Geography` |Abstract base type for all Geography types `Edm.GeographyPoint` |A point in a round-earth coordinate system `Edm.GeographyLineString` |Line string in a round-earth coordinate system @@ -614,7 +618,218 @@ representation of primitive type values in URLs and [OData-JSON](#ODataJSON) for the representation in requests and responses. -## 3.4 Built-In Abstract Types +## 3.4 Type Facets + +The facets in the following subsections modify or constrain the acceptable values of primitive typed model elements, +for example a [structural property](#StructuralProperty), +action or function [parameter](#Parameter), action or function [return type](#ReturnType), or [term](#Term). + +For single-valued model elements the facets apply to the value of the +model element. For collection-valued model elements the facets apply to the items +in the collection. + +### 3.4.1 MaxLength + +A positive integer value specifying the maximum length of a binary, +stream or string value. For binary or stream values this is the octet +length of the binary data, for string values it is the character length +(number of code points for Unicode). + +If no maximum length is specified, clients SHOULD expect arbitrary +length. + +::: {.varjson .rep} +### Type Facet Members +### `$MaxLength` + +The value of `$MaxLength` is a positive integer. + +Note: [OData-CSDL-XML](#ODataCSDL) defines a symbolic +value `max` that is only allowed in OData 4.0 responses. This symbolic +value is not allowed in CDSL JSON documents at all. Services MAY instead +specify the concrete maximum length supported for the type by the +service or omit the member entirely. +::: + + +### 3.4.2 Precision + +For a decimal value: the maximum number of significant decimal digits of +the model element's value; it MUST be a positive integer. + +For a temporal value (datetime-with-timezone-offset, duration, or +time-of-day): the number of decimal places allowed in the seconds +portion of the value; it MUST be a non-negative integer between zero and +twelve. + +Note: service authors SHOULD be aware that some clients are unable to +support a precision greater than 28 for decimal values and 7 for +temporal values. Client developers MUST be aware of the potential +for data loss when round-tripping values of greater precision. Updating +via `PATCH` and exclusively specifying modified values will reduce +the risk for unintended data loss. + +Note: model elements with duration values and a granularity less than seconds +(e.g. minutes, hours, days) can be annotated with term +[`Measures.DurationGranularity`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Measures.V1.md#DurationGranularity), +see [OData-VocMeasures](#ODataVocMeasures). + +::: {.varjson .rep} +### `$Precision` + +The value of `$Precision` is a number. + +Absence of `$Precision` means unspecified precision both for decimal and temporal values. +::: + +::: {.varjson .example} +Example 2: `Precision` facet applied to the `DateTimeOffset` type +```json +"SuggestedTimes": { + "$Type": "Edm.DateTimeOffset", + "$Collection": true, + "$Precision": 6 +} +``` +::: + + + +### 3.4.3 Scale + +A non-negative integer value specifying the maximum number of digits +allowed to the right of the decimal point, or one of the symbolic values +`floating` or `variable`. + +The value `floating` means that the decimal value represents a +decimal floating-point number whose number of significant digits is the +value of the [`Precision`](#Precision) facet. OData 4.0 responses MUST +NOT specify the value `floating`. + +The value `variable` means that the number of digits to the right of the +decimal point can vary from zero to the value of the +[`Precision`](#Precision) facet. + +An integer value means that the number of digits to the right of the +decimal point may vary from zero to the value of the `Scale` facet, and +the number of digits to the left of the decimal point may vary from one +to the value of the `Precision` facet minus the value of the `Scale` +facet. If `Precision` is equal to `Scale`, a single zero MUST precede +the decimal point. + +The value of `Scale` MUST be less than or equal to the value of +[`Precision`](#Precision). + +Note: if the underlying data store allows negative scale, services may +use a [`Precision`](#Precision) with the absolute value of the negative +scale added to the actual number of significant decimal digits, and +client-provided values may have to be rounded before being stored. + +::: {.varjson .rep} +### `$Scale` + +The value of `$Scale` is a number or a string with one of the symbolic +values `floating` or `variable`. + +Services SHOULD use lower-case values; clients SHOULD accept values in a +case-insensitive manner. + +Absence of `$Scale` means `variable`. +::: + +::: {.varjson .example} +Example 3: [`Precision`](#Precision)`=3` and `Scale=2`. +Allowed values: 1.23, 0.23, 3.14 and 0.7, not allowed values: 123, 12.3 +```json +"Amount32": { + "$Type": "Edm.Decimal", + "$Precision": 3, + "$Scale": 2 +} +``` +::: + +::: {.varjson .example} +Example 4: `Precision=2` equals `Scale`. +Allowed values: 0.23, 0.7, not allowed values: 1.23, 1.2 +```json +"Amount22": { + "$Type": "Edm.Decimal", + "$Precision": 2, + "$Scale": 2 +} +``` +::: + +::: {.varjson .example} +Example 5: `Precision=3` and a variable `Scale`. +Allowed values: 0.123, 1.23, 0.23, 0.7, 123 and 12.3, not allowed +values: 12.34, 1234 and 123.4 due to the limited precision. +```json +"Amount3v": { + "$Type": "Edm.Decimal", + "$Precision": 3 +} +``` +::: + +::: {.varjson .example} +Example 6: `Precision=7` and a floating `Scale`. +Allowed values: -1.234567e3, 1e-101, 9.999999e96, not allowed values: +1e-102 and 1e97 due to the limited precision. +```json +"Amount7f": { + "$Type": "Edm.Decimal", + "$Precision": 7, + "$Scale": "floating" +} +``` +::: + + + + + + +### 3.4.4 Unicode + +For a string-typed model element the `Unicode` facet indicates whether the it +might contain and accept string values with Unicode characters (code +points) beyond the ASCII character set. The value `false` indicates that +the it will only contain and accept string values with characters +limited to the ASCII character set. + +If no value is specified, the `Unicode` facet defaults to `true`. + +::: {.varjson .rep} +### `$Unicode` + +The value of `$Unicode` is one of the Boolean literals `true` or +`false`. Absence of the member means `true`. +::: + + +### 3.4.5 SRID + +For a geometry- or geography-typed model element the `SRID` facet identifies which +spatial reference system is applied to its values. + +The value of the `SRID` facet MUST be a non-negative integer or the +special value `variable`. If no value is specified, the facet defaults +to `0` for `Geometry` types or `4326` for `Geography` types. + +The valid values of the `SRID` facet and their meanings are as defined +by the European Petroleum Survey Group [EPSG](#_EPSG). + +::: {.varjson .rep} +### `$SRID` + +The value of `$SRID` is a string containing a number or the symbolic +value `variable`. +::: + + +## 3.5 Built-In Abstract Types The following built-in abstract types can be used within a model: - `Edm.PrimitiveType` @@ -652,15 +867,13 @@ be used anywhere a corresponding concrete type can be used, except: - cannot be used as the underlying type of a type definition or enumeration type. - `Collection(Edm.PrimitiveType)` - - cannot be used as the type of a property or term. - - cannot be used as the type of a parameter or the return type of - an action or function. + - cannot be used. - `Collection(Edm.Untyped)` - cannot be returned in a payload with an `OData-Version` header of `4.0`. Services should treat untyped properties as dynamic properties in `4.0` payloads. -## 3.5 Built-In Types for defining Vocabulary Terms +## 3.6 Built-In Types for defining Vocabulary Terms [Vocabulary terms](#VocabularyandAnnotation) can, in addition, use - `Edm.AnnotationPath` @@ -675,7 +888,7 @@ as the type of a primitive term, or the type of a property of a complex type (recursively) that is exclusively used as the type of a term. See section "[Path Expressions](#PathExpressions)" for details. -## 3.6 Annotations +## 3.7 Annotations Many parts of the model can be decorated with additional information using [annotations](#Annotation). Annotations are identified by their @@ -692,7 +905,7 @@ combination of term and qualifier. ::: {.varjson .rep} -### Document Object +### Document Object A CSDL JSON document consists of a single JSON object. This document object MUST contain the member `$Version`. @@ -702,17 +915,17 @@ It also MAY contain members for schemas. If the CSDL JSON document is the metadata document of an OData service, the document object MUST contain the member `$EntityContainer`. -### `$Version` +### `$Version` The value of `$Version` is a string containing either `4.0` or `4.01`. -### `$EntityContainer` +### `$EntityContainer` The value of `$EntityContainer` is the namespace-qualified name of the entity container of that service. This is the only place where a model element MUST be referenced with its namespace-qualified name and use of the alias-qualified name is not allowed. ::: ::: {.varjson .example} -Example 2: +Example 7: ```json { "$Version": "4.01", @@ -751,14 +964,14 @@ annotation is present, the `$schemaversion` system query option, defined referenced schema document. ::: {.varjson .rep} -### `$Reference` +### `$Reference` The value of `$Reference` is an object that contains one member per referenced CSDL document. The name of the pair is a URI for the referenced document. The URI MAY be relative to the document containing the `$Reference`. The value of each member is a reference object. -### Reference Object +### Reference Object The reference object MAY contain the members [`$Include`](#IncludedSchema) and @@ -767,7 +980,7 @@ The reference object MAY contain the members ::: ::: {.varjson .example} -Example 3: references to other CSDL documents +Example 8: references to other CSDL documents ```json { ... @@ -825,26 +1038,26 @@ An alias is only valid within the document in which it is declared; a referencing document may define its own aliases for included schemas. ::: {.varjson .rep} -### `$Include` +### `$Include` The value of `$Include` is an array. Array items are objects that MUST contain the member `$Namespace` and MAY contain the member `$Alias`. The item objects MAY contain [annotations](#Annotation). -### `$Namespace` +### `$Namespace` The value of `$Namespace` is a string containing the namespace of the included schema. -### `$Alias` +### `$Alias` The value of `$Alias` is a string containing the alias for the included schema. ::: ::: {.varjson .example} -Example 4: references to entity models containing definitions of +Example 9: references to entity models containing definitions of vocabulary terms ```json { @@ -922,27 +1135,27 @@ not interested in that particular target namespace, the consumer can opt not to inspect the referenced document. ::: {.varjson .rep} -### `$IncludeAnnotations` +### `$IncludeAnnotations` The value of `$IncludeAnnotations` is an array. Array items are objects that MUST contain the member `$TermNamespace` and MAY contain the members `$Qualifier` and `$TargetNamespace`. -### `$TermNamespace` +### `$TermNamespace` The value of `$TermNamespace` is a namespace. -### `$Qualifier` +### `$Qualifier` The value of `$Qualifier` is a simple identifier. -### `$TargetNamespace` +### `$TargetNamespace` The value of `$TargetNamespace` is a namespace. ::: ::: {.varjson .example} -Example 5: reference documents that contain annotations +Example 10: reference documents that contain annotations ```json { ... @@ -1015,7 +1228,7 @@ The namespace MUST NOT be one of the reserved values `Edm`, `odata`, `System`, or `Transient`. ::: {.varjson .rep} -### Schema Object +### Schema Object A schema is represented as a member of the document object whose name is the schema namespace. Its value is an object that MAY contain the @@ -1055,13 +1268,13 @@ The alias MUST NOT be one of the reserved values `Edm`, `odata`, `System`, or `Transient`. ::: {.varjson .rep} -### `$Alias` +### `$Alias` The value of `$Alias` is a string containing the alias for the schema. ::: ::: {.varjson .example} -Example 6: document defining a schema `org.example` with an alias and a +Example 11: document defining a schema `org.example` with an alias and a description for the schema ```json { @@ -1081,7 +1294,7 @@ description for the schema ## 5.2 Annotations with External Targeting ::: {.varjson .rep} -### `$Annotations` +### `$Annotations` The value of `$Annotations` is an object with one member per [annotation target](#Target). The member name is a path identifying the [annotation @@ -1090,7 +1303,7 @@ target](#Target), the member value is an object containing ::: ::: {.varjson .example} -Example 7: annotations targeting the `Person` type with qualifier +Example 12: annotations targeting the `Person` type with qualifier `Tablet` ```json "org.example": { @@ -1132,7 +1345,7 @@ the same name as one of the direct or indirect base types or derived types. ::: {.varjson .rep} -### Entity Type Object +### Entity Type Object An entity type is represented as a member of the schema object whose name is the unqualified name of the entity type and whose value is an @@ -1151,7 +1364,7 @@ properties](#NavigationProperty) as well as [annotations](#Annotation). ::: ::: {.varjson .example} -Example 8: a simple entity type +Example 13: a simple entity type ```json "Employee": { "$Kind": "EntityType", @@ -1184,13 +1397,13 @@ An entity type MUST NOT introduce an inheritance cycle by specifying a base type. ::: {.varjson .rep} -### `$BaseType` +### `$BaseType` The value of `$BaseType` is the qualified name of the base type. ::: ::: {.varjson .example} -Example 9: a derived entity type based on the previous example +Example 14: a derived entity type based on the previous example ```json "Manager": { "$Kind": "EntityType", @@ -1229,7 +1442,7 @@ An abstract entity type MUST NOT inherit from a non-abstract entity type. ::: {.varjson .rep} -### `$Abstract` +### `$Abstract` The value of `$Abstract` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. @@ -1253,7 +1466,7 @@ properties on instances of any structured type, see [OData-Protocol](#ODataProtocol). ::: {.varjson .rep} -### `$OpenType` +### `$OpenType` The value of `$OpenType` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. @@ -1282,9 +1495,9 @@ annotation with term see [OData-VocCore](#ODataVocCore). ::: {.varjson .rep} -### `$HasStream` +### `$HasStream` -The value of `$HasStream `is one of the Boolean literals `true` or +The value of `$HasStream` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. ::: @@ -1366,7 +1579,7 @@ used in the query part of URLs, where paths to properties don't require special encoding and are a standard constituent of expressions anyway. ::: {.varjson .rep} -### `$Key` +### `$Key` The value of `$Key` is an array with one item per key property. @@ -1379,7 +1592,7 @@ containing the path to the property. ::: ::: {.varjson .example} -Example 10: entity type with a simple key +Example 15: entity type with a simple key ```json "Category": { "$Kind": "EntityType", @@ -1398,7 +1611,7 @@ Example 10: entity type with a simple key ::: ::: {.varjson .example} -Example 11: entity type with a simple key referencing a property of a +Example 16: entity type with a simple key referencing a property of a [complex type](#ComplexType) ```json "Category": { @@ -1429,7 +1642,7 @@ Example 11: entity type with a simpl ::: ::: {.varjson .example} -Example 12: entity type with a composite key +Example 17: entity type with a composite key ```json "OrderLine": { "$Kind": "EntityType", @@ -1452,7 +1665,7 @@ Example 12: entity type with a composite key ::: example -Example 13 (based on [example 11](#complexkey)): requests to an entity set `Categories` +Example 18 (based on [example 16](#complexkey)): requests to an entity set `Categories` of type `Category` must use the alias ``` GET http://host/service/Categories(EntityInfoID=1) @@ -1460,7 +1673,7 @@ GET http://host/service/Categories(EntityInfoID=1) ::: ::: example -Example 14 (based on [example 11](#complexkey)): in a query part the value assigned to +Example 19 (based on [example 16](#complexkey)): in a query part the value assigned to the name attribute must be used ``` GET http://example.org/OData.svc/Categories?$filter=Info/ID le 100 @@ -1498,7 +1711,7 @@ Names are case-sensitive, but service authors SHOULD NOT choose names that differ only in case. ::: {.varjson .rep} -### Property Object +### Property Object Structural properties are represented as members of the object representing a structured type. The member name is the property name, @@ -1507,7 +1720,7 @@ the member value is an object. The property object MAY contain the member `$Kind` with a string value of `Property`. This member SHOULD be omitted to reduce document size. -It MAY contain the member [`$Type`](#Type), [`$Collection`](#Type), +It MAY contain the members [`$Type`](#Type), [`$Collection`](#Type), [`$Nullable`](#Nullable), [`$MaxLength`](#MaxLength), [`$Unicode`](#Unicode), [`$Precision`](#Precision), [`$Scale`](#Scale), [`$SRID`](#SRID), and [`$DefaultValue`](#DefaultValue). @@ -1516,7 +1729,7 @@ It also MAY contain [annotations](#Annotation). ::: ::: {.varjson .example} -Example 15: complex type with two properties `Dimension` and `Length` +Example 20: complex type with two properties `Dimension` and `Length` ```json "Measurement": { "$Kind": "ComplexType", @@ -1553,7 +1766,7 @@ term, defined in [OData-VocCore](#ODataVocCore), to specify that it supports inserting items into a specific ordinal position. ::: {.varjson .rep} -### `$Type` and `$Collection` +### `$Type` and `$Collection` For single-valued properties the value of `$Type` is the qualified name of the property's type. @@ -1567,7 +1780,7 @@ member SHOULD be omitted for string properties to reduce document size. ::: ::: {.varjson .example} -Example 16: property `Units` that can have zero or more strings as its +Example 21: property `Units` that can have zero or more strings as its value ```json "Units": { @@ -1578,21 +1791,13 @@ value -## 7.2 Type Facets - -Facets modify or constrain the acceptable values of a property. - -For single-valued properties the facets apply to the value of the -property. For collection-valued properties the facets apply to the items -in the collection. - -### 7.2.1 Nullable +## 7.2 Nullable A Boolean value specifying whether the property can have the value `null`. ::: {.varjson .rep} -### `$Nullable` +### `$Nullable` The value of `$Nullable` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. @@ -1600,228 +1805,23 @@ The value of `$Nullable` is one of the Boolean literals `true` or For single-valued properties the value `true` means that the property allows the `null` value. -For collection-valued properties the property value will always be a +For collection-valued properties the value will always be a collection that MAY be empty. In this case `$Nullable` applies to items of the collection and specifies whether the collection MAY contain `null` values. ::: -### 7.2.2 MaxLength - -A positive integer value specifying the maximum length of a binary, -stream or string value. For binary or stream values this is the octet -length of the binary data, for string values it is the character length -(number of code points for Unicode). - -If no maximum length is specified, clients SHOULD expect arbitrary -length. - -::: {.varjson .rep} -### `$MaxLength` - -The value of `$MaxLength` is a positive integer. - -Note: [OData-CSDL-XML](#ODataCSDL) defines a symbolic -value `max` that is only allowed in OData 4.0 responses. This symbolic -value is not allowed in CDSL JSON documents at all. Services MAY instead -specify the concrete maximum length supported for the type by the -service or omit the member entirely. -::: - - -### 7.2.3 Precision - -For a decimal value: the maximum number of significant decimal digits of -the property's value; it MUST be a positive integer. - -For a temporal value (datetime-with-timezone-offset, duration, or -time-of-day): the number of decimal places allowed in the seconds -portion of the value; it MUST be a non-negative integer between zero and -twelve. - -Note: service authors SHOULD be aware that some clients are unable to -support a precision greater than 28 for decimal properties and 7 for -temporal properties. Client developers MUST be aware of the potential -for data loss when round-tripping values of greater precision. Updating -via `PATCH` and exclusively specifying modified properties will reduce -the risk for unintended data loss. - -Note: duration properties supporting a granularity less than seconds -(e.g. minutes, hours, days) can be annotated with term -[`Measures.DurationGranularity`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Measures.V1.md#DurationGranularity), -see [OData-VocMeasures](#ODataVocMeasures). - -::: {.varjson .rep} -### `$Precision` +## 7.3 Default Value -The value of `$Precision` is a number. - -Absence of `$Precision` means arbitrary precision. -::: - -::: {.varjson .example} -Example 17: `Precision` facet applied to the `DateTimeOffset` type -```json -"SuggestedTimes": { - "$Type": "Edm.DateTimeOffset", - "$Collection": true, - "$Precision": 6 -} -``` -::: - - - -### 7.2.4 Scale - -A non-negative integer value specifying the maximum number of digits -allowed to the right of the decimal point, or one of the symbolic values -`floating` or `variable`. - -The value `floating` means that the decimal property represents a -decimal floating-point number whose number of significant digits is the -value of the [`Precision`](#Precision) facet. OData 4.0 responses MUST -NOT specify the value `floating`. - -The value `variable` means that the number of digits to the right of the -decimal point can vary from zero to the value of the -[`Precision`](#Precision) facet. - -An integer value means that the number of digits to the right of the -decimal point may vary from zero to the value of the `Scale` facet, and -the number of digits to the left of the decimal point may vary from one -to the value of the `Precision` facet minus the value of the `Scale` -facet. If `Precision` is equal to `Scale`, a single zero MUST precede -the decimal point. - -The value of `Scale` MUST be less than or equal to the value of -[`Precision`](#Precision). - -Note: if the underlying data store allows negative scale, services may -use a [`Precision`](#Precision) with the absolute value of the negative -scale added to the actual number of significant decimal digits, and -client-provided values may have to be rounded before being stored. - -::: {.varjson .rep} -### `$Scale` - -The value of `$Scale` is a number or a string with one of the symbolic -values `floating` or `variable`. - -Services SHOULD use lower-case values; clients SHOULD accept values in a -case-insensitive manner. - -Absence of `$Scale` means `variable`. -::: - -::: {.varjson .example} -Example 18: [`Precision`](#Precision)`=3` and `Scale=2`. -Allowed values: 1.23, 0.23, 3.14 and 0.7, not allowed values: 123, 12.3 -```json -"Amount32": { - "$Nullable": true, - "$Type": "Edm.Decimal", - "$Precision": 3, - "$Scale": 2 -} -``` -::: - -::: {.varjson .example} -Example 19: `Precision=2` equals `Scale`. -Allowed values: 0.23, 0.7, not allowed values: 1.23, 1.2 -```json -"Amount22": { - "$Nullable": true, - "$Type": "Edm.Decimal", - "$Precision": 2, - "$Scale": 2 -} -``` -::: - -::: {.varjson .example} -Example 20: `Precision=3` and a variable `Scale`. -Allowed values: 0.123, 1.23, 0.23, 0.7, 123 and 12.3, not allowed -values: 12.34, 1234 and 123.4 due to the limited precision. -```json -"Amount3v": { - "$Nullable": true, - "$Type": "Edm.Decimal", - "$Precision": 3 -} -``` -::: - -::: {.varjson .example} -Example 21: `Precision=7` and a floating `Scale`. -Allowed values: -1.234567e3, 1e-101, 9.999999e96, not allowed values: -1e-102 and 1e97 due to the limited precision. -```json -"Amount7f": { - "$Nullable": true, - "$Type": "Edm.Decimal", - "$Precision": 7, - "$Scale": "floating" -} -``` -::: - - - - - - -### 7.2.5 Unicode - -For a string property the `Unicode` facet indicates whether the property -might contain and accept string values with Unicode characters (code -points) beyond the ASCII character set. The value `false` indicates that -the property will only contain and accept string values with characters -limited to the ASCII character set. - -If no value is specified, the `Unicode` facet defaults to `true`. - -::: {.varjson .rep} -### `$Unicode` - -The value of `$Unicode` is one of the Boolean literals `true` or -`false`. Absence of the member means `true`. -::: - - -### 7.2.6 SRID - -For a geometry or geography property the `SRID` facet identifies which -spatial reference system is applied to values of the property on type -instances. - -The value of the `SRID` facet MUST be a non-negative integer or the -special value `variable`. If no value is specified, the facet defaults -to `0` for `Geometry` types or `4326` for `Geography` types. - -The valid values of the `SRID` facet and their meanings are as defined -by the European Petroleum Survey Group [EPSG](#_EPSG). - -::: {.varjson .rep} -### `$SRID` - -The value of `$SRID` is a string containing a number or the symbolic -value `variable`. -::: - - -### 7.2.7 Default Value - -A primitive or enumeration property MAY define a default value that is +A primitive- or enumeration-typed property MAY define a default value that is used if the property is not explicitly represented in an annotation or the body of a request or response. If no value is specified, the client SHOULD NOT assume a default value. ::: {.varjson .rep} -### `$DefaultValue` +### `$DefaultValue` The value of `$DefaultValue` is the type-specific JSON representation of the default value of the property, see @@ -1857,7 +1857,7 @@ Names are case-sensitive, but service authors SHOULD NOT choose names that differ only in case. ::: {.varjson .rep} -### Navigation Property Object +### Navigation Property Object Navigation properties are represented as members of the object representing a structured type. The member name is the property name, @@ -1940,7 +1940,7 @@ term, defined in [OData-VocCore](#ODataVocCore), to specify that it supports inserting items into a specific ordinal position. ::: {.varjson .rep} -### `$Type` and `$Collection` +### `$Type` and `$Collection` For single-valued navigation properties the value of `$Type` is the qualified name of the navigation property's type. @@ -1961,7 +1961,7 @@ Nullable MUST NOT be specified for a collection-valued navigation property, a collection is allowed to have zero items. ::: {.varjson .rep} -### `$Nullable` +### `$Nullable` The value of `$Nullable` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. @@ -2001,7 +2001,7 @@ navigation property is defined on a type derived from the type of the partner navigation property. ::: {.varjson .rep} -### `$Partner` +### `$Partner` The value of `$Partner` is a string containing the path to the partner navigation property. @@ -2076,7 +2076,7 @@ entity. This may lead to problems for clients if the contained entity can also be reached via a non-containment navigation path. ::: {.varjson .rep} -### `$ContainsTarget` +### `$ContainsTarget` The value of `$ContainsTarget` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. @@ -2095,10 +2095,10 @@ the target of the navigation). The type of the dependent property MUST match the type of the principal property, or both types MUST be complex types. -If the principle property references an entity, then the dependent +If the principal property references an entity, then the dependent property must reference the same entity. -If the principle property's value is a complex type instance, then the +If the principal property's value is a complex type instance, then the dependent property's value must be a complex type instance with the same properties, each with the same values. @@ -2109,7 +2109,7 @@ property and the principal property are not nullable, then the dependent property MUST NOT be nullable. ::: {.varjson .rep} -### `$ReferentialConstraint` +### `$ReferentialConstraint` The value of `$ReferentialConstraint` is an object with one member per referential constraint. The member name is the path to the dependent @@ -2186,7 +2186,7 @@ If no on-delete action is specified, the action taken by the service is not predictable by the client and could vary per entity. ::: {.varjson .rep} -### `$OnDelete` +### `$OnDelete` The value of `$OnDelete` is a string with one of the values `Cascade`, `None`, `SetNull`, or `SetDefault`. @@ -2242,7 +2242,7 @@ the same name as one of the direct or indirect base types or derived types. ::: {.varjson .rep} -### Complex Type Object +### Complex Type Object A complex type is represented as a member of the schema object whose name is the unqualified name of the complex type and whose value is an @@ -2313,7 +2313,7 @@ The rules for annotations of derived complex types are described in [section 14.2](#Annotation). ::: {.varjson .rep} -### `$BaseType` +### `$BaseType` The value of `$BaseType` is the qualified name of the base type. ::: @@ -2325,7 +2325,7 @@ A complex type MAY indicate that it is abstract and cannot have instances. ::: {.varjson .rep} -### `$Abstract` +### `$Abstract` The value of `$Abstract` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. @@ -2349,7 +2349,7 @@ properties on instances of any structured type, see [OData‑Protocol](#ODataProtocol). ::: {.varjson .rep} -### `$OpenType` +### `$OpenType` The value of `$OpenType` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. @@ -2377,7 +2377,7 @@ Enumeration types marked as flags allow values that consist of more than one enumeration member at a time. ::: {.varjson .rep} -### Enumeration Type Object +### Enumeration Type Object An enumeration type is represented as a member of the schema object whose name is the unqualified name of the enumeration type and whose @@ -2420,7 +2420,7 @@ An enumeration type MAY specify one of `Edm.Byte`, `Edm.SByte`, If not explicitly specified, `Edm.Int32` is used as the underlying type. ::: {.varjson .rep} -### `$UnderlyingType` +### `$UnderlyingType` The value of `$UnderlyingType` is the qualified name of the underlying type. @@ -2436,7 +2436,7 @@ If not explicitly specified, only one enumeration type member MAY be selected simultaneously. ::: {.varjson .rep} -### `$IsFlags` +### `$IsFlags` The value of `$IsFlags` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. @@ -2491,7 +2491,7 @@ selected members is the bitwise OR of the discrete numeric member values. ::: {.varjson .rep} -### Enumeration Member Object +### Enumeration Member Object Enumeration type members are represented as JSON object members, where the object member name is the enumeration member name and the object @@ -2545,7 +2545,7 @@ annotations with this term propagate to places where the annotated type definition is used, and whether they can be overridden. ::: {.varjson .rep} -### Type Definition Object +### Type Definition Object A type definition is represented as a member of the schema object whose name is the unqualified name of the type definition and whose value is @@ -2594,7 +2594,7 @@ The underlying type of a type definition MUST be a primitive type that MUST NOT be another type definition. ::: {.varjson .rep} -### `$UnderlyingType` +### `$UnderlyingType` The value of `$UnderlyingType` is the qualified name of the underlying type. @@ -2657,7 +2657,7 @@ schema. An unbound action MAY have the same name as a bound action. ::: {.varjson .rep} -### Action Overload Object +### Action Overload Object An action is represented as a member of the schema object whose name is the unqualified name of the action and whose value is an array. The @@ -2723,7 +2723,7 @@ disambiguate overloads for both bound and unbound functions, even if they specify the same underlying type. ::: {.varjson .rep} -### Function Overload Object +### Function Overload Object A function is represented as a member of the schema object whose name is the unqualified name of the function and whose value is an array. The @@ -2746,7 +2746,7 @@ explicitly indicated, it is unbound. Bound actions or functions are invoked on resources matching the type of the binding parameter. The binding parameter can be of any type, and it -MAY be [nullable](#Nullable). +MAY be nullable. Unbound actions are invoked from the entity container through an [action import](#ActionImport). @@ -2756,7 +2756,7 @@ Unbound functions are invoked as static functions within a common expression or from the entity container through a [function import](#FunctionImport). ::: {.varjson .rep} -### `$IsBound` +### `$IsBound` The value of `$IsBound` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. @@ -2783,7 +2783,7 @@ type-cast segment names the [qualified name](#QualifiedName) of the entity type that should be returned from the type cast. ::: {.varjson .rep} -### `$EntitySetPath` +### `$EntitySetPath` The value of `$EntitySetPath` is a string containing the entity set path. @@ -2801,7 +2801,7 @@ composable function, and with system query options as appropriate for the type returned by the composable function. ::: {.varjson .rep} -### `$IsComposable` +### `$IsComposable` The value of `$IsComposable` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. @@ -2813,7 +2813,7 @@ The value of `$IsComposable` is one of the Boolean literals `true` or The return type of an action or function overload MAY be any type in scope, or a collection of any type in scope. -The facets [`Nullable`](#Nullable), [`MaxLength`](#MaxLength), +The facets [`MaxLength`](#MaxLength), [`Precision`](#Precision), [`Scale`](#Scale), and [`SRID`](#SRID) can be used as appropriate to specify value restrictions of the return type, as well as the [`Unicode`](#Unicode) facet for 4.01 and greater payloads. @@ -2823,7 +2823,7 @@ For a collection-valued return type the facets apply to the items in the returned collection. ::: {.varjson .rep} -### `$ReturnType` +### `$ReturnType` The value of `$ReturnType` is an object. It MAY contain the members `$Type`, `$Collection`, `$Nullable`, [`$MaxLength`](#MaxLength), @@ -2832,7 +2832,7 @@ and [`$SRID`](#SRID). It also MAY contain [annotations](#Annotation). -### `$Type` and `$Collection` +### `$Type` and `$Collection` For single-valued return types the value of `$Type` is the qualified name of the returned type. @@ -2843,7 +2843,7 @@ present with the literal value `true`. Absence of the `$Type` member means the type is `Edm.String`. -### `$Nullable` +### `$Nullable` The value of `$Nullable` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. @@ -2888,12 +2888,12 @@ the parameter value is a collection, the facets apply to the items in the collection. ::: {.varjson .rep} -### `$Parameter` +### `$Parameter` The value of `$Parameter` is an array. The array contains one object per parameter. -### Parameter Object +### Parameter Object A parameter object MUST contain the member `$Name`, and it MAY contain the members `$Type`, `$Collection`, `$Nullable`, @@ -2902,11 +2902,11 @@ the members `$Type`, `$Collection`, `$Nullable`, Parameter objects MAY also contain [annotations](#Annotation). -### `$Name` +### `$Name` The value of `$Name` is a string containing the parameter name. -### `$Type` and `$Collection` +### `$Type` and `$Collection` For single-valued parameters the value of `$Type` is the qualified name of the accepted type. @@ -2917,7 +2917,7 @@ present with the literal value `true`. Absence of the `$Type` member means the type is `Edm.String`. -### `$Nullable` +### `$Nullable` The value of `$Nullable` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. @@ -3041,7 +3041,7 @@ import*](#ActionImport) is used to expose a function or action defined in an entity model as a top level resource. ::: {.varjson .rep} -### Entity Container Object +### Entity Container Object An entity container is represented as a member of the schema object whose name is the unqualified name of the entity container and whose @@ -3122,7 +3122,7 @@ containers. Clients should be prepared to process cycles introduced by extending entity containers. ::: {.varjson .rep} -### `$Extends` +### `$Extends` The value of `$Extends` is the qualified name of the entity container to be extended. @@ -3164,7 +3164,7 @@ Entity sets that cannot be queried without specifying additional query options SHOULD NOT be included in the service document. ::: {.varjson .rep} -### Entity Set Object +### Entity Set Object An entity set is represented as a member of the entity container object whose name is the name of the entity set and whose value is an object. @@ -3176,15 +3176,15 @@ It MAY contain the members `$IncludeInServiceDocument` and [`$NavigationPropertyBinding`](#NavigationPropertyBinding) as well as [annotations](#Annotation). -### `$Collection` +### `$Collection` The value of `$Collection` is the Booelan value `true`. -### `$Type` +### `$Type` The value of `$Type` is the qualified name of an entity type. -### `$IncludeInServiceDocument` +### `$IncludeInServiceDocument` The value of `$IncludeInServiceDocument` is one of the Boolean literals `true` or `false`. Absence of the member means `true`. @@ -3204,7 +3204,7 @@ A singleton MUST specify a type that MUST be an entity type in scope. A singleton MUST reference an instance its entity type. ::: {.varjson .rep} -### Singleton Object +### Singleton Object A singleton is represented as a member of the entity container object whose name is the name of the singleton and whose value is an object. @@ -3216,11 +3216,11 @@ It MAY contain the member [`$NavigationPropertyBinding`](#NavigationPropertyBinding) as well as [annotations](#Annotation). -### `$Type` +### `$Type` The value of `$Type` is the qualified name of an entity type. -### `$Nullable` +### `$Nullable` The value of `$Nullable` is one of the Boolean literals `true` or `false`. Absence of the member means `false`.In OData 4.0 responses this @@ -3234,10 +3234,10 @@ If the entity type of an entity set or singleton declares navigation properties, a navigation property binding allows describing which entity set or singleton will contain the related entities. -An [entity set](#EntitySet) or a [singleton](#Singleton) SHOULD specify -a navigation property binding for each [navigation -property](#NavigationProperty) of its entity type, including navigation -properties defined on complex typed properties or derived types. +An [entity set](#EntitySet) or a [singleton](#Singleton) SHOULD contain a navigation +property binding for each non-containment navigation property that can be reached +from the entity type through a sequence of type casts, complex properties, +or containment navigation properties. If omitted, clients MUST assume that the target entity set or singleton can vary per related entity. @@ -3300,7 +3300,7 @@ before ending in a containment navigation property, and there MUST NOT be any non-containment navigation properties prior to the final segment. ::: {.varjson .rep} -### `$NavigationPropertyBinding` +### `$NavigationPropertyBinding` The value of `$NavigationPropertyBinding` is an object. It consists of members whose name is the navigation property binding path and whose @@ -3374,7 +3374,7 @@ container. If a [target path](#TargetPath) is specified, it MUST resolve to an entity set in scope. ::: {.varjson .rep} -### Action Import Object +### Action Import Object An action import is represented as a member of the entity container object whose name is the name of the action import and whose value is an @@ -3386,12 +3386,12 @@ It MAY contain the member `$EntitySet`. It MAY also contain [annotations](#Annotation). -### `$Action` +### `$Action` The value of `$Action` is a string containing the qualified name of an unbound action. -### `$EntitySet` +### `$EntitySet` The value of `$EntitySet` is a string containing either the unqualified name of an entity set in the same entity container or a path to an @@ -3424,7 +3424,7 @@ is included in the service document. If not explicitly indicated, it is not included. ::: {.varjson .rep} -### Function Import Object +### Function Import Object A function import is represented as a member of the entity container object whose name is the name of the function import and whose value is @@ -3436,18 +3436,18 @@ It MAY contain the members `$EntitySet` and `$IncludeInServiceDocument`. It MAY also contain [annotations](#Annotation). -### `$Function` +### `$Function` The value of `$Function` is a string containing the qualified name of an unbound function. -### `$EntitySet` +### `$EntitySet` The value of `$EntitySet` is a string containing either the unqualified name of an entity set in the same entity container or a path to an entity set in a different entity container. -### `$IncludeInServiceDocument` +### `$IncludeInServiceDocument` The value of `$IncludeInServiceDocument` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. @@ -3564,7 +3564,7 @@ The term's type MUST be a type in scope, or a collection of a type in scope. ::: {.varjson .rep} -### Term Object +### Term Object A term is represented as a member of the schema object whose name is the unqualified name of the term and whose value is an object. @@ -3572,15 +3572,16 @@ unqualified name of the term and whose value is an object. The term object MUST contain the member `$Kind` with a string value of `Term`. -It MAY contain the members `$Type`, `$Collection`, -[`$AppliesTo`](#Applicability), [`$Nullable`](#Nullable), +It MAY contain the members `$Type`, `$Collection`, `$Nullable`, `$DefaultValue`, +[`$BaseTerm`](#SpecializedTerm), +[`$AppliesTo`](#Applicability), [`$MaxLength`](#MaxLength), [`$Precision`](#Precision), -[`$Scale`](#Scale), [`$SRID`](#SRID), and `$DefaultValue`, as well as +[`$Scale`](#Scale), and [`$SRID`](#SRID), as well as [`$Unicode`](#Unicode) for 4.01 and greater payloads. It MAY contain [annotations](#Annotation). -### `$Type` and `$Collection` +### `$Type` and `$Collection` For single-valued terms the value of `$Type` is the qualified name of the term's type. @@ -3591,7 +3592,20 @@ with the literal value `true`. Absence of the `$Type` member means the type is `Edm.String`. -### `$DefaultValue` +### `$Nullable` + +The value of `$Nullable` is one of the Boolean literals `true` or +`false`. Absence of the member means `false`. + +For single-valued terms the value `true` means that annotations may have +the `null` value. + +For collection-valued terms the annotation value will always be a +collection that MAY be empty. In this case `$Nullable` applies to items +of the collection and specifies whether the collection MAY contain +`null` values. + +### `$DefaultValue` The value of `$DefaultValue` is the type-specific JSON representation of the default value of the term, see @@ -3613,7 +3627,7 @@ with the same qualifier, and so on until a term without a base term is reached. ::: {.varjson .rep} -### `$BaseTerm` +### `$BaseTerm` The value of `$BaseTerm` is the qualified name of the base term. ::: @@ -3666,7 +3680,7 @@ Symbolic Value|Model Element `UrlRef` |UrlRef annotation expression ::: {.varjson .rep} -### `$AppliesTo` +### `$AppliesTo` The value of `$AppliesTo` is an array whose items are strings containing symbolic values from the table above that identify model elements the @@ -3709,7 +3723,7 @@ an annotation value is a [path expression](#ValuePath) that refers to a property of the same or a related structured type. ::: {.varjson .rep} -### Annotation Member +### Annotation Member An annotation is represented as a member whose name consists of an at (`@`) character, followed by the qualified name of a term, optionally @@ -4301,56 +4315,159 @@ Addresses/-1/Street #### 14.4.1.2 Path Evaluation -Annotations MAY be embedded within their target, or specified -separately, e.g. as part of a different schema, and specify a path to -their target model element. The latter situation is referred to as -*targeting* in the remainder of this section. - -For annotations embedded within or targeting an entity container, the -path is evaluated starting at the entity container, i.e. an empty path -resolves to the entity container, and non-empty paths MUST start with a -segment identifying a container child (entity set, function import, -action import, or singleton). The subsequent segments follow the rules -for paths targeting the corresponding child element. - -For annotations embedded within or targeting an entity set or a -singleton, the path is evaluated starting at the entity set or -singleton, i.e. an empty path resolves to the entity set or singleton, -and non-empty paths MUST follow the rules for annotations targeting the -declared entity type of the entity set or singleton. - -For annotations embedded within or targeting an entity type or complex -type, the path is evaluated starting at the type, i.e. an empty path -resolves to the type, and the first segment of a non-empty path MUST be -a structural or navigation property of the type, a [type -cast](#TypeCast), or a [term cast](#TermCast). - -For annotations embedded within a structural or navigation property of -an entity type or complex type, the path is evaluated starting at the -directly enclosing type. This allows e.g. specifying the value of an -annotation on one property to be calculated from values of other -properties of the same type. An empty path resolves to the enclosing -type, and non-empty paths MUST follow the rules for annotations -targeting the directly enclosing type. - -For annotations targeting a structural or navigation property of an -entity type or complex type, the path is evaluated starting at the -*outermost* entity type or complex type named in the target of the -annotation, i.e. an empty path resolves to the outermost type, and the -first segment of a non-empty path MUST be a structural or navigation -property of the outermost type, a [type cast](#TypeCast), or a [term -cast](#TermCast). - -For annotations embedded within or targeting an action, action import, -function, function import, parameter, or return type, the first segment -of the path MUST be a parameter name or `$ReturnType`. +Annotations MAY be embedded within their target, or specified separately, +e.g. as part of a different schema, and specify a path to their target model +element. The latter situation is referred to as *targeting* in the remainder of +this section. + +The *host* of an annotation is the model element targeted by the annotation, +unless that target is another annotation or a model element (collection, +record or property value) directly or indirectly embedded within another +annotation, in which case the host is the host of that other annotation. + +If the value of an annotation is expressed dynamically with a path +expression, the path evaluation rules for this expression depend upon the +model element by which the annotation is hosted. + +For annotations hosted by an entity container, the path is evaluated starting +at the entity container, i.e. an empty path resolves to the entity container, +and non-empty paths MUST start with a segment identifying a container child +(entity set, function import, action import, or singleton). The subsequent +segments follow the rules for path expressions targeting the corresponding +child element. + +For annotations hosted by an entity set or a singleton, the path is evaluated +starting at the entity set or singleton, i.e. an empty path resolves to the +entity set or singleton, and non-empty paths MUST follow the rules for +annotations targeting the declared entity type of the entity set or singleton. + +For annotations hosted by an entity type or complex type, the path is +evaluated starting at the type, i.e. an empty path resolves to the type, and +the first segment of a non-empty path MUST be a structural or navigation +property of the type, a [type cast](#TypeCast), or a [term cast](#TermCast). + +For annotations hosted by an action, action import, function, function +import, parameter, or return type, the first segment of the path MUST be the +name of a parameter of the action or function or `$ReturnType`. + +For annotations hosted by a structural or navigation property, the path +evaluation rules additionally depend upon how the annotation target is +specified, as follows: + +1. If the annotation is directly or indirectly embedded within the hosting + property, the path is evaluated starting at the directly enclosing type of + the hosting property. This allows e.g. specifying the value of an + annotation on one property to be calculated from values of other properties + of the same enclosing type. An empty path resolves to the enclosing type, + and non-empty paths MUST follow the rules for annotations targeting the + directly enclosing type. + +2. If the annotation uses targeting and the target path starts with an entity + container, or the annotation is directly or indirectly embedded within such an + annotation, the path is evaluated starting at the declared type of the + hosting property. An empty path resolves to the declared type of the + property, and non-empty paths MUST follow the rules for annotations + targeting the declared type of the property. If the type is primitive, the + first segment of a non-empty path MUST be a [type cast](#TypeCast) or a + [term cast](#TermCast). + +3. If the annotation uses targeting and the target path does not start with + an entity container, or the annotation is directly or indirectly embedded + within such an annotation, the path is evaluated starting at the *outermost* + entity type or complex type named in the target path. This allows e.g. + specifying the value of an annotation on one property to be calculated from + values of other properties of the outermost type. An empty path resolves to + the outermost type, and the first segment of a non-empty path MUST be a + structural or navigation property of the outermost type, a [type cast](#TypeCast), + or a [term cast](#TermCast). + +::: example +Example 67: Annotations hosted by property `A2` in various modes + +Path evaluation for the annotations in the first block starts at the directly +enclosing type `self.A` of the hosting property `A2`. +:::: varjson +```json +"self": { + "A": { + "$Kind": "EntityType", + "A1": { + "$Type": "Edm.Boolean" + }, + "A2": { + "$Type": "self.B" + "@Core.Description@Core.IsLanguageDependent": { + "$Path": "A1" + }, + "@Core.Description": "..." + } + }, + "B": { + "$Kind": "ComplexType", + "B1": { + "$Type": "Edm.Boolean" + } + }, +``` +:::: + + +Path evaluation for the annotations in the next block starts at the declared +type `self.B` of the hosting property `A2`. +:::: varjson +```json + "Container": { + "$Kind": "EntityContainer", + "SetA": { + "$Collection": true, + "$Type": "self.A" + } + }, + "$Annotations": { + "self.Container/SetA/A2": { + "@Core.Description#viaset@Core.IsLanguageDependent": { + "$Path": "B1" + }, + "@Core.Description#viaset": "..." + }, + "self.Container/SetA/A2/@Core.Description#viaset": { + "@Core.IsLanguageDependent": { + "$Path": "B1" + } + }, +``` +:::: + + +Path evaluation for the annotations in the final block starts at the outermost +type `self.A` named in the target path. +:::: varjson +```json + "self.A/A2": { + "@Core.Description#external@Core.IsLanguageDependent": { + "$Path": "A1" + }, + "@Core.Description#external": "..." + }, + "self.A/A2/@Core.Description": { + "@Core.IsLanguageDependent": { + "$Path": "A1" + } + } + } +} +``` +:::: + + +::: #### 14.4.1.3 Annotation Path The annotation path expression provides a value for terms or term properties that specify the [built-in types](#BuiltInTypesfordefiningVocabularyTerms) -`Edm.AnnotationPath or Edm.ModelElementPath`. Its argument is a [model +`Edm.AnnotationPath` or `Edm.ModelElementPath`. Its argument is a [model path](#PathExpressions) with the following restriction: - A non-null path MUST resolve to an annotation. @@ -4369,7 +4486,7 @@ path. ::: ::: {.varjson .example} -Example 67: +Example 68: ```json "@UI.ReferenceFacet": "Product/Supplier/@UI.LineItem", "@UI.CollectionFacet#Contacts": [ @@ -4385,7 +4502,7 @@ Example 67: The model element path expression provides a value for terms or term properties that specify the [built-in -type](#BuiltInTypesfordefiningVocabularyTerms)` Edm.ModelElementPath`. Its +type](#BuiltInTypesfordefiningVocabularyTerms) `Edm.ModelElementPath`. Its argument is a [model path](#PathExpressions). The value of the model element path expression is the path itself, not @@ -4397,7 +4514,7 @@ path. ::: ::: {.varjson .example} -Example 68: +Example 69: ```json "@org.example.MyFavoriteModelElement": "/self.someAction" ``` @@ -4410,7 +4527,7 @@ Example 68: The navigation property path expression provides a value for terms or term properties that specify the [built-in types](#BuiltInTypesfordefiningVocabularyTerms) -`Edm.NavigationPropertyPath, Edm.AnyPropertyPath, or Edm.ModelElementPath`. +`Edm.NavigationPropertyPath`, `Edm.AnyPropertyPath`, or `Edm.ModelElementPath`. Its argument is a [model path](#PathExpressions) with the following restriction: - A non-null path MUST resolve to a model @@ -4426,7 +4543,7 @@ containing a path. ::: ::: {.varjson .example} -Example 69: +Example 70: ```json "@UI.HyperLink": "Supplier", @@ -4446,7 +4563,7 @@ Example 69: The property path expression provides a value for terms or term properties that specify one of the [built-in types](#BuiltInTypesfordefiningVocabularyTerms) -`Edm.PropertyPath, Edm.AnyPropertyPath, or Edm.ModelElementPath`. Its +`Edm.PropertyPath`, `Edm.AnyPropertyPath`, or `Edm.ModelElementPath`. Its argument is a [model path](#PathExpressions) with the following restriction: - A non-null path MUST resolve to a model @@ -4462,7 +4579,7 @@ Property path expressions are represented as a string containing a path. ::: ::: {.varjson .example} -Example 70: +Example 71: ```json "@UI.RefreshOnChangeOf": "ChangedAt", @@ -4489,14 +4606,14 @@ The value of the path expression is the instance or collection of instances identified by the path. ::: {.varjson .rep} -### `$Path` +### `$Path` Path expressions are represented as an object with a single member `$Path` whose value is a string containing a path. ::: ::: {.varjson .example} -Example 71: +Example 72: ```json "@UI.DisplayName": { "$Path": "FirstName" @@ -4542,7 +4659,7 @@ The other comparison operators require two operand expressions that evaluate to comparable values. ::: {.varjson .rep} -### `$And` and `$Or` +### `$And` and `$Or` The `And` and `Or` logical expressions are represented as an object with a single member whose value is an array with two annotation expressions. @@ -4550,14 +4667,14 @@ The member name is one of `$And`, or `$Or`. It MAY contain [annotations](#Annotation). -### `$Not` +### `$Not` Negation expressions are represented as an object with a single member `$Not` whose value is an annotation expression. It MAY contain [annotations](#Annotation). -### `$Eq`, `$Ne`, `$Gt`, `$Ge`, `$Lt`, `$Le`, `$Has`, and `$In` +### `$Eq`, `$Ne`, `$Gt`, `$Ge`, `$Lt`, `$Le`, `$Has`, and `$In` All comparison expressions are represented as an object with a single member whose value is an array with two annotation expressions. The @@ -4568,7 +4685,7 @@ They MAY contain [annotations](#Annotation). ::: ::: {.varjson .example} -Example 72: +Example 73: ```json { "$And": [ @@ -4661,7 +4778,8 @@ Example 72: "S" ] ] -} ``` +} +``` ::: @@ -4690,14 +4808,14 @@ to a numeric value. The other arithmetic operators require two operand expressions that evaluate to numeric values. ::: {.varjson .rep} -### `$Neg` +### `$Neg` Negation expressions are represented as an object with a single member `$Neg` whose value is an annotation expression. It MAY contain [annotations](#Annotation). -### `$Add`, `$Sub`, `$Mul`, `$Div`, `$DivBy`, and `$Mod` +### `$Add`, `$Sub`, `$Mul`, `$Div`, `$DivBy`, and `$Mod` These arithmetic expressions are represented as an object with as single member whose value is an array with two annotation expressions. The @@ -4708,7 +4826,7 @@ They MAY contain [annotations](#Annotation). ::: ::: {.varjson .example} -Example 73: +Example 74: ```json { "$Add": [ @@ -4788,7 +4906,7 @@ The operand expressions are used as parameters to the client-side function. ::: {.varjson .rep} -### `$Apply` +### `$Apply` Apply expressions are represented as an object with a member `$Apply` whose value is an array of annotation expressions, and a member @@ -4821,7 +4939,7 @@ are represented according to the appropriate alternative in the `binaryValue`, `Edm.Boolean` as `booleanValue` etc. ::: {.varjson .example} -Example 74: +Example 75: ```json "@UI.DisplayName": { "$Apply": [ @@ -4853,7 +4971,7 @@ the member name of the enumeration value. #### 14.4.4.2 Function `odata.fillUriTemplate` The `odata.fillUriTemplate` client-side function takes two or more -expressions as arguments and returns a value of type `Edm.String.` +expressions as arguments and returns a value of type `Edm.String`. The first argument MUST be of type `Edm.String` and specifies a URI template according to [RFC6570](#rfc6570), the other arguments MUST be @@ -4880,7 +4998,7 @@ types with two properties that are used in lexicographic order. The first property is used as key, the second property as value. ::: {.varjson .example} -Example 75: assuming there are no special characters in values of the +Example 76: assuming there are no special characters in values of the Name property of the Actor entity ```json { @@ -4903,6 +5021,7 @@ Name property of the Actor entity The `odata.matchesPattern` client-side function takes two string expressions as arguments and returns a Boolean value. +It is the counterpart of the identically named URL function [OData-URL, section 5.1.1.7.1](#ODataURL). The function returns true if the second expression evaluates to an [ECMAScript](#_ECMAScript) (JavaScript) regular expression and @@ -4911,7 +5030,7 @@ expression, using syntax and semantics of [ECMAScript](#_ECMAScript) regular expressions. ::: {.varjson .example} -Example 76: all non-empty `FirstName` values not containing the letters +Example 77: all non-empty `FirstName` values not containing the letters `b`, `c`, or `d` evaluate to `true` ```json { @@ -4929,7 +5048,7 @@ Example 76: all non-empty `FirstName` values not containing the letters #### 14.4.4.4 Function `odata.uriEncode` -The `odata.uriEncode `client-side function takes one argument of +The `odata.uriEncode` client-side function takes one argument of primitive type and returns the URL-encoded OData literal that can be used as a key value in OData URLs or in the query part of OData URLs. @@ -4937,7 +5056,7 @@ Note: string literals are surrounded by single quotes as required by the paren-style key syntax. ::: {.varjson .example} -Example 77: +Example 78: ```json { "$Apply": [ @@ -4968,7 +5087,7 @@ rules as the `cast` canonical function defined in [OData-URL](#ODataURL). ::: {.varjson .rep} -### `$Cast` +### `$Cast` Cast expressions are represented as an object with a member `$Cast` whose value is an annotation expression, a member `$Type` whose value is @@ -4986,7 +5105,7 @@ considered unspecified. ::: ::: {.varjson .example} -Example 78: +Example 79: ```json "@UI.Threshold": { "$Cast": { @@ -5013,7 +5132,7 @@ item expression within the collection expression. ::: ::: {.varjson .example} -Example 79: +Example 80: ```json "@seo.SeoTerms": [ "Product", @@ -5051,7 +5170,7 @@ third expression is present, nothing is added to the surrounding collection. ::: {.varjson .rep} -### `$If` +### `$If` Conditional expressions are represented as an object with a member `$If` whose value is an array of two or three annotation expressions. @@ -5060,7 +5179,7 @@ It MAY contain [annotations](#Annotation). ::: ::: {.varjson .example} -Example 80: the condition is a [value path expression](#ValuePath) +Example 81: the condition is a [value path expression](#ValuePath) referencing the Boolean property `IsFemale`, whose value then determines the value of the `$If` expression (or so it was long ago) ```json @@ -5086,7 +5205,7 @@ child expression is compatible with the specified type. It returns the specified type, and `false` otherwise. ::: {.varjson .rep} -### `$IsOf` +### `$IsOf` Is-of expressions are represented as an object with a member `$IsOf` whose value is an annotation expression, a member `$Type` whose value is @@ -5104,7 +5223,7 @@ considered unspecified. ::: ::: {.varjson .example} -Example 81: +Example 82: ```json "@Self.IsPreferredCustomer": { "$IsOf": { @@ -5133,7 +5252,7 @@ identifier](#SimpleIdentifier) value as its name that MUST be unique within the schema containing the expression. ::: {.varjson .rep} -### `$LabeledElement` +### `$LabeledElement` Labeled element expressions are represented as an object with a member `$LabeledElement` whose value is an annotation expression, and a member @@ -5143,7 +5262,7 @@ It MAY contain [annotations](#Annotation). ::: ::: {.varjson .example} -Example 82: +Example 83: ```json "@UI.DisplayName": { "$LabeledElement": { @@ -5164,7 +5283,7 @@ in scope and returns the value of the identified labeled element expression as its value. ::: {.varjson .rep} -### `$LabeledElementReference` +### `$LabeledElementReference` Labeled element reference expressions are represented as an object with a member `$LabeledElementReference` whose value is a string containing @@ -5172,7 +5291,7 @@ an qualified name. ::: ::: {.varjson .example} -Example 83: +Example 84: ```json "@UI.DisplayName": { "$LabeledElementReference": "self.CustomerFirstName" @@ -5193,21 +5312,21 @@ literal `null`. ::: ::: {.varjson .example} -Example 84: +Example 85: ```json "@UI.DisplayName": null, ``` ::: ::: {.varjson .rep} -### `$Null` +### `$Null` Null expression containing [annotations](#Annotations) are represented as an object with a member `$Null` whose value is the literal `null`. ::: ::: {.varjson .example} -Example 85: +Example 86: ```json "@UI.Address": { "$Null": null, @@ -5254,7 +5373,7 @@ Annotations for record members are prefixed with the member name. ::: ::: {.varjson .example} -Example 86: this annotation "morphs" the entity type from [example 8](#entitytype) into +Example 87: this annotation "morphs" the entity type from [example 13](#entitytype) into a structured type with two structural properties `GivenName` and `Surname` and two navigation properties `DirectSupervisor` and `CostCenter`. The first three properties simply rename properties of the @@ -5311,7 +5430,7 @@ expression MUST be type compatible with the type expected by the surrounding expression. ::: {.varjson .rep} -### `$UrlRef` +### `$UrlRef` URL reference expressions are represented as an object with a single member `$UrlRef` whose value is an annotation expression. @@ -5320,7 +5439,7 @@ It MAY contain [annotations](#Annotation). ::: ::: {.varjson .example} -Example 87: +Example 88: ```json "@org.example.person.Supplier": { "$UrlRef": { @@ -5404,7 +5523,7 @@ forward-slash separated property, navigation property, or type-cast segments ::: example -Example 88: Target expressions +Example 89: Target expressions ``` MySchema.MyEntityContainer/MyEntitySet MySchema.MyEntityContainer/MySingleton @@ -5425,7 +5544,7 @@ CSDL JSON. These examples demonstrate many of the topics covered above. ## 16.1 Products and Categories Example ::: {.varjson .example} -Example 89: +Example 90: ```json { "$Version": "4.0", @@ -5454,7 +5573,6 @@ Example 89: "@Core.DefaultNamespace": true, "Product": { "$Kind": "EntityType", - "$HasStream": true, "$Key": [ "ID" ], @@ -5647,7 +5765,7 @@ Example 89: ## 16.2 Annotations for Products and Categories Example ::: {.varjson .example} -Example 90: +Example 91: ```json { "$Version": "4.01", @@ -5697,7 +5815,8 @@ Example 90: } } } -} ``` +} +``` ::: @@ -5809,20 +5928,20 @@ _Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14 https://www.rfc-editor.org/info/rfc2119. ###### [RFC6570] -_Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., and D. Orchard, “URI Template”, RFC 6570, March 2012_. -http://tools.ietf.org/html/rfc6570. +_Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., and D. Orchard, "URI Template", RFC 6570, DOI 10.17487/RFC6570, March 2012_. +https://www.rfc-editor.org/info/rfc6570. ###### [RFC7493] -_Bray, T., Ed., "The I-JSON Message Format", RFC7493, March 2015_. -https://tools.ietf.org/html/rfc7493. +_The I-JSON Message Format", RFC 7493, DOI 10.17487/RFC7493, March 2015_. +https://www.rfc-editor.org/info/rfc7493. ###### [RFC8174] _Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_. -http://www.rfc-editor.org/info/rfc8174. +https://www.rfc-editor.org/info/rfc8174. ###### [RFC8259] -_Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", RFC 8259, December 2017_. -http://tools.ietf.org/html/rfc8259. +_Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, DOI 10.17487/RFC8259, December 2017_. +https://www.rfc-editor.org/info/rfc8259. ###### [XML-Schema-2] @@ -5832,7 +5951,7 @@ http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/. Latest version available ## A.2 Informative References ###### [OpenUI5] -_OpenUI5 Version 1.40.10 - OData V4 Metadata JSON Format_. +_OpenUI5 Version 1.40.10 --- OData V4 Metadata JSON Format_. https://openui5.hana.ondemand.com/1.40.10/#docs/guide/87aac894a40640f89920d7b2a414499b.html. ------- @@ -5840,121 +5959,123 @@ https://openui5.hana.ondemand.com/1.40.10/#docs/guide/87aac894a40640f89920d7b2a4 # Appendix B. Table of JSON Objects and Members ::: toc -- [Document Object](#DocumentObject1) - - [`$Version`](#Version1.1) - - [`$EntityContainer`](#EntityContainer1.2) - - [`$Reference`](#Reference1.3) -- [Reference Object](#ReferenceObject2) - - [`$Include`](#Include2.1) - - [`$Namespace`](#Namespace2.2) - - [`$Alias`](#Alias2.3) - - [`$IncludeAnnotations`](#IncludeAnnotations2.4) - - [`$TermNamespace`](#TermNamespace2.5) - - [`$Qualifier`](#Qualifier2.6) - - [`$TargetNamespace`](#TargetNamespace2.7) -- [Schema Object](#SchemaObject3) - - [`$Alias`](#Alias3.1) - - [`$Annotations`](#Annotations3.2) -- [Entity Type Object](#EntityTypeObject4) - - [`$BaseType`](#BaseType4.1) - - [`$Abstract`](#Abstract4.2) - - [`$OpenType`](#OpenType4.3) - - [`$HasStream`](#HasStream4.4) - - [`$Key`](#Key4.5) -- [Property Object](#PropertyObject5) - - [`$Type`](#Type5.1) - - [`$Collection`](#Collection5.2) - - [`$Nullable`](#Nullable5.3) - - [`$MaxLength`](#MaxLength5.4) - - [`$Precision`](#Precision5.5) - - [`$Scale`](#Scale5.6) - - [`$Unicode`](#Unicode5.7) - - [`$SRID`](#SRID5.8) - - [`$DefaultValue`](#DefaultValue5.9) -- [Navigation Property Object](#NavigationPropertyObject6) +- [Type Facet Members](#TypeFacetMembers1) + - [`$MaxLength`](#MaxLength1.1) + - [`$Precision`](#Precision1.2) + - [`$Scale`](#Scale1.3) + - [`$Unicode`](#Unicode1.4) + - [`$SRID`](#SRID1.5) +- [Document Object](#DocumentObject2) + - [`$Version`](#Version2.1) + - [`$EntityContainer`](#EntityContainer2.2) + - [`$Reference`](#Reference2.3) +- [Reference Object](#ReferenceObject3) + - [`$Include`](#Include3.1) + - [`$Namespace`](#Namespace3.2) + - [`$Alias`](#Alias3.3) + - [`$IncludeAnnotations`](#IncludeAnnotations3.4) + - [`$TermNamespace`](#TermNamespace3.5) + - [`$Qualifier`](#Qualifier3.6) + - [`$TargetNamespace`](#TargetNamespace3.7) +- [Schema Object](#SchemaObject4) + - [`$Alias`](#Alias4.1) + - [`$Annotations`](#Annotations4.2) +- [Entity Type Object](#EntityTypeObject5) + - [`$BaseType`](#BaseType5.1) + - [`$Abstract`](#Abstract5.2) + - [`$OpenType`](#OpenType5.3) + - [`$HasStream`](#HasStream5.4) + - [`$Key`](#Key5.5) +- [Property Object](#PropertyObject6) - [`$Type`](#Type6.1) - [`$Collection`](#Collection6.2) - [`$Nullable`](#Nullable6.3) - - [`$Partner`](#Partner6.4) - - [`$ContainsTarget`](#ContainsTarget6.5) - - [`$ReferentialConstraint`](#ReferentialConstraint6.6) - - [`$OnDelete`](#OnDelete6.7) -- [Complex Type Object](#ComplexTypeObject7) - - [`$BaseType`](#BaseType7.1) - - [`$Abstract`](#Abstract7.2) - - [`$OpenType`](#OpenType7.3) -- [Enumeration Type Object](#EnumerationTypeObject8) - - [`$UnderlyingType`](#UnderlyingType8.1) - - [`$IsFlags`](#IsFlags8.2) -- [Enumeration Member Object](#EnumerationMemberObject9) -- [Type Definition Object](#TypeDefinitionObject10) - - [`$UnderlyingType`](#UnderlyingType10.1) -- [Action Overload Object](#ActionOverloadObject11) -- [Function Overload Object](#FunctionOverloadObject12) - - [`$IsBound`](#IsBound12.1) - - [`$EntitySetPath`](#EntitySetPath12.2) - - [`$IsComposable`](#IsComposable12.3) - - [`$ReturnType`](#ReturnType12.4) - - [`$Type`](#Type12.5) - - [`$Collection`](#Collection12.6) - - [`$Nullable`](#Nullable12.7) - - [`$Parameter`](#Parameter12.8) -- [Parameter Object](#ParameterObject13) - - [`$Name`](#Name13.1) - - [`$Type`](#Type13.2) - - [`$Collection`](#Collection13.3) - - [`$Nullable`](#Nullable13.4) -- [Entity Container Object](#EntityContainerObject14) - - [`$Extends`](#Extends14.1) -- [Entity Set Object](#EntitySetObject15) - - [`$Collection`](#Collection15.1) - - [`$Type`](#Type15.2) - - [`$IncludeInServiceDocument`](#IncludeInServiceDocument15.3) -- [Singleton Object](#SingletonObject16) - - [`$Type`](#Type16.1) - - [`$Nullable`](#Nullable16.2) - - [`$NavigationPropertyBinding`](#NavigationPropertyBinding16.3) -- [Action Import Object](#ActionImportObject17) - - [`$Action`](#Action17.1) - - [`$EntitySet`](#EntitySet17.2) -- [Function Import Object](#FunctionImportObject18) - - [`$Function`](#Function18.1) + - [`$DefaultValue`](#DefaultValue6.4) +- [Navigation Property Object](#NavigationPropertyObject7) + - [`$Type`](#Type7.1) + - [`$Collection`](#Collection7.2) + - [`$Nullable`](#Nullable7.3) + - [`$Partner`](#Partner7.4) + - [`$ContainsTarget`](#ContainsTarget7.5) + - [`$ReferentialConstraint`](#ReferentialConstraint7.6) + - [`$OnDelete`](#OnDelete7.7) +- [Complex Type Object](#ComplexTypeObject8) + - [`$BaseType`](#BaseType8.1) + - [`$Abstract`](#Abstract8.2) + - [`$OpenType`](#OpenType8.3) +- [Enumeration Type Object](#EnumerationTypeObject9) + - [`$UnderlyingType`](#UnderlyingType9.1) + - [`$IsFlags`](#IsFlags9.2) +- [Enumeration Member Object](#EnumerationMemberObject10) +- [Type Definition Object](#TypeDefinitionObject11) + - [`$UnderlyingType`](#UnderlyingType11.1) +- [Action Overload Object](#ActionOverloadObject12) +- [Function Overload Object](#FunctionOverloadObject13) + - [`$IsBound`](#IsBound13.1) + - [`$EntitySetPath`](#EntitySetPath13.2) + - [`$IsComposable`](#IsComposable13.3) + - [`$ReturnType`](#ReturnType13.4) + - [`$Type`](#Type13.5) + - [`$Collection`](#Collection13.6) + - [`$Nullable`](#Nullable13.7) + - [`$Parameter`](#Parameter13.8) +- [Parameter Object](#ParameterObject14) + - [`$Name`](#Name14.1) + - [`$Type`](#Type14.2) + - [`$Collection`](#Collection14.3) + - [`$Nullable`](#Nullable14.4) +- [Entity Container Object](#EntityContainerObject15) + - [`$Extends`](#Extends15.1) +- [Entity Set Object](#EntitySetObject16) + - [`$Collection`](#Collection16.1) + - [`$Type`](#Type16.2) + - [`$IncludeInServiceDocument`](#IncludeInServiceDocument16.3) +- [Singleton Object](#SingletonObject17) + - [`$Type`](#Type17.1) + - [`$Nullable`](#Nullable17.2) + - [`$NavigationPropertyBinding`](#NavigationPropertyBinding17.3) +- [Action Import Object](#ActionImportObject18) + - [`$Action`](#Action18.1) - [`$EntitySet`](#EntitySet18.2) - - [`$IncludeInServiceDocument`](#IncludeInServiceDocument18.3) -- [Term Object](#TermObject19) - - [`$Type`](#Type19.1) - - [`$Collection`](#Collection19.2) - - [`$DefaultValue`](#DefaultValue19.3) - - [`$BaseTerm`](#BaseTerm19.4) - - [`$AppliesTo`](#AppliesTo19.5) -- [Annotation Member](#AnnotationMember20) - - [`$Path`](#Path20.1) - - [`$And`](#And20.2) - - [`$Or`](#Or20.3) - - [`$Not`](#Not20.4) - - [`$Eq`](#Eq20.5) - - [`$Ne`](#Ne20.6) - - [`$Gt`](#Gt20.7) - - [`$Ge`](#Ge20.8) - - [`$Lt`](#Lt20.9) - - [`$Le`](#Le20.10) - - [`$Has`](#Has20.11) - - [`$In`](#In20.12) - - [`$Neg`](#Neg20.13) - - [`$Add`](#Add20.14) - - [`$Sub`](#Sub20.15) - - [`$Mul`](#Mul20.16) - - [`$Div`](#Div20.17) - - [`$DivBy`](#DivBy20.18) - - [`$Mod`](#Mod20.19) - - [`$Apply`](#Apply20.20) - - [`$Cast`](#Cast20.21) - - [`$If`](#If20.22) - - [`$IsOf`](#IsOf20.23) - - [`$LabeledElement`](#LabeledElement20.24) - - [`$LabeledElementReference`](#LabeledElementReference20.25) - - [`$Null`](#Null20.26) - - [`$UrlRef`](#UrlRef20.27) +- [Function Import Object](#FunctionImportObject19) + - [`$Function`](#Function19.1) + - [`$EntitySet`](#EntitySet19.2) + - [`$IncludeInServiceDocument`](#IncludeInServiceDocument19.3) +- [Term Object](#TermObject20) + - [`$Type`](#Type20.1) + - [`$Collection`](#Collection20.2) + - [`$Nullable`](#Nullable20.3) + - [`$DefaultValue`](#DefaultValue20.4) + - [`$BaseTerm`](#BaseTerm20.5) + - [`$AppliesTo`](#AppliesTo20.6) +- [Annotation Member](#AnnotationMember21) + - [`$Path`](#Path21.1) + - [`$And`](#And21.2) + - [`$Or`](#Or21.3) + - [`$Not`](#Not21.4) + - [`$Eq`](#Eq21.5) + - [`$Ne`](#Ne21.6) + - [`$Gt`](#Gt21.7) + - [`$Ge`](#Ge21.8) + - [`$Lt`](#Lt21.9) + - [`$Le`](#Le21.10) + - [`$Has`](#Has21.11) + - [`$In`](#In21.12) + - [`$Neg`](#Neg21.13) + - [`$Add`](#Add21.14) + - [`$Sub`](#Sub21.15) + - [`$Mul`](#Mul21.16) + - [`$Div`](#Div21.17) + - [`$DivBy`](#DivBy21.18) + - [`$Mod`](#Mod21.19) + - [`$Apply`](#Apply21.20) + - [`$Cast`](#Cast21.21) + - [`$If`](#If21.22) + - [`$IsOf`](#IsOf21.23) + - [`$LabeledElement`](#LabeledElement21.24) + - [`$LabeledElementReference`](#LabeledElementReference21.25) + - [`$Null`](#Null21.26) + - [`$UrlRef`](#UrlRef21.27) ::: ------- diff --git a/docs/odata-csdl-xml/odata-csdl-xml.html b/docs/odata-csdl-xml/odata-csdl-xml.html index c152966ca..c359dead1 100644 --- a/docs/odata-csdl-xml/odata-csdl-xml.html +++ b/docs/odata-csdl-xml/odata-csdl-xml.html @@ -142,12 +142,12 @@

    Abstract:

    OData services are described by an Entity Model (EDM). The Common Schema Definition Language (CSDL) defines specific representations of the entity data model exposed by an OData service, using XML, JSON, and other formats. This document (OData CSDL XML Representation) specifically defines the XML representation of CSDL.

    Status:

    -

    This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical.

    -

    TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/.

    -

    This specification is provided under the RF on RAND Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php).

    -

    Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product's prose narrative document(s), the content in the separate plain text file prevails.

    +

    This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the “Latest stage” location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical.

    +

    TC members should send comments on this specification to the TC’s email list. Others should send comments to the TC’s public comment list, after subscribing to it by following the instructions at the “Send A Comment” button on the TC’s web page at https://www.oasis-open.org/committees/odata/.

    +

    This specification is provided under the RF on RAND Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC’s web page (https://www.oasis-open.org/committees/odata/ipr.php).

    +

    Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product’s prose narrative document(s), the content in the separate plain text file prevails.

    Key words:

    -

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

    +

    The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

    Citation format:

    When referencing this specification the following citation format should be used:

    [OData-CSDL-JSON-v4.02]

    @@ -155,7 +155,7 @@

    Citation format:

    Notices

    Copyright © OASIS Open 2023. All Rights Reserved.

    Distributed under the terms of the OASIS IPR Policy.

    -

    The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs.

    +

    The name “OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs.

    For complete copyright information please see the full Notices section in an Appendix below.


    Table of Contents

    @@ -187,9 +187,17 @@

    Table of Contents

  • 3.1 Nominal Types
  • 3.2 Structured Types
  • 3.3 Primitive Types
  • -
  • 3.4 Built-In Abstract Types
  • -
  • 3.5 Built-In Types for defining Vocabulary Terms
  • -
  • 3.6 Annotations
  • +
  • 3.4 Type Facets +
  • +
  • 3.5 Built-In Abstract Types
  • +
  • 3.6 Built-In Types for defining Vocabulary Terms
  • +
  • 3.7 Annotations
  • 4 CSDL XML Document
      @@ -213,16 +221,8 @@

      Table of Contents

    • 7 Structural Property
    • 8 Navigation Property
        @@ -365,6 +365,22 @@

        Table of Contents

        1 Introduction

        OData services are described in terms of an Entity Model. The Common Schema Definition Language (CSDL) defines a representation of the entity model exposed by an OData service using the Extensible Markup Language (XML) 1.1 (Second Edition) XML-1.1 with further building blocks from the W3C XML Schema Definition Language (XSD) 1.1 as described in XML-Schema-1 and XML-Schema-2.

        1.1 Changes from Earlier Versions

        + + + + + + + + + + + + + + + +
        SectionFeature / ChangeIssue
        Section 14.4.1.2New path evaluation rules for annotations targeting annotations and external targeting via containerODATA-1420

        1.2 Glossary

        1.2.1 Definitions of Terms

        1.2.2 Acronyms and Abbreviations

        @@ -386,7 +402,7 @@

        Representation-Specific Headline

        All other text is normative unless otherwise labeled.

        Here is a customized command line which will generate HTML from this markdown file (named odata-csdl-xml-v4.02-csd01.md). Line breaks are added for readability only:

        -
        pandoc -f gfm+tex_math_dollars+fenced_divs
        +
        pandoc -f gfm+tex_math_dollars+fenced_divs+smart
                -t html
                -o odata-csdl-xml-v4.02-csd01.html
                -c styles/markdown-styles-v1.7.3b.css
        @@ -501,7 +517,7 @@ 

        3.3 Edm.Double -IEEE 754 binary64 floating-point number (15-17 decimal digits) +IEEE 754 binary64 floating-point number (15–17 decimal digits) Edm.Duration @@ -529,7 +545,7 @@

        3.3 Edm.Single -IEEE 754 binary32 floating-point number (6-9 decimal digits) +IEEE 754 binary32 floating-point number (6–9 decimal digits) Edm.Stream @@ -541,7 +557,7 @@

        3.3 Edm.TimeOfDay -Clock time 00:00-23:59:59.999999999999 +Clock time 00:00–23:59:59.999999999999 Edm.Geography @@ -612,9 +628,86 @@

        3.3

        Edm.Date and Edm.DateTimeOffset follow XML-Schema-2 and use the proleptic Gregorian calendar, allowing the year 0000 (equivalent to 1 BCE) and negative years (year -0001 being equivalent to 2 BCE etc.). The supported date range is service-specific and typically depends on the underlying persistency layer, e.g. SQL only supports years 0001 to 9999.

        Edm.Decimal with a Scale value of floating, Edm.Double, and Edm.Single allow the special numeric values -INF, INF, and NaN.

        Edm.Stream is a primitive type that can be used as a property of an entity type or complex type, the underlying type for a type definition, or the binding parameter or return type of an action or function. Edm.Stream, or a type definition whose underlying type is Edm.Stream, cannot be used in collections or for non-binding parameters to functions or actions.

        -

        Some of these types allow facets, defined in section "Type Facets".

        +

        Some of these types allow facets, defined in section “Type Facets”.

        See rule primitiveLiteral in OData-ABNF for the representation of primitive type values in URLs and OData-JSON for the representation in requests and responses.

        -

        3.4 Built-In Abstract Types

        +

        3.4 Type Facets

        +

        The facets in the following subsections modify or constrain the acceptable values of primitive typed model elements, for example a structural property, action or function parameter, action or function return type, or term.

        +

        For single-valued model elements the facets apply to the value of the model element. For collection-valued model elements the facets apply to the items in the collection.

        +

        3.4.1 MaxLength

        +

        A positive integer value specifying the maximum length of a binary, stream or string value. For binary or stream values this is the octet length of the binary data, for string values it is the character length (number of code points for Unicode).

        +

        If no maximum length is specified, clients SHOULD expect arbitrary length.

        +
        +

        Type Facet Attributes

        +

        Attribute MaxLength

        +

        The value of MaxLength is a positive integer or the symbolic value max as a shorthand for the maximum length supported for the type by the service.

        +

        Note: the symbolic value max is only allowed in OData 4.0 responses; it is deprecated in OData 4.01. While clients MUST be prepared for this symbolic value, OData 4.01 and greater services MUST NOT return the symbolic value max and MAY instead specify the concrete maximum length supported for the type by the service or omit the attribute entirely.

        +
        +

        3.4.2 Precision

        +

        For a decimal value: the maximum number of significant decimal digits of the model element’s value; it MUST be a positive integer.

        +

        For a temporal value (datetime-with-timezone-offset, duration, or time-of-day): the number of decimal places allowed in the seconds portion of the value; it MUST be a non-negative integer between zero and twelve.

        +

        Note: service authors SHOULD be aware that some clients are unable to support a precision greater than 28 for decimal values and 7 for temporal values. Client developers MUST be aware of the potential for data loss when round-tripping values of greater precision. Updating via PATCH and exclusively specifying modified values will reduce the risk for unintended data loss.

        +

        Note: model elements with duration values and a granularity less than seconds (e.g. minutes, hours, days) can be annotated with term Measures.DurationGranularity, see OData-VocMeasures.

        +
        +

        Attribute Precision

        +

        The value of Precision is a number.

        +

        If not specified for a decimal value, the decimal value has unspecified precision.

        +

        If not specified for a temporal value, the temporal value has a precision of zero.

        +
        +
        +

        Example 2: Precision facet applied to the DateTimeOffset type

        +
        <Property Name="SuggestedTimes" Type="Collection(Edm.DateTimeOffset)"
        +          Precision="6" />
        +
        +

        3.4.3 Scale

        +

        A non-negative integer value specifying the maximum number of digits allowed to the right of the decimal point, or one of the symbolic values floating or variable.

        +

        The value floating means that the decimal value represents a decimal floating-point number whose number of significant digits is the value of the Precision facet. OData 4.0 responses MUST NOT specify the value floating.

        +

        The value variable means that the number of digits to the right of the decimal point can vary from zero to the value of the Precision facet.

        +

        An integer value means that the number of digits to the right of the decimal point may vary from zero to the value of the Scale facet, and the number of digits to the left of the decimal point may vary from one to the value of the Precision facet minus the value of the Scale facet. If Precision is equal to Scale, a single zero MUST precede the decimal point.

        +

        The value of Scale MUST be less than or equal to the value of Precision.

        +

        Note: if the underlying data store allows negative scale, services may use a Precision with the absolute value of the negative scale added to the actual number of significant decimal digits, and client-provided values may have to be rounded before being stored.

        +
        +

        Attribute Scale

        +

        The value of Scale is a number or one of the symbolic values floating or variable.

        +

        Services SHOULD use lower-case values; clients SHOULD accept values in a case-insensitive manner.

        +

        If not specified, the Scale facet defaults to zero.

        +
        +
        +

        Example 3: Precision=3 and Scale=2.
        +Allowed values: 1.23, 0.23, 3.14 and 0.7, not allowed values: 123, 12.3
        +(the Nullable attribute can be ignored in these examples)

        +
        <Property Name="Amount32" Type="Edm.Decimal" Nullable="false" Precision="3" Scale="2" />
        +
        +
        +

        Example 4: Precision=2 equals Scale.
        +Allowed values: 0.23, 0.7, not allowed values: 1.23, 1.2

        +
        <Property Name="Amount22" Type="Edm.Decimal" Nullable="false" Precision="2" Scale="2" />
        +
        +
        +

        Example 5: Precision=3 and a variable Scale.
        +Allowed values: 0.123, 1.23, 0.23, 0.7, 123 and 12.3, not allowed values: 12.34, 1234 and 123.4 due to the limited precision.

        +
        <Property Name="Amount3v" Type="Edm.Decimal" Nullable="false" Precision="3" Scale="variable" />
        +
        +
        +

        Example 6: Precision=7 and a floating Scale.
        +Allowed values: -1.234567e3, 1e-101, 9.999999e96, not allowed values: 1e-102 and 1e97 due to the limited precision.

        +
        <Property Name="Amount7f" Type="Edm.Decimal" Nullable="false" Precision="7" Scale="floating" />
        +
        +

        3.4.4 Unicode

        +

        For a string-typed model element the Unicode facet indicates whether the it might contain and accept string values with Unicode characters (code points) beyond the ASCII character set. The value false indicates that the it will only contain and accept string values with characters limited to the ASCII character set.

        +

        If no value is specified, the Unicode facet defaults to true.

        +
        +

        Attribute Unicode

        +

        The value of Unicode is one of the Boolean literals true or false. Absence of the attribute means true.

        +
        +

        3.4.5 SRID

        +

        For a geometry- or geography-typed model element the SRID facet identifies which spatial reference system is applied to its values.

        +

        The value of the SRID facet MUST be a non-negative integer or the special value variable. If no value is specified, the facet defaults to 0 for Geometry types or 4326 for Geography types.

        +

        The valid values of the SRID facet and their meanings are as defined by the European Petroleum Survey Group EPSG.

        +
        +

        Attribute SRID

        +

        The value of SRID is a number or the symbolic value variable.

        +
        +

        3.5 Built-In Abstract Types

        The following built-in abstract types can be used within a model:

        • Edm.PrimitiveType
        • @@ -626,7 +719,7 @@

          3.5 Built-In Types for defining Vocabulary Terms

          +

          3.6 Built-In Types for defining Vocabulary Terms

          Vocabulary terms can, in addition, use

          • Edm.AnnotationPath
          • @@ -666,8 +758,8 @@

            Path Expressions" for details.

            -

            3.6 Annotations

            +

            as the type of a primitive term, or the type of a property of a complex type (recursively) that is exclusively used as the type of a term. See section “Path Expressions” for details.

            +

            3.7 Annotations

            Many parts of the model can be decorated with additional information using annotations. Annotations are identified by their term name and an optional qualifier that allows applying the same term multiple times to the same model element.

            A model element MUST NOT specify more than one annotation for a given combination of term and qualifier.


            @@ -677,52 +769,52 @@

            4
            -

            Element edmx:Edmx

            +

            Element edmx:Edmx

            The edmx:Edmx element is the root element of a CSDL XML document. It MUST contain the Version attribute and it MUST contain exactly one edmx:DataServices element.

            It MAY contain edmx:Reference elements to reference other CSDL documents.

            -

            Attribute Version

            -

            The Version attribute specifies the OData protocol version of the service. For OData 4.0 responses the value of this attribute MUST be 4.0. For OData 4.01 responses the value of this attribute MUST be 4.01. Services MUST return an OData 4.0 response if the request was made with an OData-MaxVersion header with a value of 4.0.

            -

            Element edmx:DataServices

            +

            Attribute Version

            +

            The Version attribute specifies the OData protocol version of the service. For OData 4.0 responses the value of this attribute MUST be 4.0. For OData 4.01 responses the value of this attribute MUST be 4.01. Services MUST return an OData 4.0 response if the request was made with an OData-MaxVersion header with a value of 4.0.

            +

            Element edmx:DataServices

            The edmx:DataServices element MUST contain one or more edm:Schema elements which define the schemas exposed by the OData service.

            -

            Example 2:

            -
            <edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"
            -           Version="4.01">
            -  <edmx:DataServices>
            -    ...
            -  </edmx:DataServices>
            -</edmx:Edmx>
            +

            Example 7:

            +
            <edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"
            +           Version="4.01">
            +  <edmx:DataServices>
            +    ...
            +  </edmx:DataServices>
            +</edmx:Edmx>

            4.1 Reference

            -

            A reference to an external CSDL document allows to bring part of the referenced document's content into the scope of the referencing document.

            +

            A reference to an external CSDL document allows to bring part of the referenced document’s content into the scope of the referencing document.

            A reference MUST specify a URI that uniquely identifies the referenced document, so two references MUST NOT specify the same URI. The URI SHOULD be a URL that locates the referenced document. If the URI is not dereferencable it SHOULD identify a well-known schema. The URI MAY be absolute or relative URI; relative URLs are relative to the URL of the document containing the reference, or relative to a base URL specified in a format-specific way.

            A reference MAY be annotated.

            The Core.SchemaVersion annotation, defined in OData-VocCore, MAY be used to indicate a particular version of the referenced document. If the Core.SchemaVersion annotation is present, the $schemaversion system query option, defined OData-Protocol, SHOULD be used when retrieving the referenced schema document.

            -

            Element edmx:Reference

            +

            Element edmx:Reference

            The edmx:Reference element specifies external CSDL documents referenced by the referencing document. The child elements edmx:Include and edmx:IncludeAnnotations specify which parts of the referenced document are available for use in the referencing document.

            The edmx:Reference element MUST contain the Uri attribute, and it MUST contain at least one edmx:Include or edmx:IncludeAnnotations child element.

            It MAY contain edm:Annotation elements.

            -

            Attribute Uri

            +

            Attribute Uri

            The value of Uri is an absolute or relative URI; relative URIs are relative to the xml:base attribute, see XML-Base.

            -

            Example 3: references to other CSDL documents

            -
            <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            -<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"
            -           Version="4.0">
            -  <edmx:Reference Uri="http://vocabs.odata.org/capabilities/v1">
            -   ...
            -  </edmx:Reference>
            -  <edmx:Reference Uri="http://vocabs.odata.org/core/v1">
            -    ...
            -  </edmx:Reference>
            -  <edmx:Reference Uri="http://example.org/display/v1">
            -    ...
            -  </edmx:Reference>
            -  <edmx:DataServices>...</edmx:DataServices>
            -</edmx:Edmx>
            +

            Example 8: references to other CSDL documents

            +
            <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            +<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"
            +           Version="4.0">
            +  <edmx:Reference Uri="http://vocabs.odata.org/capabilities/v1">
            +   ...
            +  </edmx:Reference>
            +  <edmx:Reference Uri="http://vocabs.odata.org/core/v1">
            +    ...
            +  </edmx:Reference>
            +  <edmx:Reference Uri="http://example.org/display/v1">
            +    ...
            +  </edmx:Reference>
            +  <edmx:DataServices>...</edmx:DataServices>
            +</edmx:Edmx>

            4.2 Included Schema

            A reference MAY include zero or more schemas from the referenced document.

            @@ -735,68 +827,68 @@

            4.2

            The alias MUST NOT be one of the reserved values Edm, odata, System, or Transient.

            An alias is only valid within the document in which it is declared; a referencing document may define its own aliases for included schemas.

            -

            Element edmx:Include

            +

            Element edmx:Include

            The edmx:Include element specifies a schema to include from the referenced CSDL document. It MUST provide the Namespace attribute and it MAY provide the Alias attribute.

            It MAY contain edm:Annotation elements.

            -

            Attribute Namespace

            +

            Attribute Namespace

            The value of Namespace is the namespace of a schema defined in the referenced CSDL document.

            -

            Attribute Alias

            +

            Attribute Alias

            The value of Alias is a simple identifier that can be used in qualified names instead of the namespace.

            -

            Example 4: references to entity models containing definitions of vocabulary terms

            -
            <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            -<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"
            -           Version="4.0">
            -  <edmx:Reference Uri="http://vocabs.odata.org/capabilities/v1">
            -    <edmx:Include Namespace="Org.OData.Capabilities.V1" />
            -  </edmx:Reference>
            -  <edmx:Reference Uri="http://vocabs.odata.org/core/v1">
            -    <edmx:Include Namespace="Org.OData.Core.V1" Alias="Core">
            -      <Annotation Term="Core.DefaultNamespace" />
            -    </edmx:Include>
            -  </edmx:Reference>
            -  <edmx:Reference Uri="http://example.org/display/v1">
            -    <edmx:Include Alias="UI" Namespace="org.example.display" />
            -  </edmx:Reference>
            -  <edmx:DataServices>...</edmx:DataServices>
            -</edmx:Edmx>
            +

            Example 9: references to entity models containing definitions of vocabulary terms

            +
            <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            +<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"
            +           Version="4.0">
            +  <edmx:Reference Uri="http://vocabs.odata.org/capabilities/v1">
            +    <edmx:Include Namespace="Org.OData.Capabilities.V1" />
            +  </edmx:Reference>
            +  <edmx:Reference Uri="http://vocabs.odata.org/core/v1">
            +    <edmx:Include Namespace="Org.OData.Core.V1" Alias="Core">
            +      <Annotation Term="Core.DefaultNamespace" />
            +    </edmx:Include>
            +  </edmx:Reference>
            +  <edmx:Reference Uri="http://example.org/display/v1">
            +    <edmx:Include Alias="UI" Namespace="org.example.display" />
            +  </edmx:Reference>
            +  <edmx:DataServices>...</edmx:DataServices>
            +</edmx:Edmx>

            4.3 Included Annotations

            In addition to including whole schemas with all model constructs defined within that schema, a reference may include annotations.

            -

            Annotations are selectively included by specifying the namespace of the annotations' term. Consumers can opt not to inspect the referenced document if none of the term namespaces is of interest for the consumer.

            +

            Annotations are selectively included by specifying the namespace of the annotations’ term. Consumers can opt not to inspect the referenced document if none of the term namespaces is of interest for the consumer.

            In addition, the qualifier of annotations to be included MAY be specified. For instance, a service author might want to supply a different set of annotations for various device form factors. If a qualifier is specified, only those annotations from the specified term namespace with the specified qualifier (applied to a model element of the target namespace, if present) SHOULD be included. If no qualifier is specified, all annotations within the referenced document from the specified term namespace (taking into account the target namespace, if present) SHOULD be included.

            The qualifier also provides consumers insight about what qualifiers are present in the referenced document. If the consumer is not interested in that particular qualifier, the consumer can opt not to inspect the referenced document.

            -

            In addition, the namespace of the annotations' target MAY be specified. If a target namespace is specified, only those annotations which apply a term form the specified term namespace to a model element of the target namespace (with the specified qualifier, if present) SHOULD be included. If no target namespace is specified, all annotations within the referenced document from the specified term namespace (taking into account the qualifier, if present) SHOULD be included.

            +

            In addition, the namespace of the annotations’ target MAY be specified. If a target namespace is specified, only those annotations which apply a term form the specified term namespace to a model element of the target namespace (with the specified qualifier, if present) SHOULD be included. If no target namespace is specified, all annotations within the referenced document from the specified term namespace (taking into account the qualifier, if present) SHOULD be included.

            The target namespace also provides consumers insight about what namespaces are present in the referenced document. If the consumer is not interested in that particular target namespace, the consumer can opt not to inspect the referenced document.

            -

            Element edmx:IncludeAnnotations

            +

            Element edmx:IncludeAnnotations

            The edmx:IncludeAnnotations element specifies the annotations to include from the referenced CSDL document. If no edmx:IncludeAnnotations element is specified, a client MAY ignore all annotations in the referenced document that are not explicitly used in an edm:Path expression of the referencing document.

            The edmx:IncludeAnnotations element MUST provide the TermNamespace attribute, and it MAY provide the Qualifier and TargetNamespace attribute.

            -

            Attribute TermNamespace

            +

            Attribute TermNamespace

            The value of TermNamespace is a namespace.

            -

            Attribute Qualifier

            +

            Attribute Qualifier

            The value of Qualifier is a simple identifier.

            -

            Attribute TargetNamespace

            +

            Attribute TargetNamespace

            The value of TargetNamespace is a namespace.

            -

            Example 5: reference documents that contain annotations

            -
            <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            -<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"
            -           Version="4.0">
            -  <edmx:Reference Uri="http://odata.org/ann/b">
            -    <edmx:IncludeAnnotations TermNamespace="org.example.validation" />
            -    <edmx:IncludeAnnotations TermNamespace="org.example.display"
            -                             Qualifier="Tablet" />
            -    <edmx:IncludeAnnotations TermNamespace="org.example.hcm"
            -                             TargetNamespace="com.example.Sales" />
            -    <edmx:IncludeAnnotations TermNamespace="org.example.hcm"
            -                             Qualifier="Tablet"
            -                             TargetNamespace="com.example.Person" />
            -  </edmx:Reference>
            -  <edmx:DataServices>...</edmx:DataServices>
            -</edmx:Edmx>
            +

            Example 10: reference documents that contain annotations

            +
            <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            +<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"
            +           Version="4.0">
            +  <edmx:Reference Uri="http://odata.org/ann/b">
            +    <edmx:IncludeAnnotations TermNamespace="org.example.validation" />
            +    <edmx:IncludeAnnotations TermNamespace="org.example.display"
            +                             Qualifier="Tablet" />
            +    <edmx:IncludeAnnotations TermNamespace="org.example.hcm"
            +                             TargetNamespace="com.example.Sales" />
            +    <edmx:IncludeAnnotations TermNamespace="org.example.hcm"
            +                             Qualifier="Tablet"
            +                             TargetNamespace="com.example.Person" />
            +  </edmx:Reference>
            +  <edmx:DataServices>...</edmx:DataServices>
            +</edmx:Edmx>

            The following annotations from http://odata.org/ann/b are included:

            @@ -811,14 +903,14 @@

            5 Schema

            One or more schemas describe the entity model exposed by an OData service. The schema acts as a namespace for elements of the entity model such as entity types, complex types, enumerations and terms.

            A schema is identified by a namespace. Schema namespaces MUST be unique within the scope of a document and SHOULD be globally unique. A schema cannot span more than one document.

            -

            The schema's namespace is combined with the name of elements in the schema to create unique qualified names, so identifiers that are used to name types MUST be unique within a namespace to prevent ambiguity.

            +

            The schema’s namespace is combined with the name of elements in the schema to create unique qualified names, so identifiers that are used to name types MUST be unique within a namespace to prevent ambiguity.

            Names are case-sensitive, but service authors SHOULD NOT choose names that differ only in case.

            The namespace MUST NOT be one of the reserved values Edm, odata, System, or Transient.

            -

            Element edm:Schema

            +

            Element edm:Schema

            The edm:Schema element defines a schema. It MUST contain the Namespace attribute and it MAY contain the Alias attribute.

            It MAY contain elements edm:Action, edm:Annotations, edm:Annotation, edm:ComplexType, edm:EntityContainer, edm:EntityType, edm:EnumType, edm:Function, edm:Term, or edm:TypeDefinition.

            -

            Attribute Namespace

            +

            Attribute Namespace

            The value of Namespace is the namespace of the schema

            5.1 Alias

            @@ -827,74 +919,74 @@

            5.1 Alias

            Aliases are document-global, so all schemas defined within or included into a document MUST have different aliases, and aliases MUST differ from the namespaces of all schemas defined within or included into a document. Aliases defined by a schema can be used throughout the containing document and are not restricted to the schema that defines them.

            The alias MUST NOT be one of the reserved values Edm, odata, System, or Transient.

            -

            Attribute Alias

            +

            Attribute Alias

            The value of Alias is a simple identifier.

            -

            Example 6: schema org.example with an alias and a description for the schema

            -
            <Schema Namespace="org.example" Alias="self">
            -  <Annotation Term="Core.Description" String="Example schema" />
            -  ...
            -</Schema>
            +

            Example 11: schema org.example with an alias and a description for the schema

            +
            <Schema Namespace="org.example" Alias="self">
            +  <Annotation Term="Core.Description" String="Example schema" />
            +  ...
            +</Schema>

            5.2 Annotations with External Targeting

            -

            Element edm:Annotations

            +

            Element edm:Annotations

            The edm:Annotations element is used to apply a group of annotations to a single model element. It MUST contain the Target attribute and it MAY contain the Qualifier attribute.

            It MUST contain at least one edm:Annotation element.

            -

            Attribute Target

            +

            Attribute Target

            The value of Target is a path expression identifying the annotation target. It MUST resolve to a model element in scope.

            -

            Attribute Qualifier

            +

            Attribute Qualifier

            The value of Qualifier is a simple identifier.

            -

            Example 7: annotations should only be applied to tablet devices

            -
            <Annotations Target="org.example.Person" Qualifier="Tablet">
            -  <Annotation Term="Core.Description" String="Dummy" />
            -  ...
            -</Annotations>
            +

            Example 12: annotations should only be applied to tablet devices

            +
            <Annotations Target="org.example.Person" Qualifier="Tablet">
            +  <Annotation Term="Core.Description" String="Dummy" />
            +  ...
            +</Annotations>

            6 Entity Type

            Entity types are nominal structured types with a key that consists of one or more references to structural properties. An entity type is the template for an entity: any uniquely identifiable record such as a customer or order.

            -

            The entity type's name is a simple identifier that MUST be unique within its schema.

            +

            The entity type’s name is a simple identifier that MUST be unique within its schema.

            An entity type can define two types of properties. A structural property is a named reference to a primitive, complex, or enumeration type, or a collection of primitive, complex, or enumeration types. A navigation property is a named reference to another entity type or collection of entity types.

            All properties MUST have a unique name within an entity type. Properties MUST NOT have the same name as the declaring entity type. They MAY have the same name as one of the direct or indirect base types or derived types.

            -

            Element edm:EntityType

            +

            Element edm:EntityType

            The edm:EntityType element MUST contain the Name attribute, and it MAY contain the BaseType, Abstract, OpenType, and HasStream attributes.

            It MAY contain edm:Property and edm:NavigationProperty elements describing the properties of the entity type.

            It MAY contain one edm:Key element.

            It MAY contain edm:Annotation elements.

            -

            Attribute Name

            -

            The value of Name is the entity type's name.

            +

            Attribute Name

            +

            The value of Name is the entity type’s name.

            -

            Example 8: a simple entity type

            -
            <EntityType Name="Employee">
            -  <Key>
            -    <PropertyRef Name="ID" />
            -  </Key>
            -  <Property Name="ID" Type="Edm.String" Nullable="false" />
            -  <Property Name="FirstName" Type="Edm.String" Nullable="false" />
            -  <Property Name="LastName" Type="Edm.String" Nullable="false" />
            -  <NavigationProperty Name="Manager" Type="self.Manager" />
            -</EntityType>
            +

            Example 13: a simple entity type

            +
            <EntityType Name="Employee">
            +  <Key>
            +    <PropertyRef Name="ID" />
            +  </Key>
            +  <Property Name="ID" Type="Edm.String" Nullable="false" />
            +  <Property Name="FirstName" Type="Edm.String" Nullable="false" />
            +  <Property Name="LastName" Type="Edm.String" Nullable="false" />
            +  <NavigationProperty Name="Manager" Type="self.Manager" />
            +</EntityType>

            6.1 Derived Entity Type

            An entity type can inherit from another entity type by specifying it as its base type.

            An entity type inherits the key as well as structural and navigation properties of its base type.

            An entity type MUST NOT introduce an inheritance cycle by specifying a base type.

            -

            Attribute BaseType

            +

            Attribute BaseType

            The value of BaseType is the qualified name of the base type.

            -

            Example 9: a derived entity type based on the previous example

            -
            <EntityType Name="Manager" BaseType="self.Employee">
            -  <Property Name="AnnualBudget" Type="Edm.Decimal" />
            -  <NavigationProperty Name="Employees" Type="Collection(self.Employee)" />
            -</EntityType>
            +

            Example 14: a derived entity type based on the previous example

            +
            <EntityType Name="Manager" BaseType="self.Employee">
            +  <Property Name="AnnualBudget" Type="Edm.Decimal" />
            +  <NavigationProperty Name="Employees" Type="Collection(self.Employee)" />
            +</EntityType>

            Note: the derived type has the same name as one of the properties of its base type.

            @@ -904,7 +996,7 @@

            key or derive from a base type with a defined key.

            An abstract entity type MUST NOT inherit from a non-abstract entity type.

            -

            Attribute Abstract

            +

            Attribute Abstract

            The value of Abstract is one of the Boolean literals true or false. Absence of the attribute means false.

            6.3 Open Entity Type

            @@ -912,7 +1004,7 @@

            6.3

            An entity type derived from an open entity type MUST indicate that it is also open.

            Note: structural and navigation properties MAY be returned by the service on instances of any structured type, whether or not the type is marked as open. Clients MUST always be prepared to deal with additional properties on instances of any structured type, see OData-Protocol.

            -

            Attribute OpenType

            +

            Attribute OpenType

            The value of OpenType is one of the Boolean literals true or false. Absence of the attribute means false.

            6.4 Media Entity Type

            @@ -920,15 +1012,15 @@

            An entity type derived from a media entity type MUST indicate that it is also a media entity type.

            Media entity types MAY specify a list of acceptable media types using an annotation with term Core.AcceptableMediaTypes, see OData-VocCore.

            -

            Attribute HasStream

            +

            Attribute HasStream

            The value of HasStream is one of the Boolean literals true or false. Absence of the attribute means false.

            6.5 Key

            An entity is uniquely identified within an entity set by its key. A key MAY be specified if the entity type does not specify a base type that already has a key declared.

            In order to be specified as the type of an entity set or a collection-valued containment navigation property, the entity type MUST either specify a key or inherit its key from its base type.

            In OData 4.01 responses entity types used for singletons or single-valued navigation properties do not require a key. In OData 4.0 responses entity types used for singletons or single-valued navigation properties MUST have a key defined.

            -

            An entity type (whether or not it is marked as abstract) MAY define a key only if it doesn't inherit one.

            -

            An entity type's key refers to the set of properties whose values uniquely identify an instance of the entity type within an entity set. The key MUST consist of at least one property.

            +

            An entity type (whether or not it is marked as abstract) MAY define a key only if it doesn’t inherit one.

            +

            An entity type’s key refers to the set of properties whose values uniquely identify an instance of the entity type within an entity set. The key MUST consist of at least one property.

            Key properties MUST NOT be nullable and MUST be typed with an enumeration type, one of the following primitive types, or a type definition based on one of these primitive types:

            • Edm.Boolean
            • @@ -950,59 +1042,59 @@

              6.5 Key

              In OData 4.01 the key properties of a directly related entity type MAY also be part of the key if the navigation property is single-valued and not nullable. This includes navigation properties of non-nullable single-valued complex properties (recursively) of the entity type. If a key property of a related entity type is part of the key, all key properties of the related entity type MUST also be part of the key.

              If the key property is a property of a complex property (recursively) or of a directly related entity type, the key MUST specify an alias for that property that MUST be a simple identifier and MUST be unique within the set of aliases, structural and navigation properties of the declaring entity type and any of its base types.

              An alias MUST NOT be defined if the key property is a primitive property of the entity type itself.

              -

              For key properties that are a property of a complex or navigation property, the alias MUST be used in the key predicate of URLs instead of the path to the property because the required percent-encoding of the forward slash separating segments of the path to the property would make URL construction and parsing rather complicated. The alias MUST NOT be used in the query part of URLs, where paths to properties don't require special encoding and are a standard constituent of expressions anyway.

              +

              For key properties that are a property of a complex or navigation property, the alias MUST be used in the key predicate of URLs instead of the path to the property because the required percent-encoding of the forward slash separating segments of the path to the property would make URL construction and parsing rather complicated. The alias MUST NOT be used in the query part of URLs, where paths to properties don’t require special encoding and are a standard constituent of expressions anyway.

              -

              Element edm:Key

              +

              Element edm:Key

              The edm:Key element MUST contain at least one edm:PropertyRef element.

              -

              Element edm:PropertyRef

              +

              Element edm:PropertyRef

              The edm:PropertyRef element MUST contain the Name attribute and MAY contain the Alias attribute.

              -

              Attribute Name

              +

              Attribute Name

              The value of Name is a path expression leading to a primitive property. The names of the properties in the path are joined together by forward slashes.

              -

              Attribute Alias

              +

              Attribute Alias

              The value of Alias is a simple identifier.

              -

              Example 10: entity type with a simple key

              -
              <EntityType Name="Category">
              -  <Key>
              -    <PropertyRef Name="ID" />
              -  </Key>
              -  <Property Name="ID" Type="Edm.Int32" Nullable="false" />
              -  <Property Name="Name" Type="Edm.String" />
              -</EntityType>
              -
              -
              -

              Example 11: entity type with a simple key referencing a property of a complex type

              -
              <EntityType Name="Category">
              -  <Key>
              -    <PropertyRef Name="Info/ID" Alias="EntityInfoID" />
              -  </Key>
              -  <Property Name="Info" Type="Sales.EntityInfo" Nullable="false" />
              -  <Property Name="Name" Type="Edm.String" />
              -</EntityType>
              -
              -<ComplexType Name="EntityInfo">
              -  <Property Name="ID" Type="Edm.Int32" Nullable="false" />
              -  <Property Name="Created" Type="Edm.DateTimeOffset" />
              -</ComplexType>
              -
              -
              -

              Example 12: entity type with a composite key

              -
              <EntityType Name="OrderLine">
              -  <Key>
              -    <PropertyRef Name="OrderID" />
              -    <PropertyRef Name="LineNumber" />
              -  </Key>
              -  <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
              -  <Property Name="LineNumber" Type="Edm.Int32" Nullable="false" />
              -</EntityType>
              +

              Example 15: entity type with a simple key

              +
              <EntityType Name="Category">
              +  <Key>
              +    <PropertyRef Name="ID" />
              +  </Key>
              +  <Property Name="ID" Type="Edm.Int32" Nullable="false" />
              +  <Property Name="Name" Type="Edm.String" />
              +</EntityType>
              +
              +
              +

              Example 16: entity type with a simple key referencing a property of a complex type

              +
              <EntityType Name="Category">
              +  <Key>
              +    <PropertyRef Name="Info/ID" Alias="EntityInfoID" />
              +  </Key>
              +  <Property Name="Info" Type="Sales.EntityInfo" Nullable="false" />
              +  <Property Name="Name" Type="Edm.String" />
              +</EntityType>
              +
              +<ComplexType Name="EntityInfo">
              +  <Property Name="ID" Type="Edm.Int32" Nullable="false" />
              +  <Property Name="Created" Type="Edm.DateTimeOffset" />
              +</ComplexType>
              +
              +
              +

              Example 17: entity type with a composite key

              +
              <EntityType Name="OrderLine">
              +  <Key>
              +    <PropertyRef Name="OrderID" />
              +    <PropertyRef Name="LineNumber" />
              +  </Key>
              +  <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
              +  <Property Name="LineNumber" Type="Edm.Int32" Nullable="false" />
              +</EntityType>
              -

              Example 13 (based on example 11): requests to an entity set Categories of type Category must use the alias

              +

              Example 18 (based on example 16): requests to an entity set Categories of type Category must use the alias

              GET http://host/service/Categories(EntityInfoID=1)
              -

              Example 14 (based on example 11): in a query part the value assigned to the name attribute must be used

              +

              Example 19 (based on example 16): in a query part the value assigned to the name attribute must be used

              GET http://example.org/OData.svc/Categories?$filter=Info/ID le 100

              @@ -1015,138 +1107,67 @@

              type.

              -

              The property's name MUST be a simple identifier. It is used when referencing, serializing or deserializing the property. It MUST be unique within the set of structural and navigation properties of the declaring structured type, and MUST NOT match the name of any navigation property in any of its base types. If a structural property with the same name is defined in any of this type's base types, then the property's type MUST be a type derived from the type specified for the property of the base type and constrains this property to be of the specified subtype for instances of this structured type. The name MUST NOT match the name of any structural or navigation property of any of this type's base types for OData 4.0 responses.

              +

              The property’s name MUST be a simple identifier. It is used when referencing, serializing or deserializing the property. It MUST be unique within the set of structural and navigation properties of the declaring structured type, and MUST NOT match the name of any navigation property in any of its base types. If a structural property with the same name is defined in any of this type’s base types, then the property’s type MUST be a type derived from the type specified for the property of the base type and constrains this property to be of the specified subtype for instances of this structured type. The name MUST NOT match the name of any structural or navigation property of any of this type’s base types for OData 4.0 responses.

              Names are case-sensitive, but service authors SHOULD NOT choose names that differ only in case.

              -

              Element edm:Property

              -

              The edm:Property element MUST contain the Name and the Type attribute, and it MAY contain the facet attributes Nullable, MaxLength, Unicode, Precision, Scale, SRID, and DefaultValue.

              +

              Element edm:Property

              +

              The edm:Property element MUST contain the Name and the Type attribute, and it MAY contain the attributes Nullable, MaxLength, Unicode, Precision, Scale, SRID, and DefaultValue.

              It MAY contain edm:Annotation elements.

              -

              Attribute Name

              -

              The value of Name is the property's name.

              +

              Attribute Name

              +

              The value of Name is the property’s name.

              -

              Example 15: complex type with two properties

              -
              <ComplexType Name="Measurement">
              -  <Property Name="Dimension" Type="Edm.String" Nullable="false" MaxLength="50"
              -            DefaultValue="Unspecified" />
              -  <Property Name="Length" Type="Edm.Decimal" Nullable="false" Precision="18"
              -            Scale="2" />
              -</ComplexType>
              +

              Example 20: complex type with two properties

              +
              <ComplexType Name="Measurement">
              +  <Property Name="Dimension" Type="Edm.String" Nullable="false" MaxLength="50"
              +            DefaultValue="Unspecified" />
              +  <Property Name="Length" Type="Edm.Decimal" Nullable="false" Precision="18"
              +            Scale="2" />
              +</ComplexType>

              7.1 Type

              -

              The property's type MUST be a primitive type, complex type, or enumeration type in scope, or a collection of one of these types.

              +

              The property’s type MUST be a primitive type, complex type, or enumeration type in scope, or a collection of one of these types.

              A collection-valued property MAY be annotated with the Core.Ordered term, defined in OData-VocCore, to specify that it supports a stable ordering.

              A collection-valued property MAY be annotated with the Core.PositionalInsert term, defined in OData-VocCore, to specify that it supports inserting items into a specific ordinal position.

              -

              Attribute Type

              -

              For single-valued properties the value of Type is the qualified name of the property's type.

              -

              For collection-valued properties the value of Type is the character sequence Collection( followed by the qualified name of the property's item type, followed by a closing parenthesis ).

              +

              Attribute Type

              +

              For single-valued properties the value of Type is the qualified name of the property’s type.

              +

              For collection-valued properties the value of Type is the character sequence Collection( followed by the qualified name of the property’s item type, followed by a closing parenthesis ).

              -

              Example 16: property Units that can have zero or more strings as its value

              -
              <Property Name="Units" Type="Collection(Edm.String)" />
              +

              Example 21: property Units that can have zero or more strings as its value

              +
              <Property Name="Units" Type="Collection(Edm.String)" />
              -

              7.2 Type Facets

              -

              Facets modify or constrain the acceptable values of a property.

              -

              For single-valued properties the facets apply to the value of the property. For collection-valued properties the facets apply to the items in the collection.

              -

              7.2.1 Nullable

              +

              7.2 Nullable

              A Boolean value specifying whether the property can have the value null.

              -

              Attribute Nullable

              +

              Attribute Nullable

              The value of Nullable is one of the Boolean literals true or false.

              For single-valued properties the value true means that the property allows the null value.

              -

              For collection-valued properties the property value will always be a collection that MAY be empty. In this case the Nullable attribute applies to items of the collection and specifies whether the collection MAY contain null values.

              +

              For collection-valued properties the value will always be a collection that MAY be empty. In this case the Nullable attribute applies to items of the collection and specifies whether the collection MAY contain null values.

              If no value is specified for a single-valued property, the Nullable attribute defaults to true.

              In OData 4.01 responses a collection-valued property MUST specify a value for the Nullable attribute.

              If no value is specified for a collection-valued property, the client cannot assume any default value. Clients SHOULD be prepared for this situation even in OData 4.01 responses.

              -

              7.2.2 MaxLength

              -

              A positive integer value specifying the maximum length of a binary, stream or string value. For binary or stream values this is the octet length of the binary data, for string values it is the character length (number of code points for Unicode).

              -

              If no maximum length is specified, clients SHOULD expect arbitrary length.

              -
              -

              Attribute MaxLength

              -

              The value of MaxLength is a positive integer or the symbolic value max as a shorthand for the maximum length supported for the type by the service.

              -

              Note: the symbolic value max is only allowed in OData 4.0 responses; it is deprecated in OData 4.01. While clients MUST be prepared for this symbolic value, OData 4.01 and greater services MUST NOT return the symbolic value max and MAY instead specify the concrete maximum length supported for the type by the service or omit the attribute entirely.

              -
              -

              7.2.3 Precision

              -

              For a decimal value: the maximum number of significant decimal digits of the property's value; it MUST be a positive integer.

              -

              For a temporal value (datetime-with-timezone-offset, duration, or time-of-day): the number of decimal places allowed in the seconds portion of the value; it MUST be a non-negative integer between zero and twelve.

              -

              Note: service authors SHOULD be aware that some clients are unable to support a precision greater than 28 for decimal properties and 7 for temporal properties. Client developers MUST be aware of the potential for data loss when round-tripping values of greater precision. Updating via PATCH and exclusively specifying modified properties will reduce the risk for unintended data loss.

              -

              Note: duration properties supporting a granularity less than seconds (e.g. minutes, hours, days) can be annotated with term Measures.DurationGranularity, see OData-VocMeasures.

              -
              -

              Attribute Precision

              -

              The value of Precision is a number.

              -

              If not specified for a decimal property, the decimal property has arbitrary precision.

              -

              If not specified for a temporal property, the temporal property has a precision of zero.

              -
              -
              -

              Example 17: Precision facet applied to the DateTimeOffset type

              -
              <Property Name="SuggestedTimes" Type="Collection(Edm.DateTimeOffset)"
              -          Precision="6" />
              -
              -

              7.2.4 Scale

              -

              A non-negative integer value specifying the maximum number of digits allowed to the right of the decimal point, or one of the symbolic values floating or variable.

              -

              The value floating means that the decimal property represents a decimal floating-point number whose number of significant digits is the value of the Precision facet. OData 4.0 responses MUST NOT specify the value floating.

              -

              The value variable means that the number of digits to the right of the decimal point can vary from zero to the value of the Precision facet.

              -

              An integer value means that the number of digits to the right of the decimal point may vary from zero to the value of the Scale facet, and the number of digits to the left of the decimal point may vary from one to the value of the Precision facet minus the value of the Scale facet. If Precision is equal to Scale, a single zero MUST precede the decimal point.

              -

              The value of Scale MUST be less than or equal to the value of Precision.

              -

              Note: if the underlying data store allows negative scale, services may use a Precision with the absolute value of the negative scale added to the actual number of significant decimal digits, and client-provided values may have to be rounded before being stored.

              -
              -

              Attribute Scale

              -

              The value of Scale is a number or one of the symbolic values floating or variable.

              -

              Services SHOULD use lower-case values; clients SHOULD accept values in a case-insensitive manner.

              -

              If not specified, the Scale facet defaults to zero.

              -
              -
              -

              Example 18: Precision=3 and Scale=2. Allowed values: 1.23, 0.23, 3.14 and 0.7, not allowed values: 123, 12.3

              -
              <Property Name="Amount32" Type="Edm.Decimal" Precision="3" Scale="2" />
              -
              -
              -

              Example 19: Precision=2 equals Scale. Allowed values: 0.23, 0.7, not allowed values: 1.23, 1.2

              -
              <Property Name="Amount22" Type="Edm.Decimal" Precision="2" Scale="2" />
              -
              -
              -

              Example 20: Precision=3 and a variable Scale. Allowed values: 0.123, 1.23, 0.23, 0.7, 123 and 12.3, not allowed values: 12.34, 1234 and 123.4 due to the limited precision.

              -
              <Property Name="Amount3v" Type="Edm.Decimal" Precision="3" Scale="variable" />
              -
              -
              -

              Example 21: Precision=7 and a floating Scale. Allowed values: -1.234567e3, 1e-101, 9.999999e96, not allowed values: 1e-102 and 1e97 due to the limited precision.

              -
              <Property Name="Amount7f" Type="Edm.Decimal" Precision="7" Scale="floating" />
              -
              -

              7.2.5 Unicode

              -

              For a string property the Unicode facet indicates whether the property might contain and accept string values with Unicode characters (code points) beyond the ASCII character set. The value false indicates that the property will only contain and accept string values with characters limited to the ASCII character set.

              -

              If no value is specified, the Unicode facet defaults to true.

              -
              -

              Attribute Unicode

              -

              The value of Unicode is one of the Boolean literals true or false. Absence of the attribute means true.

              -
              -

              7.2.6 SRID

              -

              For a geometry or geography property the SRID facet identifies which spatial reference system is applied to values of the property on type instances.

              -

              The value of the SRID facet MUST be a non-negative integer or the special value variable. If no value is specified, the facet defaults to 0 for Geometry types or 4326 for Geography types.

              -

              The valid values of the SRID facet and their meanings are as defined by the European Petroleum Survey Group EPSG.

              -
              -

              Attribute SRID

              -

              The value of SRID is a number or the symbolic value variable.

              -
              -

              7.2.7 Default Value

              -

              A primitive or enumeration property MAY define a default value that is used if the property is not explicitly represented in an annotation or the body of a request or response.

              +

              7.3 Default Value

              +

              A primitive- or enumeration-typed property MAY define a default value that is used if the property is not explicitly represented in an annotation or the body of a request or response.

              If no value is specified, the client SHOULD NOT assume a default value.

              -

              Attribute DefaultValue

              +

              Attribute DefaultValue

              Default values of type Edm.String MUST be represented according to the XML escaping rules for character data in attribute values. Values of other primitive types MUST be represented according to the appropriate alternative in the primitiveValue rule defined in OData-ABNF, i.e. Edm.Binary as binaryValue, Edm.Boolean as booleanValue etc.


              8 Navigation Property

              A navigation property allows navigation to related entities. It MUST specify a unique name as well as a type.

              -

              The navigation property's name MUST be a simple identifier. It is used when referencing, serializing or deserializing the navigation property. It MUST be unique within the set of structural and navigation properties of the declaring structured type, and MUST NOT match the name of any structural property in any of its base types. If a navigation property with the same name is defined in any of this type's base types, then the navigation property's type MUST be a type derived from the type specified for the navigation property of the base type, and constrains this navigation property to be of the specified subtype for instances of this structured type. The name MUST NOT match the name of any structural or navigation property of any of this type's base types for OData 4.0 responses.

              +

              The navigation property’s name MUST be a simple identifier. It is used when referencing, serializing or deserializing the navigation property. It MUST be unique within the set of structural and navigation properties of the declaring structured type, and MUST NOT match the name of any structural property in any of its base types. If a navigation property with the same name is defined in any of this type’s base types, then the navigation property’s type MUST be a type derived from the type specified for the navigation property of the base type, and constrains this navigation property to be of the specified subtype for instances of this structured type. The name MUST NOT match the name of any structural or navigation property of any of this type’s base types for OData 4.0 responses.

              Names are case-sensitive, but service authors SHOULD NOT choose names that differ only in case.

              -

              Element edm:NavigationProperty

              +

              Element edm:NavigationProperty

              The edm:NavigationProperty element MUST contain the Name and Type attributes, and it MAY contain the attributes Nullable, Partner, and ContainsTarget.

              It MAY contain child elements edm:ReferentialConstraint and at most one child element edm:OnDelete.

              It MAY contain edm:Annotation elements.

              -

              Attribute Name

              -

              The value of Name is the navigation property's name.

              +

              Attribute Name

              +

              The value of Name is the navigation property’s name.

              Example 22: the Product entity type has a navigation property to a Category, which has a navigation link back to one or more products

              @@ -1164,22 +1185,22 @@

              </EntityType>

        8.1 Navigation Property Type

        -

        The navigation property's type MUST be an entity type in scope, the abstract type Edm.EntityType, or a collection of one of these types.

        +

        The navigation property’s type MUST be an entity type in scope, the abstract type Edm.EntityType, or a collection of one of these types.

        If the type is a collection, an arbitrary number of entities can be related. Otherwise there is at most one related entity.

        The related entities MUST be of the specified entity type or one of its subtypes.

        For a collection-valued containment navigation property the specified entity type MUST have a key defined.

        A collection-valued navigation property MAY be annotated with the Core.Ordered term, defined in OData-VocCore, to specify that it supports a stable ordering.

        A collection-valued navigation property MAY be annotated with the Core.PositionalInsert term, defined in OData-VocCore, to specify that it supports inserting items into a specific ordinal position.

        -

        Attribute Type

        -

        For single-valued navigation properties the value of Type is the qualified name of the navigation property's type.

        -

        For collection-valued navigation properties the value of Type is the character sequence Collection( followed by the qualified name of the navigation property's item type, followed by a closing parenthesis ).

        +

        Attribute Type

        +

        For single-valued navigation properties the value of Type is the qualified name of the navigation property’s type.

        +

        For collection-valued navigation properties the value of Type is the character sequence Collection( followed by the qualified name of the navigation property’s item type, followed by a closing parenthesis ).

        8.2 Nullable Navigation Property

        A Boolean value specifying whether the declaring type MAY have no related entity. If false, instances of the declaring structured type MUST always have a related entity.

        Nullable MUST NOT be specified for a collection-valued navigation property, a collection is allowed to have zero items.

        -

        Attribute Nullable

        +

        Attribute Nullable

        The value of Nullable is one of the Boolean literals true or false. Absence of the attribute means true.

        8.3 Partner Navigation Property

        @@ -1189,7 +1210,7 @@

        If no partner navigation property is specified, no assumptions can be made as to whether one of the navigation properties on the target type will lead back to the source entity.

        If a partner navigation property is specified, this partner navigation property MUST either specify the current navigation property as its partner to define a bi-directional relationship or it MUST NOT specify a partner navigation property. The latter can occur if the partner navigation property is defined on a complex type, or if the current navigation property is defined on a type derived from the type of the partner navigation property.

        -

        Attribute Partner

        +

        Attribute Partner

        The value of Partner is the path to the of the partner navigation property.

        8.4 Containment Navigation Property

        @@ -1206,22 +1227,22 @@

        -

        Attribute ContainsTarget

        +

        Attribute ContainsTarget

        The value of ContainsTarget is one of the Boolean literals true or false. Absence of the attribute means false.

        8.5 Referential Constraint

        A single-valued navigation property MAY define one or more referential constraints. A referential constraint asserts that the dependent property (the property defined on the structured type declaring the navigation property) MUST have the same value as the principal property (the referenced property declared on the entity type that is the target of the navigation).

        The type of the dependent property MUST match the type of the principal property, or both types MUST be complex types.

        -

        If the principle property references an entity, then the dependent property must reference the same entity.

        -

        If the principle property's value is a complex type instance, then the dependent property's value must be a complex type instance with the same properties, each with the same values.

        +

        If the principal property references an entity, then the dependent property must reference the same entity.

        +

        If the principal property’s value is a complex type instance, then the dependent property’s value must be a complex type instance with the same properties, each with the same values.

        If the navigation property on which the referential constraint is defined is nullable, or the principal property is nullable, then the dependent property MUST also be nullable. If both the navigation property and the principal property are not nullable, then the dependent property MUST NOT be nullable.

        -

        Element edm:ReferentialConstraint

        +

        Element edm:ReferentialConstraint

        The edm:ReferentialConstraint element MUST contain the attributes Property and ReferencedProperty.

        It MAY contain edm:Annotation elements.

        -

        Attribute Property

        +

        Attribute Property

        The Property attribute specifies the property that takes part in the referential constraint on the dependent structured type. Its value MUST be a path expression resolving to a property of the dependent structured type itself or to a property of a complex property (recursively) of the dependent structured type. The names of the properties in the path are joined together by forward slashes. The path is relative to the dependent structured type declaring the navigation property.

        -

        Attribute ReferencedProperty

        +

        Attribute ReferencedProperty

        The ReferencedProperty attribute specifies the corresponding property of the principal entity type. Its value MUST be a path expression resolving to a property of the principal entity type itself or to a property of a complex property (recursively) of the principal entity type that MUST have the same type as the property of the dependent entity type. The path is relative to the entity type that is the target of the navigation property.

        @@ -1259,10 +1280,10 @@

        8.6

      If no on-delete action is specified, the action taken by the service is not predictable by the client and could vary per entity.

      -

      Element edm:OnDelete

      +

      Element edm:OnDelete

      The edm:OnDelete element MUST contain the Action attribute.

      It MAY contain edm:Annotation elements.

      -

      Attribute Action

      +

      Attribute Action

      The value of Action is one of the values Cascade, None, SetNull, or SetDefault.

      @@ -1280,16 +1301,16 @@

      9 Complex Type

      Complex types are keyless nominal structured types. The lack of a key means that instances of complex types cannot be referenced, created, updated or deleted independently of an entity type. Complex types allow entity models to group properties into common structures.

      -

      The complex type's name is a simple identifier that MUST be unique within its schema.

      +

      The complex type’s name is a simple identifier that MUST be unique within its schema.

      A complex type can define two types of properties. A structural property is a named reference to a primitive, complex, or enumeration type, or a collection of primitive, complex, or enumeration types. A navigation property is a named reference to an entity type or a collection of entity types.

      All properties MUST have a unique name within a complex type. Properties MUST NOT have the same name as the declaring complex type. They MAY have the same name as one of the direct or indirect base types or derived types.

      -

      Element edm:ComplexType

      +

      Element edm:ComplexType

      The edm:ComplexType element MUST contain the Name attribute, and it MAY contain the BaseType, Abstract, and OpenType attributes.

      It MAY contain edm:Property and edm:NavigationProperty elements describing the properties of the complex type.

      It MAY contain edm:Annotation elements.

      -

      Attribute Name

      -

      The value of Name is the complex type's name.

      +

      Attribute Name

      +

      The value of Name is the complex type’s name.

      Example 25: a complex type used by two entity types

      @@ -1316,13 +1337,13 @@

      section 14.2.

      -

      Attribute BaseType

      +

      Attribute BaseType

      The value of BaseType is the qualified name of the base type.

      9.2 Abstract Complex Type

      A complex type MAY indicate that it is abstract and cannot have instances.

      -

      Attribute Abstract

      +

      Attribute Abstract

      The value of Abstract is one of the Boolean literals true or false. Absence of the attribute means false.

      9.3 Open Complex Type

      @@ -1330,22 +1351,22 @@

      A complex type derived from an open complex type MUST indicate that it is also open.

      Note: structural and navigation properties MAY be returned by the service on instances of any structured type, whether or not the type is marked as open. Clients MUST always be prepared to deal with additional properties on instances of any structured type, see OData‑Protocol.

      -

      Attribute OpenType

      +

      Attribute OpenType

      The value of OpenType is one of the Boolean literals true or false. Absence of the attribute means false.


      10 Enumeration Type

      Enumeration types are nominal types that represent a non-empty series of related values. Enumeration types expose these related values as members of the enumeration.

      -

      The enumeration type's name is a simple identifier that MUST be unique within its schema.

      +

      The enumeration type’s name is a simple identifier that MUST be unique within its schema.

      Although enumeration types have an underlying numeric value, the preferred representation for an enumeration value is the member name. Discrete sets of numeric values should be represented as numeric values annotated with the AllowedValues annotation defined in OData-VocCore.

      Enumeration types marked as flags allow values that consist of more than one enumeration member at a time.

      -

      Element edm:EnumType

      +

      Element edm:EnumType

      The edm:EnumType element MUST contain the Name attribute, and it MAY contain the UnderlyingType and IsFlags attributes.

      It MUST contain one or more edm:Member elements defining the members of the enumeration type.

      It MAY contain edm:Annotation elements.

      -

      Attribute Name

      -

      The value of Name is the enumeration type's name.

      +

      Attribute Name

      +

      The value of Name is the enumeration type’s name.

      Example 26: a simple flags-enabled enumeration

      @@ -1360,14 +1381,14 @@

      -

      Attribute UnderlyingType

      +

      Attribute UnderlyingType

      The value of UnderlyingType is the qualified name of the underlying type.

      10.2 Flags Enumeration Type

      An enumeration type MAY indicate that the enumeration type allows multiple members to be selected simultaneously.

      If not explicitly specified, only one enumeration type member MAY be selected simultaneously.

      -

      Attribute IsFlags

      +

      Attribute IsFlags

      The value of IsFlags is one of the Boolean literals true or false. Absence of the attribute means false.

      @@ -1395,12 +1416,12 @@

      -

      Element edm:Member

      +

      Element edm:Member

      The edm:Member element MUST contain the Name attribute and it MAY contain the Value attribute.

      It MAY contain edm:Annotation elements.

      -

      Attribute Name

      -

      The value of Name is the enumeration member's name.

      -

      Attribute Value

      +

      Attribute Name

      +

      The value of Name is the enumeration member’s name.

      +

      Attribute Value

      If the IsFlags attribute has a value of false, either all members MUST specify an integer value for the Value attribute, or all members MUST NOT specify a value for the Value attribute. If no values are specified, the members are assigned consecutive integer values in the order of their appearance, starting with zero for the first member. Client libraries MUST preserve elements in document order.

      If the IsFlags attribute has a value of true, a non-negative integer value MUST be specified for the Value attribute. A combined value is equivalent to the bitwise OR of the discrete values.

      @@ -1424,15 +1445,15 @@

      11 Type Definition

      A type definition defines a specialization of one of the primitive types or of the built-in abstract type Edm.PrimitiveType.

      -

      The type definition's name is a simple identifier that MUST be unique within its schema.

      +

      The type definition’s name is a simple identifier that MUST be unique within its schema.

      Type definitions can be used wherever a primitive type is used (other than as the underlying type in a new type definition) and are type-comparable with their underlying types and any type definitions defined using the same underlying type.

      It is up to the definition of a term to specify whether and how annotations with this term propagate to places where the annotated type definition is used, and whether they can be overridden.

      -

      Element edm:TypeDefinition

      +

      Element edm:TypeDefinition

      The edm:TypeDefinition element MUST contain the Name and UnderlyingType attributes.

      It MAY contain edm:Annotation elements.

      -

      Attribute Name

      -

      The value of Name is the type definition's name.

      +

      Attribute Name

      +

      The value of Name is the type definition’s name.

      Example 29:

      @@ -1454,7 +1475,7 @@

      11.1 Underlying Primitive Type

      The underlying type of a type definition MUST be a primitive type that MUST NOT be another type definition.

      -

      Attribute UnderlyingType

      +

      Attribute UnderlyingType

      The value of UnderlyingType is the qualified name of the underlying type.

      The type definition MAY specify facets applicable to the underlying type. Possible facets are: MaxLength, Unicode, Precision, Scale, or SRID.

      @@ -1465,7 +1486,7 @@

      A

      12 Action and Function

      12.1 Action

      Actions are service-defined operations that MAY have observable side effects and MAY return a single instance or a collection of instances of any type.

      -

      The action's name is a simple identifier that MUST be unique within its schema.

      +

      The action’s name is a simple identifier that MUST be unique within its schema.

      Actions cannot be composed with additional path segments.

      An action MAY specify a return type that MUST be a primitive, entity or complex type, or a collection of primitive, entity or complex types in scope.

      An action MAY define parameters used during the execution of the action.

      @@ -1474,16 +1495,16 @@

      Unbound actions do not support overloads. The names of all unbound actions MUST be unique within a schema.

      An unbound action MAY have the same name as a bound action.

      -

      Element edm:Action

      +

      Element edm:Action

      The edm:Action element MUST contain the Name attribute and it MAY contain the IsBound and EntitySetPath attributes.

      It MAY contain at most one edm:ReturnType element and MAY contain edm:Parameter elements.

      It MAY contain edm:Annotation elements.

      -

      Attribute Name

      -

      The value of Name is the action's name.

      +

      Attribute Name

      +

      The value of Name is the action’s name.

      12.3 Function

      Functions are service-defined operations that MUST NOT have observable side effects and MUST return a single instance or a collection of instances of any type.

      -

      The function's name is a simple identifier that MUST be unique within its schema.

      +

      The function’s name is a simple identifier that MUST be unique within its schema.

      Functions MAY be composable.

      The function MUST specify a return type which MUST be a primitive, entity or complex type, or a collection of primitive, entity or complex types in scope.

      A function MAY define parameters used during the execution of the function.

      @@ -1503,20 +1524,20 @@

      type definitions can be used to disambiguate overloads for both bound and unbound functions, even if they specify the same underlying type.

      -

      Element edm:Function

      +

      Element edm:Function

      The edm:Function element MUST contain the Name attribute and it MAY contain the IsBound and EntitySetPath attributes.

      It MUST contain one edm:ReturnType element, and it MAY contain edm:Parameter elements.

      It MAY contain edm:Annotation elements.

      -

      Attribute Name

      -

      The value of Name is the action's name.

      +

      Attribute Name

      +

      The value of Name is the action’s name.

      12.5 Bound or Unbound Action or Function Overloads

      An action or function overload MAY indicate that it is bound. If not explicitly indicated, it is unbound.

      -

      Bound actions or functions are invoked on resources matching the type of the binding parameter. The binding parameter can be of any type, and it MAY be nullable.

      +

      Bound actions or functions are invoked on resources matching the type of the binding parameter. The binding parameter can be of any type, and it MAY be nullable.

      Unbound actions are invoked from the entity container through an action import.

      Unbound functions are invoked as static functions within a common expression (see OData-URL, section 5.1.1), or from the entity container through a function import.

      -

      Attribute IsBound

      +

      Attribute IsBound

      The value of IsBound is one of the Boolean literals true or false. Absence of the attribute means false.

      12.6 Entity Set Path

      @@ -1525,28 +1546,28 @@

      12.6

      The first segment of the entity set path MUST be the name of the binding parameter. The remaining segments of the entity set path MUST represent navigation segments or type casts.

      A navigation segment names the simple identifier of the navigation property to be traversed. A type-cast segment names the qualified name of the entity type that should be returned from the type cast.

      -

      Attribute EntitySetPath

      +

      Attribute EntitySetPath

      The value of EntitySetPath is the entity set path.

      12.7 Composable Function

      A function MAY indicate that it is composable. If not explicitly indicated, it is not composable.

      A composable function can be invoked with additional path segments or key predicates appended to the resource path that identifies the composable function, and with system query options as appropriate for the type returned by the composable function.

      -

      Attribute IsComposable

      +

      Attribute IsComposable

      The value of IsComposable is one of the Boolean literals true or false. Absence of the attribute means false.

      12.8 Return Type

      The return type of an action or function overload MAY be any type in scope, or a collection of any type in scope.

      -

      The facets Nullable, MaxLength, Precision, Scale, and SRID can be used as appropriate to specify value restrictions of the return type, as well as the Unicode facet for 4.01 and greater payloads.

      +

      The facets MaxLength, Precision, Scale, and SRID can be used as appropriate to specify value restrictions of the return type, as well as the Unicode facet for 4.01 and greater payloads.

      For a single-valued return type the facets apply to the returned value. For a collection-valued return type the facets apply to the items in the returned collection.

      -

      Element edm:ReturnType

      +

      Element edm:ReturnType

      The edm:ReturnType element MUST contain the Type attribute, and it MAY contain the attributes Nullable, MaxLength, Unicode, Precision, Scale, and SRID.

      It MAY contain edm:Annotation elements.

      -

      Attribute Type

      +

      Attribute Type

      For single-valued return types the value of Type is the qualified name of the return type.

      For collection-valued return types the value of Type is the character sequence Collection( followed by the qualified name of the return item type, followed by a closing parenthesis ).

      -

      Attribute Nullable

      +

      Attribute Nullable

      The value of Nullable is one of the Boolean literals true or false. Absence of the attribute means true.

      If the return type is a collection of entity types, the Nullable attribute has no meaning and MUST NOT be specified.

      For other collection-valued return types the result will always be a collection that MAY be empty. In this case the Nullable attribute applies to items of the collection and specifies whether the collection MAY contain null values.

      @@ -1560,15 +1581,15 @@

      12.9 Parameter<

      The facets MaxLength, Precision, Scale, or SRID can be used as appropriate to specify value restrictions of the parameter, as well as the Unicode facet for 4.01 and greater payloads.

      For single-valued parameters the facets apply to the parameter value. If the parameter value is a collection, the facets apply to the items in the collection.

      -

      Element edm:Parameter

      +

      Element edm:Parameter

      The edm:Parameter element MUST contain the Name and the Type attribute, and it MAY contain the attributes Nullable, MaxLength, Unicode, Precision, Scale, and SRID.

      It MAY contain edm:Annotation elements.

      -

      Attribute Name

      -

      The value of Name is the parameter's name.

      -

      Attribute Type

      +

      Attribute Name

      +

      The value of Name is the parameter’s name.

      +

      Attribute Type

      For single-valued parameters the value of Type is the qualified name of the parameter.

      -

      For collection-valued parameters the value of Type is the character sequence Collection( followed by the qualified name of the parameter's type, followed by a closing parenthesis ).

      -

      Attribute Nullable

      +

      For collection-valued parameters the value of Type is the character sequence Collection( followed by the qualified name of the parameter’s type, followed by a closing parenthesis ).

      +

      Attribute Nullable

      The value of Nullable is one of the Boolean literals true or false. Absence of the attribute means true.

      The value true means that the parameter accepts a null value.

      @@ -1582,7 +1603,7 @@

      13 Entity Container

      Each metadata document used to describe an OData service MUST define exactly one entity container.

      -

      The entity container's name is a simple identifier that MUST be unique within its schema.

      +

      The entity container’s name is a simple identifier that MUST be unique within its schema.

      Entity containers define the entity sets, singletons, function and action imports exposed by the service.

      Entity set, singleton, action import, and function import names MUST be unique within an entity container.

      An entity set allows access to entity type instances. Simple entity models frequently have one entity set per entity type.

      @@ -1607,11 +1628,11 @@

      1

      A singleton allows addressing a single entity directly from the entity container without having to know its key, and without requiring an entity set.

      A function import or an action import is used to expose a function or action defined in an entity model as a top level resource.

      -

      Element edm:EntityContainer

      +

      Element edm:EntityContainer

      The edm:EntityContainer MUST contain one or more edm:EntitySet, edm:Singleton, edm:ActionImport, or edm:FunctionImport elements.

      It MAY contain edm:Annotation elements.

      -

      Attribute Name

      -

      The value of Name is the entity container's name.

      +

      Attribute Name

      +

      The value of Name is the entity container’s name.

      Example 33: An entity container aggregates entity sets, singletons, action imports, and function imports.

      @@ -1633,11 +1654,11 @@

      </EntityContainer>

      13.1 Extending an Entity Container

      -

      An entity container MAY specify that it extends another entity container in scope. All children of the "base" entity container are added to the "extending" entity container.

      -

      If the "extending" entity container defines an entity set with the same name as defined in any of its "base" containers, then the entity set's type MUST specify an entity type derived from the entity type specified for the identically named entity set in the "base" container. The same holds for singletons. Action imports and function imports cannot be redefined, nor can the "extending" container define a child with the same name as a child of a different kind in a "base" container.

      +

      An entity container MAY specify that it extends another entity container in scope. All children of the “base” entity container are added to the “extending” entity container.

      +

      If the “extending” entity container defines an entity set with the same name as defined in any of its “base” containers, then the entity set’s type MUST specify an entity type derived from the entity type specified for the identically named entity set in the “base” container. The same holds for singletons. Action imports and function imports cannot be redefined, nor can the “extending” container define a child with the same name as a child of a different kind in a “base” container.

      Note: services should not introduce cycles by extending entity containers. Clients should be prepared to process cycles introduced by extending entity containers.

      -

      Attribute Extends

      +

      Attribute Extends

      The value of Extends is the qualified name of the entity container to be extended.

      @@ -1654,15 +1675,15 @@

      13.2 Entity SetAn entity set MAY indicate whether it is included in the service document. If not explicitly indicated, it is included.

      Entity sets that cannot be queried without specifying additional query options SHOULD NOT be included in the service document.

      -

      Element edm:EntitySet

      +

      Element edm:EntitySet

      The edm:EntitySet element MUST contain the attributes Name and EntityType, and it MAY contain the IncludeInServiceDocument attribute.

      It MAY contain edm:NavigationPropertyBinding elements.

      It MAY contain edm:Annotation elements.

      -

      Attribute Name

      -

      The value of Name is the entity set's name.

      -

      Attribute EntityType

      +

      Attribute Name

      +

      The value of Name is the entity set’s name.

      +

      Attribute EntityType

      The value of EntityType is the qualified name of an entity type in scope.

      -

      Attribute IncludeInServiceDocument

      +

      Attribute IncludeInServiceDocument

      The value of IncludeInServiceDocument is one of the Boolean literals true or false. Absence of the attribute means true.

      13.3 Singleton

      @@ -1671,25 +1692,25 @@

      13.3 Singleton<

      A singleton MUST specify a type that MUST be an entity type in scope.

      A singleton MUST reference an instance its entity type.

      -

      Element edm:Singleton

      +

      Element edm:Singleton

      The edm:Singleton element MUST include the attributes Name and Type, and it MAY contain the Nullable attribute.

      It MAY contain edm:NavigationPropertyBinding elements.

      It MAY contain edm:Annotation elements.

      -

      Attribute Name

      -

      The value of Name is the singleton's name.

      -

      Attribute Type

      +

      Attribute Name

      +

      The value of Name is the singleton’s name.

      +

      Attribute Type

      The value of Type is whose value is the qualified name of an entity type in scope.

      -

      Attribute Nullable

      +

      Attribute Nullable

      The value of Nullable is one of the Boolean literals true or false.

      If no value is specified, the Nullable attribute defaults to false.

      In OData 4.0 responses this attribute MUST NOT be specified.

      13.4 Navigation Property Binding

      If the entity type of an entity set or singleton declares navigation properties, a navigation property binding allows describing which entity set or singleton will contain the related entities.

      -

      An entity set or a singleton SHOULD specify a navigation property binding for each navigation property of its entity type, including navigation properties defined on complex typed properties or derived types.

      +

      An entity set or a singleton SHOULD contain a navigation property binding for each non-containment navigation property that can be reached from the entity type through a sequence of type casts, complex properties, or containment navigation properties.

      If omitted, clients MUST assume that the target entity set or singleton can vary per related entity.

      13.4.1 Navigation Property Path Binding

      -

      A navigation property binding MUST specify a path to a navigation property of the entity set's or singleton's declared entity type, or a navigation property reached through a chain of type casts, complex properties, or containment navigation properties. If the navigation property is defined on a subtype, the path MUST contain the qualified name of the subtype, followed by a forward slash, followed by the navigation property name. If the navigation property is defined on a complex type used in the definition of the entity set's entity type, the path MUST contain a forward-slash separated list of complex property names and qualified type names that describe the path leading to the navigation property.

      +

      A navigation property binding MUST specify a path to a navigation property of the entity set’s or singleton’s declared entity type, or a navigation property reached through a chain of type casts, complex properties, or containment navigation properties. If the navigation property is defined on a subtype, the path MUST contain the qualified name of the subtype, followed by a forward slash, followed by the navigation property name. If the navigation property is defined on a complex type used in the definition of the entity set’s entity type, the path MUST contain a forward-slash separated list of complex property names and qualified type names that describe the path leading to the navigation property.

      The path can traverse one or more containment navigation properties, but the last navigation property segment MUST be a non-containment navigation property and there MUST NOT be any non-containment navigation properties prior to the final navigation property segment.

      If the path traverses collection-valued complex properties or collection-valued containment navigation properties, the binding applies to all items of these collections.

      If the path contains a recursive sub-path (i.e. a path leading back to the same structured type, the binding applies recursively to any positive number of cycles through that sub-path.

      @@ -1700,11 +1721,11 @@

      13.4.

      If the target is a simple identifier, it MUST resolve to an entity set or singleton defined in the same entity container.

      If the target is a target path, it MUST resolve to an entity set, singleton, or direct or indirect containment navigation property of a singleton in scope. The path can traverse single-valued containment navigation properties or single-valued complex properties before ending in a containment navigation property, and there MUST NOT be any non-containment navigation properties prior to the final segment.

      -

      Element edm:NavigationPropertyBinding

      +

      Element edm:NavigationPropertyBinding

      The edm:NavigationPropertyBinding element MUST contain the attributes Path and Target.

      -

      Attribute Path

      +

      Attribute Path

      The value of Path is a path expression.

      -

      Attribute Target

      +

      Attribute Target

      The value of Target is a target path.

      @@ -1722,7 +1743,7 @@

      </EntitySet>

      -

      Example 37: binding Supplier on Products contained within Categories – binding applies to all suppliers of all products of all categories

      +

      Example 37: binding Supplier on Products contained within Categories – binding applies to all suppliers of all products of all categories

      <EntitySet Name="Categories" EntityType="self.Category">
         <NavigationPropertyBinding Path="Products/Supplier"
                                    Target="Suppliers" />
      @@ -1734,14 +1755,14 @@ 

      13.5 Acti

      An action import MUST specify the name of an unbound action in scope.

      If the imported action returns an entity or a collection of entities, a simple identifier or target path value MAY be specified to identify the entity set that contains the returned entities. If a simple identifier is specified, it MUST resolve to an entity set defined in the same entity container. If a target path is specified, it MUST resolve to an entity set in scope.

      -

      Element edm:ActionImport

      +

      Element edm:ActionImport

      The edm:ActionImport element MUST contain the attributes Name and Action, and it MAY contain the EntitySet attribute.

      It MAY contain edm:Annotation elements.

      -

      Attribute Name

      -

      The value of Name is the action import's name.

      -

      Attribute Action

      +

      Attribute Name

      +

      The value of Name is the action import’s name.

      +

      Attribute Action

      The value of Action is the qualified name of an unbound action.

      -

      Attribute EntitySet

      +

      Attribute EntitySet

      The value of EntitySet is either the unqualified name of an entity set in the same entity container or a path to an entity set in a different entity container.

      13.6 Function Import

      @@ -1751,15 +1772,16 @@

      13.

      If the imported function returns an entity or a collection of entities, a simple identifier or target path value MAY be specified to identify the entity set that contains the returned entities. If a simple identifier is specified, it MUST resolve to an entity set defined in the same entity container. If a target path is specified, it MUST resolve to an entity set in scope.

      A function import for a parameterless function MAY indicate whether it is included in the service document. If not explicitly indicated, it is not included.

      -

      Element edm:FunctionImport

      +

      Element edm:FunctionImport

      The edm:FunctionImport element MUST contain the attributes Name and Function, and it MAY contain the attributes EntitySet and IncludeInServiceDocument.

      -

      Attribute Name

      -

      The value of Name is the function import's name.

      -

      Attribute Function

      +

      It MAY contain edm:Annotation elements.

      +

      Attribute Name

      +

      The value of Name is the function import’s name.

      +

      Attribute Function

      The value of Function is the qualified name of an unbound function.

      -

      Attribute EntitySet

      +

      Attribute EntitySet

      The value of EntitySet is either the unqualified name of an entity set in the same entity container or a path to an entity set in a different entity container.

      -

      Attribute IncludeInServiceDocument

      +

      Attribute IncludeInServiceDocument

      The value of IncludeInServiceDocument is one of the Boolean literals true or false. Absence of the attribute means false.


      @@ -1802,20 +1824,27 @@

      14.1 Term

      A term allows annotating a model element or OData resource representation with additional data.

      -

      The term's name is a simple identifier that MUST be unique within its schema.

      -

      The term's type MUST be a type in scope, or a collection of a type in scope.

      +

      The term’s name is a simple identifier that MUST be unique within its schema.

      +

      The term’s type MUST be a type in scope, or a collection of a type in scope.

      -

      Element edm:Term

      -

      The edm:Term element MUST contain the attributes Name and Type. It MAY contain the attributes BaseTerm and AppliesTo.

      -

      It MAY specify values for the Nullable, [ ]{.apple-converted-space}MaxLength, Precision, Scale, or SRID facet attributes, as well as the Unicode facet attribute for 4.01 and greater payloads. These facets and their implications are described in section 7.2.

      +

      Element edm:Term

      +

      The edm:Term element MUST contain the attributes Name and Type. It MAY contain the attributes Nullable, DefaultValue, BaseTerm and AppliesTo.

      +

      The facets MaxLength, Precision, Scale, and SRID can be used as appropriate, as well as the Unicode facet attribute for 4.01 and greater payloads.

      A edm:Term element whose Type attribute specifies a primitive or enumeration type MAY define a value for the DefaultValue attribute.

      It MAY contain edm:Annotation elements.

      -

      Attribute Name

      -

      The value of Name is the term's name.

      -

      Attribute Type

      -

      For single-valued properties the value of Type is the qualified name of the property's type.

      -

      For collection-valued properties the value of Type is the character sequence Collection( followed by the qualified name of the property's item type, followed by a closing parenthesis ).

      -

      Attribute DefaultValue

      +

      Attribute Name

      +

      The value of Name is the term’s name.

      +

      Attribute Type

      +

      For single-valued terms the value of Type is the qualified name of the term’s type.

      +

      For collection-valued properties the value of Type is the character sequence Collection( followed by the qualified name of the property’s item type, followed by a closing parenthesis ).

      +

      Attribute Nullable

      +

      The value of Nullable is one of the Boolean literals true or false.

      +

      For single-valued terms the value true means that annotations may have the null value.

      +

      For collection-valued terms the annotation value will always be a collection that MAY be empty. In this case the Nullable attribute applies to items of the collection and specifies whether the collection MAY contain null values.

      +

      If no value is specified for a single-valued term, the Nullable attribute defaults to true.

      +

      In OData 4.01 responses a collection-valued term MUST specify a value for the Nullable attribute.

      +

      If no value is specified for a collection-valued term, the client cannot assume any default value. Clients SHOULD be prepared for this situation even in OData 4.01 responses.

      +

      Attribute DefaultValue

      The value of this attribute determines the value of the term when applied in an edm:Annotation without providing an expression.

      Default values of type Edm.String MUST be represented according to the XML escaping rules for character data in attribute values. Values of other primitive types MUST be represented according to the appropriate alternative in the primitiveValue rule defined in OData-ABNF, i.e. Edm.Binary as binaryValue, Edm.Boolean as booleanValue etc.

      If no value is specified, the DefaultValue attribute defaults to null.

      @@ -1824,7 +1853,7 @@

      A term MAY specialize another term in scope by specifying it as its base term.

      When applying a specialized term, the base term MUST also be applied with the same qualifier, and so on until a term without a base term is reached.

      -

      Attribute BaseTerm

      +

      Attribute BaseTerm

      The value of BaseTerm is the qualified name of the base term.

      14.1.2 Applicability

      @@ -1972,7 +2001,7 @@

      14.1.2
      -

      Attribute AppliesTo

      +

      Attribute AppliesTo

      The value of AppliesTo is a whitespace-separated list of symbolic values from the table above that identify model elements the term is intended to be applied to.

      @@ -1991,13 +2020,13 @@

      14.2 Annotation<

      An annotation applies a term to a model element and defines how to calculate a value for the term application. Both term and model element MUST be in scope. Section 14.1.2 specifies which model elements MAY be annotated with a term.

      The value of an annotation is specified as an annotation expression, which is either a constant expression representing a constant value, or a dynamic expression. The most common construct for assigning an annotation value is a path expression that refers to a property of the same or a related structured type.

      -

      Element edm:Annotation

      +

      Element edm:Annotation

      The edm:Annotation element MUST contain the attribute Term, and it MAY contain the attribute Qualifier.

      The value of the annotation MAY be a constant expression or dynamic expression.

      If no expression is specified for a term with a primitive type, the annotation evaluates to the default value of the term definition. If no expression is specified for a term with a complex type, the annotation evaluates to a complex instance with default values for its properties. If no expression is specified for a collection-valued term, the annotation evaluates to an empty collection.

      An edm:Annotation element can be used as a child of the model element it annotates, or as the child of an edm:Annotations element that targets the model element to be annotated.

      An edm:Annotation element MAY contain edm:Annotation elements that annotate the annotation.

      -

      Attribute Term

      +

      Attribute Term

      The value of Term is the qualified name of a term in scope.

      @@ -2013,14 +2042,14 @@

      </Property> <Property Name="Currency" Type="Edm.String" MaxLength="3" />

      -

      If an entity type or complex type is annotated with a term that itself has a structured type, an instance of the annotated type may be viewed as an "instance" of the term, and the qualified term name may be used as a term-cast segment in path expressions.

      -

      Structured types "inherit" annotations from their direct or indirect base types. If both the type and one of its base types is annotated with the same term and qualifier, the annotation on the type completely replaces the annotation on the base type; structured or collection-valued annotation values are not merged. Similarly, properties of a structured type inherit annotations from identically named properties of a base type.

      -

      It is up to the definition of a term to specify whether and how annotations with this term propagate to places where the annotated model element is used, and whether they can be overridden. E.g. a "Label" annotation for a UI can propagate from a type definition to all properties using that type definition and may be overridden at each property with a more specific label, whereas an annotation marking a type definition as containing a phone number will propagate to all using properties but may not be overridden.

      +

      If an entity type or complex type is annotated with a term that itself has a structured type, an instance of the annotated type may be viewed as an “instance” of the term, and the qualified term name may be used as a term-cast segment in path expressions.

      +

      Structured types “inherit” annotations from their direct or indirect base types. If both the type and one of its base types is annotated with the same term and qualifier, the annotation on the type completely replaces the annotation on the base type; structured or collection-valued annotation values are not merged. Similarly, properties of a structured type inherit annotations from identically named properties of a base type.

      +

      It is up to the definition of a term to specify whether and how annotations with this term propagate to places where the annotated model element is used, and whether they can be overridden. E.g. a “Label” annotation for a UI can propagate from a type definition to all properties using that type definition and may be overridden at each property with a more specific label, whereas an annotation marking a type definition as containing a phone number will propagate to all using properties but may not be overridden.

      14.2.1 Qualifier

      A term can be applied multiple times to the same model element by providing a qualifier to distinguish the annotations. The qualifier is a simple identifier.

      The combination of target model element, term, and qualifier uniquely identifies an annotation.

      -

      Attribute Qualifier

      +

      Attribute Qualifier

      Annotation elements that are children of an edm:Annotations element MUST NOT provide a value for the qualifier attribute if the parent edm:Annotations element provides a value for the qualifier attribute.

      @@ -2030,7 +2059,7 @@

      Attribute <

      14.2.2 Target

      The target of an annotation is the model element the term is applied to.

      -

      The target of an annotation MAY be specified indirectly by "nesting" the annotation within the model element. Whether and how this is possible is described per model element in this specification.

      +

      The target of an annotation MAY be specified indirectly by “nesting” the annotation within the model element. Whether and how this is possible is described per model element in this specification.

      The target of an annotation MAY also be specified directly; this allows defining an annotation in a different schema than the targeted model element.

      This external targeting is only possible for model elements that are uniquely identified within their parent, and all their ancestor elements are uniquely identified within their parent.

      These are the direct children of a schema with a unique name (i.e. except actions and functions whose overloads to not possess a natural identifier), and all direct children of an entity container.

      @@ -2171,7 +2200,7 @@

      14.3.1 Binary

      -

      Expression edm:Binary

      +

      Expression edm:Binary

      The edm:Binary expression evaluates to a primitive binary value. A binary expression MUST be assigned a value conforming to the rule binaryValue in OData-ABNF.

      The binary expression MAY be provided using element notation or attribute notation.

      @@ -2185,7 +2214,7 @@

      Expression

      14.3.2 Boolean

      -

      Expression edm:Bool

      +

      Expression edm:Bool

      The edm:Bool expression evaluates to a primitive Boolean value. A Boolean expression MUST be assigned a Boolean value.

      The Boolean expression MAY be provided using element notation or attribute notation.

      @@ -2199,7 +2228,7 @@

      Expression

      14.3.3 Date

      -

      Expression edm:Date

      +

      Expression edm:Date

      The edm:Date expression evaluates to a primitive date value. A date expression MUST be assigned a value of type xs:date, see XML-Schema-2, section 3.3.9. The value MUST also conform to rule dateValue in OData-ABNF, i.e. it MUST NOT contain a time-zone offset.

      The date expression MAY be provided using element notation or attribute notation.

      @@ -2213,7 +2242,7 @@

      Expression

      14.3.4 DateTimeOffset

      -

      Expression edm:DateTimeOffset

      +

      Expression edm:DateTimeOffset

      The edm:DateTimeOffset expression evaluates to a primitive datetimestamp value with a time-zone offset. A datetimestamp expression MUST be assigned a value of type xs:dateTimeStamp, see XML-Schema-2, section 3.4.28. The value MUST also conform to rule dateTimeOffsetValue in OData-ABNF, i.e. it MUST NOT contain an end-of-day fragment (24:00:00).

      The datetimestamp expression MAY be provided using element notation or attribute notation.

      @@ -2229,7 +2258,7 @@

      14.3.5 Decimal

      -

      Expression edm:Decimal

      +

      Expression edm:Decimal

      The edm:Decimal expression evaluates to a primitive decimal value. A decimal expression MUST be assigned a value conforming to the rule decimalValue in OData-ABNF.

      The decimal expression MAY be provided using element notation or attribute notation.

      @@ -2245,7 +2274,7 @@

      Expression

      14.3.6 Duration

      -

      Expression edm:Duration

      +

      Expression edm:Duration

      The edm:Duration expression evaluates to a primitive duration value. A duration expression MUST be assigned a value of type xs:dayTimeDuration, see XML-Schema-2, section 3.4.27.

      The duration expression MAY be provided using element notation or attribute notation.

      @@ -2259,7 +2288,7 @@

      Expressio

      14.3.7 Enumeration Member

      -

      Expression edm:EnumMember

      +

      Expression edm:EnumMember

      The edm:EnumMember expression references a member of an enumeration type. An enumeration member expression MUST be assigned a value that consists of the qualified name of the enumeration type, followed by a forward slash and the name of the enumeration member. If the enumeration type specifies an IsFlags attribute with value true, the expression MAY also be assigned a whitespace-separated list of values. Each of these values MUST resolve to the name of a member of the enumeration type of the specified term.

      The enumeration member expression MAY be provided using element notation or attribute notation.

      @@ -2283,7 +2312,7 @@

      Expre

      14.3.8 Floating-Point Number

      -

      Expression edm:Float

      +

      Expression edm:Float

      The edm:Float expression evaluates to a primitive floating point (or double) value. A float expression MUST be assigned a value conforming to the rule doubleValue in OData-ABNF.

      The float expression MAY be provided using element notation or attribute notation.

      @@ -2297,7 +2326,7 @@

      Expression

      14.3.9 Guid

      -

      Expression edm:Guid

      +

      Expression edm:Guid

      The edm:Guid expression evaluates to a primitive guid value. A guid expression MUST be assigned a value conforming to the rule guidValue in OData-ABNF.

      The guid expression MAY be provided using element notation or attribute notation.

      @@ -2312,7 +2341,7 @@

      Expression

      14.3.10 Integer

      -

      Expression edm:Int

      +

      Expression edm:Int

      The edm:Int expression evaluates to a primitive integer value. An integer MUST be assigned a value conforming to the rule int64Value in OData-ABNF.

      The integer expression MAY be provided using element notation or attribute notation.

      @@ -2328,7 +2357,7 @@

      Expression ed

      14.3.11 String

      -

      Expression edm:String

      +

      Expression edm:String

      The edm:String expression evaluates to a primitive string value. A string expression MUST be assigned a value of the type xs:string, see XML-Schema-2, section 3.3.1.

      The string expression MAY be provided using element notation or attribute notation.

      @@ -2342,7 +2371,7 @@

      Expression

      14.3.12 Time of Day

      -

      Expression edm:TimeOfDay

      +

      Expression edm:TimeOfDay

      The edm:TimeOfDay expression evaluates to a primitive time value. A time-of-day expression MUST be assigned a value conforming to the rule timeOfDayValue in OData-ABNF.

      The time-of-day expression MAY be provided using element notation or attribute notation.

      @@ -2370,7 +2399,7 @@

      14.4.1.1 Path

      Example 58: absolute path to an entity set

      /My.Schema.MyEntityContainer/MyEntitySet
      -

      Paths not starting with a forward slash are interpreted relative to the annotation target, following the rules specified in section "Path Evaluation".

      +

      Paths not starting with a forward slash are interpreted relative to the annotation target, following the rules specified in section “Path Evaluation”.

      Example 59: relative path to a property

      Address/City
      @@ -2380,7 +2409,7 @@

      14.4.1.1 Path

      Example 60: type-cast segment

      .../self.Manager/...

      -

      If a path segment starts with an at (@) character, it represents a term cast. The at (@) character MUST be followed by a qualified name that MAY be followed by a hash (#) character and a simple identifier. The qualified name preceding the hash character MUST resolve to a term that is in scope, the simple identifier following the hash sign is interpreted as a qualifier for the term. If the model element or instance identified by the preceding path part has not been annotated with that term (and if present, with that qualifier), the term cast evaluates to the null value. Four special terms are implicitly "annotated" for media entities and stream properties:

      +

      If a path segment starts with an at (@) character, it represents a term cast. The at (@) character MUST be followed by a qualified name that MAY be followed by a hash (#) character and a simple identifier. The qualified name preceding the hash character MUST resolve to a term that is in scope, the simple identifier following the hash sign is interpreted as a qualifier for the term. If the model element or instance identified by the preceding path part has not been annotated with that term (and if present, with that qualifier), the term cast evaluates to the null value. Four special terms are implicitly “annotated” for media entities and stream properties:

      • odata.mediaEditLink
      • odata.mediaReadLink
      • @@ -2423,115 +2452,165 @@

        14.4.1.1 Path

        14.4.1.2 Path Evaluation

        Annotations MAY be embedded within their target, or specified separately, e.g. as part of a different schema, and specify a path to their target model element. The latter situation is referred to as targeting in the remainder of this section.

        -

        For annotations embedded within or targeting an entity container, the path is evaluated starting at the entity container, i.e. an empty path resolves to the entity container, and non-empty paths MUST start with a segment identifying a container child (entity set, function import, action import, or singleton). The subsequent segments follow the rules for paths targeting the corresponding child element.

        -

        For annotations embedded within or targeting an entity set or a singleton, the path is evaluated starting at the entity set or singleton, i.e. an empty path resolves to the entity set or singleton, and non-empty paths MUST follow the rules for annotations targeting the declared entity type of the entity set or singleton.

        -

        For annotations embedded within or targeting an entity type or complex type, the path is evaluated starting at the type, i.e. an empty path resolves to the type, and the first segment of a non-empty path MUST be a structural or navigation property of the type, a type cast, or a term cast.

        -

        For annotations embedded within a structural or navigation property of an entity type or complex type, the path is evaluated starting at the directly enclosing type. This allows e.g. specifying the value of an annotation on one property to be calculated from values of other properties of the same type. An empty path resolves to the enclosing type, and non-empty paths MUST follow the rules for annotations targeting the directly enclosing type.

        -

        For annotations targeting a structural or navigation property of an entity type or complex type, the path is evaluated starting at the outermost entity type or complex type named in the target of the annotation, i.e. an empty path resolves to the outermost type, and the first segment of a non-empty path MUST be a structural or navigation property of the outermost type, a type cast, or a term cast.

        -

        For annotations embedded within or targeting an action, action import, function, function import, parameter, or return type, the first segment of the path MUST be a parameter name or $ReturnType.

        +

        The host of an annotation is the model element targeted by the annotation, unless that target is another annotation or a model element (collection, record or property value) directly or indirectly embedded within another annotation, in which case the host is the host of that other annotation.

        +

        If the value of an annotation is expressed dynamically with a path expression, the path evaluation rules for this expression depend upon the model element by which the annotation is hosted.

        +

        For annotations hosted by an entity container, the path is evaluated starting at the entity container, i.e. an empty path resolves to the entity container, and non-empty paths MUST start with a segment identifying a container child (entity set, function import, action import, or singleton). The subsequent segments follow the rules for path expressions targeting the corresponding child element.

        +

        For annotations hosted by an entity set or a singleton, the path is evaluated starting at the entity set or singleton, i.e. an empty path resolves to the entity set or singleton, and non-empty paths MUST follow the rules for annotations targeting the declared entity type of the entity set or singleton.

        +

        For annotations hosted by an entity type or complex type, the path is evaluated starting at the type, i.e. an empty path resolves to the type, and the first segment of a non-empty path MUST be a structural or navigation property of the type, a type cast, or a term cast.

        +

        For annotations hosted by an action, action import, function, function import, parameter, or return type, the first segment of the path MUST be the name of a parameter of the action or function or $ReturnType.

        +

        For annotations hosted by a structural or navigation property, the path evaluation rules additionally depend upon how the annotation target is specified, as follows:

        +
          +
        1. If the annotation is directly or indirectly embedded within the hosting property, the path is evaluated starting at the directly enclosing type of the hosting property. This allows e.g. specifying the value of an annotation on one property to be calculated from values of other properties of the same enclosing type. An empty path resolves to the enclosing type, and non-empty paths MUST follow the rules for annotations targeting the directly enclosing type.

        2. +
        3. If the annotation uses targeting and the target path starts with an entity container, or the annotation is directly or indirectly embedded within such an annotation, the path is evaluated starting at the declared type of the hosting property. An empty path resolves to the declared type of the property, and non-empty paths MUST follow the rules for annotations targeting the declared type of the property. If the type is primitive, the first segment of a non-empty path MUST be a type cast or a term cast.

        4. +
        5. If the annotation uses targeting and the target path does not start with an entity container, or the annotation is directly or indirectly embedded within such an annotation, the path is evaluated starting at the outermost entity type or complex type named in the target path. This allows e.g. specifying the value of an annotation on one property to be calculated from values of other properties of the outermost type. An empty path resolves to the outermost type, and the first segment of a non-empty path MUST be a structural or navigation property of the outermost type, a type cast, or a term cast.

        6. +
        +
        +

        Example 67: Annotations hosted by property A2 in various modes

        +

        Path evaluation for the annotations in the first block starts at the directly enclosing type self.A of the hosting property A2.

        +
        +
        <Schema Namespace="self">
        +  <EntityType Name="A">
        +    <Property Name="A1" Type="Edm.Boolean" Nullable="false" />
        +    <Property Name="A2" Type="self.B" Nullable="false">
        +      <Annotation Term="Core.Description" String="...">
        +        <Annotation Term="Core.IsLanguageDependent" Path="A1" />
        +      </Annotation>
        +    </Property>
        +  </EntityType>
        +  <ComplexType Name="B">
        +    <Property Name="B1" Type="Edm.Boolean" Nullable="false" />
        +  </ComplexType>
        +
        +

        Path evaluation for the annotations in the next block starts at the declared type self.B of the hosting property A2.

        +
        +
          <EntityContainer Name="Container">
        +    <EntitySet Name="SetA" EntityType="self.A" />
        +  </EntityContainer>
        +  <Annotations Target="self.Container/SetA/A2">
        +    <Annotation Term="Core.Description" Qualifier="viaset" String="...">
        +      <Annotation Term="Core.IsLanguageDependent" Path="B1" />
        +    </Annotation>
        +  </Annotations>
        +  <Annotations Target="self.Container/SetA/A2/@Core.Description#viaset">
        +    <Annotation Term="Core.IsLanguageDependent" Path="B1" />
        +  </Annotations>
        +
        +

        Path evaluation for the annotations in the final block starts at the outermost type self.A named in the target path.

        +
        +
          <Annotations Target="self.A/A2">
        +    <Annotation Term="Core.Description" Qualifier="external" String="...">
        +      <Annotation Term="Core.IsLanguageDependent" Path="A1" />
        +    </Annotation>
        +  </Annotations>
        +  <Annotations Target="self.A/A2/@Core.Description">
        +    <Annotation Term="Core.IsLanguageDependent" Path="A1" />
        +  </Annotations>
        +</Schema>
        +
        +

        14.4.1.3 Annotation Path

        -

        The annotation path expression provides a value for terms or term properties that specify the built-in types Edm.AnnotationPath or Edm.ModelElementPath. Its argument is a model path with the following restriction:

        +

        The annotation path expression provides a value for terms or term properties that specify the built-in types Edm.AnnotationPath or Edm.ModelElementPath. Its argument is a model path with the following restriction:

        • A non-null path MUST resolve to an annotation.

        A term or term property of type Edm.AnnotationPath can be annotated with term Validation.AllowedTerms (see OData-VocValidation) if its intended value is an annotation path that ends in a term cast with one of the listed terms.

        The value of the annotation path expression is the path itself, not the value of the annotation identified by the path. This is useful for terms that reuse or refer to other terms.

        -

        Expression edm:AnnotationPath

        +

        Expression edm:AnnotationPath

        The edm:AnnotationPath expression MAY be provided using element notation or attribute notation.

        -

        Example 67:

        -
        <Annotation Term="UI.ReferenceFacet"
        -            AnnotationPath="Product/Supplier/@UI.LineItem" />
        -
        -<Annotation Term="UI.CollectionFacet" Qualifier="Contacts">
        -  <Collection>
        -    <AnnotationPath>Supplier/@Communication.Contact</AnnotationPath>
        -    <AnnotationPath>Customer/@Communication.Contact</AnnotationPath>
        -  </Collection>
        -</Annotation>
        +

        Example 68:

        +
        <Annotation Term="UI.ReferenceFacet"
        +            AnnotationPath="Product/Supplier/@UI.LineItem" />
        +
        +<Annotation Term="UI.CollectionFacet" Qualifier="Contacts">
        +  <Collection>
        +    <AnnotationPath>Supplier/@Communication.Contact</AnnotationPath>
        +    <AnnotationPath>Customer/@Communication.Contact</AnnotationPath>
        +  </Collection>
        +</Annotation>

        14.4.1.4 Model Element Path

        -

        The model element path expression provides a value for terms or term properties that specify the built-in type Edm.ModelElementPath. Its argument is a model path.

        +

        The model element path expression provides a value for terms or term properties that specify the built-in type Edm.ModelElementPath. Its argument is a model path.

        The value of the model element path expression is the path itself, not the instance(s) identified by the path.

        -

        Expression edm:ModelElementPath

        +

        Expression edm:ModelElementPath

        The edm:ModelElementPath expression MAY be provided using element notation or attribute notation.

        -

        Example 68:

        -
        <Annotation Term="org.example.MyFavoriteModelElement"
        -            ModelElementPath="/org.example.someAction" />
        -
        -<Annotation Term="org.example.MyFavoriteModelElement">
        -  <ModelElementPath>/org.example.someAction</ModelElementPath>
        -</Annotation>
        +

        Example 69:

        +
        <Annotation Term="org.example.MyFavoriteModelElement"
        +            ModelElementPath="/org.example.someAction" />
        +
        +<Annotation Term="org.example.MyFavoriteModelElement">
        +  <ModelElementPath>/org.example.someAction</ModelElementPath>
        +</Annotation>

        14.4.1.5 Navigation Property Path

        -

        The navigation property path expression provides a value for terms or term properties that specify the built-in types Edm.NavigationPropertyPath, Edm.AnyPropertyPath, or Edm.ModelElementPath. Its argument is a model path with the following restriction:

        +

        The navigation property path expression provides a value for terms or term properties that specify the built-in types Edm.NavigationPropertyPath, Edm.AnyPropertyPath, or Edm.ModelElementPath. Its argument is a model path with the following restriction:

        • A non-null path MUST resolve to a model element whose type is an entity type, or a collection of entity types, e.g. a navigation property.

        The value of the navigation property path expression is the path itself, not the entitiy or collection of entities identified by the path.

        -

        Expression edm:NavigationPropertyPath

        +

        Expression edm:NavigationPropertyPath

        The edm:NavigationPropertyPath expression MAY be provided using element notation or attribute notation.

        -

        Example 69:

        -
        <Annotation Term="UI.HyperLink" NavigationPropertyPath="Supplier" />
        -
        -<Annotation Term="Capabilities.UpdateRestrictions">
        -  <Record>
        -    <PropertyValue Property="NonUpdatableNavigationProperties">
        -      <Collection>
        -        <NavigationPropertyPath>Supplier</NavigationPropertyPath>
        -        <NavigationPropertyPath>Category</NavigationPropertyPath>
        -      </Collection>
        -    </PropertyValue>
        -  </Record>
        -</Annotation>
        +

        Example 70:

        +
        <Annotation Term="UI.HyperLink" NavigationPropertyPath="Supplier" />
        +
        +<Annotation Term="Capabilities.UpdateRestrictions">
        +  <Record>
        +    <PropertyValue Property="NonUpdatableNavigationProperties">
        +      <Collection>
        +        <NavigationPropertyPath>Supplier</NavigationPropertyPath>
        +        <NavigationPropertyPath>Category</NavigationPropertyPath>
        +      </Collection>
        +    </PropertyValue>
        +  </Record>
        +</Annotation>

        14.4.1.6 Property Path

        -

        The property path expression provides a value for terms or term properties that specify one of the built-in types Edm.PropertyPath, Edm.AnyPropertyPath, or Edm.ModelElementPath. Its argument is a model path with the following restriction:

        +

        The property path expression provides a value for terms or term properties that specify one of the built-in types Edm.PropertyPath, Edm.AnyPropertyPath, or Edm.ModelElementPath. Its argument is a model path with the following restriction:

        • A non-null path MUST resolve to a model element whose type is a primitive or complex type, an enumeration type, a type definition, or a collection of one of these types.

        The value of the property path expression is the path itself, not the value of the structural property or the value of the term cast identified by the path.

        -

        Expression edm:PropertyPath

        +

        Expression edm:PropertyPath

        The edm:PropertyPath MAY be provided using either element notation or attribute notation.

        -

        Example 70:

        -
        <Annotation Term="UI.RefreshOnChangeOf" PropertyPath="ChangedAt" />
        -
        -<Annotation Term="Capabilities.UpdateRestrictions">
        -  <Record>
        -    <PropertyValue Property="NonUpdatableProperties">
        -      <Collection>
        -        <PropertyPath>CreatedAt</PropertyPath>
        -        <PropertyPath>ChangedAt</PropertyPath>
        -      </Collection>
        -    </PropertyValue>
        -  </Record>
        -</Annotation>
        +

        Example 71:

        +
        <Annotation Term="UI.RefreshOnChangeOf" PropertyPath="ChangedAt" />
        +
        +<Annotation Term="Capabilities.UpdateRestrictions">
        +  <Record>
        +    <PropertyValue Property="NonUpdatableProperties">
        +      <Collection>
        +        <PropertyPath>CreatedAt</PropertyPath>
        +        <PropertyPath>ChangedAt</PropertyPath>
        +      </Collection>
        +    </PropertyValue>
        +  </Record>
        +</Annotation>

        14.4.1.7 Value Path

        The value path expression allows assigning a value by traversing an object graph. It can be used in annotations that target entity containers, entity sets, entity types, complex types, navigation properties of structured types, and structural properties of structured types. Its argument is an instance path.

        The value of the path expression is the instance or collection of instances identified by the path.

        -

        Expression edm:Path

        +

        Expression edm:Path

        The edm:Path expression MAY be provided using element notation or attribute notation.

        -

        Example 71:

        -
        <Annotation Term="org.example.display.DisplayName" Path="FirstName" />
        -
        -<Annotation Term="org.example.display.DisplayName">
        -  <Path>@vCard.Address#work/FullName</Path>
        -</Annotation>
        +

        Example 72:

        +
        <Annotation Term="org.example.display.DisplayName" Path="FirstName" />
        +
        +<Annotation Term="org.example.display.DisplayName">
        +  <Path>@vCard.Address#work/FullName</Path>
        +</Annotation>

        14.4.2 Comparison and Logical Operators

        Annotations MAY use the following logical and comparison expressions which evaluate to a Boolean value. These expressions MAY be combined and they MAY be used anywhere instead of a Boolean expression.

        @@ -2555,64 +2634,64 @@

        OData-URL.

        The other comparison operators require two operand expressions that evaluate to comparable values.

        -

        Expressions edm:And and edm:Or

        +

        Expressions edm:And and edm:Or

        The And and Or logical expressions are represented as elements edm:And and edm:Or that MUST contain two annotation expressions.

        It MAY contain edm:Annotation elements.

        -

        Expression edm:Not

        +

        Expression edm:Not

        Negation expressions are represented as an element edm:Not that MUST contain a single annotation expression.

        It MAY contain edm:Annotation elements.

        -

        Expressions edm:Eq, edm:Ne, edm:Gt, edm:Ge, edm:Lt, edm:Le, edm:Has, and edm:In

        +

        Expressions edm:Eq, edm:Ne, edm:Gt, edm:Ge, edm:Lt, edm:Le, edm:Has, and edm:In

        All comparison expressions are represented as an element that MUST contain two annotation expressions.

        They MAY contain edm:Annotation elements.

        -

        Example 72:

        -
        <And>
        -  <Path>IsMale</Path>
        -  <Path>IsMarried</Path>
        -</And>
        -<Or>
        -  <Path>IsMale</Path>
        -  <Path>IsMarried</Path>
        -</Or>
        -<Not>
        -  <Path>IsMale</Path>
        -</Not>
        -<Eq>
        -  <Null />
        -  <Path>IsMale</Path>
        -</Eq>
        -<Ne>
        -  <Null />
        -  <Path>IsMale</Path>
        -</Ne>
        -<Gt>
        -  <Path>Price</Path>
        -  <Int>20</Int>
        -</Gt>
        -<Ge>
        -  <Path>Price</Path>
        -  <Int>10</Int>
        -</Ge>
        -<Lt>
        -  <Path>Price</Path>
        -  <Int>20</Int>
        -</Lt>
        -<Le>
        -  <Path>Price</Path>
        -  <Int>100</Int>
        -</Le>
        -<Has>
        -  <Path>Fabric</Path>
        -  <EnumMember>org.example.Pattern/Red</EnumMember>
        -</Has>
        -<In>
        -  <Path>Size</Path>
        -  <Collection>
        -    <String>XS</String>
        -    <String>S</String>
        -  </Collection>
        -</In>
        +

        Example 73:

        +
        <And>
        +  <Path>IsMale</Path>
        +  <Path>IsMarried</Path>
        +</And>
        +<Or>
        +  <Path>IsMale</Path>
        +  <Path>IsMarried</Path>
        +</Or>
        +<Not>
        +  <Path>IsMale</Path>
        +</Not>
        +<Eq>
        +  <Null />
        +  <Path>IsMale</Path>
        +</Eq>
        +<Ne>
        +  <Null />
        +  <Path>IsMale</Path>
        +</Ne>
        +<Gt>
        +  <Path>Price</Path>
        +  <Int>20</Int>
        +</Gt>
        +<Ge>
        +  <Path>Price</Path>
        +  <Int>10</Int>
        +</Ge>
        +<Lt>
        +  <Path>Price</Path>
        +  <Int>20</Int>
        +</Lt>
        +<Le>
        +  <Path>Price</Path>
        +  <Int>100</Int>
        +</Le>
        +<Has>
        +  <Path>Fabric</Path>
        +  <EnumMember>org.example.Pattern/Red</EnumMember>
        +</Has>
        +<In>
        +  <Path>Size</Path>
        +  <Collection>
        +    <String>XS</String>
        +    <String>S</String>
        +  </Collection>
        +</In>

        14.4.3 Arithmetic Operators

        Annotations MAY use the following arithmetic expressions which evaluate to a numeric value. These expressions MAY be combined, and they MAY be used anywhere instead of a numeric expression of the appropriate type. The semantics and evaluation rules for each arithmetic expression is identical to the corresponding arithmetic operator defined in OData-URL.

        @@ -2656,50 +2735,50 @@

        -

        Expression edm:Neg

        +

        Expression edm:Neg

        Negation expressions are represented as an element edm:Neg that MUST contain a single annotation expression.

        It MAY contain edm:Annotation elements.

        -

        Expressions edm:Add, edm:Sub, edm:Mul, edm:Div, edm:DivBy, and edm:Mod

        +

        Expressions edm:Add, edm:Sub, edm:Mul, edm:Div, edm:DivBy, and edm:Mod

        These arithmetic expressions are represented as an element that MUST contain two annotation expressions.

        They MAY contain edm:Annotation elements.

        -

        Example 73:

        -
        <Add>
        -  <Path>StartDate</Path>
        -  <Path>Duration</Path>
        -</Add>
        -<Sub>
        -  <Path>Revenue</Path>
        -  <Path>Cost</Path>
        -</Sub>
        -<Neg>
        -  <Path>Height</Path>
        -</Neg>
        -<Mul>
        -  <Path>NetPrice</Path>
        -  <Path>TaxRate</Path>
        -</Mul>
        -<Div>
        -  <Path>Quantity</Path>
        -  <Path>QuantityPerParcel</Path>
        -</Div>
        -<DivBy>
        -  <Path>Quantity</Path>
        -  <Path>QuantityPerParcel</Path>
        -</DivBy>
        -<Mod>
        -  <Path>Quantity</Path>
        -  <Path>QuantityPerParcel</Path>
        -</Mod>
        +

        Example 74:

        +
        <Add>
        +  <Path>StartDate</Path>
        +  <Path>Duration</Path>
        +</Add>
        +<Sub>
        +  <Path>Revenue</Path>
        +  <Path>Cost</Path>
        +</Sub>
        +<Neg>
        +  <Path>Height</Path>
        +</Neg>
        +<Mul>
        +  <Path>NetPrice</Path>
        +  <Path>TaxRate</Path>
        +</Mul>
        +<Div>
        +  <Path>Quantity</Path>
        +  <Path>QuantityPerParcel</Path>
        +</Div>
        +<DivBy>
        +  <Path>Quantity</Path>
        +  <Path>QuantityPerParcel</Path>
        +</DivBy>
        +<Mod>
        +  <Path>Quantity</Path>
        +  <Path>QuantityPerParcel</Path>
        +</Mod>

        14.4.4 Apply Client-Side Functions

        The apply expression enables a value to be obtained by applying a client-side function. The apply expression MAY have operand expressions. The operand expressions are used as parameters to the client-side function.

        -

        Expression edm:Apply

        +

        Expression edm:Apply

        The edm:Apply element MUST contain the Function attribute and MAY contain annotation expressions as operands for the applied function.

        It MAY contain more edm:Annotation elements.

        -

        Attribute Function

        +

        Attribute Function

        The value of Function is the qualified name of the client-side function to apply.

        OData defines the following functions. Services MAY support additional functions that MUST be qualified with a namespace other than odata. Function names qualified with odata are reserved for this specification and its future versions.

        @@ -2707,91 +2786,91 @@

        OData-URL can be used as client-side functions, qualified with the namespace odata. The semantics of these client-side functions is identical to their counterpart function defined in OData-URL.

        For example, the odata.concat client-side function takes two or more expressions as arguments. Each argument MUST evaluate to a primitive or enumeration type. It returns a value of type Edm.String that is the concatenation of the literal representations of the results of the argument expressions. Values of primitive types other than Edm.String are represented according to the appropriate alternative in the primitiveValue rule of OData-ABNF, i.e. Edm.Binary as binaryValue, Edm.Boolean as booleanValue etc.

        -

        Example 74:

        -
        <Annotation Term="org.example.display.DisplayName">
        -  <Apply Function="odata.concat">
        -    <String>Product: </String>
        -    <Path>ProductName</Path>
        -    <String> (</String>
        -    <Path>Available/Quantity</Path>
        -    <String> </String>
        -    <Path>Available/Unit</Path>
        -    <String> available)</String>
        -  </Apply>
        -</Annotation>
        +

        Example 75:

        +
        <Annotation Term="org.example.display.DisplayName">
        +  <Apply Function="odata.concat">
        +    <String>Product: </String>
        +    <Path>ProductName</Path>
        +    <String> (</String>
        +    <Path>Available/Quantity</Path>
        +    <String> </String>
        +    <Path>Available/Unit</Path>
        +    <String> available)</String>
        +  </Apply>
        +</Annotation>

        ProductName is of type String, Quantity in complex type Available is of type Decimal, and Unit in Available is of type enumeration, so the result of the Path expression is represented as the member name of the enumeration value.

        14.4.4.2 Function odata.fillUriTemplate

        -

        The odata.fillUriTemplate client-side function takes two or more expressions as arguments and returns a value of type Edm.String.

        +

        The odata.fillUriTemplate client-side function takes two or more expressions as arguments and returns a value of type Edm.String.

        The first argument MUST be of type Edm.String and specifies a URI template according to RFC6570, the other arguments MUST be labeled element expressions. Each labeled element expression specifies the template parameter name as its name and evaluates to the template parameter value.

        RFC6570 defines three kinds of template parameters: simple values, lists of values, and key-value maps.

        Simple values are represented as labeled element expressions that evaluate to a single primitive value. The literal representation of this value according to OData-ABNF is used to fill the corresponding template parameter.

        Lists of values are represented as labeled element expressions that evaluate to a collection of primitive values.

        Key-value maps are represented as labeled element expressions that evaluate to a collection of complex types with two properties that are used in lexicographic order. The first property is used as key, the second property as value.

        -

        Example 75: assuming there are no special characters in values of the Name property of the Actor entity

        -
        <Apply Function="odata.fillUriTemplate">
        -  <String>http://host/someAPI/Actors/{actorName}/CV</String>
        -  <LabeledElement Name="actorName" Path="Actor/Name" />
        -</Apply>
        +

        Example 76: assuming there are no special characters in values of the Name property of the Actor entity

        +
        <Apply Function="odata.fillUriTemplate">
        +  <String>http://host/someAPI/Actors/{actorName}/CV</String>
        +  <LabeledElement Name="actorName" Path="Actor/Name" />
        +</Apply>

        14.4.4.3 Function odata.matchesPattern

        -

        The odata.matchesPattern client-side function takes two string expressions as arguments and returns a Boolean value.

        +

        The odata.matchesPattern client-side function takes two string expressions as arguments and returns a Boolean value. It is the counterpart of the identically named URL function OData-URL, section 5.1.1.7.1.

        The function returns true if the second expression evaluates to an ECMAScript (JavaScript) regular expression and the result of the first argument expression matches that regular expression, using syntax and semantics of ECMAScript regular expressions.

        -

        Example 76: all non-empty FirstName values not containing the letters b, c, or d evaluate to true

        -
        <Apply Function="odata.matchesPattern">
        -  <Path>FirstName</Path>
        -  <String>^[^b-d]+$</String>
        -</Apply>
        +

        Example 77: all non-empty FirstName values not containing the letters b, c, or d evaluate to true

        +
        <Apply Function="odata.matchesPattern">
        +  <Path>FirstName</Path>
        +  <String>^[^b-d]+$</String>
        +</Apply>

        14.4.4.4 Function odata.uriEncode

        -

        The odata.uriEncode client-side function takes one argument of primitive type and returns the URL-encoded OData literal that can be used as a key value in OData URLs or in the query part of OData URLs.

        +

        The odata.uriEncode client-side function takes one argument of primitive type and returns the URL-encoded OData literal that can be used as a key value in OData URLs or in the query part of OData URLs.

        Note: string literals are surrounded by single quotes as required by the paren-style key syntax.

        -

        Example 77:

        -
        <Apply Function="odata.fillUriTemplate">
        -  <String>http://host/service/Genres({genreName})</String>
        -  <LabeledElement Name="genreName">
        -    <Apply Function="odata.uriEncode" >
        -      <Path>NameOfMovieGenre</Path>
        -    </Apply>
        -  </LabeledElement>
        -</Apply>
        +

        Example 78:

        +
        <Apply Function="odata.fillUriTemplate">
        +  <String>http://host/service/Genres({genreName})</String>
        +  <LabeledElement Name="genreName">
        +    <Apply Function="odata.uriEncode" >
        +      <Path>NameOfMovieGenre</Path>
        +    </Apply>
        +  </LabeledElement>
        +</Apply>

        14.4.5 Cast

        The cast expression casts the value obtained from its single child expression to the specified type. The cast expression follows the same rules as the cast canonical function defined in OData-URL.

        -

        Expression edm:Cast

        +

        Expression edm:Cast

        The edm:Cast element MUST contain the Type attribute and MUST contain exactly one expression.

        It MAY contain edm:Annotation elements.

        -

        Attribute Type

        +

        Attribute Type

        The value of Type is a qualified type name in scope, or the character sequence Collection( followed by the qualified name of a type in scope, followed by a closing parenthesis ).

        If the specified type is a primitive type or a collection of a primitive type, the facet attributes MaxLength, Unicode, Precision, Scale, and SRID MAY be specified if applicable to the specified primitive type. If the facet attributes are not specified, their values are considered unspecified.

        -

        Example 78:

        -
        <Annotation Term="org.example.display.Threshold">
        -  <Cast Type="Edm.Decimal">
        -    <Path>Average</Path>
        -  </Cast>
        -</Annotation>
        +

        Example 79:

        +
        <Annotation Term="org.example.display.Threshold">
        +  <Cast Type="Edm.Decimal">
        +    <Path>Average</Path>
        +  </Cast>
        +</Annotation>

        14.4.6 Collection

        The collection expression enables a value to be obtained from zero or more item expressions. The value calculated by the collection expression is the collection of the values calculated by each of the item expressions. The values of the child expressions MUST all be type compatible.

        -

        Expression edm:Collection

        +

        Expression edm:Collection

        The edm:Collection element contains zero or more child expressions.

        -

        Example 79:

        -
        <Annotation Term="org.example.seo.SeoTerms">
        -  <Collection>
        -    <String>Product</String>
        -    <String>Supplier</String>
        -    <String>Customer</String>
        -  </Collection>
        -</Annotation>
        +

        Example 80:

        +
        <Annotation Term="org.example.seo.SeoTerms">
        +  <Collection>
        +    <String>Product</String>
        +    <String>Supplier</String>
        +    <String>Customer</String>
        +  </Collection>
        +</Annotation>

        14.4.7 If-Then-Else

        The if-then-else expression enables a value to be obtained by evaluating a condition expression. It MUST contain exactly three child expressions. There is one exception to this rule: if and only if the if-then-else expression is an item of a collection expression, the third child expression MAY be omitted, reducing it to an if-then expression. This can be used to conditionally add an element to a collection.

        @@ -2799,161 +2878,161 @@

        14.4.7 If-The

        The second and third child expressions are evaluated conditionally. The result MUST be type compatible with the type expected by the surrounding expression.

        If the first expression evaluates to true, the second expression MUST be evaluated and its value MUST be returned as the result of the if-then-else expression. If the first expression evaluates to false and a third child element is present, it MUST be evaluated and its value MUST be returned as the result of the if-then-else expression. If no third expression is present, nothing is added to the surrounding collection.

        -

        Expression edm:If

        +

        Expression edm:If

        The edm:If element MUST contain two or three child expressions that MUST use element notation.

        It MAY contain edm:Annotation elements.

        -

        Example 80: the condition is a value path expression referencing the Boolean property IsFemale, whose value then determines the value of the edm:If expression (or so it was long ago)

        -
        <Annotation Term="org.example.person.Gender">
        -  <If>
        -    <Path>IsFemale</Path>
        -    <String>Female</String>
        -    <String>Male</String>
        -  </If>
        -</Annotation>
        +

        Example 81: the condition is a value path expression referencing the Boolean property IsFemale, whose value then determines the value of the edm:If expression (or so it was long ago)

        +
        <Annotation Term="org.example.person.Gender">
        +  <If>
        +    <Path>IsFemale</Path>
        +    <String>Female</String>
        +    <String>Male</String>
        +  </If>
        +</Annotation>

        14.4.8 Is-Of

        The is-of expression checks whether the value obtained from its single child expression is compatible with the specified type. It returns true if the child expression returns a type that is compatible with the specified type, and false otherwise.

        -

        Expression edm:UrlRef

        +

        Expression edm:UrlRef

        The edm:UrlRef expression MAY be provided using element notation or attribute notation.

        Relative URLs are relative to the xml:base attribute, see XML-Base.

        In element notation it MAY contain edm:Annotation elements.

        -

        Example 81:

        -
        <Annotation Term="self.IsPreferredCustomer">
        -  <IsOf Type="self.PreferredCustomer">
        -    <Path>Customer</Path>
        -  </IsOf>
        -</Annotation>
        +

        Example 82:

        +
        <Annotation Term="self.IsPreferredCustomer">
        +  <IsOf Type="self.PreferredCustomer">
        +    <Path>Customer</Path>
        +  </IsOf>
        +</Annotation>

        14.4.9 Labeled Element

        The labeled element expression assigns a name to its single child expression. The value of the child expression can then be reused elsewhere with a labeled element reference expression.

        A labeled element expression MUST contain exactly one child expression. The value of the child expression is also the value of the labeled element expression.

        A labeled element expression MUST provide a simple identifier value as its name that MUST be unique within the schema containing the expression.

        -

        Expression edm:LabeledElement

        +

        Expression edm:LabeledElement

        The edm:LabeledElement element MUST contain the Name attribute.

        It MUST contain a child expression written either in attribute notation or element notation.

        It MAY contain edm:Annotation elements.

        -

        Attribute Name

        -

        The value of Name is the labeled element's name.

        +

        Attribute Name

        +

        The value of Name is the labeled element’s name.

        -

        Example 82:

        -
        <Annotation Term="org.example.display.DisplayName">
        -  <LabeledElement Name="CustomerFirstName" Path="FirstName" />
        -</Annotation>
        -
        -<Annotation Term="org.example.display.DisplayName">
        -  <LabeledElement Name="CustomerFirstName">
        -    <Path>FirstName</Path>
        -  </LabeledElement>
        -</Annotation>
        +

        Example 83:

        +
        <Annotation Term="org.example.display.DisplayName">
        +  <LabeledElement Name="CustomerFirstName" Path="FirstName" />
        +</Annotation>
        +
        +<Annotation Term="org.example.display.DisplayName">
        +  <LabeledElement Name="CustomerFirstName">
        +    <Path>FirstName</Path>
        +  </LabeledElement>
        +</Annotation>

        14.4.10 Labeled Element Reference

        The labeled element reference expression MUST specify the qualified name of a labeled element expression in scope and returns the value of the identified labeled element expression as its value.

        -

        Expression edm:LabeledElementReference

        +

        Expression edm:LabeledElementReference

        The edm:LabeledElementReference element MUST contain the qualified name of a labeled element expression in its body.

        -

        Example 83:

        -
        <Annotation Term="org.example.display.DisplayName">
        -  <LabeledElementReference>Model.CustomerFirstName</LabeledElementReference>
        -</Annotation>
        +

        Example 84:

        +
        <Annotation Term="org.example.display.DisplayName">
        +  <LabeledElementReference>Model.CustomerFirstName</LabeledElementReference>
        +</Annotation>

        14.4.11 Null

        The null expression indicates the absence of a value. The null expression MAY be annotated.

        -

        Expression edm:Null

        +

        Expression edm:Null

        The edm:Null element MAY contain edm:Annotation elements.

        -

        Example 84:

        -
        <Annotation Term="org.example.display.DisplayName">
        -  <Null/>
        -</Annotation>
        +

        Example 85:

        +
        <Annotation Term="org.example.display.DisplayName">
        +  <Null/>
        +</Annotation>
        -

        Example 85:

        -
        <Annotation Term="@UI.Address">
        -  <Null>
        -    <Annotation Term="self.Reason" String="Private" />
        -  </Null>
        -</Annotation>
        +

        Example 86:

        +
        <Annotation Term="@UI.Address">
        +  <Null>
        +    <Annotation Term="self.Reason" String="Private" />
        +  </Null>
        +</Annotation>

        14.4.12 Record

        The record expression enables a new entity type or complex type instance to be constructed.

        -

        A record expression MAY specify the structured type of its result, which MUST be an entity type or complex type in scope. If not explicitly specified, the type is derived from the expression's context.

        -

        A record expression contains zero or more property value expressions. For each single-valued structural or navigation property of the record expression's type that is neither nullable nor specifies a default value a property value expression MUST be provided. The only exception is if the record expression is the value of an annotation for a term that has a base term whose type is structured and directly or indirectly inherits from the type of its base term. In this case, property values that already have been specified in the annotation for the base term or its base term etc. need not be specified again.

        +

        A record expression MAY specify the structured type of its result, which MUST be an entity type or complex type in scope. If not explicitly specified, the type is derived from the expression’s context.

        +

        A record expression contains zero or more property value expressions. For each single-valued structural or navigation property of the record expression’s type that is neither nullable nor specifies a default value a property value expression MUST be provided. The only exception is if the record expression is the value of an annotation for a term that has a base term whose type is structured and directly or indirectly inherits from the type of its base term. In this case, property values that already have been specified in the annotation for the base term or its base term etc. need not be specified again.

        For collection-valued properties the absence of a property value expression is equivalent to specifying an empty collection as its value.

        -

        Expression edm:Record

        +

        Expression edm:Record

        The edm:Record element MAY contain the Type attribute and MAY contain edm:PropertyValue elements.

        It MAY contain edm:Annotation elements.

        -

        Attribute Type

        +

        Attribute Type

        The value of Type is the qualified name of a structured type in scope.

        -

        Element edm:PropertyValue

        +

        Element edm:PropertyValue

        The edm:PropertyValue element MUST contain the Property attribute, and it MUST contain exactly one expression that MAY be provided using either element notation or attribute notation.

        It MAY contain edm:Annotation elements.

        -

        Attribute Property

        +

        Attribute Property

        The value of Property is the name of a property of the type of the enclosing edm:Record expression.

        -

        Example 86: this annotation "morphs" the entity type from example 8 into a structured type with two structural properties GivenName and Surname and two navigation properties DirectSupervisor and CostCenter. The first three properties simply rename properties of the annotated entity type, the fourth adds a calculated navigation property that is pointing to a different service

        -
        <Annotation Term="org.example.person.Employee">
        -  <Record>
        -    <Annotation Term="Core.Description" String="Annotation on record" />
        -    <PropertyValue Property="GivenName" Path="FirstName">
        -      <Annotation Term="Core.Description"
        -                  String="Annotation on record member" />
        -    </PropertyValue>
        -    <PropertyValue Property="Surname" Path="LastName" />
        -    <PropertyValue Property="DirectSupervisor" Path="Manager" />
        -    <PropertyValue Property="CostCenter">
        -      <UrlRef>
        -        <Apply Function="odata.fillUriTemplate">
        -          <String>http://host/anotherservice/CostCenters('{ccid}')</String>
        -          <LabeledElement Name="ccid" Path="CostCenterID" />
        -        </Apply>
        -      </UrlRef>
        -    </PropertyValue>
        -  </Record>
        -</Annotation>
        +

        Example 87: this annotation “morphs” the entity type from example 13 into a structured type with two structural properties GivenName and Surname and two navigation properties DirectSupervisor and CostCenter. The first three properties simply rename properties of the annotated entity type, the fourth adds a calculated navigation property that is pointing to a different service

        +
        <Annotation Term="org.example.person.Employee">
        +  <Record>
        +    <Annotation Term="Core.Description" String="Annotation on record" />
        +    <PropertyValue Property="GivenName" Path="FirstName">
        +      <Annotation Term="Core.Description"
        +                  String="Annotation on record member" />
        +    </PropertyValue>
        +    <PropertyValue Property="Surname" Path="LastName" />
        +    <PropertyValue Property="DirectSupervisor" Path="Manager" />
        +    <PropertyValue Property="CostCenter">
        +      <UrlRef>
        +        <Apply Function="odata.fillUriTemplate">
        +          <String>http://host/anotherservice/CostCenters('{ccid}')</String>
        +          <LabeledElement Name="ccid" Path="CostCenterID" />
        +        </Apply>
        +      </UrlRef>
        +    </PropertyValue>
        +  </Record>
        +</Annotation>

        14.4.13 URL Reference

        The URL reference expression enables a value to be obtained by sending a GET request.

        The URL reference expression MUST contain exactly one expression of type Edm.String. Its value is treated as a URL that MAY be relative or absolute; relative URLs are relative to the URL of the document containing the URL reference expression, or relative to a base URL specified in a format-specific way.

        The response body of the GET request MUST be returned as the result of the URL reference expression. The result of the URL reference expression MUST be type compatible with the type expected by the surrounding expression.

        -

        Expression edm:UrlRef

        +

        Expression edm:UrlRef

        The edm:UrlRef expression MAY be provided using element notation or attribute notation.

        Relative URLs are relative to the xml:base attribute, see XML-Base.

        In element notation it MAY contain edm:Annotation elements.

        -

        Example 87:

        -
        <Annotation Term="org.example.person.Supplier">
        -  <UrlRef>
        -    <Apply Function="odata.fillUriTemplate">
        -      <String>http://host/service/Suppliers({suppID})</String>
        -      <LabeledElement Name="suppID">
        -      <Apply Function="odata.uriEncode">
        -        <Path>SupplierId</Path>
        -      </Apply>
        -      </LabeledElement>
        -     </Apply>
        -  </UrlRef>
        -</Annotation>
        -
        -<Annotation Term="Core.LongDescription">
        -  <UrlRef><String>http://host/wiki/HowToUse</String></UrlRef>
        -</Annotation>
        -
        -<Annotation Term="Core.LongDescription" UrlRef="http://host/wiki/HowToUse" />
        +

        Example 88:

        +
        <Annotation Term="org.example.person.Supplier">
        +  <UrlRef>
        +    <Apply Function="odata.fillUriTemplate">
        +      <String>http://host/service/Suppliers({suppID})</String>
        +      <LabeledElement Name="suppID">
        +      <Apply Function="odata.uriEncode">
        +        <Path>SupplierId</Path>
        +      </Apply>
        +      </LabeledElement>
        +     </Apply>
        +  </UrlRef>
        +</Annotation>
        +
        +<Annotation Term="Core.LongDescription">
        +  <UrlRef><String>http://host/wiki/HowToUse</String></UrlRef>
        +</Annotation>
        +
        +<Annotation Term="Core.LongDescription" UrlRef="http://host/wiki/HowToUse" />

        15 Identifier and Path Values

        @@ -2963,8 +3042,8 @@

        -
      • The remaining characters MUST be the underscore character (U+005F) or any character in the Unicode category "Letter (L)", "Letter number (Nl)", "Decimal number (Nd)", "Non-spacing mark (Mn)", "Combining spacing mark (Mc)", "Connector punctuation (Pc)", and "Other, format (Cf)".
      • +
      • The first character MUST be the underscore character (U+005F) or any character in the Unicode category “Letter (L)” or “Letter number (Nl)”.
      • +
      • The remaining characters MUST be the underscore character (U+005F) or any character in the Unicode category “Letter (L)”, “Letter number (Nl)”, “Decimal number (Nd)”, “Non-spacing mark (Mn)”, “Combining spacing mark (Mc)”, “Connector punctuation (Pc)”, and “Other, format (Cf)”.

      Non-normatively speaking it starts with a letter or underscore, followed by at most 127 letters, underscores or digits.

      15.3 Qualified Name

      @@ -2978,7 +3057,7 @@

      15.4 Target Pat
    • The target path of a container child followed by a forward slash and one or more forward-slash separated property, navigation property, or type-cast segments
    -

    Example 88: Target expressions

    +

    Example 89: Target expressions

    MySchema.MyEntityContainer/MyEntitySet
     MySchema.MyEntityContainer/MySingleton
     MySchema.MyEntityContainer/MySingleton/MyContainmentNavigationProperty
    @@ -2990,154 +3069,154 @@ 

    16 CSDL Ex

    Following are two basic examples of valid EDM models as represented in CSDL. These examples demonstrate many of the topics covered above.

    16.1 Products and Categories Example

    -

    Example 89:

    -
    <edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"
    -           xmlns="http://docs.oasis-open.org/odata/ns/edm" Version="4.0">
    -  <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml">
    -    <edmx:Include Namespace="Org.OData.Core.V1" Alias="Core">
    -      <Annotation Term="Core.DefaultNamespace" />
    -    </edmx:Include>
    -  </edmx:Reference>
    -  <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Measures.V1.xml">
    -    <edmx:Include Alias="Measures" Namespace="Org.OData.Measures.V1" />
    -  </edmx:Reference>
    -  <edmx:DataServices>
    -    <Schema Namespace="ODataDemo">
    -      <EntityType Name="Product" HasStream="true">
    -        <Key>
    -          <PropertyRef Name="ID" />
    -        </Key>
    -        <Property Name="ID" Type="Edm.Int32" Nullable="false" />
    -        <Property Name="Description" Type="Edm.String" >
    -          <Annotation Term="Core.IsLanguageDependent" />
    -        </Property>
    -        <Property Name="ReleaseDate" Type="Edm.Date" />
    -        <Property Name="DiscontinuedDate" Type="Edm.Date" />
    -        <Property Name="Rating" Type="Edm.Int32" />
    -        <Property Name="Price" Type="Edm.Decimal" Scale="variable">
    -          <Annotation Term="Measures.ISOCurrency" Path="Currency" />
    -        </Property>
    -        <Property Name="Currency" Type="Edm.String" MaxLength="3" />
    -        <NavigationProperty Name="Category" Type="ODataDemo.Category"
    -                            Nullable="false" Partner="Products" />
    -        <NavigationProperty Name="Supplier" Type="ODataDemo.Supplier"
    -                            Partner="Products" />
    -      </EntityType>
    -      <EntityType Name="Category">
    -        <Key>
    -         <PropertyRef Name="ID" />
    -        </Key>
    -        <Property Name="ID" Type="Edm.Int32" Nullable="false" />
    -        <Property Name="Name" Type="Edm.String" Nullable="false">
    -          <Annotation Term="Core.IsLanguageDependent" />
    -        </Property>
    -        <NavigationProperty Name="Products" Partner="Category"
    -                            Type="Collection(ODataDemo.Product)">
    -          <OnDelete Action="Cascade" />
    -        </NavigationProperty>
    -      </EntityType>
    -      <EntityType Name="Supplier">
    -        <Key>
    -          <PropertyRef Name="ID" />
    -        </Key>
    -        <Property Name="ID" Type="Edm.String" Nullable="false" />
    -        <Property Name="Name" Type="Edm.String" />
    -        <Property Name="Address" Type="ODataDemo.Address" Nullable="false" />
    -        <Property Name="Concurrency" Type="Edm.Int32" Nullable="false" />
    -        <NavigationProperty Name="Products" Partner="Supplier"
    -                            Type="Collection(ODataDemo.Product)" />
    -      </EntityType>
    -      <EntityType Name="Country">
    -        <Key>
    -          <PropertyRef Name="Code" />
    -        </Key>
    -        <Property Name="Code" Type="Edm.String" MaxLength="2"
    -                              Nullable="false" />
    -        <Property Name="Name" Type="Edm.String" />
    -      </EntityType>
    -      <ComplexType Name="Address">
    -        <Property Name="Street" Type="Edm.String" />
    -        <Property Name="City" Type="Edm.String" />
    -        <Property Name="State" Type="Edm.String" />
    -        <Property Name="ZipCode" Type="Edm.String" />
    -        <Property Name="CountryName" Type="Edm.String" />
    -        <NavigationProperty Name="Country" Type="ODataDemo.Country">
    -          <ReferentialConstraint Property="CountryName"  
    -                                 ReferencedProperty="Name" />
    -        </NavigationProperty>
    -      </ComplexType>
    -      <Function Name="ProductsByRating">
    -        <Parameter Name="Rating" Type="Edm.Int32" />
    -        <ReturnType Type="Collection(ODataDemo.Product)" />
    -      </Function>
    -      <EntityContainer Name="DemoService">
    -        <EntitySet Name="Products" EntityType="ODataDemo.Product">
    -          <NavigationPropertyBinding Path="Category" Target="Categories" />
    -        </EntitySet>
    -        <EntitySet Name="Categories" EntityType="ODataDemo.Category">
    -          <NavigationPropertyBinding Path="Products" Target="Products" />
    -          <Annotation Term="Core.Description" String="Product Categories" />
    -        </EntitySet>
    -        <EntitySet Name="Suppliers" EntityType="ODataDemo.Supplier">
    -          <NavigationPropertyBinding Path="Products" Target="Products" />
    -          <NavigationPropertyBinding Path="Address/Country"
    -                                     Target="Countries" />
    -          <Annotation Term="Core.OptimisticConcurrency">
    -            <Collection>
    -              <PropertyPath>Concurrency</PropertyPath>
    -            </Collection>
    -          </Annotation>
    -        </EntitySet>
    -        <Singleton Name="MainSupplier" Type="self.Supplier">
    -          <NavigationPropertyBinding Path="Products" Target="Products" />
    -          <Annotation Term="Core.Description" String="Primary Supplier" />
    -        </Singleton>
    -        <EntitySet Name="Countries" EntityType="ODataDemo.Country" />
    -        <FunctionImport Name="ProductsByRating" EntitySet="Products"
    -                        Function="ODataDemo.ProductsByRating" />
    -      </EntityContainer>
    -    </Schema>
    -  </edmx:DataServices>
    -</edmx:Edmx>
    +

    Example 90:

    +
    <edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"
    +           xmlns="http://docs.oasis-open.org/odata/ns/edm" Version="4.0">
    +  <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml">
    +    <edmx:Include Namespace="Org.OData.Core.V1" Alias="Core">
    +      <Annotation Term="Core.DefaultNamespace" />
    +    </edmx:Include>
    +  </edmx:Reference>
    +  <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Measures.V1.xml">
    +    <edmx:Include Alias="Measures" Namespace="Org.OData.Measures.V1" />
    +  </edmx:Reference>
    +  <edmx:DataServices>
    +    <Schema Namespace="ODataDemo">
    +      <EntityType Name="Product">
    +        <Key>
    +          <PropertyRef Name="ID" />
    +        </Key>
    +        <Property Name="ID" Type="Edm.Int32" Nullable="false" />
    +        <Property Name="Description" Type="Edm.String" >
    +          <Annotation Term="Core.IsLanguageDependent" />
    +        </Property>
    +        <Property Name="ReleaseDate" Type="Edm.Date" />
    +        <Property Name="DiscontinuedDate" Type="Edm.Date" />
    +        <Property Name="Rating" Type="Edm.Int32" />
    +        <Property Name="Price" Type="Edm.Decimal" Scale="variable">
    +          <Annotation Term="Measures.ISOCurrency" Path="Currency" />
    +        </Property>
    +        <Property Name="Currency" Type="Edm.String" MaxLength="3" />
    +        <NavigationProperty Name="Category" Type="ODataDemo.Category"
    +                            Nullable="false" Partner="Products" />
    +        <NavigationProperty Name="Supplier" Type="ODataDemo.Supplier"
    +                            Partner="Products" />
    +      </EntityType>
    +      <EntityType Name="Category">
    +        <Key>
    +         <PropertyRef Name="ID" />
    +        </Key>
    +        <Property Name="ID" Type="Edm.Int32" Nullable="false" />
    +        <Property Name="Name" Type="Edm.String" Nullable="false">
    +          <Annotation Term="Core.IsLanguageDependent" />
    +        </Property>
    +        <NavigationProperty Name="Products" Partner="Category"
    +                            Type="Collection(ODataDemo.Product)">
    +          <OnDelete Action="Cascade" />
    +        </NavigationProperty>
    +      </EntityType>
    +      <EntityType Name="Supplier">
    +        <Key>
    +          <PropertyRef Name="ID" />
    +        </Key>
    +        <Property Name="ID" Type="Edm.String" Nullable="false" />
    +        <Property Name="Name" Type="Edm.String" />
    +        <Property Name="Address" Type="ODataDemo.Address" Nullable="false" />
    +        <Property Name="Concurrency" Type="Edm.Int32" Nullable="false" />
    +        <NavigationProperty Name="Products" Partner="Supplier"
    +                            Type="Collection(ODataDemo.Product)" />
    +      </EntityType>
    +      <EntityType Name="Country">
    +        <Key>
    +          <PropertyRef Name="Code" />
    +        </Key>
    +        <Property Name="Code" Type="Edm.String" MaxLength="2"
    +                              Nullable="false" />
    +        <Property Name="Name" Type="Edm.String" />
    +      </EntityType>
    +      <ComplexType Name="Address">
    +        <Property Name="Street" Type="Edm.String" />
    +        <Property Name="City" Type="Edm.String" />
    +        <Property Name="State" Type="Edm.String" />
    +        <Property Name="ZipCode" Type="Edm.String" />
    +        <Property Name="CountryName" Type="Edm.String" />
    +        <NavigationProperty Name="Country" Type="ODataDemo.Country">
    +          <ReferentialConstraint Property="CountryName"  
    +                                 ReferencedProperty="Name" />
    +        </NavigationProperty>
    +      </ComplexType>
    +      <Function Name="ProductsByRating">
    +        <Parameter Name="Rating" Type="Edm.Int32" />
    +        <ReturnType Type="Collection(ODataDemo.Product)" />
    +      </Function>
    +      <EntityContainer Name="DemoService">
    +        <EntitySet Name="Products" EntityType="ODataDemo.Product">
    +          <NavigationPropertyBinding Path="Category" Target="Categories" />
    +        </EntitySet>
    +        <EntitySet Name="Categories" EntityType="ODataDemo.Category">
    +          <NavigationPropertyBinding Path="Products" Target="Products" />
    +          <Annotation Term="Core.Description" String="Product Categories" />
    +        </EntitySet>
    +        <EntitySet Name="Suppliers" EntityType="ODataDemo.Supplier">
    +          <NavigationPropertyBinding Path="Products" Target="Products" />
    +          <NavigationPropertyBinding Path="Address/Country"
    +                                     Target="Countries" />
    +          <Annotation Term="Core.OptimisticConcurrency">
    +            <Collection>
    +              <PropertyPath>Concurrency</PropertyPath>
    +            </Collection>
    +          </Annotation>
    +        </EntitySet>
    +        <Singleton Name="MainSupplier" Type="self.Supplier">
    +          <NavigationPropertyBinding Path="Products" Target="Products" />
    +          <Annotation Term="Core.Description" String="Primary Supplier" />
    +        </Singleton>
    +        <EntitySet Name="Countries" EntityType="ODataDemo.Country" />
    +        <FunctionImport Name="ProductsByRating" EntitySet="Products"
    +                        Function="ODataDemo.ProductsByRating" />
    +      </EntityContainer>
    +    </Schema>
    +  </edmx:DataServices>
    +</edmx:Edmx>

    16.2 Annotations for Products and Categories Example

    -

    Example 90:

    -
    <edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"
    -           Version="4.01">
    -  <edmx:Reference Uri="http://host/service/$metadata">
    -    <edmx:Include Namespace="ODataDemo" Alias="target" />
    -  </edmx:Reference>
    -  <edmx:Reference Uri="http://somewhere/Vocabulary/V1">
    -    <edmx:Include Alias="Vocabulary1" Namespace="Some.Vocabulary.V1" />
    -  </edmx:Reference>
    -  <edmx:DataServices>
    -    <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm"
    -            Namespace="External.Annotations">
    -      <Annotations Target="ODataDemo.Supplier">
    -        <Annotation Term="Vocabulary1.EMail">
    -          <Null />
    -        </Annotation>
    -        <Annotation Term="Vocabulary1.AccountID" Path="ID" />
    -        <Annotation Term="Vocabulary1.Title" String="Supplier Info" />
    -        <Annotation Term="Vocabulary1.DisplayName">
    -        <Apply Function="odata.concat">
    -            <Path>Name</Path>
    -            <String> in </String>
    -            <Path>Address/CountryName</Path>
    -          </Apply>
    -        </Annotation>
    -      </Annotations>
    -      <Annotations Target="ODataDemo.Product">
    -        <Annotation Term="Vocabulary1.Tags">
    -          <Collection>
    -            <String>MasterData</String>
    -          </Collection>
    -        </Annotation>
    -      </Annotations>
    -  </Schema>
    -  </edmx:DataServices>
    -</edmx:Edmx>
    +

    Example 91:

    +
    <edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"
    +           Version="4.01">
    +  <edmx:Reference Uri="http://host/service/$metadata">
    +    <edmx:Include Namespace="ODataDemo" Alias="target" />
    +  </edmx:Reference>
    +  <edmx:Reference Uri="http://somewhere/Vocabulary/V1">
    +    <edmx:Include Alias="Vocabulary1" Namespace="Some.Vocabulary.V1" />
    +  </edmx:Reference>
    +  <edmx:DataServices>
    +    <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm"
    +            Namespace="External.Annotations">
    +      <Annotations Target="ODataDemo.Supplier">
    +        <Annotation Term="Vocabulary1.EMail">
    +          <Null />
    +        </Annotation>
    +        <Annotation Term="Vocabulary1.AccountID" Path="ID" />
    +        <Annotation Term="Vocabulary1.Title" String="Supplier Info" />
    +        <Annotation Term="Vocabulary1.DisplayName">
    +        <Apply Function="odata.concat">
    +            <Path>Name</Path>
    +            <String> in </String>
    +            <Path>Address/CountryName</Path>
    +          </Apply>
    +        </Annotation>
    +      </Annotations>
    +      <Annotations Target="ODataDemo.Product">
    +        <Annotation Term="Vocabulary1.Tags">
    +          <Collection>
    +            <String>MasterData</String>
    +          </Collection>
    +        </Annotation>
    +      </Annotations>
    +  </Schema>
    +  </edmx:DataServices>
    +</edmx:Edmx>

    17 Conformance

    @@ -3174,43 +3253,43 @@
    [EPSG]

    European Petroleum Survey Group (EPSG). http://www.epsg.org/.

    [OData-ABNF]

    OData ABNF Construction Rules Version 4.02.
    -See link in "Additional artifacts" section on cover page.

    +See link in “Additional artifacts” section on cover page.

    [OData-CSDL]
    -

    OData Common Schema Definition Language (CSDL) JSON Representation Version 4.02. See link in "Related work" section on cover page.

    +

    OData Common Schema Definition Language (CSDL) JSON Representation Version 4.02. See link in “Related work” section on cover page.

    OData Common Schema Definition Language (CSDL) XML Representation Version 4.02. This document.

    [OData-EDM]

    OData EDM XML Schema.
    -See link in "Additional artifacts" section on cover page.

    +See link in “Additional artifacts” section on cover page.

    [OData-EDMX]

    OData EDM XML Schema.
    -See link in "Additional artifacts" section on cover page.

    +See link in “Additional artifacts” section on cover page.

    [OData-JSON]

    OData JSON Format Version 4.02.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-Protocol]

    OData Version 4.02 Part 1: Protocol.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-URL]

    OData Version 4.02 Part 2: URL Conventions.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-VocCore]

    OData Vocabularies Version 4.0: Core Vocabulary.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-VocMeasures]

    OData Vocabularies Version 4.0: Measures Vocabulary.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-VocValidation]

    OData Vocabularies Version 4.0: Validation Vocabulary.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [RFC2119]
    -

    Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.
    +

    Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels”, BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.
    https://www.rfc-editor.org/info/rfc2119.

    [RFC6570]
    -

    Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., and D. Orchard, “URI Template”, RFC 6570, March 2012.
    -http://tools.ietf.org/html/rfc6570.

    +

    Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., and D. Orchard, “URI Template”, RFC 6570, DOI 10.17487/RFC6570, March 2012.
    +https://www.rfc-editor.org/info/rfc6570.

    [RFC8174]
    -

    Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017.
    -http://www.rfc-editor.org/info/rfc8174.

    +

    Leiba, B., “Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words”, BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017.
    +https://www.rfc-editor.org/info/rfc8174.

    [XML-1.1]

    Extensible Markup Language (XML) 1.1 (Second Edition). F. Yergeau, E. Maler, J. Cowan, T. Bray, C. M. Sperberg-McQueen, J. Paoli, Editors, W3C Recommendation, 16 August 2006.
    http://www.w3.org/TR/2006/REC-xml11-20060816. Latest version available at http://www.w3.org/TR/xml11/.

    @@ -3225,245 +3304,249 @@
    [XML-Schema-2]
    http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/. Latest version available at http://www.w3.org/TR/xmlschema11-2/.

    A.2 Informative References

    [OpenUI5]
    -

    OpenUI5 Version 1.40.10 - OData V4 Metadata JSON Format.
    +

    OpenUI5 Version 1.40.10 — OData V4 Metadata JSON Format.
    https://openui5.hana.ondemand.com/1.40.10/#docs/guide/87aac894a40640f89920d7b2a414499b.html.


    Appendix B. Table of XML Elements and Attributes


    @@ -3575,14 +3658,14 @@

    Appendix E. Notices

    Copyright © OASIS Open 2023. All Rights Reserved.

    -

    All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The full Policy may be found at the OASIS website.

    +

    All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the “OASIS IPR Policy”). The full Policy may be found at the OASIS website.

    This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published, and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this section are included on all such copies and derivative works. However, this document itself may not be modified in any way, including by removing the copyright notice or references to OASIS, except as needed for the purpose of developing any document or deliverable produced by an OASIS Technical Committee (in which case the rules applicable to copyrights, as set forth in the OASIS IPR Policy, must be followed) or as required to translate it into languages other than English.

    The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.

    -

    This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

    +

    This document and the information contained herein is provided on an “AS IS” basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

    As stated in the OASIS IPR Policy, the following three paragraphs in brackets apply to OASIS Standards Final Deliverable documents (Committee Specification, Candidate OASIS Standard, OASIS Standard, or Approved Errata).

    [OASIS requests that any OASIS Party or any other party that believes it has patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable, to notify OASIS TC Administrator and provide an indication of its willingness to grant patent licenses to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this deliverable.]

    [OASIS invites any party to contact the OASIS TC Administrator if it is aware of a claim of ownership of any patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable by a patent holder that is not willing to provide a license to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this OASIS Standards Final Deliverable. OASIS may include such claims on its website, but disclaims any obligation to do so.]

    -

    [OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS' procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

    -

    The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark/ for above guidance.

    +

    [OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS’ procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

    +

    The name “OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark/ for above guidance.

    diff --git a/docs/odata-csdl-xml/odata-csdl-xml.md b/docs/odata-csdl-xml/odata-csdl-xml.md index a7c83d8a7..fa239840d 100644 --- a/docs/odata-csdl-xml/odata-csdl-xml.md +++ b/docs/odata-csdl-xml/odata-csdl-xml.md @@ -61,7 +61,7 @@ OData services are described by an Entity Model (EDM). The Common Schema Definit #### Status: This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical. -TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "[Send A Comment](https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=odata)" button on the TC's web page at https://www.oasis-open.org/committees/odata/. +TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/. This specification is provided under the [RF on RAND Terms Mode](https://www.oasis-open.org/policies-guidelines/ipr/#RF-on-RAND-Mode) of the [OASIS IPR Policy](https://www.oasis-open.org/policies-guidelines/ipr/), the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php). @@ -111,9 +111,15 @@ For complete copyright information please see the full Notices section in an App - [3.1 Nominal Types](#NominalTypes) - [3.2 Structured Types](#StructuredTypes) - [3.3 Primitive Types](#PrimitiveTypes) - - [3.4 Built-In Abstract Types](#BuiltInAbstractTypes) - - [3.5 Built-In Types for defining Vocabulary Terms](#BuiltInTypesfordefiningVocabularyTerms) - - [3.6 Annotations](#Annotations) + - [3.4 Type Facets](#TypeFacets) + - [3.4.1 MaxLength](#MaxLength) + - [3.4.2 Precision](#Precision) + - [3.4.3 Scale](#Scale) + - [3.4.4 Unicode](#Unicode) + - [3.4.5 SRID](#SRID) + - [3.5 Built-In Abstract Types](#BuiltInAbstractTypes) + - [3.6 Built-In Types for defining Vocabulary Terms](#BuiltInTypesfordefiningVocabularyTerms) + - [3.7 Annotations](#Annotations) - [4 CSDL XML Document](#CSDLXMLDocument) - [4.1 Reference](#Reference) - [4.2 Included Schema](#IncludedSchema) @@ -129,14 +135,8 @@ For complete copyright information please see the full Notices section in an App - [6.5 Key](#Key) - [7 Structural Property](#StructuralProperty) - [7.1 Type](#Type) - - [7.2 Type Facets](#TypeFacets) - - [7.2.1 Nullable](#Nullable) - - [7.2.2 MaxLength](#MaxLength) - - [7.2.3 Precision](#Precision) - - [7.2.4 Scale](#Scale) - - [7.2.5 Unicode](#Unicode) - - [7.2.6 SRID](#SRID) - - [7.2.7 Default Value](#DefaultValue) + - [7.2 Nullable](#Nullable) + - [7.3 Default Value](#DefaultValue) - [8 Navigation Property](#NavigationProperty) - [8.1 Navigation Property Type](#NavigationPropertyType) - [8.2 Nullable Navigation Property](#NullableNavigationProperty) @@ -255,6 +255,10 @@ Schema Definition Language (XSD) 1.1 as described in ## 1.1 Changes from Earlier Versions +Section | Feature / Change | Issue +--------|------------------|------ +[Section 14.4.1.2](#PathEvaluation)| New path evaluation rules for annotations targeting annotations and external targeting via container| [ODATA-1420](https://issues.oasis-open.org/browse/ODATA-1420) + ## 1.2 Glossary ### 1.2.1 Definitions of Terms @@ -292,7 +296,7 @@ All other text is normative unless otherwise labeled. Here is a customized command line which will generate HTML from this markdown file (named `odata-csdl-xml-v4.02-csd01.md`). Line breaks are added for readability only: ``` -pandoc -f gfm+tex_math_dollars+fenced_divs +pandoc -f gfm+tex_math_dollars+fenced_divs+smart -t html -o odata-csdl-xml-v4.02-csd01.html -c styles/markdown-styles-v1.7.3b.css @@ -499,17 +503,17 @@ Type|Meaning `Edm.Date` |Date without a time-zone offset `Edm.DateTimeOffset` |Date and time with a time-zone offset, no leap seconds `Edm.Decimal` |Numeric values with decimal representation -`Edm.Double` |IEEE 754 binary64 floating-point number (15-17 decimal digits) +`Edm.Double` |IEEE 754 binary64 floating-point number (15--17 decimal digits) `Edm.Duration` |Signed duration in days, hours, minutes, and (sub)seconds `Edm.Guid` |16-byte (128-bit) unique identifier `Edm.Int16` |Signed 16-bit integer `Edm.Int32` |Signed 32-bit integer `Edm.Int64` |Signed 64-bit integer `Edm.SByte` |Signed 8-bit integer -`Edm.Single` |IEEE 754 binary32 floating-point number (6-9 decimal digits) +`Edm.Single` |IEEE 754 binary32 floating-point number (6--9 decimal digits) `Edm.Stream` |Binary data stream `Edm.String` |Sequence of characters -`Edm.TimeOfDay` |Clock time 00:00-23:59:59.999999999999 +`Edm.TimeOfDay` |Clock time 00:00--23:59:59.999999999999 `Edm.Geography` |Abstract base type for all Geography types `Edm.GeographyPoint` |A point in a round-earth coordinate system `Edm.GeographyLineString` |Line string in a round-earth coordinate system @@ -554,7 +558,207 @@ representation of primitive type values in URLs and [OData-JSON](#ODataJSON) for the representation in requests and responses. -## 3.4 Built-In Abstract Types +## 3.4 Type Facets + +The facets in the following subsections modify or constrain the acceptable values of primitive typed model elements, +for example a [structural property](#StructuralProperty), +action or function [parameter](#Parameter), action or function [return type](#ReturnType), or [term](#Term). + +For single-valued model elements the facets apply to the value of the +model element. For collection-valued model elements the facets apply to the items +in the collection. + +### 3.4.1 MaxLength + +A positive integer value specifying the maximum length of a binary, +stream or string value. For binary or stream values this is the octet +length of the binary data, for string values it is the character length +(number of code points for Unicode). + +If no maximum length is specified, clients SHOULD expect arbitrary +length. + + +::: {.varxml .rep} +### Type Facet Attributes +### Attribute `MaxLength` + +The value of `MaxLength` is a positive integer or the symbolic value +`max` as a shorthand for the maximum length supported for the type by +the service. + +Note: the symbolic value `max` is only allowed in OData 4.0 responses; +it is deprecated in OData 4.01. While clients MUST be prepared for this +symbolic value, OData 4.01 and greater services MUST NOT return the +symbolic value `max` and MAY instead specify the concrete maximum length +supported for the type by the service or omit the attribute entirely. +::: + +### 3.4.2 Precision + +For a decimal value: the maximum number of significant decimal digits of +the model element's value; it MUST be a positive integer. + +For a temporal value (datetime-with-timezone-offset, duration, or +time-of-day): the number of decimal places allowed in the seconds +portion of the value; it MUST be a non-negative integer between zero and +twelve. + +Note: service authors SHOULD be aware that some clients are unable to +support a precision greater than 28 for decimal values and 7 for +temporal values. Client developers MUST be aware of the potential +for data loss when round-tripping values of greater precision. Updating +via `PATCH` and exclusively specifying modified values will reduce +the risk for unintended data loss. + +Note: model elements with duration values and a granularity less than seconds +(e.g. minutes, hours, days) can be annotated with term +[`Measures.DurationGranularity`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Measures.V1.md#DurationGranularity), +see [OData-VocMeasures](#ODataVocMeasures). + + + +::: {.varxml .rep} +### Attribute `Precision` + +The value of `Precision` is a number. + +If not specified for a decimal value, the decimal value has +unspecified precision. + +If not specified for a temporal value, the temporal value has a +precision of zero. +::: + +::: {.varxml .example} +Example 2: [`Precision`](#Precision) facet applied to the +`DateTimeOffset` type +```xml + +``` +::: + +### 3.4.3 Scale + +A non-negative integer value specifying the maximum number of digits +allowed to the right of the decimal point, or one of the symbolic values +`floating` or `variable`. + +The value `floating` means that the decimal value represents a +decimal floating-point number whose number of significant digits is the +value of the [`Precision`](#Precision) facet. OData 4.0 responses MUST +NOT specify the value `floating`. + +The value `variable` means that the number of digits to the right of the +decimal point can vary from zero to the value of the +[`Precision`](#Precision) facet. + +An integer value means that the number of digits to the right of the +decimal point may vary from zero to the value of the `Scale` facet, and +the number of digits to the left of the decimal point may vary from one +to the value of the `Precision` facet minus the value of the `Scale` +facet. If `Precision` is equal to `Scale`, a single zero MUST precede +the decimal point. + +The value of `Scale` MUST be less than or equal to the value of +[`Precision`](#Precision). + +Note: if the underlying data store allows negative scale, services may +use a [`Precision`](#Precision) with the absolute value of the negative +scale added to the actual number of significant decimal digits, and +client-provided values may have to be rounded before being stored. + + + + + + +::: {.varxml .rep} +### Attribute `Scale` + +The value of `Scale` is a number or one of the symbolic values +`floating` or `variable`. + +Services SHOULD use lower-case values; clients SHOULD accept values in a +case-insensitive manner. + +If not specified, the `Scale` facet defaults to zero. +::: + +::: {.varxml .example} +Example 3: [`Precision`](#Precision)`=3` and `Scale=2`. +Allowed values: 1.23, 0.23, 3.14 and 0.7, not allowed values: 123, 12.3 +(the [`Nullable`](#Nullable) attribute can be ignored in these examples) +```xml + +``` +::: + +::: {.varxml .example} +Example 4: `Precision=2` equals `Scale`. +Allowed values: 0.23, 0.7, not allowed values: 1.23, 1.2 +```xml + +``` +::: + +::: {.varxml .example} +Example 5: `Precision=3` and a variable `Scale`. +Allowed values: 0.123, 1.23, 0.23, 0.7, 123 and 12.3, not allowed +values: 12.34, 1234 and 123.4 due to the limited precision. +```xml + +``` +::: + +::: {.varxml .example} +Example 6: `Precision=7` and a floating `Scale`. +Allowed values: -1.234567e3, 1e-101, 9.999999e96, not allowed values: +1e-102 and 1e97 due to the limited precision. +```xml + +``` +::: + +### 3.4.4 Unicode + +For a string-typed model element the `Unicode` facet indicates whether the it +might contain and accept string values with Unicode characters (code +points) beyond the ASCII character set. The value `false` indicates that +the it will only contain and accept string values with characters +limited to the ASCII character set. + +If no value is specified, the `Unicode` facet defaults to `true`. + + +::: {.varxml .rep} +### Attribute `Unicode` + +The value of `Unicode` is one of the Boolean literals `true` or `false`. +Absence of the attribute means `true`. +::: + +### 3.4.5 SRID + +For a geometry- or geography-typed model element the `SRID` facet identifies which +spatial reference system is applied to its values. + +The value of the `SRID` facet MUST be a non-negative integer or the +special value `variable`. If no value is specified, the facet defaults +to `0` for `Geometry` types or `4326` for `Geography` types. + +The valid values of the `SRID` facet and their meanings are as defined +by the European Petroleum Survey Group [EPSG](#_EPSG). + + +::: {.varxml .rep} +### Attribute `SRID` + +The value of `SRID` is a number or the symbolic value `variable`. +::: + +## 3.5 Built-In Abstract Types The following built-in abstract types can be used within a model: - `Edm.PrimitiveType` @@ -592,15 +796,13 @@ be used anywhere a corresponding concrete type can be used, except: - cannot be used as the underlying type of a type definition or enumeration type. - `Collection(Edm.PrimitiveType)` - - cannot be used as the type of a property or term. - - cannot be used as the type of a parameter or the return type of - an action or function. + - cannot be used. - `Collection(Edm.Untyped)` - cannot be returned in a payload with an `OData-Version` header of `4.0`. Services should treat untyped properties as dynamic properties in `4.0` payloads. -## 3.5 Built-In Types for defining Vocabulary Terms +## 3.6 Built-In Types for defining Vocabulary Terms [Vocabulary terms](#VocabularyandAnnotation) can, in addition, use - `Edm.AnnotationPath` @@ -615,7 +817,7 @@ as the type of a primitive term, or the type of a property of a complex type (recursively) that is exclusively used as the type of a term. See section "[Path Expressions](#PathExpressions)" for details. -## 3.6 Annotations +## 3.7 Annotations Many parts of the model can be decorated with additional information using [annotations](#Annotation). Annotations are identified by their @@ -635,7 +837,7 @@ combination of term and qualifier. ::: {.varxml .rep} -### Element `edmx:Edmx` +### Element `edmx:Edmx` The `edmx:Edmx` element is the root element of a CSDL XML document. It MUST contain the `Version` attribute and it MUST contain exactly one @@ -644,15 +846,15 @@ MUST contain the `Version` attribute and it MUST contain exactly one It MAY contain [`edmx:Reference`](#Reference) elements to reference other CSDL documents. -### Attribute `Version` +### Attribute `Version` The `Version` attribute specifies the OData protocol version of the service. For OData 4.0 responses the value of this attribute MUST be -`4.0.` For OData 4.01 responses the value of this attribute MUST be -`4.01.` Services MUST return an OData 4.0 response if the request was -made with an `OData-MaxVersion `header with a value of `4.0`. +`4.0`. For OData 4.01 responses the value of this attribute MUST be +`4.01`. Services MUST return an OData 4.0 response if the request was +made with an `OData-MaxVersion` header with a value of `4.0`. -### Element `edmx:DataServices` +### Element `edmx:DataServices` The `edmx:DataServices` element MUST contain one or more [`edm:Schema`](#Schema) elements which define the schemas exposed by the @@ -660,7 +862,7 @@ OData service. ::: ::: {.varxml .example} -Example 2: +Example 7: ```xml @@ -699,7 +901,7 @@ referenced schema document. ::: {.varxml .rep} -### Element `edmx:Reference` +### Element `edmx:Reference` The `edmx:Reference` element specifies external CSDL documents referenced by the referencing document. The child elements @@ -714,7 +916,7 @@ MUST contain at least one [`edmx:Include`](#IncludedSchema) or It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Uri` +### Attribute `Uri` The value of `Uri` is an absolute or relative URI; relative URIs are relative to the `xml:base` attribute, see @@ -722,7 +924,7 @@ relative to the `xml:base` attribute, see ::: ::: {.varxml .example} -Example 3: references to other CSDL documents +Example 8: references to other CSDL documents ```xml Element `edmx:Include` +### Element `edmx:Include` The `edmx:Include` element specifies a schema to include from the referenced CSDL document. It MUST provide the `Namespace` attribute and @@ -789,19 +991,19 @@ it MAY provide the `Alias` attribute. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Namespace` +### Attribute `Namespace` The value of `Namespace` is the namespace of a schema defined in the referenced CSDL document. -### Attribute `Alias` +### Attribute `Alias` The value of `Alias` is a [simple identifier](#SimpleIdentifier) that can be used in qualified names instead of the namespace. ::: ::: {.varxml .example} -Example 4: references to entity models containing definitions of +Example 9: references to entity models containing definitions of vocabulary terms ```xml @@ -864,7 +1066,7 @@ not to inspect the referenced document. ::: {.varxml .rep} -### Element `edmx:IncludeAnnotations` +### Element `edmx:IncludeAnnotations` The `edmx:IncludeAnnotations` element specifies the annotations to include from the referenced CSDL document. If no @@ -876,21 +1078,21 @@ The `edmx:IncludeAnnotations` element MUST provide the `TermNamespace` attribute, and it MAY provide the `Qualifier` and `TargetNamespace` attribute. -### Attribute `TermNamespace` +### Attribute `TermNamespace` The value of `TermNamespace` is a namespace. -### Attribute `Qualifier` +### Attribute `Qualifier` The value of `Qualifier` is a [simple identifier](#SimpleIdentifier). -### Attribute `TargetNamespace` +### Attribute `TargetNamespace` The value of `TargetNamespace` is a namespace. ::: ::: {.varxml .example} -Example 5: reference documents that contain annotations +Example 10: reference documents that contain annotations ```xml Element `edm:Schema` +### Element `edm:Schema` The `edm:Schema` element defines a schema. It MUST contain the `Namespace` attribute and it MAY @@ -965,7 +1167,7 @@ It MAY contain elements [`edm:Action`](#Action), [`edm:Function`](#Function), [`edm:Term`](#Term), or [`edm:TypeDefinition`](#TypeDefinition). -### Attribute `Namespace` +### Attribute `Namespace` The value of `Namespace` is the namespace of the schema ::: @@ -996,13 +1198,13 @@ The alias MUST NOT be one of the reserved values `Edm`, `odata`, ::: {.varxml .rep} -### Attribute `Alias` +### Attribute `Alias` The value of `Alias` is a [simple identifier](#SimpleIdentifier). ::: ::: {.varxml .example} -Example 6: schema `org.example` with an alias and a description for the +Example 11: schema `org.example` with an alias and a description for the schema ```xml @@ -1017,7 +1219,7 @@ schema ::: {.varxml .rep} -### Element `edm:Annotations` +### Element `edm:Annotations` The `edm:Annotations` element is used to apply a group of annotations to a single model element. It MUST contain the `Target` attribute and it @@ -1025,18 +1227,18 @@ MAY contain the `Qualifier` attribute. It MUST contain at least one [`edm:Annotation`](#Annotation) element. -### Attribute `Target` +### Attribute `Target` The value of `Target` is a path expression identifying the [annotation target](#Target). It MUST resolve to a model element in scope. -### Attribute `Qualifier` +### Attribute `Qualifier` The value of `Qualifier` is a [simple identifier](#SimpleIdentifier). ::: ::: {.varxml .example} -Example 7: annotations should only be applied to tablet devices +Example 12: annotations should only be applied to tablet devices ```xml @@ -1072,7 +1274,7 @@ types. ::: {.varxml .rep} -### Element `edm:EntityType` +### Element `edm:EntityType` The `edm:EntityType` element MUST contain the `Name` attribute, and it MAY contain the [`BaseType`](#DerivedEntityType), @@ -1087,13 +1289,13 @@ It MAY contain one [`edm:Key`](#Key) element. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the entity type's name. ::: ::: {.varxml .example} -Example 8: a simple entity type +Example 13: a simple entity type ```xml @@ -1121,13 +1323,13 @@ base type. ::: {.varxml .rep} -### Attribute `BaseType` +### Attribute `BaseType` The value of `BaseType` is the qualified name of the base type. ::: ::: {.varxml .example} -Example 9: a derived entity type based on the previous example +Example 14: a derived entity type based on the previous example ```xml @@ -1155,7 +1357,7 @@ type. ::: {.varxml .rep} -### Attribute `Abstract` +### Attribute `Abstract` The value of `Abstract` is one of the Boolean literals `true` or `false`. Absence of the attribute means `false`. @@ -1179,7 +1381,7 @@ properties on instances of any structured type, see ::: {.varxml .rep} -### Attribute `OpenType` +### Attribute `OpenType` The value of `OpenType` is one of the Boolean literals `true` or `false`. Absence of the attribute means `false`. @@ -1208,7 +1410,7 @@ see [OData-VocCore](#ODataVocCore). ::: {.varxml .rep} -### Attribute `HasStream` +### Attribute `HasStream` The value of `HasStream` is one of the Boolean literals `true` or `false`. Absence of the attribute means `false`. @@ -1295,29 +1497,29 @@ special encoding and are a standard constituent of expressions anyway. ::: {.varxml .rep} -### Element `edm:Key` +### Element `edm:Key` The `edm:Key` element MUST contain at least one `edm:PropertyRef` element. -### Element `edm:PropertyRef` +### Element `edm:PropertyRef` The `edm:PropertyRef` element MUST contain the `Name` attribute and MAY contain the `Alias` attribute. -### Attribute `Name` +### Attribute `Name` The value of `Name` is a path expression leading to a primitive property. The names of the properties in the path are joined together by forward slashes. -### Attribute `Alias` +### Attribute `Alias` The value of `Alias` is a [simple identifier](#SimpleIdentifier). ::: ::: {.varxml .example} -Example 10: entity type with a simple key +Example 15: entity type with a simple key ```xml @@ -1330,7 +1532,7 @@ Example 10: entity type with a simple key ::: ::: {.varxml .example} -Example 11: entity type with a simple key referencing a property of a +Example 16: entity type with a simple key referencing a property of a [complex type](#ComplexType) ```xml @@ -1349,7 +1551,7 @@ Example 11: entity type with a simpl ::: ::: {.varxml .example} -Example 12: entity type with a composite key +Example 17: entity type with a composite key ```xml @@ -1363,7 +1565,7 @@ Example 12: entity type with a composite key ::: ::: example -Example 13 (based on [example 11](#complexkey)): requests to an entity set `Categories` +Example 18 (based on [example 16](#complexkey)): requests to an entity set `Categories` of type `Category` must use the alias ``` GET http://host/service/Categories(EntityInfoID=1) @@ -1371,7 +1573,7 @@ GET http://host/service/Categories(EntityInfoID=1) ::: ::: example -Example 14 (based on [example 11](#complexkey)): in a query part the value assigned to +Example 19 (based on [example 16](#complexkey)): in a query part the value assigned to the name attribute must be used ``` GET http://example.org/OData.svc/Categories?$filter=Info/ID le 100 @@ -1411,23 +1613,23 @@ that differ only in case. ::: {.varxml .rep} -### Element `edm:Property` +### Element `edm:Property` The `edm:Property` element MUST contain the `Name` and the `Type` -attribute, and it MAY contain the facet attributes +attribute, and it MAY contain the attributes [`Nullable`](#Nullable), [`MaxLength`](#MaxLength), [`Unicode`](#Unicode), [`Precision`](#Precision), [`Scale`](#Scale), [`SRID`](#SRID), and [`DefaultValue`](#DefaultValue). It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the property's name. ::: ::: {.varxml .example} -Example 15: complex type with two properties +Example 20: complex type with two properties ```xml Attribute `Type` +### Attribute `Type` For single-valued properties the value of `Type` is the qualified name of the property's type. @@ -1469,29 +1671,21 @@ item type, followed by a closing parenthesis `)`. ::: ::: {.varxml .example} -Example 16: property `Units` that can have zero or more strings as its +Example 21: property `Units` that can have zero or more strings as its value ```xml ``` ::: -## 7.2 Type Facets - -Facets modify or constrain the acceptable values of a property. - -For single-valued properties the facets apply to the value of the -property. For collection-valued properties the facets apply to the items -in the collection. - -### 7.2.1 Nullable +## 7.2 Nullable A Boolean value specifying whether the property can have the value `null`. ::: {.varxml .rep} -### Attribute `Nullable` +### Attribute `Nullable` The value of `Nullable` is one of the Boolean literals `true` or `false`. @@ -1499,7 +1693,7 @@ The value of `Nullable` is one of the Boolean literals `true` or For single-valued properties the value `true` means that the property allows the `null` value. -For collection-valued properties the property value will always be a +For collection-valued properties the value will always be a collection that MAY be empty. In this case the `Nullable` attribute applies to items of the collection and specifies whether the collection MAY contain `null` values. @@ -1515,198 +1709,9 @@ cannot assume any default value. Clients SHOULD be prepared for this situation even in OData 4.01 responses. ::: -### 7.2.2 MaxLength - -A positive integer value specifying the maximum length of a binary, -stream or string value. For binary or stream values this is the octet -length of the binary data, for string values it is the character length -(number of code points for Unicode). - -If no maximum length is specified, clients SHOULD expect arbitrary -length. - - -::: {.varxml .rep} -### Attribute `MaxLength` - -The value of `MaxLength` is a positive integer or the symbolic value -`max` as a shorthand for the maximum length supported for the type by -the service. - -Note: the symbolic value `max` is only allowed in OData 4.0 responses; -it is deprecated in OData 4.01. While clients MUST be prepared for this -symbolic value, OData 4.01 and greater services MUST NOT return the -symbolic value `max` and MAY instead specify the concrete maximum length -supported for the type by the service or omit the attribute entirely. -::: - -### 7.2.3 Precision - -For a decimal value: the maximum number of significant decimal digits of -the property's value; it MUST be a positive integer. - -For a temporal value (datetime-with-timezone-offset, duration, or -time-of-day): the number of decimal places allowed in the seconds -portion of the value; it MUST be a non-negative integer between zero and -twelve. - -Note: service authors SHOULD be aware that some clients are unable to -support a precision greater than 28 for decimal properties and 7 for -temporal properties. Client developers MUST be aware of the potential -for data loss when round-tripping values of greater precision. Updating -via `PATCH` and exclusively specifying modified properties will reduce -the risk for unintended data loss. - -Note: duration properties supporting a granularity less than seconds -(e.g. minutes, hours, days) can be annotated with term -[`Measures.DurationGranularity`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Measures.V1.md#DurationGranularity), -see [OData-VocMeasures](#ODataVocMeasures). - - - -::: {.varxml .rep} -### Attribute `Precision` - -The value of `Precision` is a number. - -If not specified for a decimal property, the decimal property has -arbitrary precision. - -If not specified for a temporal property, the temporal property has a -precision of zero. -::: - -::: {.varxml .example} -Example 17: [`Precision`](#Precision) facet applied to the -`DateTimeOffset` type -```xml - -``` -::: - -### 7.2.4 Scale - -A non-negative integer value specifying the maximum number of digits -allowed to the right of the decimal point, or one of the symbolic values -`floating` or `variable`. - -The value `floating` means that the decimal property represents a -decimal floating-point number whose number of significant digits is the -value of the [`Precision`](#Precision) facet. OData 4.0 responses MUST -NOT specify the value `floating`. - -The value `variable` means that the number of digits to the right of the -decimal point can vary from zero to the value of the -[`Precision`](#Precision) facet. - -An integer value means that the number of digits to the right of the -decimal point may vary from zero to the value of the `Scale` facet, and -the number of digits to the left of the decimal point may vary from one -to the value of the `Precision` facet minus the value of the `Scale` -facet. If `Precision` is equal to `Scale`, a single zero MUST precede -the decimal point. - -The value of `Scale` MUST be less than or equal to the value of -[`Precision`](#Precision). - -Note: if the underlying data store allows negative scale, services may -use a [`Precision`](#Precision) with the absolute value of the negative -scale added to the actual number of significant decimal digits, and -client-provided values may have to be rounded before being stored. - - - - - - -::: {.varxml .rep} -### Attribute `Scale` - -The value of `Scale` is a number or one of the symbolic values -`floating` or `variable`. - -Services SHOULD use lower-case values; clients SHOULD accept values in a -case-insensitive manner. - -If not specified, the `Scale` facet defaults to zero. -::: - -::: {.varxml .example} -Example 18: [`Precision`](#Precision)`=3` and `Scale=2`. -Allowed values: 1.23, 0.23, 3.14 and 0.7, not allowed values: 123, 12.3 -```xml - -``` -::: - -::: {.varxml .example} -Example 19: `Precision=2` equals `Scale`. -Allowed values: 0.23, 0.7, not allowed values: 1.23, 1.2 -```xml - -``` -::: - -::: {.varxml .example} -Example 20: `Precision=3` and a variable `Scale`. -Allowed values: 0.123, 1.23, 0.23, 0.7, 123 and 12.3, not allowed -values: 12.34, 1234 and 123.4 due to the limited precision. -```xml - -``` -::: - -::: {.varxml .example} -Example 21: `Precision=7` and a floating `Scale`. -Allowed values: -1.234567e3, 1e-101, 9.999999e96, not allowed values: -1e-102 and 1e97 due to the limited precision. -```xml - -``` -::: - -### 7.2.5 Unicode - -For a string property the `Unicode` facet indicates whether the property -might contain and accept string values with Unicode characters (code -points) beyond the ASCII character set. The value `false` indicates that -the property will only contain and accept string values with characters -limited to the ASCII character set. - -If no value is specified, the `Unicode` facet defaults to `true`. - - -::: {.varxml .rep} -### Attribute `Unicode` - -The value of `Unicode` is one of the Boolean literals `true` or `false`. -Absence of the attribute means `true`. -::: - -### 7.2.6 SRID - -For a geometry or geography property the `SRID` facet identifies which -spatial reference system is applied to values of the property on type -instances. - -The value of the `SRID` facet MUST be a non-negative integer or the -special value `variable`. If no value is specified, the facet defaults -to `0` for `Geometry` types or `4326` for `Geography` types. - -The valid values of the `SRID` facet and their meanings are as defined -by the European Petroleum Survey Group [EPSG](#_EPSG). - - -::: {.varxml .rep} -### Attribute `SRID` - -The value of `SRID` is a number or the symbolic value `variable`. -::: - -### 7.2.7 Default Value +## 7.3 Default Value -A primitive or enumeration property MAY define a default value that is +A primitive- or enumeration-typed property MAY define a default value that is used if the property is not explicitly represented in an annotation or the body of a request or response. @@ -1714,7 +1719,7 @@ If no value is specified, the client SHOULD NOT assume a default value. ::: {.varxml .rep} -### Attribute `DefaultValue` +### Attribute `DefaultValue` Default values of type `Edm.String` MUST be represented according to the XML escaping rules for character data in attribute values. Values of @@ -1751,7 +1756,7 @@ that differ only in case. ::: {.varxml .rep} -### Element `edm:NavigationProperty` +### Element `edm:NavigationProperty` The `edm:NavigationProperty` element MUST contain the `Name` and `Type` attributes, and it MAY contain the attributes @@ -1765,7 +1770,7 @@ child element [`edm:OnDelete`](#OnDeleteAction). It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the navigation property's name. ::: @@ -1816,7 +1821,7 @@ supports inserting items into a specific ordinal position. ::: {.varxml .rep} -### Attribute `Type` +### Attribute `Type` For single-valued navigation properties the value of `Type` is the qualified name of the navigation property's type. @@ -1837,7 +1842,7 @@ property, a collection is allowed to have zero items. ::: {.varxml .rep} -### Attribute `Nullable` +### Attribute `Nullable` The value of `Nullable` is one of the Boolean literals `true` or `false`. Absence of the attribute means `true`. @@ -1877,7 +1882,7 @@ partner navigation property. ::: {.varxml .rep} -### Attribute `Partner` +### Attribute `Partner` The value of `Partner` is the path to the of the partner navigation property. @@ -1952,7 +1957,7 @@ can also be reached via a non-containment navigation path. ::: {.varxml .rep} -### Attribute `ContainsTarget` +### Attribute `ContainsTarget` The value of `ContainsTarget` is one of the Boolean literals `true` or `false`. Absence of the attribute means `false`. @@ -1970,10 +1975,10 @@ the target of the navigation). The type of the dependent property MUST match the type of the principal property, or both types MUST be complex types. -If the principle property references an entity, then the dependent +If the principal property references an entity, then the dependent property must reference the same entity. -If the principle property's value is a complex type instance, then the +If the principal property's value is a complex type instance, then the dependent property's value must be a complex type instance with the same properties, each with the same values. @@ -1986,14 +1991,14 @@ property MUST NOT be nullable. ::: {.varxml .rep} -### Element `edm:ReferentialConstraint` +### Element `edm:ReferentialConstraint` The `edm:ReferentialConstraint` element MUST contain the attributes `Property` and `ReferencedProperty`. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Property` +### Attribute `Property` The `Property` attribute specifies the property that takes part in the referential constraint on the dependent structured type. Its value MUST @@ -2003,7 +2008,7 @@ dependent structured type. The names of the properties in the path are joined together by forward slashes. The path is relative to the dependent structured type declaring the navigation property. -### Attribute `ReferencedProperty` +### Attribute `ReferencedProperty` The `ReferencedProperty` attribute specifies the corresponding property of the principal entity type. Its value MUST be a path expression @@ -2071,13 +2076,13 @@ not predictable by the client and could vary per entity. ::: {.varxml .rep} -### Element `edm:OnDelete` +### Element `edm:OnDelete` The `edm:OnDelete` element MUST contain the `Action` attribute. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Action` +### Attribute `Action` The value of `Action` is one of the values `Cascade`, `None`, `SetNull`, or `SetDefault`. @@ -2127,7 +2132,7 @@ types. ::: {.varxml .rep} -### Element `edm:ComplexType` +### Element `edm:ComplexType` The `edm:ComplexType` element MUST contain the `Name` attribute, and it MAY contain the [`BaseType`](#DerivedComplexType), @@ -2140,7 +2145,7 @@ properties of the complex type. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the complex type's name. ::: @@ -2183,7 +2188,7 @@ The rules for annotations of derived complex types are described in ::: {.varxml .rep} -### Attribute `BaseType` +### Attribute `BaseType` The value of `BaseType` is the qualified name of the base type. ::: @@ -2195,7 +2200,7 @@ instances. ::: {.varxml .rep} -### Attribute `Abstract` +### Attribute `Abstract` The value of `Abstract` is one of the Boolean literals `true` or `false`. Absence of the attribute means `false`. @@ -2219,7 +2224,7 @@ properties on instances of any structured type, see ::: {.varxml .rep} -### Attribute `OpenType` +### Attribute `OpenType` The value of `OpenType` is one of the Boolean literals `true` or `false`. Absence of the attribute means `false`. @@ -2248,7 +2253,7 @@ one enumeration member at a time. ::: {.varxml .rep} -### Element `edm:EnumType` +### Element `edm:EnumType` The `edm:EnumType` element MUST contain the Name attribute, and it MAY contain the [`UnderlyingType`](#UnderlyingIntegerType) and @@ -2259,7 +2264,7 @@ elements defining the members of the enumeration type. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the enumeration type's name. ::: @@ -2285,7 +2290,7 @@ If not explicitly specified, `Edm.Int32` is used as the underlying type. ::: {.varxml .rep} -### Attribute `UnderlyingType` +### Attribute `UnderlyingType` The value of `UnderlyingType` is the qualified name of the underlying type. @@ -2302,7 +2307,7 @@ selected simultaneously. ::: {.varxml .rep} -### Attribute `IsFlags` +### Attribute `IsFlags` The value of `IsFlags` is one of the Boolean literals `true` or `false`. Absence of the attribute means `false`. @@ -2354,18 +2359,18 @@ values. ::: {.varxml .rep} -### Element `edm:Member` +### Element `edm:Member` The `edm:Member` element MUST contain the `Name` attribute and it MAY contain the `Value` attribute. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the enumeration member's name. -### Attribute `Value` +### Attribute `Value` If the [`IsFlags`](#FlagsEnumerationType) attribute has a value of `false`, either all members MUST specify an integer value for the @@ -2425,14 +2430,14 @@ definition is used, and whether they can be overridden. ::: {.varxml .rep} -### Element `edm:TypeDefinition` +### Element `edm:TypeDefinition` The `edm:TypeDefinition` element MUST contain the `Name` and [`UnderlyingType`](#UnderlyingPrimitiveType) attributes. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the type definition's name. ::: @@ -2465,7 +2470,7 @@ MUST NOT be another type definition. ::: {.varxml .rep} -### Attribute `UnderlyingType` +### Attribute `UnderlyingType` The value of `UnderlyingType` is the qualified name of the underlying type. @@ -2527,7 +2532,7 @@ An unbound action MAY have the same name as a bound action. ::: {.varxml .rep} -### Element `edm:Action` +### Element `edm:Action` The `edm:Action` element MUST contain the `Name` attribute and it MAY contain the [`IsBound`](#BoundorUnboundActionorFunctionOverloads) and @@ -2538,7 +2543,7 @@ MAY contain [`edm:Parameter`](#Parameter) elements. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the action's name. ::: @@ -2593,7 +2598,7 @@ they specify the same underlying type. ::: {.varxml .rep} -### Element `edm:Function` +### Element `edm:Function` The `edm:Function` element MUST contain the `Name` attribute and it MAY contain the [`IsBound`](#BoundorUnboundActionorFunctionOverloads) and @@ -2604,7 +2609,7 @@ contain [`edm:Parameter`](#Parameter) elements. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the action's name. ::: @@ -2616,7 +2621,7 @@ explicitly indicated, it is unbound. Bound actions or functions are invoked on resources matching the type of the binding parameter. The binding parameter can be of any type, and it -MAY be [nullable](#Nullable). +MAY be nullable. Unbound actions are invoked from the entity container through an [action import](#ActionImport). @@ -2627,7 +2632,7 @@ or from the entity container through a [function import](#FunctionImport). ::: {.varxml .rep} -### Attribute `IsBound` +### Attribute `IsBound` The value of `IsBound` is one of the Boolean literals `true` or `false`. Absence of the attribute means `false`. @@ -2654,7 +2659,7 @@ entity type that should be returned from the type cast. ::: {.varxml .rep} -### Attribute `EntitySetPath` +### Attribute `EntitySetPath` The value of `EntitySetPath` is the entity set path. ::: @@ -2671,7 +2676,7 @@ the type returned by the composable function. ::: {.varxml .rep} -### Attribute `IsComposable` +### Attribute `IsComposable` The value of `IsComposable` is one of the Boolean literals `true` or `false`. Absence of the attribute means `false`. @@ -2682,7 +2687,7 @@ The value of `IsComposable` is one of the Boolean literals `true` or The return type of an action or function overload MAY be any type in scope, or a collection of any type in scope. -The facets [`Nullable`](#Nullable), [`MaxLength`](#MaxLength), +The facets [`MaxLength`](#MaxLength), [`Precision`](#Precision), [`Scale`](#Scale), and [`SRID`](#SRID) can be used as appropriate to specify value restrictions of the return type, as well as the [`Unicode`](#Unicode) facet for 4.01 and greater payloads. @@ -2693,7 +2698,7 @@ returned collection. ::: {.varxml .rep} -### Element `edm:ReturnType` +### Element `edm:ReturnType` The `edm:ReturnType` element MUST contain the `Type` attribute, and it MAY contain the attributes `Nullable`, [`MaxLength`](#MaxLength), @@ -2702,7 +2707,7 @@ MAY contain the attributes `Nullable`, [`MaxLength`](#MaxLength), It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Type` +### Attribute `Type` For single-valued return types the value of `Type` is the qualified name of the return type. @@ -2711,7 +2716,7 @@ For collection-valued return types the value of `Type` is the character sequence `Collection(` followed by the qualified name of the return item type, followed by a closing parenthesis `)`. -### Attribute `Nullable` +### Attribute `Nullable` The value of `Nullable` is one of the Boolean literals `true` or `false`. Absence of the attribute means `true`. @@ -2757,7 +2762,7 @@ the collection. ::: {.varxml .rep} -### Element `edm:Parameter` +### Element `edm:Parameter` The `edm:Parameter` element MUST contain the `Name` and the `Type` attribute, and it MAY contain the attributes `Nullable`, @@ -2766,11 +2771,11 @@ attribute, and it MAY contain the attributes `Nullable`, It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the parameter's name. -### Attribute `Type` +### Attribute `Type` For single-valued parameters the value of `Type` is the qualified name of the parameter. @@ -2779,7 +2784,7 @@ For collection-valued parameters the value of `Type` is the character sequence `Collection(` followed by the qualified name of the parameter's type, followed by a closing parenthesis `)`. -### Attribute `Nullable` +### Attribute `Nullable` The value of `Nullable` is one of the Boolean literals `true` or `false`. Absence of the attribute means `true`. @@ -2866,7 +2871,7 @@ in an entity model as a top level resource. ::: {.varxml .rep} -### Element `edm:EntityContainer` +### Element `edm:EntityContainer` The `edm:EntityContainer` MUST contain one or more [`edm:EntitySet`](#EntitySet), [`edm:Singleton`](#Singleton), @@ -2875,7 +2880,7 @@ The `edm:EntityContainer` MUST contain one or more It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the entity container's name. ::: @@ -2924,7 +2929,7 @@ extending entity containers. ::: {.varxml .rep} -### Attribute `Extends` +### Attribute `Extends` The value of `Extends` is the qualified name of the entity container to be extended. @@ -2963,7 +2968,7 @@ options SHOULD NOT be included in the service document. ::: {.varxml .rep} -### Element `edm:EntitySet` +### Element `edm:EntitySet` The `edm:EntitySet` element MUST contain the attributes `Name` and `EntityType`, and it MAY contain the `IncludeInServiceDocument` @@ -2974,16 +2979,16 @@ It MAY contain It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the entity set's name. -### Attribute `EntityType` +### Attribute `EntityType` The value of `EntityType` is the qualified name of an entity type in scope. -### Attribute `IncludeInServiceDocument` +### Attribute `IncludeInServiceDocument` The value of `IncludeInServiceDocument` is one of the Boolean literals `true` or `false`. Absence of the attribute means `true`. @@ -3003,7 +3008,7 @@ A singleton MUST reference an instance its entity type. ::: {.varxml .rep} -### Element `edm:Singleton` +### Element `edm:Singleton` The `edm:Singleton` element MUST include the attributes `Name` and `Type`, and it MAY contain the `Nullable` attribute. @@ -3013,16 +3018,16 @@ It MAY contain It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the singleton's name. -### Attribute `Type` +### Attribute `Type` The value of `Type` is whose value is the [qualified name](#QualifiedName) of an entity type in scope. -### Attribute `Nullable` +### Attribute `Nullable` The value of `Nullable` is one of the Boolean literals `true` or `false`. @@ -3038,10 +3043,10 @@ If the entity type of an entity set or singleton declares navigation properties, a navigation property binding allows describing which entity set or singleton will contain the related entities. -An [entity set](#EntitySet) or a [singleton](#Singleton) SHOULD specify -a navigation property binding for each [navigation -property](#NavigationProperty) of its entity type, including navigation -properties defined on complex typed properties or derived types. +An [entity set](#EntitySet) or a [singleton](#Singleton) SHOULD contain a navigation +property binding for each non-containment navigation property that can be reached +from the entity type through a sequence of type casts, complex properties, +or containment navigation properties. If omitted, clients MUST assume that the target entity set or singleton can vary per related entity. @@ -3108,16 +3113,16 @@ be any non-containment navigation properties prior to the final segment. ::: {.varxml .rep} -### Element `edm:NavigationPropertyBinding` +### Element `edm:NavigationPropertyBinding` The `edm:NavigationPropertyBinding` element MUST contain the attributes `Path` and `Target`. -### Attribute `Path` +### Attribute `Path` The value of `Path` is a path expression. -### Attribute `Target` +### Attribute `Target` The value of `Target` is a [target path](#TargetPath). ::: @@ -3145,7 +3150,7 @@ Example 36: for an entity set in any container in scope ::: {.varxml .example} Example 37: binding `Supplier` on `Products` contained within -`Categories – binding applies to all suppliers of all products of all categories` +`Categories` – binding applies to all suppliers of all products of all categories ```xml Element `edm:ActionImport` +### Element `edm:ActionImport` The `edm:ActionImport` element MUST contain the attributes `Name` and `Action`, and it MAY contain the `EntitySet` attribute. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the action import's name. -### Attribute `Action` +### Attribute `Action` The value of `Action` is the qualified name of an unbound action. -### Attribute `EntitySet` +### Attribute `EntitySet` The value of `EntitySet` is either the unqualified name of an entity set in the same entity container or a path to an entity set in a different @@ -3223,27 +3228,29 @@ not included. ::: {.varxml .rep} -### Element `edm:FunctionImport` +### Element `edm:FunctionImport` The `edm:FunctionImport` element MUST contain the attributes `Name` and `Function`, and it MAY contain the attributes `EntitySet` and `IncludeInServiceDocument`. -### Attribute `Name` +It MAY contain [`edm:Annotation`](#Annotation) elements. + +### Attribute `Name` The value of `Name` is the function import's name. -### Attribute `Function` +### Attribute `Function` The value of `Function` is the qualified name of an unbound function. -### Attribute `EntitySet` +### Attribute `EntitySet` The value of `EntitySet` is either the unqualified name of an entity set in the same entity container or a path to an entity set in a different entity container. -### Attribute `IncludeInServiceDocument` +### Attribute `IncludeInServiceDocument` The value of `IncludeInServiceDocument` is one of the Boolean literals `true` or `false`. Absence of the attribute means `false`. @@ -3347,37 +3354,57 @@ scope. ::: {.varxml .rep} -### Element `edm:Term` +### Element `edm:Term` The `edm:Term` element MUST contain the attributes `Name` and `Type`. It -MAY contain the attributes `BaseTerm` and `AppliesTo`. +MAY contain the attributes `Nullable`, `DefaultValue`, [`BaseTerm`](#SpecializedTerm) and [`AppliesTo`](#Applicability). -It MAY specify values for the [`Nullable`](#Nullable), -[ ]{.apple-converted-space}[`MaxLength`](#MaxLength), -[`Precision`](#Precision), [`Scale`](#Scale), or [`SRID`](#SRID) facet -attributes, as well as the [`Unicode`](#Unicode) facet attribute for -4.01 and greater payloads. These facets and their implications are -described in section 7.2. +The facets [`MaxLength`](#MaxLength), +[`Precision`](#Precision), [`Scale`](#Scale), and [`SRID`](#SRID) can be +used as appropriate, as well as the [`Unicode`](#Unicode) facet attribute for +4.01 and greater payloads. A `edm:Term` element whose `Type` attribute specifies a primitive or enumeration type MAY define a value for the `DefaultValue` attribute. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the term's name. -### Attribute `Type` +### Attribute `Type` -For single-valued properties the value of `Type` is the qualified name -of the property's type. +For single-valued terms the value of `Type` is the qualified name +of the term's type. For collection-valued properties the value of `Type` is the character sequence `Collection(` followed by the qualified name of the property's item type, followed by a closing parenthesis `)`. -### Attribute `DefaultValue` +### Attribute `Nullable` + +The value of `Nullable` is one of the Boolean literals `true` or +`false`. + +For single-valued terms the value `true` means that annotations may have the `null` value. + +For collection-valued terms the annotation value will always be a +collection that MAY be empty. In this case the `Nullable` attribute +applies to items of the collection and specifies whether the collection +MAY contain `null` values. + +If no value is specified for a single-valued term, the `Nullable` +attribute defaults to `true`. + +In OData 4.01 responses a collection-valued term MUST specify a +value for the `Nullable` attribute. + +If no value is specified for a collection-valued term, the client +cannot assume any default value. Clients SHOULD be prepared for this +situation even in OData 4.01 responses. + +### Attribute `DefaultValue` The value of this attribute determines the value of the term when applied in an [`edm:Annotation`](#Annotation) without providing an @@ -3405,7 +3432,7 @@ reached. ::: {.varxml .rep} -### Attribute `BaseTerm` +### Attribute `BaseTerm` The value of `BaseTerm` is the qualified name of the base term. ::: @@ -3459,7 +3486,7 @@ Symbolic Value|Model Element ::: {.varxml .rep} -### Attribute `AppliesTo` +### Attribute `AppliesTo` The value of `AppliesTo` is a whitespace-separated list of symbolic values from the table above that identify model elements the term is @@ -3500,7 +3527,7 @@ property of the same or a related structured type. ::: {.varxml .rep} -### Element `edm:Annotation` +### Element `edm:Annotation` The `edm:Annotation` element MUST contain the attribute `Term`, and it MAY contain the attribute [`Qualifier`](#Qualifier). @@ -3524,7 +3551,7 @@ targets the model element to be annotated. An `edm:Annotation` element MAY contain [`edm:Annotation`](#Annotation) elements that annotate the annotation. -### Attribute `Term` +### Attribute `Term` The value of `Term` is the qualified name of a [term](#Term) in scope. ::: @@ -3579,7 +3606,7 @@ identifies an annotation. ::: {.varxml .rep} -### Attribute `Qualifier` +### Attribute `Qualifier` Annotation elements that are children of an [`edm:Annotations`](#AnnotationswithExternalTargeting) element MUST NOT @@ -3660,7 +3687,7 @@ term. ::: {.varxml .rep} -### Expression `edm:Binary` +### Expression `edm:Binary` The `edm:Binary` expression evaluates to a primitive binary value. A binary expression MUST be assigned a value conforming to the rule @@ -3686,7 +3713,7 @@ Example 43: base64url-encoded binary value (OData) ::: {.varxml .rep} -### Expression `edm:Bool` +### Expression `edm:Bool` The `edm:Bool` expression evaluates to a primitive Boolean value. A Boolean expression MUST be assigned a Boolean value. @@ -3711,7 +3738,7 @@ Example 44: ::: {.varxml .rep} -### Expression `edm:Date` +### Expression `edm:Date` The `edm:Date` expression evaluates to a primitive date value. A date expression MUST be assigned a value of type `xs:date`, see @@ -3740,7 +3767,7 @@ Example 45: ::: {.varxml .rep} -### Expression `edm:DateTimeOffset` +### Expression `edm:DateTimeOffset` The `edm:DateTimeOffset` expression evaluates to a primitive datetimestamp value with a time-zone offset. A datetimestamp expression @@ -3774,7 +3801,7 @@ Example 46: ::: {.varxml .rep} -### Expression `edm:Decimal` +### Expression `edm:Decimal` The `edm:Decimal` expression evaluates to a primitive decimal value. A decimal expression MUST be assigned a value conforming to the rule @@ -3805,7 +3832,7 @@ Example 48: element notation ::: {.varxml .rep} -### Expression `edm:Duration` +### Expression `edm:Duration` The `edm:Duration` expression evaluates to a primitive duration value. A duration expression MUST be assigned a value of type @@ -3833,7 +3860,7 @@ Example 49: ::: {.varxml .rep} -### Expression `edm:EnumMember` +### Expression `edm:EnumMember` The `edm:EnumMember` expression references a [member](#EnumerationTypeMember) of an [enumeration @@ -3878,7 +3905,7 @@ Example 51: combined value for `IsFlags` enumeration type ::: {.varxml .rep} -### Expression `edm:Float` +### Expression `edm:Float` The `edm:Float` expression evaluates to a primitive floating point (or double) value. A float expression MUST be assigned a value conforming to @@ -3904,7 +3931,7 @@ Example 52: ::: {.varxml .rep} -### Expression `edm:Guid` +### Expression `edm:Guid` The `edm:Guid` expression evaluates to a primitive guid value. A guid expression MUST be assigned a value conforming to the rule `guidValue` @@ -3932,7 +3959,7 @@ Example 53: ::: {.varxml .rep} -### Expression `edm:Int` +### Expression `edm:Int` The `edm:Int` expression evaluates to a primitive integer value. An integer MUST be assigned a value conforming to the rule `int64Value` in @@ -3963,7 +3990,7 @@ Example 55: element notation ::: {.varxml .rep} -### Expression `edm:String` +### Expression `edm:String` The `edm:String` expression evaluates to a primitive string value. A string expression MUST be assigned a value of the type `xs:string`, see @@ -3990,7 +4017,7 @@ Example 56: ::: {.varxml .rep} -### Expression `edm:TimeOfDay` +### Expression `edm:TimeOfDay` The `edm:TimeOfDay` expression evaluates to a primitive time value. A time-of-day expression MUST be assigned a value conforming to the rule @@ -4208,56 +4235,139 @@ Addresses/-1/Street #### 14.4.1.2 Path Evaluation -Annotations MAY be embedded within their target, or specified -separately, e.g. as part of a different schema, and specify a path to -their target model element. The latter situation is referred to as -*targeting* in the remainder of this section. - -For annotations embedded within or targeting an entity container, the -path is evaluated starting at the entity container, i.e. an empty path -resolves to the entity container, and non-empty paths MUST start with a -segment identifying a container child (entity set, function import, -action import, or singleton). The subsequent segments follow the rules -for paths targeting the corresponding child element. - -For annotations embedded within or targeting an entity set or a -singleton, the path is evaluated starting at the entity set or -singleton, i.e. an empty path resolves to the entity set or singleton, -and non-empty paths MUST follow the rules for annotations targeting the -declared entity type of the entity set or singleton. - -For annotations embedded within or targeting an entity type or complex -type, the path is evaluated starting at the type, i.e. an empty path -resolves to the type, and the first segment of a non-empty path MUST be -a structural or navigation property of the type, a [type -cast](#TypeCast), or a [term cast](#TermCast). - -For annotations embedded within a structural or navigation property of -an entity type or complex type, the path is evaluated starting at the -directly enclosing type. This allows e.g. specifying the value of an -annotation on one property to be calculated from values of other -properties of the same type. An empty path resolves to the enclosing -type, and non-empty paths MUST follow the rules for annotations -targeting the directly enclosing type. - -For annotations targeting a structural or navigation property of an -entity type or complex type, the path is evaluated starting at the -*outermost* entity type or complex type named in the target of the -annotation, i.e. an empty path resolves to the outermost type, and the -first segment of a non-empty path MUST be a structural or navigation -property of the outermost type, a [type cast](#TypeCast), or a [term -cast](#TermCast). - -For annotations embedded within or targeting an action, action import, -function, function import, parameter, or return type, the first segment -of the path MUST be a parameter name or `$ReturnType`. +Annotations MAY be embedded within their target, or specified separately, +e.g. as part of a different schema, and specify a path to their target model +element. The latter situation is referred to as *targeting* in the remainder of +this section. + +The *host* of an annotation is the model element targeted by the annotation, +unless that target is another annotation or a model element (collection, +record or property value) directly or indirectly embedded within another +annotation, in which case the host is the host of that other annotation. + +If the value of an annotation is expressed dynamically with a path +expression, the path evaluation rules for this expression depend upon the +model element by which the annotation is hosted. + +For annotations hosted by an entity container, the path is evaluated starting +at the entity container, i.e. an empty path resolves to the entity container, +and non-empty paths MUST start with a segment identifying a container child +(entity set, function import, action import, or singleton). The subsequent +segments follow the rules for path expressions targeting the corresponding +child element. + +For annotations hosted by an entity set or a singleton, the path is evaluated +starting at the entity set or singleton, i.e. an empty path resolves to the +entity set or singleton, and non-empty paths MUST follow the rules for +annotations targeting the declared entity type of the entity set or singleton. + +For annotations hosted by an entity type or complex type, the path is +evaluated starting at the type, i.e. an empty path resolves to the type, and +the first segment of a non-empty path MUST be a structural or navigation +property of the type, a [type cast](#TypeCast), or a [term cast](#TermCast). + +For annotations hosted by an action, action import, function, function +import, parameter, or return type, the first segment of the path MUST be the +name of a parameter of the action or function or `$ReturnType`. + +For annotations hosted by a structural or navigation property, the path +evaluation rules additionally depend upon how the annotation target is +specified, as follows: + +1. If the annotation is directly or indirectly embedded within the hosting + property, the path is evaluated starting at the directly enclosing type of + the hosting property. This allows e.g. specifying the value of an + annotation on one property to be calculated from values of other properties + of the same enclosing type. An empty path resolves to the enclosing type, + and non-empty paths MUST follow the rules for annotations targeting the + directly enclosing type. + +2. If the annotation uses targeting and the target path starts with an entity + container, or the annotation is directly or indirectly embedded within such an + annotation, the path is evaluated starting at the declared type of the + hosting property. An empty path resolves to the declared type of the + property, and non-empty paths MUST follow the rules for annotations + targeting the declared type of the property. If the type is primitive, the + first segment of a non-empty path MUST be a [type cast](#TypeCast) or a + [term cast](#TermCast). + +3. If the annotation uses targeting and the target path does not start with + an entity container, or the annotation is directly or indirectly embedded + within such an annotation, the path is evaluated starting at the *outermost* + entity type or complex type named in the target path. This allows e.g. + specifying the value of an annotation on one property to be calculated from + values of other properties of the outermost type. An empty path resolves to + the outermost type, and the first segment of a non-empty path MUST be a + structural or navigation property of the outermost type, a [type cast](#TypeCast), + or a [term cast](#TermCast). + +::: example +Example 67: Annotations hosted by property `A2` in various modes + +Path evaluation for the annotations in the first block starts at the directly +enclosing type `self.A` of the hosting property `A2`. + +:::: varxml +```xml + + + + + + + + + + + + +``` +:::: + +Path evaluation for the annotations in the next block starts at the declared +type `self.B` of the hosting property `A2`. + +:::: varxml +```xml + + + + + + + + + + + +``` +:::: + +Path evaluation for the annotations in the final block starts at the outermost +type `self.A` named in the target path. + +:::: varxml +```xml + + + + + + + + + +``` +:::: + +::: #### 14.4.1.3 Annotation Path The annotation path expression provides a value for terms or term properties that specify the [built-in types](#BuiltInTypesfordefiningVocabularyTerms) -`Edm.AnnotationPath or Edm.ModelElementPath`. Its argument is a [model +`Edm.AnnotationPath` or `Edm.ModelElementPath`. Its argument is a [model path](#PathExpressions) with the following restriction: - A non-null path MUST resolve to an annotation. @@ -4273,14 +4383,14 @@ that reuse or refer to other terms. ::: {.varxml .rep} -### Expression `edm:AnnotationPath` +### Expression `edm:AnnotationPath` The `edm:AnnotationPath` expression MAY be provided using element notation or attribute notation. ::: ::: {.varxml .example} -Example 67: +Example 68: ```xml @@ -4298,7 +4408,7 @@ Example 67: The model element path expression provides a value for terms or term properties that specify the [built-in -type](#BuiltInTypesfordefiningVocabularyTerms)` Edm.ModelElementPath`. Its +type](#BuiltInTypesfordefiningVocabularyTerms) `Edm.ModelElementPath`. Its argument is a [model path](#PathExpressions). The value of the model element path expression is the path itself, not @@ -4307,14 +4417,14 @@ the instance(s) identified by the path. ::: {.varxml .rep} -### Expression `edm:ModelElementPath` +### Expression `edm:ModelElementPath` The `edm:ModelElementPath` expression MAY be provided using element notation or attribute notation. ::: ::: {.varxml .example} -Example 68: +Example 69: ```xml @@ -4330,7 +4440,7 @@ Example 68: The navigation property path expression provides a value for terms or term properties that specify the [built-in types](#BuiltInTypesfordefiningVocabularyTerms) -`Edm.NavigationPropertyPath, Edm.AnyPropertyPath, or Edm.ModelElementPath`. +`Edm.NavigationPropertyPath`, `Edm.AnyPropertyPath`, or `Edm.ModelElementPath`. Its argument is a [model path](#PathExpressions) with the following restriction: - A non-null path MUST resolve to a model @@ -4343,14 +4453,14 @@ not the entitiy or collection of entities identified by the path. ::: {.varxml .rep} -### Expression `edm:NavigationPropertyPath` +### Expression `edm:NavigationPropertyPath` The `edm:NavigationPropertyPath` expression MAY be provided using element notation or attribute notation. ::: ::: {.varxml .example} -Example 69: +Example 70: ```xml @@ -4372,7 +4482,7 @@ Example 69: The property path expression provides a value for terms or term properties that specify one of the [built-in types](#BuiltInTypesfordefiningVocabularyTerms) -`Edm.PropertyPath, Edm.AnyPropertyPath, or Edm.ModelElementPath`. Its +`Edm.PropertyPath`, `Edm.AnyPropertyPath`, or `Edm.ModelElementPath`. Its argument is a [model path](#PathExpressions) with the following restriction: - A non-null path MUST resolve to a model @@ -4386,14 +4496,14 @@ identified by the path. ::: {.varxml .rep} -### Expression `edm:PropertyPath` +### Expression `edm:PropertyPath` The `edm:PropertyPath` MAY be provided using either element notation or attribute notation. ::: ::: {.varxml .example} -Example 70: +Example 71: ```xml @@ -4424,14 +4534,14 @@ instances identified by the path. ::: {.varxml .rep} -### Expression `edm:Path` +### Expression `edm:Path` The `edm:Path` expression MAY be provided using element notation or attribute notation. ::: ::: {.varxml .example} -Example 71: +Example 72: ```xml @@ -4475,21 +4585,21 @@ evaluate to comparable values. ::: {.varxml .rep} -### Expressions `edm:And` and `edm:Or` +### Expressions `edm:And` and `edm:Or` The `And` and `Or` logical expressions are represented as elements `edm:And` and `edm:Or` that MUST contain two annotation expressions. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Expression `edm:Not` +### Expression `edm:Not` Negation expressions are represented as an element `edm:Not` that MUST contain a single annotation expression. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Expressions `edm:Eq`, `edm:Ne`, `edm:Gt`, `edm:Ge`, `edm:Lt`, `edm:Le`, `edm:Has`, and `edm:In` +### Expressions `edm:Eq`, `edm:Ne`, `edm:Gt`, `edm:Ge`, `edm:Lt`, `edm:Le`, `edm:Has`, and `edm:In` All comparison expressions are represented as an element that MUST contain two annotation expressions. @@ -4498,7 +4608,7 @@ They MAY contain [`edm:Annotation`](#Annotation) elements. ::: ::: {.varxml .example} -Example 72: +Example 73: ```xml IsMale @@ -4575,14 +4685,14 @@ expressions that evaluate to numeric values. ::: {.varxml .rep} -### Expression `edm:Neg` +### Expression `edm:Neg` Negation expressions are represented as an element `edm:Neg` that MUST contain a single annotation expression. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Expressions `edm:Add`, `edm:Sub`, `edm:Mul`, `edm:Div`, `edm:DivBy`, and `edm:Mod` +### Expressions `edm:Add`, `edm:Sub`, `edm:Mul`, `edm:Div`, `edm:DivBy`, and `edm:Mod` These arithmetic expressions are represented as an element that MUST contain two annotation expressions. @@ -4591,7 +4701,7 @@ They MAY contain [`edm:Annotation`](#Annotation) elements. ::: ::: {.varxml .example} -Example 73: +Example 74: ```xml StartDate @@ -4632,14 +4742,14 @@ function. ::: {.varxml .rep} -### Expression `edm:Apply` +### Expression `edm:Apply` The `edm:Apply` element MUST contain the `Function` attribute and MAY contain annotation expressions as operands for the applied function. It MAY contain more [`edm:Annotation`](#Annotation) elements. -### Attribute `Function` +### Attribute `Function` The value of `Function` is the [qualified name](#QualifiedName) of the client-side function to apply. @@ -4668,7 +4778,7 @@ are represented according to the appropriate alternative in the ::: {.varxml .example} -Example 74: +Example 75: ```xml @@ -4692,7 +4802,7 @@ the member name of the enumeration value. #### 14.4.4.2 Function `odata.fillUriTemplate` The `odata.fillUriTemplate` client-side function takes two or more -expressions as arguments and returns a value of type `Edm.String.` +expressions as arguments and returns a value of type `Edm.String`. The first argument MUST be of type `Edm.String` and specifies a URI template according to [RFC6570](#rfc6570), the other arguments MUST be @@ -4720,7 +4830,7 @@ first property is used as key, the second property as value. ::: {.varxml .example} -Example 75: assuming there are no special characters in values of the +Example 76: assuming there are no special characters in values of the Name property of the Actor entity ```xml @@ -4734,6 +4844,7 @@ Name property of the Actor entity The `odata.matchesPattern` client-side function takes two string expressions as arguments and returns a Boolean value. +It is the counterpart of the identically named URL function [OData-URL, section 5.1.1.7.1](#ODataURL). The function returns true if the second expression evaluates to an [ECMAScript](#_ECMAScript) (JavaScript) regular expression and @@ -4743,7 +4854,7 @@ expression, using syntax and semantics of ::: {.varxml .example} -Example 76: all non-empty `FirstName` values not containing the letters +Example 77: all non-empty `FirstName` values not containing the letters `b`, `c`, or `d` evaluate to `true` ```xml @@ -4755,7 +4866,7 @@ Example 76: all non-empty `FirstName` values not containing the letters #### 14.4.4.4 Function `odata.uriEncode` -The `odata.uriEncode `client-side function takes one argument of +The `odata.uriEncode` client-side function takes one argument of primitive type and returns the URL-encoded OData literal that can be used as a key value in OData URLs or in the query part of OData URLs. @@ -4764,7 +4875,7 @@ paren-style key syntax. ::: {.varxml .example} -Example 77: +Example 78: ```xml http://host/service/Genres({genreName}) @@ -4787,14 +4898,14 @@ rules as the `cast` canonical function defined in ::: {.varxml .rep} -### Expression `edm:Cast` +### Expression `edm:Cast` The `edm:Cast` element MUST contain the `Type` attribute and MUST contain exactly one expression. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Type` +### Attribute `Type` The value of `Type` is a qualified type name in scope, or the character sequence `Collection(` followed by the qualified name of a type in @@ -4809,7 +4920,7 @@ are considered unspecified. ::: ::: {.varxml .example} -Example 78: +Example 79: ```xml @@ -4830,13 +4941,13 @@ compatible. ::: {.varxml .rep} -### Expression `edm:Collection` +### Expression `edm:Collection` The `edm:Collection` element contains zero or more child expressions. ::: ::: {.varxml .example} -Example 79: +Example 80: ```xml @@ -4876,7 +4987,7 @@ collection. ::: {.varxml .rep} -### Expression `edm:If` +### Expression `edm:If` The `edm:If` element MUST contain two or three child expressions that MUST use element notation. @@ -4885,7 +4996,7 @@ It MAY contain [`edm:Annotation`](#Annotation) elements. ::: ::: {.varxml .example} -Example 80: the condition is a [value path expression](#ValuePath) +Example 81: the condition is a [value path expression](#ValuePath) referencing the Boolean property `IsFemale`, whose value then determines the value of the `edm:If` expression (or so it was long ago) ```xml @@ -4909,7 +5020,7 @@ the specified type, and `false` otherwise. ::: {.varxml .rep} -### Expression `edm:UrlRef` +### Expression `edm:UrlRef` The `edm:UrlRef` expression MAY be provided using element notation or attribute notation. @@ -4922,7 +5033,7 @@ elements. ::: ::: {.varxml .example} -Example 81: +Example 82: ```xml @@ -4950,7 +5061,7 @@ within the schema containing the expression. ::: {.varxml .rep} -### Expression `edm:LabeledElement` +### Expression `edm:LabeledElement` The `edm:LabeledElement` element MUST contain the Name attribute. @@ -4959,13 +5070,13 @@ or element notation. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Name` +### Attribute `Name` The value of `Name` is the labeled element's name. ::: ::: {.varxml .example} -Example 82: +Example 83: ```xml @@ -4989,14 +5100,14 @@ expression as its value. ::: {.varxml .rep} -### Expression `edm:LabeledElementReference` +### Expression `edm:LabeledElementReference` The `edm:LabeledElementReference` element MUST contain the qualified name of a labeled element expression in its body. ::: ::: {.varxml .example} -Example 83: +Example 84: ```xml Model.CustomerFirstName @@ -5014,14 +5125,14 @@ expression MAY be annotated. ::: {.varxml .rep} -### Expression `edm:Null` +### Expression `edm:Null` The `edm:Null` element MAY contain [`edm:Annotation`](#Annotation) elements. ::: ::: {.varxml .example} -Example 84: +Example 85: ```xml @@ -5030,7 +5141,7 @@ Example 84: ::: ::: {.varxml .example} -Example 85: +Example 86: ```xml @@ -5065,18 +5176,18 @@ expression is equivalent to specifying an empty collection as its value. ::: {.varxml .rep} -### Expression `edm:Record` +### Expression `edm:Record` The `edm:Record` element MAY contain the `Type` attribute and MAY contain `edm:PropertyValue` elements. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Type` +### Attribute `Type` The value of `Type` is the qualified name of a structured type in scope. -### Element `edm:PropertyValue` +### Element `edm:PropertyValue` The `edm:PropertyValue` element MUST contain the `Property` attribute, and it MUST contain exactly one expression that MAY be provided using @@ -5084,14 +5195,14 @@ either element notation or attribute notation. It MAY contain [`edm:Annotation`](#Annotation) elements. -### Attribute `Property` +### Attribute `Property` The value of `Property` is the name of a property of the type of the enclosing `edm:Record` expression. ::: ::: {.varxml .example} -Example 86: this annotation "morphs" the entity type from [example 8](#entitytype) into +Example 87: this annotation "morphs" the entity type from [example 13](#entitytype) into a structured type with two structural properties `GivenName` and `Surname` and two navigation properties `DirectSupervisor` and `CostCenter`. The first three properties simply rename properties of the @@ -5139,7 +5250,7 @@ surrounding expression. ::: {.varxml .rep} -### Expression `edm:UrlRef` +### Expression `edm:UrlRef` The `edm:UrlRef` expression MAY be provided using element notation or attribute notation. @@ -5152,7 +5263,7 @@ elements. ::: ::: {.varxml .example} -Example 87: +Example 88: ```xml @@ -5229,7 +5340,7 @@ forward-slash separated property, navigation property, or type-cast segments ::: example -Example 88: Target expressions +Example 89: Target expressions ``` MySchema.MyEntityContainer/MyEntitySet MySchema.MyEntityContainer/MySingleton @@ -5251,7 +5362,7 @@ CSDL. These examples demonstrate many of the topics covered above. ::: {.varxml .example} -Example 89: +Example 90: ```xml @@ -5265,7 +5376,7 @@ Example 89: - + @@ -5369,7 +5480,7 @@ Example 89: ::: {.varxml .example} -Example 90: +Example 91: ```xml @@ -5521,13 +5632,13 @@ _Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14 https://www.rfc-editor.org/info/rfc2119. ###### [RFC6570] -_Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., and D. Orchard, “URI Template”, RFC 6570, March 2012_. -http://tools.ietf.org/html/rfc6570. +_Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., and D. Orchard, "URI Template", RFC 6570, DOI 10.17487/RFC6570, March 2012_. +https://www.rfc-editor.org/info/rfc6570. ###### [RFC8174] _Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_. -http://www.rfc-editor.org/info/rfc8174. +https://www.rfc-editor.org/info/rfc8174. ###### [XML-1.1] @@ -5548,7 +5659,7 @@ http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/. Latest version available ## A.2 Informative References ###### [OpenUI5] -_OpenUI5 Version 1.40.10 - OData V4 Metadata JSON Format_. +_OpenUI5 Version 1.40.10 --- OData V4 Metadata JSON Format_. https://openui5.hana.ondemand.com/1.40.10/#docs/guide/87aac894a40640f89920d7b2a414499b.html. ------- @@ -5556,167 +5667,169 @@ https://openui5.hana.ondemand.com/1.40.10/#docs/guide/87aac894a40640f89920d7b2a4 # Appendix B. Table of XML Elements and Attributes ::: toc -- [Element `edmx:Edmx`](#ElementedmxEdmx1) - - [Attribute `Version`](#AttributeVersion1.1) -- [Element `edmx:DataServices`](#ElementedmxDataServices2) -- [Element `edmx:Reference`](#ElementedmxReference3) - - [Attribute `Uri`](#AttributeUri3.1) -- [Element `edmx:Include`](#ElementedmxInclude4) - - [Attribute `Namespace`](#AttributeNamespace4.1) - - [Attribute `Alias`](#AttributeAlias4.2) -- [Element `edmx:IncludeAnnotations`](#ElementedmxIncludeAnnotations5) - - [Attribute `TermNamespace`](#AttributeTermNamespace5.1) - - [Attribute `Qualifier`](#AttributeQualifier5.2) - - [Attribute `TargetNamespace`](#AttributeTargetNamespace5.3) -- [Element `edm:Schema`](#ElementedmSchema6) - - [Attribute `Namespace`](#AttributeNamespace6.1) - - [Attribute `Alias`](#AttributeAlias6.2) -- [Element `edm:Annotations`](#ElementedmAnnotations7) - - [Attribute `Target`](#AttributeTarget7.1) - - [Attribute `Qualifier`](#AttributeQualifier7.2) -- [Element `edm:EntityType`](#ElementedmEntityType8) - - [Attribute `Name`](#AttributeName8.1) - - [Attribute `BaseType`](#AttributeBaseType8.2) - - [Attribute `Abstract`](#AttributeAbstract8.3) - - [Attribute `OpenType`](#AttributeOpenType8.4) - - [Attribute `HasStream`](#AttributeHasStream8.5) -- [Element `edm:Key`](#ElementedmKey9) -- [Element `edm:PropertyRef`](#ElementedmPropertyRef10) - - [Attribute `Name`](#AttributeName10.1) - - [Attribute `Alias`](#AttributeAlias10.2) -- [Element `edm:Property`](#ElementedmProperty11) +- [Type Facet Attributes](#TypeFacetAttributes1) + - [Attribute `MaxLength`](#AttributeMaxLength1.1) + - [Attribute `Precision`](#AttributePrecision1.2) + - [Attribute `Scale`](#AttributeScale1.3) + - [Attribute `Unicode`](#AttributeUnicode1.4) + - [Attribute `SRID`](#AttributeSRID1.5) +- [Element `edmx:Edmx`](#ElementedmxEdmx2) + - [Attribute `Version`](#AttributeVersion2.1) +- [Element `edmx:DataServices`](#ElementedmxDataServices3) +- [Element `edmx:Reference`](#ElementedmxReference4) + - [Attribute `Uri`](#AttributeUri4.1) +- [Element `edmx:Include`](#ElementedmxInclude5) + - [Attribute `Namespace`](#AttributeNamespace5.1) + - [Attribute `Alias`](#AttributeAlias5.2) +- [Element `edmx:IncludeAnnotations`](#ElementedmxIncludeAnnotations6) + - [Attribute `TermNamespace`](#AttributeTermNamespace6.1) + - [Attribute `Qualifier`](#AttributeQualifier6.2) + - [Attribute `TargetNamespace`](#AttributeTargetNamespace6.3) +- [Element `edm:Schema`](#ElementedmSchema7) + - [Attribute `Namespace`](#AttributeNamespace7.1) + - [Attribute `Alias`](#AttributeAlias7.2) +- [Element `edm:Annotations`](#ElementedmAnnotations8) + - [Attribute `Target`](#AttributeTarget8.1) + - [Attribute `Qualifier`](#AttributeQualifier8.2) +- [Element `edm:EntityType`](#ElementedmEntityType9) + - [Attribute `Name`](#AttributeName9.1) + - [Attribute `BaseType`](#AttributeBaseType9.2) + - [Attribute `Abstract`](#AttributeAbstract9.3) + - [Attribute `OpenType`](#AttributeOpenType9.4) + - [Attribute `HasStream`](#AttributeHasStream9.5) +- [Element `edm:Key`](#ElementedmKey10) +- [Element `edm:PropertyRef`](#ElementedmPropertyRef11) - [Attribute `Name`](#AttributeName11.1) - - [Attribute `Type`](#AttributeType11.2) - - [Attribute `Nullable`](#AttributeNullable11.3) - - [Attribute `MaxLength`](#AttributeMaxLength11.4) - - [Attribute `Precision`](#AttributePrecision11.5) - - [Attribute `Scale`](#AttributeScale11.6) - - [Attribute `Unicode`](#AttributeUnicode11.7) - - [Attribute `SRID`](#AttributeSRID11.8) - - [Attribute `DefaultValue`](#AttributeDefaultValue11.9) -- [Element `edm:NavigationProperty`](#ElementedmNavigationProperty12) + - [Attribute `Alias`](#AttributeAlias11.2) +- [Element `edm:Property`](#ElementedmProperty12) - [Attribute `Name`](#AttributeName12.1) - [Attribute `Type`](#AttributeType12.2) - [Attribute `Nullable`](#AttributeNullable12.3) - - [Attribute `Partner`](#AttributePartner12.4) - - [Attribute `ContainsTarget`](#AttributeContainsTarget12.5) -- [Element `edm:ReferentialConstraint`](#ElementedmReferentialConstraint13) - - [Attribute `Property`](#AttributeProperty13.1) - - [Attribute `ReferencedProperty`](#AttributeReferencedProperty13.2) -- [Element `edm:OnDelete`](#ElementedmOnDelete14) - - [Attribute `Action`](#AttributeAction14.1) -- [Element `edm:ComplexType`](#ElementedmComplexType15) - - [Attribute `Name`](#AttributeName15.1) - - [Attribute `BaseType`](#AttributeBaseType15.2) - - [Attribute `Abstract`](#AttributeAbstract15.3) - - [Attribute `OpenType`](#AttributeOpenType15.4) -- [Element `edm:EnumType`](#ElementedmEnumType16) + - [Attribute `DefaultValue`](#AttributeDefaultValue12.4) +- [Element `edm:NavigationProperty`](#ElementedmNavigationProperty13) + - [Attribute `Name`](#AttributeName13.1) + - [Attribute `Type`](#AttributeType13.2) + - [Attribute `Nullable`](#AttributeNullable13.3) + - [Attribute `Partner`](#AttributePartner13.4) + - [Attribute `ContainsTarget`](#AttributeContainsTarget13.5) +- [Element `edm:ReferentialConstraint`](#ElementedmReferentialConstraint14) + - [Attribute `Property`](#AttributeProperty14.1) + - [Attribute `ReferencedProperty`](#AttributeReferencedProperty14.2) +- [Element `edm:OnDelete`](#ElementedmOnDelete15) + - [Attribute `Action`](#AttributeAction15.1) +- [Element `edm:ComplexType`](#ElementedmComplexType16) - [Attribute `Name`](#AttributeName16.1) - - [Attribute `UnderlyingType`](#AttributeUnderlyingType16.2) - - [Attribute `IsFlags`](#AttributeIsFlags16.3) -- [Element `edm:Member`](#ElementedmMember17) + - [Attribute `BaseType`](#AttributeBaseType16.2) + - [Attribute `Abstract`](#AttributeAbstract16.3) + - [Attribute `OpenType`](#AttributeOpenType16.4) +- [Element `edm:EnumType`](#ElementedmEnumType17) - [Attribute `Name`](#AttributeName17.1) - - [Attribute `Value`](#AttributeValue17.2) -- [Element `edm:TypeDefinition`](#ElementedmTypeDefinition18) + - [Attribute `UnderlyingType`](#AttributeUnderlyingType17.2) + - [Attribute `IsFlags`](#AttributeIsFlags17.3) +- [Element `edm:Member`](#ElementedmMember18) - [Attribute `Name`](#AttributeName18.1) - - [Attribute `UnderlyingType`](#AttributeUnderlyingType18.2) -- [Element `edm:Action`](#ElementedmAction19) + - [Attribute `Value`](#AttributeValue18.2) +- [Element `edm:TypeDefinition`](#ElementedmTypeDefinition19) - [Attribute `Name`](#AttributeName19.1) -- [Element `edm:Function`](#ElementedmFunction20) + - [Attribute `UnderlyingType`](#AttributeUnderlyingType19.2) +- [Element `edm:Action`](#ElementedmAction20) - [Attribute `Name`](#AttributeName20.1) - - [Attribute `IsBound`](#AttributeIsBound20.2) - - [Attribute `EntitySetPath`](#AttributeEntitySetPath20.3) - - [Attribute `IsComposable`](#AttributeIsComposable20.4) -- [Element `edm:ReturnType`](#ElementedmReturnType21) - - [Attribute `Type`](#AttributeType21.1) - - [Attribute `Nullable`](#AttributeNullable21.2) -- [Element `edm:Parameter`](#ElementedmParameter22) - - [Attribute `Name`](#AttributeName22.1) - - [Attribute `Type`](#AttributeType22.2) - - [Attribute `Nullable`](#AttributeNullable22.3) -- [Element `edm:EntityContainer`](#ElementedmEntityContainer23) +- [Element `edm:Function`](#ElementedmFunction21) + - [Attribute `Name`](#AttributeName21.1) + - [Attribute `IsBound`](#AttributeIsBound21.2) + - [Attribute `EntitySetPath`](#AttributeEntitySetPath21.3) + - [Attribute `IsComposable`](#AttributeIsComposable21.4) +- [Element `edm:ReturnType`](#ElementedmReturnType22) + - [Attribute `Type`](#AttributeType22.1) + - [Attribute `Nullable`](#AttributeNullable22.2) +- [Element `edm:Parameter`](#ElementedmParameter23) - [Attribute `Name`](#AttributeName23.1) - - [Attribute `Extends`](#AttributeExtends23.2) -- [Element `edm:EntitySet`](#ElementedmEntitySet24) + - [Attribute `Type`](#AttributeType23.2) + - [Attribute `Nullable`](#AttributeNullable23.3) +- [Element `edm:EntityContainer`](#ElementedmEntityContainer24) - [Attribute `Name`](#AttributeName24.1) - - [Attribute `EntityType`](#AttributeEntityType24.2) - - [Attribute `IncludeInServiceDocument`](#AttributeIncludeInServiceDocument24.3) -- [Element `edm:Singleton`](#ElementedmSingleton25) + - [Attribute `Extends`](#AttributeExtends24.2) +- [Element `edm:EntitySet`](#ElementedmEntitySet25) - [Attribute `Name`](#AttributeName25.1) - - [Attribute `Type`](#AttributeType25.2) - - [Attribute `Nullable`](#AttributeNullable25.3) -- [Element `edm:NavigationPropertyBinding`](#ElementedmNavigationPropertyBinding26) - - [Attribute `Path`](#AttributePath26.1) - - [Attribute `Target`](#AttributeTarget26.2) -- [Element `edm:ActionImport`](#ElementedmActionImport27) - - [Attribute `Name`](#AttributeName27.1) - - [Attribute `Action`](#AttributeAction27.2) - - [Attribute `EntitySet`](#AttributeEntitySet27.3) -- [Element `edm:FunctionImport`](#ElementedmFunctionImport28) + - [Attribute `EntityType`](#AttributeEntityType25.2) + - [Attribute `IncludeInServiceDocument`](#AttributeIncludeInServiceDocument25.3) +- [Element `edm:Singleton`](#ElementedmSingleton26) + - [Attribute `Name`](#AttributeName26.1) + - [Attribute `Type`](#AttributeType26.2) + - [Attribute `Nullable`](#AttributeNullable26.3) +- [Element `edm:NavigationPropertyBinding`](#ElementedmNavigationPropertyBinding27) + - [Attribute `Path`](#AttributePath27.1) + - [Attribute `Target`](#AttributeTarget27.2) +- [Element `edm:ActionImport`](#ElementedmActionImport28) - [Attribute `Name`](#AttributeName28.1) - - [Attribute `Function`](#AttributeFunction28.2) + - [Attribute `Action`](#AttributeAction28.2) - [Attribute `EntitySet`](#AttributeEntitySet28.3) - - [Attribute `IncludeInServiceDocument`](#AttributeIncludeInServiceDocument28.4) -- [Element `edm:Term`](#ElementedmTerm29) +- [Element `edm:FunctionImport`](#ElementedmFunctionImport29) - [Attribute `Name`](#AttributeName29.1) - - [Attribute `Type`](#AttributeType29.2) - - [Attribute `DefaultValue`](#AttributeDefaultValue29.3) - - [Attribute `BaseTerm`](#AttributeBaseTerm29.4) - - [Attribute `AppliesTo`](#AttributeAppliesTo29.5) -- [Element `edm:Annotation`](#ElementedmAnnotation30) - - [Attribute `Term`](#AttributeTerm30.1) - - [Attribute `Qualifier`](#AttributeQualifier30.2) -- [Expression `edm:Binary`](#ExpressionedmBinary31) -- [Expression `edm:Bool`](#ExpressionedmBool32) -- [Expression `edm:Date`](#ExpressionedmDate33) -- [Expression `edm:DateTimeOffset`](#ExpressionedmDateTimeOffset34) -- [Expression `edm:Decimal`](#ExpressionedmDecimal35) -- [Expression `edm:Duration`](#ExpressionedmDuration36) -- [Expression `edm:EnumMember`](#ExpressionedmEnumMember37) -- [Expression `edm:Float`](#ExpressionedmFloat38) -- [Expression `edm:Guid`](#ExpressionedmGuid39) -- [Expression `edm:Int`](#ExpressionedmInt40) -- [Expression `edm:String`](#ExpressionedmString41) -- [Expression `edm:TimeOfDay`](#ExpressionedmTimeOfDay42) -- [Expression `edm:AnnotationPath`](#ExpressionedmAnnotationPath43) -- [Expression `edm:ModelElementPath`](#ExpressionedmModelElementPath44) -- [Expression `edm:NavigationPropertyPath`](#ExpressionedmNavigationPropertyPath45) -- [Expression `edm:PropertyPath`](#ExpressionedmPropertyPath46) -- [Expression `edm:Path`](#ExpressionedmPath47) -- [Expressions `edm:And`](#ExpressionsedmAnd48) - - [`edm:Or`](#edmOr48.1) -- [Expression `edm:Not`](#ExpressionedmNot49) -- [Expressions `edm:Eq`](#ExpressionsedmEq50) - - [`edm:Ne`](#edmNe50.1) - - [`edm:Gt`](#edmGt50.2) - - [`edm:Ge`](#edmGe50.3) - - [`edm:Lt`](#edmLt50.4) - - [`edm:Le`](#edmLe50.5) - - [`edm:Has`](#edmHas50.6) - - [`edm:In`](#edmIn50.7) -- [Expression `edm:Neg`](#ExpressionedmNeg51) -- [Expressions `edm:Add`](#ExpressionsedmAdd52) - - [`edm:Sub`](#edmSub52.1) - - [`edm:Mul`](#edmMul52.2) - - [`edm:Div`](#edmDiv52.3) - - [`edm:DivBy`](#edmDivBy52.4) - - [`edm:Mod`](#edmMod52.5) -- [Expression `edm:Apply`](#ExpressionedmApply53) - - [Attribute `Function`](#AttributeFunction53.1) -- [Expression `edm:Cast`](#ExpressionedmCast54) - - [Attribute `Type`](#AttributeType54.1) -- [Expression `edm:Collection`](#ExpressionedmCollection55) -- [Expression `edm:If`](#ExpressionedmIf56) -- [Expression `edm:UrlRef`](#ExpressionedmUrlRef57) -- [Expression `edm:LabeledElement`](#ExpressionedmLabeledElement58) - - [Attribute `Name`](#AttributeName58.1) -- [Expression `edm:LabeledElementReference`](#ExpressionedmLabeledElementReference59) -- [Expression `edm:Null`](#ExpressionedmNull60) -- [Expression `edm:Record`](#ExpressionedmRecord61) - - [Attribute `Type`](#AttributeType61.1) -- [Element `edm:PropertyValue`](#ElementedmPropertyValue62) - - [Attribute `Property`](#AttributeProperty62.1) -- [Expression `edm:UrlRef`](#ExpressionedmUrlRef63) + - [Attribute `Function`](#AttributeFunction29.2) + - [Attribute `EntitySet`](#AttributeEntitySet29.3) + - [Attribute `IncludeInServiceDocument`](#AttributeIncludeInServiceDocument29.4) +- [Element `edm:Term`](#ElementedmTerm30) + - [Attribute `Name`](#AttributeName30.1) + - [Attribute `Type`](#AttributeType30.2) + - [Attribute `Nullable`](#AttributeNullable30.3) + - [Attribute `DefaultValue`](#AttributeDefaultValue30.4) + - [Attribute `BaseTerm`](#AttributeBaseTerm30.5) + - [Attribute `AppliesTo`](#AttributeAppliesTo30.6) +- [Element `edm:Annotation`](#ElementedmAnnotation31) + - [Attribute `Term`](#AttributeTerm31.1) + - [Attribute `Qualifier`](#AttributeQualifier31.2) +- [Expression `edm:Binary`](#ExpressionedmBinary32) +- [Expression `edm:Bool`](#ExpressionedmBool33) +- [Expression `edm:Date`](#ExpressionedmDate34) +- [Expression `edm:DateTimeOffset`](#ExpressionedmDateTimeOffset35) +- [Expression `edm:Decimal`](#ExpressionedmDecimal36) +- [Expression `edm:Duration`](#ExpressionedmDuration37) +- [Expression `edm:EnumMember`](#ExpressionedmEnumMember38) +- [Expression `edm:Float`](#ExpressionedmFloat39) +- [Expression `edm:Guid`](#ExpressionedmGuid40) +- [Expression `edm:Int`](#ExpressionedmInt41) +- [Expression `edm:String`](#ExpressionedmString42) +- [Expression `edm:TimeOfDay`](#ExpressionedmTimeOfDay43) +- [Expression `edm:AnnotationPath`](#ExpressionedmAnnotationPath44) +- [Expression `edm:ModelElementPath`](#ExpressionedmModelElementPath45) +- [Expression `edm:NavigationPropertyPath`](#ExpressionedmNavigationPropertyPath46) +- [Expression `edm:PropertyPath`](#ExpressionedmPropertyPath47) +- [Expression `edm:Path`](#ExpressionedmPath48) +- [Expressions `edm:And`](#ExpressionsedmAnd49) + - [`edm:Or`](#edmOr49.1) +- [Expression `edm:Not`](#ExpressionedmNot50) +- [Expressions `edm:Eq`](#ExpressionsedmEq51) + - [`edm:Ne`](#edmNe51.1) + - [`edm:Gt`](#edmGt51.2) + - [`edm:Ge`](#edmGe51.3) + - [`edm:Lt`](#edmLt51.4) + - [`edm:Le`](#edmLe51.5) + - [`edm:Has`](#edmHas51.6) + - [`edm:In`](#edmIn51.7) +- [Expression `edm:Neg`](#ExpressionedmNeg52) +- [Expressions `edm:Add`](#ExpressionsedmAdd53) + - [`edm:Sub`](#edmSub53.1) + - [`edm:Mul`](#edmMul53.2) + - [`edm:Div`](#edmDiv53.3) + - [`edm:DivBy`](#edmDivBy53.4) + - [`edm:Mod`](#edmMod53.5) +- [Expression `edm:Apply`](#ExpressionedmApply54) + - [Attribute `Function`](#AttributeFunction54.1) +- [Expression `edm:Cast`](#ExpressionedmCast55) + - [Attribute `Type`](#AttributeType55.1) +- [Expression `edm:Collection`](#ExpressionedmCollection56) +- [Expression `edm:If`](#ExpressionedmIf57) +- [Expression `edm:UrlRef`](#ExpressionedmUrlRef58) +- [Expression `edm:LabeledElement`](#ExpressionedmLabeledElement59) + - [Attribute `Name`](#AttributeName59.1) +- [Expression `edm:LabeledElementReference`](#ExpressionedmLabeledElementReference60) +- [Expression `edm:Null`](#ExpressionedmNull61) +- [Expression `edm:Record`](#ExpressionedmRecord62) + - [Attribute `Type`](#AttributeType62.1) +- [Element `edm:PropertyValue`](#ElementedmPropertyValue63) + - [Attribute `Property`](#AttributeProperty63.1) +- [Expression `edm:UrlRef`](#ExpressionedmUrlRef64) ::: ------- diff --git a/docs/odata-data-aggregation-ext/odata-data-aggregation-ext.html b/docs/odata-data-aggregation-ext/odata-data-aggregation-ext.html index bd6163a31..bdddb4475 100644 --- a/docs/odata-data-aggregation-ext/odata-data-aggregation-ext.html +++ b/docs/odata-data-aggregation-ext/odata-data-aggregation-ext.html @@ -96,7 +96,7 @@

    OData Extension for Data Aggregation Version 4.0

    Committee Specification 03

    -

    30 August 2023

    +

    19 September 2023

     

    This stage:

    https://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/cs03/odata-data-aggregation-ext-v4.0-cs03.md (Authoritative)
    @@ -149,20 +149,20 @@

    Abstract:

    This specification adds basic grouping and aggregation functionality (e.g. sum, min, and max) to the Open Data Protocol (OData) without changing any of the base principles of OData.

    Status:

    -

    This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical.

    -

    TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/.

    -

    This specification is provided under the RF on RAND Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php).

    -

    Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product's prose narrative document(s), the content in the separate plain text file prevails.

    +

    This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the “Latest stage” location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical.

    +

    TC members should send comments on this specification to the TC’s email list. Others should send comments to the TC’s public comment list, after subscribing to it by following the instructions at the “Send A Comment” button on the TC’s web page at https://www.oasis-open.org/committees/odata/.

    +

    This specification is provided under the RF on RAND Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC’s web page (https://www.oasis-open.org/committees/odata/ipr.php).

    +

    Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product’s prose narrative document(s), the content in the separate plain text file prevails.

    Key words:

    -

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

    +

    The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

    Citation format:

    When referencing this specification the following citation format should be used:

    [OData-Data-Agg-v4.0]

    -

    OData Extension for Data Aggregation Version 4.0. Edited by Ralf Handl, Hubert Heijkers, Gerald Krause, Michael Pizzo, Heiko Theißen, and Martin Zurmuehl. 30 August 2023. OASIS Committee Specification 03. https://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/cs03/odata-data-aggregation-ext-v4.0-cs03.html. Latest stage: https://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/odata-data-aggregation-ext-v4.0.html.

    +

    OData Extension for Data Aggregation Version 4.0. Edited by Ralf Handl, Hubert Heijkers, Gerald Krause, Michael Pizzo, Heiko Theißen, and Martin Zurmuehl. 19 September 2023. OASIS Committee Specification 03. https://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/cs03/odata-data-aggregation-ext-v4.0-cs03.html. Latest stage: https://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/odata-data-aggregation-ext-v4.0.html.

    Notices

    Copyright © OASIS Open 2023. All Rights Reserved.

    Distributed under the terms of the OASIS IPR Policy.

    -

    The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs.

    +

    The name “OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs.

    For complete copyright information please see the full Notices section in an Appendix below.


    Table of Contents

    @@ -357,7 +357,7 @@

    Here is a customized command line which will generate HTML from this markdown file (named odata-data-aggregation-ext-v4.0-cs03.md). Line breaks are added for readability only:

    -
    pandoc -f gfm+tex_math_dollars+fenced_divs
    +
    pandoc -f gfm+tex_math_dollars+fenced_divs+smart
            -t html
            -o odata-data-aggregation-ext-v4.0-cs03.html
            -c styles/markdown-styles-v1.7.3b.css
    @@ -373,13 +373,13 @@ 

    2 Overview

    Open Data Protocol (OData) services expose a data model that describes the schema of the service in terms of the Entity Data Model (EDM, see OData-CSDL) and then allows for querying data in terms of this model. The responses returned by an OData service are based on that data model and retain the relationships between the entities in the model.

    -

    Extending the OData query features with simple aggregation capabilities avoids cluttering OData services with an exponential number of explicitly modeled "aggregation level entities" or else restricting the consumer to a small subset of predefined aggregations.

    +

    Extending the OData query features with simple aggregation capabilities avoids cluttering OData services with an exponential number of explicitly modeled “aggregation level entities” or else restricting the consumer to a small subset of predefined aggregations.

    Adding the notion of aggregation to OData without changing any of the base principles in OData has two aspects:

    1. Means for the consumer to query aggregated data on top of any given data model (for sufficiently capable data providers)
    2. Means for the provider to annotate what data can be aggregated, and in which way, allowing consumers to avoid asking questions that the provider cannot answer
    -

    Implementing any of these two aspects is valuable in itself independent of the other, and implementing both provides additional value for consumers. The provided aggregation annotations help a consumer understand more of the data structure looking at the service's exposed data model. The query extensions allow the consumers to explicitly express the desired aggregation behavior for a particular query. They also allow consumers to formulate queries that utilize the aggregation annotations.

    +

    Implementing any of these two aspects is valuable in itself independent of the other, and implementing both provides additional value for consumers. The provided aggregation annotations help a consumer understand more of the data structure looking at the service’s exposed data model. The query extensions allow the consumers to explicitly express the desired aggregation behavior for a particular query. They also allow consumers to formulate queries that utilize the aggregation annotations.

    2.1 Example Data Model

    Example 2: The following diagram depicts a simple model that is used throughout this document.

    @@ -881,7 +881,7 @@

    hierarchy based on Year, Month, and Date

  • SalesOrganization hierarchy based on the recursive association to itself
  • -

    In the context of Online Analytical Processing (OLAP), this model might be described in terms of a Sales "cube" with an Amount "measure" and three "dimensions". This document will avoid such terms, as they are heavily overloaded.

    +

    In the context of Online Analytical Processing (OLAP), this model might be described in terms of a Sales “cube” with an Amount “measure” and three “dimensions”. This document will avoid such terms, as they are heavily overloaded.

    Query extensions and descriptive annotations can be applied to normalized schemas as well as partly or fully denormalized schemas.

    2.3 Example Use Cases

    -

    Example 5: In the example model, one prominent use case is the relation of customers to products. The first question that is likely to be asked is: "Which customers bought which products?"

    -

    This leads to the second more quantitative question: "Who bought how much of what?"

    +

    Example 5: In the example model, one prominent use case is the relation of customers to products. The first question that is likely to be asked is: “Which customers bought which products?”

    +

    This leads to the second more quantitative question: “Who bought how much of what?”

    The answer to the second question typically is visualized as a cross-table:

    @@ -1593,7 +1593,7 @@

    \(B=γ(v,p_2)\).
  • Return \(B\).
  • -

    This notation is extended to the case of an empty path \(e\) by setting \(\Gamma(A,e)=A\) with null values removed. Note the collections returned by \(\Gamma\) and \(γ\) never contain the null value. Also, every instance \(u\) in \(\Gamma(A,p)\) occurs also in \(A\) or nested into \(A\), therefore an algorithmic step like "Add a dynamic property to each \(u\) in \(\Gamma(A,p)\)" effectively changes \(A\).

    +

    This notation is extended to the case of an empty path \(e\) by setting \(\Gamma(A,e)=A\) with null values removed. Note the collections returned by \(\Gamma\) and \(γ\) never contain the null value. Also, every instance \(u\) in \(\Gamma(A,p)\) occurs also in \(A\) or nested into \(A\), therefore an algorithmic step like “Add a dynamic property to each \(u\) in \(\Gamma(A,p)\)” effectively changes \(A\).

    3.2 Basic Aggregation

    3.2.1 Transformation aggregate

    3.2.1.1 Aggregation Algorithm

    @@ -2386,7 +2386,7 @@

    OData-URL for details.

    Where useful navigations exist it is beneficial to expose those as explicit navigation properties in the model, but the ability to pose queries that span entity sets not related by an association provides a mechanism for advanced consumers to use more flexible join conditions.

    -

    Example 47: if Sale had a string property ProductID instead of the navigation property Product, a "join" between Sales and Products could be accessed via the $crossjoin resource

    +

    Example 47: if Sale had a string property ProductID instead of the navigation property Product, a “join” between Sales and Products could be accessed via the $crossjoin resource

    GET /service/$crossjoin(Products,Sales)
                              ?$expand=Products($select=Name),Sales($select=Amount)
                              &$filter=Products/ID eq Sales/ProductID
    @@ -2551,7 +2551,7 @@

    </EntityContainer>

    5.5 Hierarchies

    -

    A hierarchy is an arrangement of entities whose values are represented as being "above", "below", or "at the same level as" one another. A hierarchy can be leveled or recursive.

    +

    A hierarchy is an arrangement of entities whose values are represented as being “above”, “below”, or “at the same level as” one another. A hierarchy can be leveled or recursive.

    5.5.1 Leveled Hierarchy

    A leveled hierarchy has a fixed number of levels each of which is represented by a grouping property. The values of a lower-level property depend on the property value of the level above.

    A leveled hierarchy can be defined for a collection of instances of an entity or complex type and is described with the term LeveledHierarchy that lists the properties used to form the hierarchy.

    @@ -2699,7 +2699,7 @@

    }
    -

    Example 57: the lowest-level organizations including their superordinate's ID

    +

    Example 57: the lowest-level organizations including their superordinate’s ID

    GET /service/SalesOrganizations?$filter=Aggregation.isleaf(
       HierarchyNodes=$root/SalesOrganizations,
       HierarchyQualifier='SalesOrgHierarchy',
    @@ -2842,7 +2842,7 @@ 

    \(o\) of expressions that could also be passed as a $orderby system query option. If \(o\) is present, the transformation stable-sorts \(H'\) by \(o\).

    The instances in the input set are related to one node (if \(p\) is single-valued) or multiple nodes (if \(p\) is collection-valued) in the recursive hierarchy. Given a node \(x\), denote by \(\hat F(x)\) the collection of all instances in the input set that are related to \(x\); these collections can overlap. For each \(u\) in \(\hat F(x)\), the output set contains one instance that comprises the properties of \(u\) and additional properties that identify the node \(x\). These additional properties are independent of \(u\) and are bundled into an instance called \(σ(x)\). For example, if a sale \(u\) is related to two sales organizations and hence contained in both \(\hat F(x_1)\) and \(\hat F(x_2)\), the output set will contain two instances \((u,σ(x_1))\) and \((u,σ(x_2))\) and \(σ(x_i)\) contributes a navigation property SalesOrganization.

    A transformation \(F(x)\) is defined below such that \(\hat F(x)\) is the output set of \(F(x)\) applied to the input set of the traverse transformation.

    -

    Given a node \(x\), the formulas below contain the transformation \(\Pi_G(σ(x))\) in order to inject the properties of \(σ(x)\) into the instances in \(\hat F(x)\); this uses the function \(\Pi_G\) that is defined in the simple grouping section. Further, \(G\) is a list of data aggregation paths that shall be present in the output set, and \(σ\) is a function that maps each hierarchy node \(x\) to an instance of the input type containing the paths from \(G\). As a consequence of the following definitions, only single-valued properties and "final segments from \(G\)" are nested into \(σ(x)\), therefore the behavior of \(\Pi_G(σ(x))\) is well-defined.

    +

    Given a node \(x\), the formulas below contain the transformation \(\Pi_G(σ(x))\) in order to inject the properties of \(σ(x)\) into the instances in \(\hat F(x)\); this uses the function \(\Pi_G\) that is defined in the simple grouping section. Further, \(G\) is a list of data aggregation paths that shall be present in the output set, and \(σ\) is a function that maps each hierarchy node \(x\) to an instance of the input type containing the paths from \(G\). As a consequence of the following definitions, only single-valued properties and “final segments from \(G\)” are nested into \(σ(x)\), therefore the behavior of \(\Pi_G(σ(x))\) is well-defined.

    The definition of \(σ(x)\) makes use of a function \(a(ε,t,x)\), which returns a sparsely populated instance \(u\) in which only the path \(t\) has a value, namely \(u[t]=x\).

    Three cases are distinguished:

      @@ -2940,7 +2940,7 @@

      \(S\) is not specified, then the result is effectively like in the standard case, except for the presence of the Aggregation.UpPath annotations.

      6.3 Grouping with rolluprecursive

      -

      Recall that simple grouping partitions the input set and applies a transformation sequence to each partition. By contrast, grouping with rolluprecursive, informally speaking, transforms the input set into overlapping portions (like "US" and "US East"), one for each node \(x\) of a recursive hierarchy. The transformation \(F(x)\), defined below, outputs the portion whose node identifiers are among the descendants of \(x\) (including \(x\) itself). A transformation sequence is then applied to each portion, and they are made distinguishable in the output set through injection of information about the node \(x\), which is achieved through the transformation \(\Pi_G(σ(x))\) defined in the traverse section.

      +

      Recall that simple grouping partitions the input set and applies a transformation sequence to each partition. By contrast, grouping with rolluprecursive, informally speaking, transforms the input set into overlapping portions (like “US” and “US East”), one for each node \(x\) of a recursive hierarchy. The transformation \(F(x)\), defined below, outputs the portion whose node identifiers are among the descendants of \(x\) (including \(x\) itself). A transformation sequence is then applied to each portion, and they are made distinguishable in the output set through injection of information about the node \(x\), which is achieved through the transformation \(\Pi_G(σ(x))\) defined in the traverse section.

      As defined above, \(H\), \(Q\) and \(p\) are the first three parameters of rolluprecursive, \(S\) is an optional fourth parameter. Let \(H'\) be the output set of the transformation sequence \(S\) applied to \(H\), or \(H'=H\) if \(S\) is not specified.

      Navigation properties specified in \(p\) are expanded by default.

      Let \(T\) be a transformation sequence, \(P_1\) stand in for zero or more property paths and \(P_2\) for zero or more rollup or rolluprecursive operators or property paths. The transformation \({\tt groupby}((P_1,{\tt rolluprecursive}(H,Q,p,S),P_2),T)\) is computed by the following algorithm, which invokes itself recursively if the number of rolluprecursive operators in the first argument of the groupby transformation, which is called \(M\), is greater than one. Let \(N\) be the recursion depth of the algorithm, starting with 1.

      @@ -3016,7 +3016,7 @@

      }

    -

    ⚠ Example 67: When requesting a sub-hierarchy consisting of the US East sales organization and its ancestors, the total sales amounts can either include the descendants outside this sub-hierarchy ("actual totals") or can exclude them ("visual totals").

    +

    ⚠ Example 67: When requesting a sub-hierarchy consisting of the US East sales organization and its ancestors, the total sales amounts can either include the descendants outside this sub-hierarchy (“actual totals”) or can exclude them (“visual totals”).

    Actual totals are computed when rolluprecursive is restricted to the sub-hierarchy by setting the optional parameter \(S\) to an ancestors transformation:

    GET /service/Sales?$apply=groupby((rolluprecursive(
         $root/SalesOrganizations,SalesOrgHierarchy,SalesOrganization/ID,
    @@ -3094,7 +3094,7 @@ 

    { "Name": "Sue" } ] }

    -

    Note that "Sue" appears only once although the customer base contains two different Sues.

    +

    Note that “Sue” appears only once although the customer base contains two different Sues.

    Aggregation is also possible across related entities.

    @@ -3109,8 +3109,8 @@

    ] }

    Since groupby expands navigation properties in grouping properties by default, this is the same result as if the request would include a $expand=Customer($select=Name). The groupby removes all other properties.

    -

    Note that "Luc" does not appear in the aggregated result as he hasn't bought anything and therefore there are no sales entities that refer/navigate to Luc.

    -

    However, even though both Sues bought products, only one "Sue" appears in the aggregate result. Including properties that guarantee the right level of uniqueness in the grouping can repair that.

    +

    Note that “Luc” does not appear in the aggregated result as he hasn’t bought anything and therefore there are no sales entities that refer/navigate to Luc.

    +

    However, even though both Sues bought products, only one “Sue” appears in the aggregate result. Including properties that guarantee the right level of uniqueness in the grouping can repair that.

    Example 71:

    @@ -3275,7 +3275,7 @@

    "TotalSales": { "Total@type": "Decimal", "Total": 4 } } ] }

    -

    Applying outerjoin instead would return an additional entity for product with ID "Pencil" and TotalSales having a null value.

    +

    Applying outerjoin instead would return an additional entity for product with ID “Pencil” and TotalSales having a null value.

    Example 80:

    @@ -3755,7 +3755,7 @@

    }

    -

    Example 103: concatenation of two different groupings "biggest sale per customer" and "biggest sale per product", made distinguishable by a dynamic property:

    +

    Example 103: concatenation of two different groupings “biggest sale per customer” and “biggest sale per product”, made distinguishable by a dynamic property:

    GET /service/Sales?$apply=concat(
         groupby((Customer),topcount(1,Amount))/compute('Customer' as per),
         groupby((Product),topcount(1,Amount))/compute('Product' as per))
    @@ -3869,7 +3869,7 @@ 

    7.9 Aggregation in Recursive Hierarchies

    If aggregation along a recursive hierarchy does not apply to the entire hierarchy, transformations ancestors and descendants may be used to restrict it as needed.

    7.10 Maintaining Recursive Hierarchies

    Besides changes to the structural properties of the entities in a hierarchical collection, hierarchy maintenance involves changes to the parent-child relationships.

    @@ -4324,12 +4324,12 @@

    }

    7.11 Transformation Sequences

    -

    Applying aggregation first covers the most prominent use cases. The slightly more sophisticated question "how much money is earned with small sales" requires filtering the base set before applying the aggregation. To enable this type of question several transformations can be specified in $apply in the order they are to be applied, separated by a forward slash.

    +

    Applying aggregation first covers the most prominent use cases. The slightly more sophisticated question “how much money is earned with small sales” requires filtering the base set before applying the aggregation. To enable this type of question several transformations can be specified in $apply in the order they are to be applied, separated by a forward slash.

    Example 119:

    GET /service/Sales?$apply=filter(Amount le 1)
         /aggregate(Amount with sum as Total)
    -

    means "filter first, then aggregate", and results in

    +

    means “filter first, then aggregate”, and results in

    {
       "@context": "$metadata#Sales(Total)",
       "value": [
    @@ -4467,35 +4467,35 @@ 

    [OData-ABNF]

    ABNF components: OData ABNF Construction Rules Version 4.01 and OData ABNF Test Cases.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-Agg-ABNF]

    OData Aggregation ABNF Construction Rules Version 4.0.
    -See link in "Additional artifacts" section on cover page.

    +See link in “Additional artifacts” section on cover page.

    [OData-CSDL]

    OData Common Schema Definition Language (CSDL) JSON Representation Version 4.01.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    OData Common Schema Definition Language (CSDL) XML Representation Version 4.01.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-JSON]

    OData JSON Format Version 4.01.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-Protocol]

    OData Version 4.01. Part 1: Protocol.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-URL]

    OData Version 4.01. Part 2: URL Conventions.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-VocAggr]

    OData Aggregation Vocabulary.
    -See link in "Additional artifacts" section on cover page.

    +See link in “Additional artifacts” section on cover page.

    [OData-VocCore]

    OData Core Vocabulary.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [RFC2119]
    -

    Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997
    +

    Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels”, BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997
    https://www.rfc-editor.org/info/rfc2119.

    [RFC8174]
    -

    Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017
    +

    Leiba, B., “Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words”, BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017
    https://www.rfc-editor.org/info/rfc8174.


    Appendix B. Acknowledgments

    @@ -4604,11 +4604,11 @@

    Remove actions and functions (except set transformations) on aggregated entities, adapted section "Actions and Functions on Aggregated Entities" +

    - + @@ -4617,14 +4617,14 @@

    Appendix D. Notices

    Copyright © OASIS Open 2023. All Rights Reserved.

    -

    All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The full Policy may be found at the OASIS website.

    +

    All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the “OASIS IPR Policy”). The full Policy may be found at the OASIS website.

    This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published, and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this section are included on all such copies and derivative works. However, this document itself may not be modified in any way, including by removing the copyright notice or references to OASIS, except as needed for the purpose of developing any document or deliverable produced by an OASIS Technical Committee (in which case the rules applicable to copyrights, as set forth in the OASIS IPR Policy, must be followed) or as required to translate it into languages other than English.

    The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.

    -

    This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

    +

    This document and the information contained herein is provided on an “AS IS” basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

    As stated in the OASIS IPR Policy, the following three paragraphs in brackets apply to OASIS Standards Final Deliverable documents (Committee Specification, Candidate OASIS Standard, OASIS Standard, or Approved Errata).

    [OASIS requests that any OASIS Party or any other party that believes it has patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable, to notify OASIS TC Administrator and provide an indication of its willingness to grant patent licenses to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this deliverable.]

    [OASIS invites any party to contact the OASIS TC Administrator if it is aware of a claim of ownership of any patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable by a patent holder that is not willing to provide a license to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this OASIS Standards Final Deliverable. OASIS may include such claims on its website, but disclaims any obligation to do so.]

    -

    [OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS' procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

    -

    The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark/ for above guidance.

    +

    [OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS’ procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

    +

    The name “OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark/ for above guidance.

    diff --git a/docs/odata-data-aggregation-ext/odata-data-aggregation-ext.md b/docs/odata-data-aggregation-ext/odata-data-aggregation-ext.md index 5a713d993..02e65d81f 100644 --- a/docs/odata-data-aggregation-ext/odata-data-aggregation-ext.md +++ b/docs/odata-data-aggregation-ext/odata-data-aggregation-ext.md @@ -7,7 +7,7 @@ ## Committee Specification 03 -## 30 August 2023 +## 19 September 2023   @@ -67,7 +67,7 @@ This specification adds basic grouping and aggregation functionality (e.g. sum, #### Status: This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical. -TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "[Send A Comment](https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=odata)" button on the TC's web page at https://www.oasis-open.org/committees/odata/. +TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/. This specification is provided under the [RF on RAND Terms Mode](https://www.oasis-open.org/policies-guidelines/ipr/#RF-on-RAND-Mode) of the [OASIS IPR Policy](https://www.oasis-open.org/policies-guidelines/ipr/), the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php). @@ -82,7 +82,7 @@ When referencing this specification the following citation format should be used **[OData-Data-Agg-v4.0]** _OData Extension for Data Aggregation Version 4.0_. -Edited by Ralf Handl, Hubert Heijkers, Gerald Krause, Michael Pizzo, Heiko Theißen, and Martin Zurmuehl. 30 August 2023. OASIS Committee Specification 03. +Edited by Ralf Handl, Hubert Heijkers, Gerald Krause, Michael Pizzo, Heiko Theißen, and Martin Zurmuehl. 19 September 2023. OASIS Committee Specification 03. https://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/cs03/odata-data-aggregation-ext-v4.0-cs03.html. Latest stage: https://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/odata-data-aggregation-ext-v4.0.html. @@ -256,7 +256,7 @@ All other text is normative unless otherwise labeled. Here is a customized command line which will generate HTML from this markdown file (named `odata-data-aggregation-ext-v4.0-cs03.md`). Line breaks are added for readability only: ``` -pandoc -f gfm+tex_math_dollars+fenced_divs +pandoc -f gfm+tex_math_dollars+fenced_divs+smart -t html -o odata-data-aggregation-ext-v4.0-cs03.html -c styles/markdown-styles-v1.7.3b.css @@ -4955,7 +4955,7 @@ Committee Specification Draft 01|2013-07-25| Ralf Handl
    Hubert Heijkers
    Committee Specification Draft 02|2014-01-09| Ralf Handl
    Hubert Heijkers
    Gerald Krause
    Michael Pizzo
    Martin Zurmuehl| Dynamic properties used all aggregated values either via aliases or via custom aggregates
    Refactored annotations Committee Specification Draft 03|2015-07-16| Ralf Handl
    Hubert Heijkers
    Gerald Krause
    Michael Pizzo
    Martin Zurmuehl| Added compute transformation
    Minor clean-up Committee Specification Draft 04|2023-07-05| Ralf Handl
    Hubert Heijkers
    Gerald Krause
    Michael Pizzo
    Heiko Theißen| Added section about fundamentals of input and output sets
    Algorithmic descriptions of transformations
    Added join and outerjoin transformations, replaced expand by addnested
    Added transformations orderby, skip, top, nest
    Added transformations for recursive hierarchies, updated related filter functions
    Added functions evaluable on a collection, introduced keyword $these
    Merged section 4 "Representation of Aggregated Instances" into section 3
    Remove actions and functions (except set transformations) on aggregated entities, adapted section "Actions and Functions on Aggregated Entities" -Committee Specification 03|2023-08-30| Ralf Handl
    Gerald Krause
    Heiko Theißen| Non-material changes from public review feedback +Committee Specification 03|2023-09-19| Ralf Handl
    Gerald Krause
    Heiko Theißen| Non-material changes from public review feedback ------- diff --git a/docs/odata-data-aggregation-ext/odata-data-aggregation-ext.pdf b/docs/odata-data-aggregation-ext/odata-data-aggregation-ext.pdf index 00da673cd..cf8e88501 100644 Binary files a/docs/odata-data-aggregation-ext/odata-data-aggregation-ext.pdf and b/docs/odata-data-aggregation-ext/odata-data-aggregation-ext.pdf differ diff --git a/docs/odata-json-format/odata-json-format.html b/docs/odata-json-format/odata-json-format.html index 6853057c8..a65181d62 100644 --- a/docs/odata-json-format/odata-json-format.html +++ b/docs/odata-json-format/odata-json-format.html @@ -138,12 +138,12 @@

    Abstract:

    The Open Data Protocol (OData) for representing and interacting with structured content is comprised of a set of specifications. The core specification for the protocol is in OData Version 4.02 Part 1: Protocol. This document extends the core specification by defining representations for OData requests and responses using a JSON format.

    Status:

    -

    This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical.

    -

    TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/.

    -

    This specification is provided under the RF on RAND Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php).

    -

    Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product's prose narrative document(s), the content in the separate plain text file prevails.

    +

    This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the “Latest stage” location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical.

    +

    TC members should send comments on this specification to the TC’s email list. Others should send comments to the TC’s public comment list, after subscribing to it by following the instructions at the “Send A Comment” button on the TC’s web page at https://www.oasis-open.org/committees/odata/.

    +

    This specification is provided under the RF on RAND Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC’s web page (https://www.oasis-open.org/committees/odata/ipr.php).

    +

    Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product’s prose narrative document(s), the content in the separate plain text file prevails.

    Key words:

    -

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

    +

    The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

    Citation format:

    When referencing this specification the following citation format should be used:

    [OData-JSON-Format-v4.02]

    @@ -151,7 +151,7 @@

    Citation format:

    Notices

    Copyright © OASIS Open 2023. All Rights Reserved.

    Distributed under the terms of the OASIS IPR Policy.

    -

    The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs.

    +

    The name “OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs.

    For complete copyright information please see the full Notices section in an Appendix below.


    Table of Contents

    @@ -318,7 +318,7 @@

    Here is a customized command line which will generate HTML from this markdown file (named odata-json-format-v4.02-csd01.md). Line breaks are added for readability only:

    -
    pandoc -f gfm+tex_math_dollars+fenced_divs
    +
    pandoc -f gfm+tex_math_dollars+fenced_divs+smart
            -t html
            -o odata-json-format-v4.02-csd01.html
            -c styles/markdown-styles-v1.7.3b.css
    @@ -335,8 +335,8 @@ 

    2 JSON Format Design

    JSON, as described in RFC8259 defines a text format for serializing structured data. Objects are serialized as an unordered collection of name/value pairs.

    JSON does not define any semantics around the name/value pairs that make up an object, nor does it define an extensibility mechanism for adding control information to a payload.

    -

    OData's JSON format extends JSON by defining general conventions for name/value pairs that annotate a JSON object, property or array. OData defines a set of canonical name/value pairs for control information such as ids, types, and links, and instance annotations MAY be used to add domain-specific information to the payload.

    -

    A key feature of OData's JSON format is to allow omitting predictable parts of the wire format from the actual payload. To reconstitute this data on the receiving end, expressions are used to compute missing links, type information, and other control data. These expressions (together with the data on the wire) can be used by the client to compute predictable payload pieces as if they had been included on the wire directly.

    +

    OData’s JSON format extends JSON by defining general conventions for name/value pairs that annotate a JSON object, property or array. OData defines a set of canonical name/value pairs for control information such as ids, types, and links, and instance annotations MAY be used to add domain-specific information to the payload.

    +

    A key feature of OData’s JSON format is to allow omitting predictable parts of the wire format from the actual payload. To reconstitute this data on the receiving end, expressions are used to compute missing links, type information, and other control data. These expressions (together with the data on the wire) can be used by the client to compute predictable payload pieces as if they had been included on the wire directly.

    Control information is used in JSON to capture instance metadata that cannot be predicted (e.g. the next link of a collection) as well as a mechanism to provide values where a computed value would be wrong (e.g. if the media read link of one particular entity does not follow the standard URL conventions). Computing values from metadata expressions is compute intensive and some clients might opt for a larger payload size to avoid computational complexity; to accommodate for this the Accept header allows the client to control the amount of control information added to the response.

    To optimize streaming scenarios, there are a few restrictions that MAY be imposed on the sequence in which name/value pairs appear within JSON objects. For details on the ordering requirements see Payload Ordering Constraints.


    @@ -389,7 +389,7 @@

    editLink: the link used to edit/update the entity, if the entity is updatable and the id does not represent a URL that can be used to edit the entity
  • navigationLink: the link used to retrieve the values of a navigation property
  • associationLink: the link used to describe the relationship between this entity and related entities
  • -
  • type: the type of the containing object or targeted property if the type of the object or targeted property cannot be heuristically determined from the data value, see section "Control Information: type (odata.type)".
  • +
  • type: the type of the containing object or targeted property if the type of the object or targeted property cannot be heuristically determined from the data value, see section “Control Information: type (odata.type)”.
  • Media entities and stream properties may in addition contain the following control information:

    cannot be assumed to support streaming.

    -

    JSON producers are encouraged to follow the payload ordering constraints whenever possible (and include the streaming=true content-type parameter) to support the maximum set of client scenarios.

    +

    JSON producers are encouraged to follow the payload ordering constraints whenever possible (and include the streaming=true media type parameter) to support the maximum set of client scenarios.

    To support streaming scenarios the following payload ordering constraints have to be met:

    • If present, the context control information MUST be the first property in the JSON object.
    • @@ -479,7 +479,7 @@

      Note that in OData 4.0 the streaming format parameter was prefixed with odata.. Payloads with an OData-Version header equal to 4.0 MUST include the odata. prefix. Payloads with an OData-Version header equal to 4.01 or greater SHOULD NOT include the odata. prefix.

      4.5 Control Information

      -

      In addition to the "pure data" a message body MAY contain annotations and control information that is represented as name/value pairs whose names start with @.

      +

      In addition to the “pure data” a message body MAY contain annotations and control information that is represented as name/value pairs whose names start with @.

      In requests and responses with an OData-Version header with a value of 4.0 control information names are prefixed with @odata., e.g. @odata.context. In requests and responses without such a header the odata. prefix SHOULD be omitted, e.g. @context.

      In some cases, control information is required in request payloads; this is called out in the following subsections.

      Receivers that encounter unknown annotations in any namespace or unknown control information MUST NOT stop processing and MUST NOT signal an error.

      @@ -502,7 +502,7 @@

      OData-Protocol.

      4.5.3 Control Information: type (odata.type)

      The type control information specifies the type of a JSON object or name/value pair. Its value is a URI that identifies the type of the property or object. For built-in primitive types the value is the unqualified name of the primitive type. For payloads described by an OData-Version header with a value of 4.0, this name MUST be prefixed with the hash symbol (#); for non-OData 4.0 payloads, built-in primitive type values SHOULD be represented without the hash symbol, but consumers of 4.01 or greater payloads MUST support values with or without the hash symbol. For all other types, the URI may be absolute or relative to the type of the containing object. The root type may be absolute or relative to the root context URL.

      -

      If the URI references a metadata document (that is, it's not just a fragment), it MAY refer to a specific version of that metadata document using the $schemaversion system query option defined in OData-Protocol.

      +

      If the URI references a metadata document (that is, it’s not just a fragment), it MAY refer to a specific version of that metadata document using the $schemaversion system query option defined in OData-Protocol.

      For non-built in primitive types, the URI contains the namespace-qualified or alias-qualified type, specified as a URI fragment. For properties that represent a collection of values, the fragment is the namespace-qualified or alias-qualified element type enclosed in parentheses and prefixed with Collection. The namespace or alias MUST be defined or the namespace referenced in the metadata document of the service, see OData-CSDLJSON or OData-CSDLXML.

      The type control information MUST appear in requests and in responses with minimal or full metadata, if the type cannot be heuristically determined, as described below, and one of the following is true:

        @@ -514,9 +514,10 @@

        type control information unless their type is Double. -
      • The special floating-point values -INF, INF, and NaN are serialized as strings and MUST have a type control information to specify the numeric type of the property.
      • +
      • The special floating-point values -INF, INF, and NaN are serialized as strings and MUST have a type control information to specify the numeric type of the property.
      • String values do have a first class representation in JSON, but there is an obvious collision: OData also encodes a number of other primitive types as strings, e.g. DateTimeOffset, Int64 in the presence of the IEEE754Compatible format parameter etc. If a property appears in JSON string format, it should be treated as a string value unless the property is known (from the metadata document) to have a different type.
      +

      The type control information can be absent in properties nested in an instance of type Edm.Untyped. In particular, individual primitive values within a collection cannot have type control information.

      For more information on namespace- and alias-qualified names, see OData-CSDLJSON or OData-CSDLXML.

      Example 5: entity of type Model.VipCustomer defined in the metadata document of the same service with a dynamic property of type Edm.Date

      @@ -530,7 +531,7 @@

      }

    -

    Example 6: entity of type Model.VipCustomer defined in the metadata document of a different service

    +

    Example 6: entity of type Model.VipCustomer defined in the metadata document of a different service

    {
       "@context": "http://host/service/$metadata#Customers/$entity",
       "@type": "http://host/alternate/$metadata#Model.VipCustomer",
    @@ -549,7 +550,7 @@ 

    4.5.8 Control Information: id (odata.id)

    The id control information contains the entity-id, see OData-Protocol. By convention the entity-id is identical to the canonical URL of the entity, as defined in OData-URL.

    -

    The id control information MUST appear in responses if metadata=full is requested, or if metadata=minimal is requested and any of a non-transient entity's key fields are omitted from the response or the entity-id is not identical to the canonical URL of the entity after

    +

    The id control information MUST appear in responses if metadata=full is requested, or if metadata=minimal is requested and any of a non-transient entity’s key fields are omitted from the response or the entity-id is not identical to the canonical URL of the entity after

    • IRI-to-URI conversion as defined in RFC3987,
    • relative resolution as defined in section 5.2 of RFC3986, and
    • @@ -590,10 +591,10 @@

      4.5.12 Control Information: media* (odata.media*)

      -

      For media entities and stream properties at least one of the control information mediaEditLink and mediaReadLink MUST be included in responses if they don't follow standard URL conventions as defined in OData-URL or if metadata=full is requested.

      +

      For media entities and stream properties at least one of the control information mediaEditLink and mediaReadLink MUST be included in responses if they don't follow standard URL conventions as defined in OData-URL, sections 4.6 Addressing a property and 4.14 Addressing the Media Stream of a Media Entity, or if metadata=full is requested.

      The mediaEditLink control information contains a URL that can be used to update the binary stream associated with the media entity or stream property. It MUST be included for updatable streams if it differs from standard URL conventions relative to the edit link of the entity.

      -

      The mediaReadLink control information contains a URL that can be used to read the binary stream associated with the media entity or stream property. It MUST be included if its value differs from the value of the associated mediaEditLink, if present, or if it doesn't follow standard URL conventions relative to the read link of the entity and the associated mediaEditLink is not present.

      -

      The mediaContentType control information MAY be included; its value SHOULD match the media type of the binary stream represented by the mediaReadLink URL. This is only a hint; the actual media type will be included in the Content-Type header when the resource is requested.

      +

      The mediaReadLink control information contains a URL that can be used to read the binary stream associated with the media entity or stream property. It MUST be included if its value differs from the value of the associated mediaEditLink, if present, or if it doesn’t follow standard URL conventions relative to the read link of the entity and the associated mediaEditLink is not present.

      +

      The mediaContentType control information MAY be included; its value SHOULD match the media type of the binary stream represented by the mediaReadLink URL. This is only a hint; the actual media type will be included in the Content-Type header when the resource is requested.

      The mediaEtag control information MAY be included; its value is the ETag of the binary stream represented by this media entity or stream property.

      The media* control information is not written in responses if metadata=none is requested.

      If a stream property is provided inline in a request, the mediaContentType control information may be specified.

      @@ -687,7 +688,7 @@

      5

      6 Entity

      An entity is serialized as a JSON object. It MAY contain context, type, or deltaLink control information.

      Each property to be transmitted is represented as a name/value pair within the object. The order properties appear within the object is considered insignificant.

      -

      An entity in a payload may be a complete entity, a projected entity (see System Query Option $select OData-Protocol), or a partial entity update (see Update an Entity in OData-Protocol).

      +

      An entity in a payload may be a complete entity, a projected entity (see System Query Option $select in OData-Protocol), or a partial entity update (see Update an Entity in OData-Protocol).

      An entity representation can be (modified and) round-tripped to the service directly. The context URL is used in requests only as a base for relative URLs.

      Example 10: entity with metadata=minimal

      @@ -732,10 +733,10 @@

      6 Entity


      7 Structural Property

      -

      A property within an entity or complex type instance is represented as a name/value pair. The name MUST be the name of the property; the value is represented depending on its type as a primitive value, a complex value, a collection of primitive values, or a collection of complex values.

      +

      A property within an entity or complex type instance is represented as a name/value pair. The name MUST be the name of the property; a non-null value is represented depending on its type as a primitive value, a complex value, a collection of primitive values, or a collection of complex values.

      +

      Null values are represented as the JSON literal null.

      7.1 Primitive Value

      Primitive values are represented following the rules of RFC8259.

      -

      Null values are represented as the JSON literal null.

      Values of type Edm.Boolean are represented as the JSON literals true and false

      Values of types Edm.Byte, Edm.SByte, Edm.Int16, Edm.Int32, Edm.Int64, Edm.Single, Edm.Double, and Edm.Decimal are represented as JSON numbers, except for -INF, INF, and NaN which are represented as strings.

      Values of type Edm.String are represented as JSON strings, using the JSON string escaping rules.

      @@ -801,6 +802,7 @@

      "EmailAddresses@nextLink": "..." }

    +

    A collection of primitive values that occurs in a property of type Edm.Untyped is interpreted as a collection of Edm.Boolean, Edm.String, and Edm.Decimal values, depending on the JavaScript type.

    7.4 Collection of Complex Values

    A collection of complex values is represented as a JSON array; each element in the array is the representation of a complex value. A JSON literal null represents a null value within the collection. An empty collection is represented as an empty array.

    @@ -822,7 +824,7 @@

    }

    7.5 Untyped Value

    -

    OData 4.01 adds the built-in abstract types Edm.Untyped and Collection(Edm.Untyped)that services can use to advertise in metadata that there is a property of a particular name present, but there is no type to describe the structure of the property's values.

    +

    OData 4.01 adds the built-in abstract types Edm.Untyped and Collection(Edm.Untyped)that services can use to advertise in metadata that there is a property of a particular name present, but there is no type to describe the structure of the property’s values.

    The value of an Edm.Untyped property MAY be a primitive value, a structural value, or a collection. If a collection, it may contain any combination of primitive values, structural values, and collections.

    The value of a property of type Collection(Edm.Untyped)MUST be a collection, and it MAY contain any combination of primitive values, structural values, and collections.

    Untyped values are the only place where a collection can directly contain a collection, or a collection can contain a mix of primitive values, structural values, and collections.

    @@ -924,7 +926,7 @@

    8.5 Bin
  • modify the name of an existing category
  • assign an existing product with the id 42 to the category
  • assign an existing product 57 to the category and update its name
  • -
  • create a new product named "Wedges" and assign it to the category
  • +
  • create a new product named Wedges and assign it to the category
  • At the end of the request, the updated category contains exactly the three specified products.

    PATCH http://host/service/Categories(6) HTTP/1.1
    @@ -968,8 +970,13 @@ 

    8.6

    9 Stream Property

    An entity or complex type instance can have one or more stream properties.

    The actual stream data is not usually contained in the representation. Instead stream property data is generally read and edited via URLs.

    -

    Depending on the metadata level, the stream property MAY be annotated to provide the read link, edit link, media type, and ETag of the media stream through a set of media* control information.

    -

    If the actual stream data is included inline, the control information mediaContentType MUST be present to indicate how the included stream property value is represented. Stream property values of media type application/json or one of its subtypes, optionally with format parameters, are represented as native JSON. Values of top-level type text, for example text/plain, are represented as a string, with JSON string escaping rules applied. Included stream data of other media types is represented as a base64url-encoded string value, see RFC4648, section 5.

    +
      +
    • Stream properties requested with $select or included in the default selection are represented by media* control information.
    • +
    • Stream properties requested with $expand or implicitly expanded are represented as a property with its value.
    • +
    +

    See OData-Protocol for details on the system query options $select and $expand.

    +

    Depending on the metadata level, the stream property MAY be annotated to provide the read link, edit link, media type, and ETag of the media stream through their media* control information.

    +

    If the actual stream data is included inline, the control information mediaContentType MUST be present to indicate how the included stream property value is represented. Stream property values of media type application/json or one of its subtypes, optionally with format parameters, are represented as native JSON. Values of top-level type text with an explicit or default charset of utf-8 or us-ascii, for example text/plain, are represented as a string, with JSON string escaping rules applied. Included stream data of other media types is represented as a base64url-encoded string value, see RFC4648, section 5.

    If the included stream property has no value, the non-existing stream data is represented as null and the control information mediaContentType is not necessary.

    Example 24:

    @@ -1055,9 +1062,9 @@

    13 Collection of Entities

    A collection of entities is represented as a JSON object containing a name/value pair named value. It MAY contain context, type, count, nextLink, or deltaLink control information.

    If present, the context control information MUST be the first name/value pair in the response.

    -

    The count name/value pair represents the number of entities in the collection. If present and the streaming=true content-type parameter is set, it MUST come before the value name/value pair. If the response represents a partial result, the count name/value pair MUST appear in the first partial response, and it MAY appear in subsequent partial responses (in which case it may vary from response to response).

    +

    The count name/value pair represents the number of entities in the collection. If present and the streaming=true media type parameter is set, it MUST come before the value name/value pair. If the response represents a partial result, the count name/value pair MUST appear in the first partial response, and it MAY appear in subsequent partial responses (in which case it may vary from response to response).

    The value of the value name/value pair is a JSON array where each element is representation of an entity or a representation of an entity reference. An empty collection is represented as an empty JSON array.

    -

    Functions or actions that are bound to this collection of entities are advertised in the "wrapper object" in the same way as functions or actions are advertised in the object representing a single entity.

    +

    Functions or actions that are bound to this collection of entities are advertised in the “wrapper object” in the same way as functions or actions are advertised in the object representing a single entity.

    The nextLink control information MUST be included in a response that represents a partial result.

    Example 28:

    @@ -1096,7 +1103,7 @@

    1


    15 Delta Payload

    -

    The non-format specific aspects of the delta handling are described in the section "Requesting Changes" in OData-Protocol.

    +

    The non-format specific aspects of the delta handling are described in the section “Requesting Changes” in OData-Protocol.

    15.1 Delta Responses

    Responses from a delta request are returned as a JSON object.

    The JSON object for a delta response to a single entity is either an added, changed, or deleted entity.

    @@ -1108,11 +1115,11 @@

    15.

    Example 33: a 4.01 delta response with five changes, in order of occurrence

      -
    1. ContactName for customer 'BOTTM' was changed to "Susan Halvenstern"
    2. -
    3. Order 10643 was removed from customer 'ALFKI'
    4. -
    5. Order 10645 was added to customer 'BOTTM'
    6. +
    7. ContactName for customer BOTTM was changed to Susan Halvenstern
    8. +
    9. Order 10643 was removed from customer ALFKI
    10. +
    11. Order 10645 was added to customer BOTTM
    12. The shipping information for order 10643 was updated
    13. -
    14. Customer 'ANTON' was deleted
    15. +
    16. Customer ANTON was deleted
    {
       "@context": "http://host/service/$metadata#Customers/$delta",
    @@ -1159,7 +1166,7 @@ 

    entities.

    Added entities MUST include all available selected properties and MAY include additional, unselected properties. Collection-valued properties are treated as atomic values; any collection-valued properties returned from a delta request MUST contain all current values for that collection.

    Changed entities MUST include all available selected properties that have changed, and MAY include additional properties.

    -

    If a property of an entity is dependent upon the property of another entity within the expanded set of entities being tracked, then both the change to the dependent property as well as the change to the principle property or added/deleted link corresponding to the change to the dependent property are returned in the delta response.

    +

    If a property of an entity is dependent upon the property of another entity within the expanded set of entities being tracked, then both the change to the dependent property as well as the change to the principal property or added/deleted link corresponding to the change to the dependent property are returned in the delta response.

    Entities that are not part of the entity set specified by the context URL MUST include the context control information to specify the entity set of the entity, regardless of the specified metadata value.

    Entities include control information for selected navigation links based on metadata.

    OData 4.0 payloads MUST NOT include expanded navigation properties inline; all changes MUST be represented as a flat array of added, deleted, or changed entities, along with added or deleted links.

    @@ -1168,16 +1175,16 @@

    Example 34: 4.01 delta response customers with expanded orders represented inline as a delta

      -
    1. Customer 'BOTTM': +
    2. Customer BOTTM:
        -
      1. ContactName was changed to "Susan Halvenstern"
      2. +
      3. ContactName was changed to Susan Halvenstern
      4. Order 10645 was added
    3. -
    4. Customer 'ALFKI': +
    5. Customer ALFKI:
      1. Order 10643 was removed
    6. -
    7. Customer 'ANTON' was deleted
    8. +
    9. Customer ANTON was deleted
    {
       "@context": "http://host/service/$metadata#Customers/$delta",
    @@ -1233,15 +1240,15 @@ 

    15.3 D

    The representation of deleted-entity objects differs between OData 4.0 and OData 4.01.

    In OData 4.0 payloads the deleted-entity object MUST include the following properties, regardless of the specified metadata value:

      -
    • Control information context - The context URL fragment MUST be #{entity-set}/$deletedEntity, where {entity-set} is the entity set of the deleted entity
    • -
    • id - The id of the deleted entity (same as the id returned or computed when calling GET on resource), which may be absolute or relative
    • +
    • Control information context — The context URL fragment MUST be #{entity-set}/$deletedEntity, where {entity-set} is the entity set of the deleted entity
    • +
    • id — The id of the deleted entity (same as the id returned or computed when calling GET on resource), which may be absolute or relative

    In OData 4.0 payloads the deleted-entity object MAY include the following optional property, regardless of the specified metadata value, and MAY include annotations:

      -
    • reason - either deleted, if the entity was deleted (destroyed), or changed if the entity was removed from membership in the result (i.e., due to a data change).
    • +
    • reason — either deleted, if the entity was deleted (destroyed), or changed if the entity was removed from membership in the result (i.e., due to a data change).
    -

    Example 36: deleted entity in OData 4.0 response - note that id is a property, not control information

    +

    Example 36: deleted entity in OData 4.0 response — note that id is a property, not control information

    {
       "@context":"#Customers/$deletedEntity",
       "reason":"deleted",
    @@ -1251,7 +1258,7 @@ 

    15.3 D

    In OData 4.01 payloads the deleted-entity object MUST include the following properties, regardless of the specified metadata value:

    • Control information removed, whose value is an object that MAY contain a property named reason. If present, the value of reason MUST be either deleted if the entity was deleted (destroyed), or changed if the entity was removed from membership in the result either due to change in value such that the entity no longer matches the defining query or because the entity was removed from the collection. The object MAY include annotations, and clients SHOULD NOT error due to the presence of additional properties that MAY be defined by future versions of this specification. For ordered payloads, the control information removed MUST immediately follow the context control information, if present, otherwise it MUST be the first property in the deleted entity.

    • -
    • Control information id or all of the entity's key fields. The id control information MUST appear if any of the entity's key fields are omitted from the response or the entity-id is not identical to the canonical URL of the entity. For ordered payloads, the control information id, if present, MUST immediately follow the control information removed.

    • +
    • Control information id or all of the entity’s key fields. The id control information MUST appear if any of the entity’s key fields are omitted from the response or the entity-id is not identical to the canonical URL of the entity. For ordered payloads, the control information id, if present, MUST immediately follow the control information removed.

    For full metadata the context control information MUST be included. It also MUST be included if the entity set of the deleted entity cannot be determined from the surrounding context.

    The deleted-entity object MAY include additional properties of the entity, as well as annotations, and MAY include related entities, related deleted entities, or a delta or full representation of a related collection of entities, to represent related entities that have been modified or deleted.

    @@ -1279,9 +1286,9 @@

    Deleted links within a delta response are represented as deleted-link objects.

    @@ -1292,28 +1299,28 @@

    15.6 Update a Collection of Entities

    The body of a PATCH request to a URL identifying a collection of entities is a JSON object. It MUST contain the context control information with a string value of #$delta, and it MUST contain an array-valued property named value containing all added, changed, or deleted entities, as well as added or deleted links between entities.

    Example 39: 4.01 delta response customers with expanded orders represented inline as a delta

      -
    1. Add customer 'EASTC'
    2. -
    3. Change ContactName of customer 'AROUT'
    4. -
    5. Delete customer 'ANTON'
    6. -
    7. Change customer 'ALFKI': +
    8. Add customer EASTC
    9. +
    10. Change ContactName of customer AROUT
    11. +
    12. Delete customer ANTON
    13. +
    14. Change customer ALFKI:
      1. Create order 11011
      2. Add link to existing order 10692
      3. Change ShippedDate of related order 10835
      4. Delete link to order 10643
    15. -
    16. Add link between customer 'ANATR' and order 10643
    17. -
    18. Delete link between customer 'DUMON' and order 10311
    19. +
    20. Add link between customer ANATR and order 10643
    21. +
    22. Delete link between customer DUMON and order 10311
    {
       "@context": "#$delta",
    @@ -1507,7 +1514,7 @@ 

    19.1 Batc

    Note: the id name/value pair corresponds to the Content-ID header in the multipart batch format specified in OData-Protocol.

    The value of method is a string that MUST contain one of the literals delete, get, patch, post, or put. These literals are case-insensitive.

    The value of url is a string containing the individual request URL. The URL MAY be an absolute path (starting with a forward slash /) which is appended to scheme, host, and port of the batch request URL, or a relative path (not starting with a forward slash /).

    -

    If the first segment of a relative path starts with a $ character and is not identical to the name of a top-level system resource ($batch, $crossjoin, $all, $entity, $root, $id, $metadata, or other system resources defined according to the OData-Version of the protocol specified in the request), then this first segment is replaced with the URL of the entity created by or returned from a preceding request whose id value is identical to the value of the first segment with the leading $ character removed. The id of this request MUST be specified in the dependsOn name/value pair.

    +

    If the first segment of a relative path starts with a $ character and is not identical to the name of a top-level system resource ($batch, $crossjoin, $all, $entity, $root, $id, $metadata, or other system resources defined according to the OData-Version of the protocol specified in the request), then this first segment is replaced with the URL of the entity created by or returned from a preceding request whose id value is identical to the value of the first segment with the leading $ character removed. The id of this request MUST be specified in the dependsOn name/value pair.

    Otherwise, the relative path is resolved relative to the batch request URL (i.e. relative to the service root).

    The value of atomicityGroup is a string whose content MUST NOT be identical to any value of id within the batch request, and which MUST satisfy the rule request-id in OData-ABNF. All request objects with the same value for atomicityGroup MUST be adjacent in the requests array. These requests are processed as an atomic operation and MUST either all succeed, or all fail.

    Note: the atomicity group is a generalization of the change set in the multipart batch format specified in OData-Protocol.

    @@ -1578,7 +1585,7 @@

    19.1 Batc }

    19.2 Referencing New Entities

    -

    The entity returned by a preceding request can be referenced in the request URL of subsequent requests. If the Location header in the response contains a relative URL, clients MUST be able to resolve it relative to the request's URL even if that contains such a reference.

    +

    The entity returned by a preceding request can be referenced in the request URL of subsequent requests. If the Location header in the response contains a relative URL, clients MUST be able to resolve it relative to the request’s URL even if that contains such a reference.

    Example 49: a batch request that contains the following operations in the order listed:

    19.6 Asynchronous Batch Requests

    -

    A batch request that specifies the respond-async preference MAY be executed asynchronously. This means that the "outer" batch request is executed asynchronously; this preference does not automatically cascade down to the individual requests within the batch. After successful execution of the batch request the response to the batch request is returned in the body of a response to an interrogation request against the status monitor resource URL, see section "Asynchronous Requests" in OData-Protocol.

    +

    A batch request that specifies the respond-async preference MAY be executed asynchronously. This means that the “outer” batch request is executed asynchronously; this preference does not automatically cascade down to the individual requests within the batch. After successful execution of the batch request the response to the batch request is returned in the body of a response to an interrogation request against the status monitor resource URL, see section “Asynchronous Requests” in OData-Protocol.

    A service MAY return interim results to an asynchronously executing batch. It does this by responding with 200 OK to a GET request to the monitor resource and including a nextLink control information in the JSON batch response, thus signaling that the response is only a partial result. A subsequent GET request to the next link MAY result in a 202 Accepted response with a location header pointing to a new status monitor resource.

    Example 52: referencing the example 47 above again, assume that the request is sent with the respond-async preference. This results in a 202 response pointing to a status monitor resource:

    HTTP/1.1 202 Accepted
     Location: http://service-root/async-monitor-0
     Retry-After: ###
    -

    When interrogating the monitor URL only the first request in the batch has finished processing and all the remaining requests are still being processed. The service signals that asynchronous processing is "finished" and returns a partial result with the first response and a next link. The client did not explicitly accept application/http, so the response is "unwrapped" and only indicates with the AsyncResult header that it is a response to a status monitor resource:

    +

    When interrogating the monitor URL only the first request in the batch has finished processing and all the remaining requests are still being processed. The service signals that asynchronous processing is “finished” and returns a partial result with the first response and a next link. The client did not explicitly accept application/http, so the response is “unwrapped” and only indicates with the AsyncResult header that it is a response to a status monitor resource:

    HTTP/1.1 200 OK
     AsyncResult: 200
     OData-Version: 4.01
    @@ -1777,7 +1784,7 @@ 

    20 Instance Annotations

    Annotations are an extensibility mechanism that allows services and clients to include information other than the raw data in the request or response.

    -

    Annotations are name/value pairs that have an at (@) and a dot (.) as part of the name. The part after the "at" sign (@) is the annotation identifier. It consists of the namespace or alias of the schema that defines the term, followed by a dot (.), followed by the name of the term, optionally followed by a hash (#) and a qualifier. The namespace or alias MUST be defined in the metadata document, see OData-CSDLJSON or OData-CSDLXML

    +

    Annotations are name/value pairs that have an at (@) and a dot (.) as part of the name. The part after the “at” sign (@) is the annotation identifier. It consists of the namespace or alias of the schema that defines the term, followed by a dot (.), followed by the name of the term, optionally followed by a hash (#) and a qualifier. The namespace or alias MUST be defined in the metadata document, see OData-CSDLJSON or OData-CSDLXML

    The annotation identifier odata is reserved for future extensions of the protocol and format. Instance annotations MUST have a namespace or alias that is different from odata.

    Annotations can be applied to any name/value pair in a JSON payload that represents a value of any type from the entity data model. Clients should never error due to an unexpected annotation in a JSON payload.

    Annotations are always expressed as name/value pairs. For entity data model constructs represented as JSON objects the annotation name/value pairs are placed within the object; for constructs represented as JSON arrays or primitives they are placed next to the annotated model construct. When annotating a payload that represents a single primitive or collection value, the annotations for the value appear next to the value property and are not prefixed with a property name.

    @@ -1799,15 +1806,15 @@

    20.1 Annotate a JSON Object

    When annotating a name/value pair for which the value is represented as a JSON object, each annotation is placed within the object and represented as a single name/value pair.

    -

    The name always starts with the "at" sign (@), followed by the annotation identifier.

    +

    The name always starts with the “at” sign (@), followed by the annotation identifier.

    The value MUST be an appropriate value for the annotation.

    20.2 Annotate a JSON Array or Primitive

    When annotating a name/value pair for which the value is represented as a JSON array or primitive value, each annotation that applies to this name/value pair MUST be represented as a single name/value pair and placed immediately prior to the annotated name/value pair, with the exception of the nextLink or collectionAnnotations control information, which can appear immediately before or after the annotated collection.

    -

    The name is the same as the name of the property or name/value pair being annotated, followed by the "at" sign (@), followed by the annotation identifier.

    +

    The name is the same as the name of the property or name/value pair being annotated, followed by the “at” sign (@), followed by the annotation identifier.

    The value MUST be an appropriate value for the annotation.

    20.3 Annotate a Primitive Value within a JSON Array

    Individual primitive elements within a JSON array can be annotated by applying the collectionAnnotations control information to the array containing the primitive member.

    -

    The control information must come with other annotations or control information immediately before or after the collection valued property. The name of the property representing the control information is the same as the name of the collection-valued property, followed by the "at" sign (@), followed by the collectionAnnotations identifier.

    +

    The control information must come with other annotations or control information immediately before or after the collection valued property. The name of the property representing the control information is the same as the name of the collection-valued property, followed by the “at” sign (@), followed by the collectionAnnotations identifier.


    21 Error Handling

    OData requests may return a well formed error response, an in-stream error, or error information within a success payload.

    @@ -1965,49 +1972,47 @@

    [OData-ABNF]

    ABNF components: OData ABNF Construction Rules Version 4.02 and OData ABNF Test Cases.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-CSDL]

    OData Common Schema Definition Language (CSDL) JSON Representation Version 4.02.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    OData Common Schema Definition Language (CSDL) XML Representation Version 4.02.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-Protocol]

    OData Version 4.02. Part 1: Protocol.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-URL]

    OData Version 4.02. Part 2: URL Conventions.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-VocCap]

    OData Vocabularies Version 4.0: Capabilities Vocabulary.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-VocCore]

    OData Vocabularies Version 4.0: Core Vocabulary.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [RFC2119]
    -

    Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997
    -https://www.rfc-editor.org/info/rfc2119.

    +

    Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels”, BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997. https://www.rfc-editor.org/info/rfc2119.

    [RFC3986]
    -

    Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", IETF RFC3986, January 2005 https://tools.ietf.org/html/rfc3986.

    +

    Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax”, STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005. https://www.rfc-editor.org/info/rfc3986.

    [RFC3987]
    -

    Duerst, M. and, M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC 3987, January 2005 https://tools.ietf.org/html/rfc3987.

    +

    Duerst, M. and M. Suignard, “Internationalized Resource Identifiers (IRIs)”, RFC 3987, DOI 10.17487/RFC3987, January 2005. https://www.rfc-editor.org/info/rfc3987.

    [RFC4648]
    -

    Josefsson, S,, "The Base16, Base32, and Base64 Data Encodings", RFC 4648, October 2006 https://tools.ietf.org/html/rfc4648.

    +

    Josefsson, S., “The Base16, Base32, and Base64 Data Encodings”, RFC 4648, DOI 10.17487/RFC4648, October 2006. https://www.rfc-editor.org/info/rfc4648.

    [RFC5646]
    -

    Phillips, A., Ed., and M. Davis, Ed., "Tags for Identifying Languages", BCP 47, RFC 5646, September 2009 http://tools.ietf.org/html/rfc5646.

    +

    Phillips, A., Ed., and M. Davis, Ed., “Tags for Identifying Languages”, BCP 47, RFC 5646, DOI 10.17487/RFC5646, September 2009. https://www.rfc-editor.org/info/rfc5646.

    [RFC7493]
    -

    Bray, T., Ed., "The I-JSON Message Format", RFC7493, March 2015 https://tools.ietf.org/html/rfc7493.

    +

    Bray, T., Ed., “The I-JSON Message Format”, RFC 7493, DOI 10.17487/RFC7493, March 2015. https://www.rfc-editor.org/info/rfc7493.

    [RFC7946]
    -

    Howard Butler, Martin Daly, Alan Doyle, Sean Gillies, Stefan Hagen and Tim Schaub, "The GeoJSON Format", RFC 7946, August 2016. http://tools.ietf.org/html/rfc7946.

    +

    Butler, H., Daly, M., Doyle, A., Gillies, S., Hagen, S., and T. Schaub, “The GeoJSON Format”, RFC 7946, DOI 10.17487/RFC7946, August 2016. https://www.rfc-editor.org/info/rfc7946.

    [RFC8174]
    -

    Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017
    -https://www.rfc-editor.org/info/rfc8174.

    +

    Leiba, B., “Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words”, BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017. https://www.rfc-editor.org/info/rfc8174.

    [RFC8259]
    -

    Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", RFC 8259, December 2017 http://tools.ietf.org/html/rfc8259.

    +

    Bray, T., Ed., “The JavaScript Object Notation (JSON) Data Interchange Format”, STD 90, RFC 8259, DOI 10.17487/RFC8259, December 2017. https://www.rfc-editor.org/info/rfc8259.

    A.2 Informative References

    [ECMAScript]

    ECMAScript 2023 Language Specification, 14th Edition, June 2023. Standard ECMA-262. https://www.ecma-international.org/publications-and-standards/standards/ecma-262/.

    [GeoJSON-2008]
    -

    Butler, H., Daly, M., Doyle, A., Gillies, S., Schaub, T., and C. Schmidt, "The GeoJSON Format Specification", June 2008 http://geojson.org/geojson-spec.html.

    +

    Butler, H., Daly, M., Doyle, A., Gillies, S., Schaub, T., and C. Schmidt, “The GeoJSON Format Specification”, June 2008 http://geojson.org/geojson-spec.html.


    Appendix B. Safety, Security and Privacy Considerations

    This specification raises no security issues.

    @@ -2110,14 +2115,14 @@

    Appendix E. Notice

    Copyright © OASIS Open 2023. All Rights Reserved.

    -

    All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The full Policy may be found at the OASIS website.

    +

    All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the “OASIS IPR Policy”). The full Policy may be found at the OASIS website.

    This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published, and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this section are included on all such copies and derivative works. However, this document itself may not be modified in any way, including by removing the copyright notice or references to OASIS, except as needed for the purpose of developing any document or deliverable produced by an OASIS Technical Committee (in which case the rules applicable to copyrights, as set forth in the OASIS IPR Policy, must be followed) or as required to translate it into languages other than English.

    The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.

    -

    This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

    +

    This document and the information contained herein is provided on an “AS IS” basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

    As stated in the OASIS IPR Policy, the following three paragraphs in brackets apply to OASIS Standards Final Deliverable documents (Committee Specification, Candidate OASIS Standard, OASIS Standard, or Approved Errata).

    [OASIS requests that any OASIS Party or any other party that believes it has patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable, to notify OASIS TC Administrator and provide an indication of its willingness to grant patent licenses to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this deliverable.]

    [OASIS invites any party to contact the OASIS TC Administrator if it is aware of a claim of ownership of any patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable by a patent holder that is not willing to provide a license to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this OASIS Standards Final Deliverable. OASIS may include such claims on its website, but disclaims any obligation to do so.]

    -

    [OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS' procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

    -

    The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark/ for above guidance.

    +

    [OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS’ procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

    +

    The name “OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark/ for above guidance.

    diff --git a/docs/odata-json-format/odata-json-format.md b/docs/odata-json-format/odata-json-format.md index 6d014668d..17d894b33 100644 --- a/docs/odata-json-format/odata-json-format.md +++ b/docs/odata-json-format/odata-json-format.md @@ -58,7 +58,7 @@ The Open Data Protocol (OData) for representing and interacting with structured #### Status: This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical. -TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "[Send A Comment](https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=odata)" button on the TC's web page at https://www.oasis-open.org/committees/odata/. +TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/. This specification is provided under the [RF on RAND Terms Mode](https://www.oasis-open.org/policies-guidelines/ipr/#RF-on-RAND-Mode) of the [OASIS IPR Policy](https://www.oasis-open.org/policies-guidelines/ipr/), the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php). @@ -239,7 +239,7 @@ All other text is normative unless otherwise labeled. Here is a customized command line which will generate HTML from this markdown file (named `odata-json-format-v4.02-csd01.md`). Line breaks are added for readability only: ``` -pandoc -f gfm+tex_math_dollars+fenced_divs +pandoc -f gfm+tex_math_dollars+fenced_divs+smart -t html -o odata-json-format-v4.02-csd01.html -c styles/markdown-styles-v1.7.3b.css @@ -551,7 +551,7 @@ Requests and responses with a JSON message body MUST have a `Content-Type` header value of `application/json`. Requests MAY add the `charset` parameter to the content type. -Allowed values are `UTF-8`,` UTF-16`, and +Allowed values are `UTF-8`, `UTF-16`, and `UTF-32`. If no `charset` parameter is present, `UTF-8` MUST be assumed. @@ -688,7 +688,7 @@ cannot be assumed to support streaming. JSON producers are encouraged to follow the payload ordering constraints whenever possible (and include the `streaming=true` -content-type parameter) to support the maximum set of client scenarios. +media type parameter) to support the maximum set of client scenarios. To support streaming scenarios the following payload ordering constraints have to be met: @@ -842,7 +842,7 @@ information: [`type`](#ControlInformationtypeodatatype) control information unless their type is `Double`. - The special floating-point values `-INF`, `INF`, and - `NaN `are serialized as strings and MUST have a + `NaN` are serialized as strings and MUST have a [`type`](#ControlInformationtypeodatatype) control information to specify the numeric type of the property. - String values do have a first class representation in JSON, but there is an @@ -854,6 +854,9 @@ information: should be treated as a string value unless the property is known (from the metadata document) to have a different type. +The `type` control information can be absent in properties nested in an instance of type `Edm.Untyped`. +In particular, individual primitive values within a collection cannot have `type` control information. + For more information on namespace- and alias-qualified names, see [OData-CSDLJSON](#ODataCSDL) or [OData-CSDLXML](#ODataCSDL). @@ -876,10 +879,8 @@ metadata document of the same service with a dynamic property of type ::: ::: example -Example 6: entity of type -`Model.VipCustomer` defined in the -metadata` `document of a different -service +Example 6: entity of type `Model.VipCustomer` defined in the +metadata document of a different service ```json { "@context": "http://host/service/$metadata#Customers/$entity", @@ -932,11 +933,11 @@ The `id` control information contains the entity-id, see identical to the canonical URL of the entity, as defined in [OData-URL](#ODataURL). -The `id `control information MUST appear in responses if +The `id` control information MUST appear in responses if [`metadata=full`](#metadatafullodatametadatafull) is requested, or if [`metadata=minimal`](#metadataminimalodatametadataminimal) -is requested and any of a non-transient entity\'s key fields are omitted +is requested and any of a non-transient entity's key fields are omitted from the response _or_ the entity-id is not identical to the canonical URL of the entity after @@ -1068,7 +1069,7 @@ For [media entities](#MediaEntity) and [stream properties](#StreamProperty) at least one of the control information `mediaEditLink` and `mediaReadLink` MUST be included in responses if they don\'t follow standard URL conventions as defined -in [OData-URL](#ODataURL) or if +in [OData-URL](#ODataURL), sections 4.6 Addressing a property and 4.14 Addressing the Media Stream of a Media Entity, or if [`metadata=full`](#metadatafullodatametadatafull) is requested. @@ -1086,7 +1087,7 @@ doesn't follow standard URL conventions relative to the read link of the entity and the associated `mediaEditLink` is not present. -The `mediaContentType `control information MAY be included; +The `mediaContentType` control information MAY be included; its value SHOULD match the media type of the binary stream represented by the `mediaReadLink` URL. This is only a hint; the actual media type will be included in the `Content-Type` header when @@ -1277,7 +1278,7 @@ represented as a name/value pair within the object. The order properties appear within the object is considered insignificant. An entity in a payload may be a complete entity, a projected entity (see -_System Query Option_ `$select` +_System Query Option_ `$select` in [OData-Protocol](#ODataProtocol)), or a partial entity update (see _Update an Entity_ in [OData-Protocol](#ODataProtocol)). @@ -1339,18 +1340,18 @@ Example 11: entity with `metadata=full` # 7 Structural Property A property within an entity or complex type instance is represented as a -name/value pair. The name MUST be the name of the property; the value is +name/value pair. The name MUST be the name of the property; a non-null value is represented depending on its type as a [primitive value](#PrimitiveValue), a [complex value](#ComplexValue), a [collection of primitive values](#CollectionofPrimitiveValues), or a [collection of complex values](#CollectionofComplexValues). +Null values are represented as the JSON literal `null`. + ## 7.1 Primitive Value Primitive values are represented following the rules of [RFC8259](#rfc8259). -Null values are represented as the JSON literal `null`. - Values of type `Edm.Boolean` are represented as the JSON literals `true` and `false` @@ -1479,6 +1480,10 @@ Example 14: partial collection of strings with next link ``` ::: +A collection of primitive values that occurs in a property of type `Edm.Untyped` +is interpreted as a collection of `Edm.Boolean`, `Edm.String`, and `Edm.Decimal` values, +depending on the JavaScript type. + ## 7.4 Collection of Complex Values A collection of complex values is represented as a JSON array; each @@ -1716,7 +1721,7 @@ Example 22: submit a partial update request to: - modify the name of an existing category - assign an existing product with the id 42 to the category - assign an existing product 57 to the category and update its name -- create a new product named "Wedges" and assign it to the category +- create a new product named `Wedges` and assign it to the category At the end of the request, the updated category contains exactly the three specified products. @@ -1793,18 +1798,23 @@ An entity or complex type instance can have one or more stream properties. The actual stream data is not usually contained in the representation. Instead stream property data is generally read and edited via URLs. +- Stream properties requested with `$select` or included in the default selection are represented by +[`media*`](#ControlInformationmediaodatamedia) control information. +- Stream properties requested with `$expand` or implicitly expanded are represented as a property with its value. + +See [OData-Protocol](#ODataProtocol) for details on the system query options `$select` and `$expand`. Depending on the [metadata level](#ControllingtheAmountofControlInformationinResponses), the stream property MAY be annotated to provide the read link, edit -link, media type, and ETag of the media stream through a set of -[`media*`](#ControlInformationmediaodatamedia) control information. +link, media type, and ETag of the media stream through their `media*` control information. If the actual stream data is included inline, the control information [`mediaContentType`](#ControlInformationmediaodatamedia) MUST be present to indicate how the included stream property value is represented. Stream property values of media type `application/json` or one of its subtypes, optionally with format parameters, are represented -as native JSON. Values of top-level type `text`, for example +as native JSON. Values of top-level type `text` with an explicit or +default `charset` of `utf-8` or `us-ascii`, for example `text/plain`, are represented as a string, with JSON string escaping rules applied. Included stream data of other media types is represented as a base64url-encoded string value, see @@ -1985,7 +1995,7 @@ first name/value pair in the response. The `count` name/value pair represents the number of entities in the collection. If present and the [`streaming=true`](#PayloadOrderingConstraints) -content-type parameter is set, it MUST come before the +media type parameter is set, it MUST come before the `value` name/value pair. If the response represents a partial result, the `count` name/value pair MUST appear in the first partial response, and it MAY appear in subsequent partial responses (in @@ -2117,11 +2127,11 @@ or deleted links. Example 33: a 4.01 delta response with five changes, in order of occurrence - 1. `ContactName` for customer 'BOTTM' was changed to "Susan Halvenstern" - 2. Order 10643 was removed from customer 'ALFKI' - 3. Order 10645 was added to customer 'BOTTM' + 1. `ContactName` for customer `BOTTM` was changed to `Susan Halvenstern` + 2. Order 10643 was removed from customer `ALFKI` + 3. Order 10645 was added to customer `BOTTM` 4. The shipping information for order 10643 was updated - 5. Customer 'ANTON' was deleted + 5. Customer `ANTON` was deleted ```json { @@ -2183,7 +2193,7 @@ have changed, and MAY include additional properties. If a property of an entity is dependent upon the property of another entity within the expanded set of entities being tracked, then both the -change to the dependent property as well as the change to the principle +change to the dependent property as well as the change to the principal property or [added](#AddedLink)/[deleted link](#DeletedLink) corresponding to the change to the dependent property are returned in the delta response. @@ -2229,12 +2239,12 @@ links](#DeletedLink). Example 34: 4.01 delta response customers with expanded orders represented inline as a delta - 1. Customer 'BOTTM': - 1. `ContactName` was changed to "Susan Halvenstern" + 1. Customer `BOTTM`: + 1. `ContactName` was changed to `Susan Halvenstern` 2. Order 10645 was added - 2. Customer 'ALFKI': + 2. Customer `ALFKI`: 1. Order 10643 was removed - 3. Customer 'ANTON' was deleted + 3. Customer `ANTON` was deleted ```json { @@ -2322,10 +2332,10 @@ In OData 4.0 payloads the deleted-entity object MUST include the following properties, regardless of the specified [`metadata`](#ControllingtheAmountofControlInformationinResponses) value: -- Control information [`context`](#ControlInformationcontextodatacontext) - The context URL fragment MUST be +- Control information [`context`](#ControlInformationcontextodatacontext) --- The context URL fragment MUST be `#{entity-set}/$deletedEntity`, where `{entity-set}` is the entity set of the deleted entity -- `id` - The [id](#ControlInformationidodataid) of the deleted entity +- `id` --- The [id](#ControlInformationidodataid) of the deleted entity (same as the [id](#ControlInformationidodataid) returned or computed when calling GET on resource), which may be absolute or [relative](#RelativeURLs) @@ -2335,12 +2345,12 @@ following optional property, regardless of the specified [`metadata`](#ControllingtheAmountofControlInformationinResponses) value, and MAY include [annotations](#InstanceAnnotations): -- `reason` - either `deleted`, if the entity was deleted (destroyed), +- `reason` --- either `deleted`, if the entity was deleted (destroyed), or `changed` if the entity was removed from membership in the result (i.e., due to a data change). ::: example -Example 36: deleted entity in OData 4.0 response - note that `id` is +Example 36: deleted entity in OData 4.0 response --- note that `id` is a property, not control information ```json { @@ -2380,7 +2390,7 @@ following properties, regardless of the specified from the response _or_ the entity-id is not identical to the canonical URL of the entity. For [ordered payloads](#PayloadOrderingConstraints), the control information - `id,` if present, MUST immediately follow the control + `id`, if present, MUST immediately follow the control information [`removed`](#ControlInformationremovedodataremoved). @@ -2435,13 +2445,13 @@ The link object MUST include the following properties, regardless of the specifi the context URL fragment MUST be `#{entity-set}/$link`, where `{entity-set}` is the entity set containing the source entity -- `source` - The [id](#ControlInformationidodataid) of the entity from which +- `source` --- The [id](#ControlInformationidodataid) of the entity from which the relationship is defined, which may be absolute or [relative](#RelativeURLs) -- `relationship` - The path from the source object to the navigation property which MAY +- `relationship` --- The path from the source object to the navigation property which MAY traverse one or more complex properties, type cast segments, or members of ordered collections -- `target` - The [id](#ControlInformationidodataid) of the related entity, +- `target` --- The [id](#ControlInformationidodataid) of the related entity, which may be absolute or [relative](#RelativeURLs) ## 15.5 Deleted Link @@ -2459,16 +2469,16 @@ path in the initial request, unless either of the following is true: `source` and `relationship`. The deleted-link object MUST include the following properties, regardless of the specified [`metadata`](#ControllingtheAmountofControlInformationinResponses) value, and MAY include [annotations](#InstanceAnnotations): -- [`context`](#ControlInformationcontextodatacontext) - the context URL fragment MUST be +- [`context`](#ControlInformationcontextodatacontext) --- the context URL fragment MUST be `#{entity-set}/$deletedLink`, where `{entity-set}` is the entity set containing the source entity -- `source` - The [id](#ControlInformationidodataid) of the entity from which +- `source` --- The [id](#ControlInformationidodataid) of the entity from which the relationship is defined, which may be absolute or [relative](#RelativeURLs) -- `relationship` - The path from the source object to the navigation property which MAY +- `relationship` --- The path from the source object to the navigation property which MAY traverse one or more complex properties, type cast segments, or members of ordered collections -- `target` - The [id](#ControlInformationidodataid) of the related entity for +- `target` --- The [id](#ControlInformationidodataid) of the related entity for multi-valued navigation properties, which may be absolute or [relative](#RelativeURLs). For delta payloads that do not specify an `OData-Version` header value of `4.0`, @@ -2489,16 +2499,16 @@ entities, as well as [added](#AddedLink) or ::: example Example 39: 4.01 delta response customers with expanded orders represented inline as a delta - 1. Add customer 'EASTC' - 2. Change `ContactName` of customer 'AROUT' - 3. Delete customer 'ANTON' - 4. Change customer 'ALFKI': + 1. Add customer `EASTC` + 2. Change `ContactName` of customer `AROUT` + 3. Delete customer `ANTON` + 4. Change customer `ALFKI`: 1. Create order 11011 2. Add link to existing order 10692 3. Change `ShippedDate` of related order 10835 4. Delete link to order 10643 - 5. Add link between customer 'ANATR' and order 10643 - 6. Delete link between customer 'DUMON' and order 10311 + 5. Add link between customer `ANATR` and order 10643 + 6. Delete link between customer `DUMON` and order 10311 ```json { "@context": "#$delta", @@ -2868,7 +2878,7 @@ batch request URL, or a relative path (not starting with a forward slash `/`). If the first segment of a relative path starts with a `$` character and is not identical to the name of a top-level system -resource (`$batch`, `$crossjoin,` `$all,` `$entity`, `$root,` +resource (`$batch`, `$crossjoin`, `$all`, `$entity`, `$root`, `$id`, `$metadata`, or other system resources defined according to the `OData-Version` of the protocol specified in the request), then this first segment is replaced with the @@ -3731,40 +3741,40 @@ _OData Vocabularies Version 4.0: Core Vocabulary._ See link in "[Related work](#RelatedWork)" section on cover page. ###### [RFC2119] -_Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997_ +_Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997_. https://www.rfc-editor.org/info/rfc2119. ###### [RFC3986] -_Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", IETF RFC3986, January 2005_ -https://tools.ietf.org/html/rfc3986. +_Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005_. +https://www.rfc-editor.org/info/rfc3986. ###### [RFC3987] -_Duerst, M. and, M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC 3987, January 2005_ -https://tools.ietf.org/html/rfc3987. +_Duerst, M. and M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC 3987, DOI 10.17487/RFC3987, January 2005_. +https://www.rfc-editor.org/info/rfc3987. ###### [RFC4648] -_Josefsson, S,, "The Base16, Base32, and Base64 Data Encodings", RFC 4648, October 2006_ -https://tools.ietf.org/html/rfc4648. +_Josefsson, S., "The Base16, Base32, and Base64 Data Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006_. +https://www.rfc-editor.org/info/rfc4648. ###### [RFC5646] -_Phillips, A., Ed., and M. Davis, Ed., "Tags for Identifying Languages", BCP 47, RFC 5646, September 2009_ -http://tools.ietf.org/html/rfc5646. +_Phillips, A., Ed., and M. Davis, Ed., "Tags for Identifying Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646, September 2009_. +https://www.rfc-editor.org/info/rfc5646. ###### [RFC7493] -_Bray, T., Ed., "The I-JSON Message Format", RFC7493, March 2015_ -https://tools.ietf.org/html/rfc7493. +_Bray, T., Ed., "The I-JSON Message Format", RFC 7493, DOI 10.17487/RFC7493, March 2015_. +https://www.rfc-editor.org/info/rfc7493. ###### [RFC7946] -_Howard Butler, Martin Daly, Alan Doyle, Sean Gillies, Stefan Hagen and Tim Schaub, "The GeoJSON Format", RFC 7946, August 2016._ -http://tools.ietf.org/html/rfc7946. +_Butler, H., Daly, M., Doyle, A., Gillies, S., Hagen, S., and T. Schaub, "The GeoJSON Format", RFC 7946, DOI 10.17487/RFC7946, August 2016_. +https://www.rfc-editor.org/info/rfc7946. ###### [RFC8174] -_Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_ +_Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_. https://www.rfc-editor.org/info/rfc8174. ###### [RFC8259] -_Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", RFC 8259, December 2017_ -http://tools.ietf.org/html/rfc8259. +_Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, DOI 10.17487/RFC8259, December 2017_. +https://www.rfc-editor.org/info/rfc8259. ## A.2 Informative References ###### [ECMAScript] diff --git a/docs/odata-protocol/odata-protocol.html b/docs/odata-protocol/odata-protocol.html index d90b3eb6a..ea72fa8df 100644 --- a/docs/odata-protocol/odata-protocol.html +++ b/docs/odata-protocol/odata-protocol.html @@ -141,12 +141,12 @@

    Abstract:

    The Open Data Protocol (OData) enables the creation of REST-based data services, which allow resources, identified using Uniform Resource Locators (URLs) and defined in an Entity Data Model (EDM), to be published and edited by Web clients using simple HTTP messages. This document defines the core semantics and facilities of the protocol.

    Status:

    -

    This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical.

    -

    TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/.

    -

    This specification is provided under the RF on RAND Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php).

    -

    Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product's prose narrative document(s), the content in the separate plain text file prevails.

    +

    This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the “Latest stage” location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical.

    +

    TC members should send comments on this specification to the TC’s email list. Others should send comments to the TC’s public comment list, after subscribing to it by following the instructions at the “Send A Comment” button on the TC’s web page at https://www.oasis-open.org/committees/odata/.

    +

    This specification is provided under the RF on RAND Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC’s web page (https://www.oasis-open.org/committees/odata/ipr.php).

    +

    Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product’s prose narrative document(s), the content in the separate plain text file prevails.

    Key words:

    -

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

    +

    The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

    Citation format:

    When referencing this specification the following citation format should be used:

    [OData-v4.02-Part1]

    @@ -154,7 +154,7 @@

    Citation format:

    Notices

    Copyright © OASIS Open 2023. All Rights Reserved.

    Distributed under the terms of the OASIS IPR Policy.

    -

    The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs.

    +

    The name “OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs.

    For complete copyright information please see the full Notices section in an Appendix below.


    Table of Contents

    @@ -306,7 +306,8 @@

    Table of Contents

  • 11.2.3 Requesting the Media Stream of a Media Entity using $value
  • 11.2.4 Requesting Individual Properties
  • 11.2.5 Specifying Properties to Return

    3 Data Model

    -

    This section provides a high-level description of the Entity Data Model (EDM): the abstract data model that is used to describe the data exposed by an OData service. An OData Metadata Document is a representation of a service's data model exposed for client consumption.

    +

    This section provides a high-level description of the Entity Data Model (EDM): the abstract data model that is used to describe the data exposed by an OData service. An OData Metadata Document is a representation of a service’s data model exposed for client consumption.

    The central concepts in the EDM are entities, relationships, entity sets, actions, and functions.

    Entities are instances of entity types (e.g. Customer, Employee, etc.).

    Entity types are named structured types with a key. They define the named properties and relationships of an entity. Entity types may derive by single inheritance from other entity types.

    The key of an entity type is formed from a subset of the primitive properties (e.g. CustomerId, OrderId, LineId, etc.) of the entity type.

    Complex types are keyless named structured types consisting of a set of properties. These are value types whose instances cannot be referenced outside of their containing entity. Complex types are commonly used as property values in an entity or as parameters to operations.

    -

    Properties declared as part of a structured type's definition are called declared properties. Instances of structured types may contain additional undeclared dynamic properties. A dynamic property cannot have the same name as a declared property. Entity or complex types which allow clients to persist additional undeclared properties are called open types.

    +

    Properties declared as part of a structured type’s definition are called declared properties. Instances of structured types may contain additional undeclared dynamic properties. A dynamic property cannot have the same name as a declared property. Entity or complex types which allow clients to persist additional undeclared properties are called open types.

    Relationships from one entity to another are represented as navigation properties. Navigation properties are generally defined as part of an entity type, but can also appear on entity instances as undeclared dynamic navigation properties. Each relationship has a cardinality.

    Enumeration types are named primitive types whose values are named constants with underlying integer values.

    Type definitions are named primitive types with fixed facet values such as maximum length or precision. Type definitions can be used in place of primitive typed properties, for example, within property definitions.

    -

    Entity sets are named collections of entities (e.g. Customers is an entity set containing Customer entities). An entity's key uniquely identifies the entity within an entity set. If multiple entity sets use the same entity type, the same combination of key values can appear in more than one entity set and identifies different entities, one per entity set where this key combination appears. Each of these entities has a different entity-id. Entity sets provide entry points into the data model.

    +

    Entity sets are named collections of entities (e.g. Customers is an entity set containing Customer entities). An entity’s key uniquely identifies the entity within an entity set. If multiple entity sets use the same entity type, the same combination of key values can appear in more than one entity set and identifies different entities, one per entity set where this key combination appears. Each of these entities has a different entity-id. Entity sets provide entry points into the data model.

    Operations allow the execution of custom logic on parts of a data model. Functions are operations that do not have side effects and may support further composition, for example, with additional filter operations, functions or an action. Actions are operations that allow side effects, such as data modification, and cannot be further composed in order to avoid non-deterministic behavior. Actions and functions are either bound to a type, enabling them to be called as members of an instance of that type, or unbound, in which case they are called as static operations. Action imports and function imports enable unbound actions and functions to be called from the service root.

    Singletons are named entities which can be accessed as direct children of the entity container. A singleton may also be a member of an entity set.

    An OData resource is anything in the model that can be addressed (an entity set, entity, property, or operation).

    @@ -564,20 +565,20 @@

    4 Service M

    An OData service exposes two well-defined resources that describe its data model; a service document and a metadata document.

    The service document lists entity sets, functions, and singletons that can be retrieved. Clients can use the service document to navigate the model in a hypermedia-driven fashion.

    The metadata document describes the types, sets, functions and actions understood by the OData service. Clients can use the metadata document to understand how to query and interact with entities in the service.

    -

    In addition to these two "fixed" resources, an OData service consists of dynamic resources. The URLs for many of these resources can be computed from the information in the metadata document.

    +

    In addition to these two “fixed” resources, an OData service consists of dynamic resources. The URLs for many of these resources can be computed from the information in the metadata document.

    See Requesting Data and Data Modification for details.

    4.1 Entity-Ids and Entity References

    Whereas entities within an entity set are uniquely identified by their key values, entities are also uniquely identified by a durable, opaque, globally unique entity-id. The entity-id MUST be an IRI as defined in RFC3987 and MAY be expressed in payloads, headers, and URLs as a relative reference as appropriate. While the client MUST be prepared to accept any IRI, services MUST use valid URIs in this version of the specification since there is currently no lossless representation of an IRI in the EntityId header.

    Services are strongly encouraged to use the canonical URL for an entity as defined in OData-URL as its entity-id, but clients cannot assume the entity-id can be used to locate the entity unless the Core.DereferenceableIDs term is applied to the entity container, nor can the client assume any semantics from the structure of the entity-id. The canonical resource $entity provides a general mechanism for resolving an entity-id into an entity representation.

    Services that use the standard URL conventions for entity-ids annotate their entity container with the term Core.ConventionalIDs, see OData-VocCore.

    -

    Entity references refer to an entity using the entity's entity-id.

    +

    Entity references refer to an entity using the entity’s entity-id.

    4.2 Read URLs and Edit URLs

    The read URL of an entity is the URL that can be used to read the entity.

    The edit URL of an entity is the URL that can be used to update or delete the entity.

    The edit URL of a property is the edit URL of the entity with appended segment(s) containing the path to the property.

    Services are strongly encouraged to use the canonical URL for an entity as defined in OData-URL for both the read URL and the edit URL of an entity, with a cast segment to the type of the entity appended to the canonical URL if the type of the entity is derived from the declared type of the entity set. However, clients cannot assume this convention and must use the links specified in the payload according to the appropriate format as the two URLs may be different from one another, or one or both of them may differ from convention.

    4.3 Transient Entities

    -

    Transient entities are instances of an entity type that are "calculated on the fly" and only exist within a single payload. They cannot be reread or updated and consequently possess neither a stable entity-id nor a read URL or an update URL.

    +

    Transient entities are instances of an entity type that are “calculated on the fly” and only exist within a single payload. They cannot be reread or updated and consequently possess neither a stable entity-id nor a read URL or an update URL.

    4.4 Default Namespaces

    References to actions, functions, and types within a URL typically requires prefixing the name of the action, function, or type with the namespace or alias in which it is defined. This namespace qualification enables differentiating between similarly named elements across schema, or between properties and bound functions, actions, or types with the same name.

    Services MAY define one or more default namespaces through the Core.DefaultNamespace term defined in OData-VocCore. Functions, actions and types in a default namespace can be referenced in URLs with or without namespace or alias qualification.

    @@ -617,7 +618,7 @@

    6 Extensi

    The OData protocol supports both user- and version-driven extensibility through a combination of versioning, convention, and explicit extension points.

    6.1 Query Option Extensibility

    Query options within the request URL can control how a particular request is processed by the service.

    -

    OData-defined system query options are optionally prefixed with "$". Services may support additional custom query options not defined in the OData specification, but they MUST NOT begin with the "$" or "@" character and MUST NOT conflict with any OData-defined system query options defined in the OData version supported by the service.

    +

    OData-defined system query options are optionally prefixed with “$”. Services may support additional custom query options not defined in the OData specification, but they MUST NOT begin with the “$” or “@” character and MUST NOT conflict with any OData-defined system query options defined in the OData version supported by the service.

    OData services SHOULD NOT require any query options to be specified in a request. Services SHOULD fail any request that contains query options that they do not understand and MUST fail any request that contains unsupported OData query options defined in the version of this specification supported by the service.

    In many cases OData services return URLs to identify resources that are later requested by clients. Where possible, interoperability is enhanced by providing all identifying information in the path portion of the URL. However, clients should be prepared for such URLs to include custom query options and propagate any such custom query options in future requests to the identified resource.

    6.2 Payload Extensibility

    @@ -645,7 +646,7 @@

    7 Formats

    In the case that both the Accept header and the $format system query option are specified on a request, the value specified in the $format query option MUST be used.

    If the service does not support the requested format, it replies with a 406 Not Acceptable error response.

    Services SHOULD advertise their supported formats in the metadata document by annotating their entity container with the term Capabilities.SupportedFormats, as defined in OData-VocCap, listing all available formats and combinations of supported format parameters.

    -

    The media types for the JSON and XML representation of the metadata document are described in section "Metadata Document Request".

    +

    The media types for the JSON and XML representation of the metadata document are described in section “Metadata Document Request”.

    The format specification OData-JSON describes the media type and the format parameters for non-metadata requests and responses.

    For non-metadata requests, if neither the Accept header nor the $format query option are specified, the service MAY respond to requests in any format.

    Client libraries MUST retain the order of objects within an array in JSON responses, and elements in document order for XML responses, including CSDL documents.

    @@ -656,16 +657,16 @@

    8.1 Com

    The following headers are common between OData requests and responses.

    8.1.1 Header Content-Type

    The format of a non-empty individual request or response body, alone or within a batch, MUST be specified in the Content-Type header of a request or response. The exception to this is if the body represents the media stream of a media entity or stream property, in which case the Content-Type header SHOULD be present.

    -

    The specified format MAY include format parameters. Clients MUST be prepared for the service to return custom format parameters not defined in OData and SHOULD NOT expect that such format parameters can be ignored. Custom format parameters MUST NOT start with "odata" and services MUST NOT require generic OData consumers to understand custom format parameters in order to correctly interpret the payload.

    +

    The specified format MAY include format parameters. Clients MUST be prepared for the service to return custom format parameters not defined in OData and SHOULD NOT expect that such format parameters can be ignored. Custom format parameters MUST NOT start with odata and services MUST NOT require generic OData consumers to understand custom format parameters in order to correctly interpret the payload.

    See OData-JSON for format-specific details about format parameters within the Content-Type header.

    8.1.2 Header Content-Encoding

    -

    As defined in RFC7231, the Content-Encoding header field is used as a modifier to the media-type (as indicated in the Content-Type). When present, its value indicates what additional content codings have been applied to the entity-body. A service MAY specify a list of acceptable content codings using an annotation with term Capabilities.AcceptableEncodings, see OData-VocCap.

    -

    If the Content-Encoding header is specified on an individual request or response within a batch, then it specifies the encoding for that individual request or response. Individual requests or responses that don't include the Content-Encoding header inherit the encoding of the overall batch request or response.

    +

    As defined in RFC7231, the Content-Encoding header field is used as a modifier to the media-type (as indicated in the Content-Type header). When present, its value indicates what additional content codings have been applied to the entity-body. A service MAY specify a list of acceptable content codings using an annotation with term Capabilities.AcceptableEncodings, see OData-VocCap.

    +

    If the Content-Encoding header is specified on an individual request or response within a batch, then it specifies the encoding for that individual request or response. Individual requests or responses that don’t include the Content-Encoding header inherit the encoding of the overall batch request or response.

    8.1.3 Header Content-Language

    As defined in RFC7231, a request or response can include a Content-Language header to indicate the natural language of the intended audience for the enclosed message body. OData does not add any additional requirements over HTTP for including Content-Language. OData services can annotate model elements whose content depends on the content language with the term Core.IsLanguageDependent, see OData-VocCore.

    -

    If the Content-Language header is specified on an individual request or response within a batch, then it specifies the language for that individual request or response. Individual requests or responses that don't include the Content-Language header inherit the language of the overall batch request or response.

    +

    If the Content-Language header is specified on an individual request or response within a batch, then it specifies the language for that individual request or response. Individual requests or responses that don’t include the Content-Language header inherit the language of the overall batch request or response.

    8.1.4 Header Content-Length

    -

    As defined in RFC7230, a request or response SHOULD include a Content-Length header when the message's length can be determined prior to being transferred. OData does not add any additional requirements over HTTP for writing Content-Length.

    +

    As defined in RFC7230, a request or response SHOULD include a Content-Length header when the message’s length can be determined prior to being transferred. OData does not add any additional requirements over HTTP for writing Content-Length.

    If the Content-Length header is specified on an individual request or response within a batch, then it specifies the length for that individual request or response.

    8.1.5 Header OData-Version

    OData clients SHOULD use the OData-Version header on a request to specify the version of the protocol used to generate the request payload.

    @@ -673,7 +674,7 @@

    OData-MaxVersion, if specified, and the maximum version of the protocol that the service understands.

    OData services MUST include the OData-Version header on a response to specify the version of the protocol used to generate the response payload. The client MUST interpret the response payload according to the rules defined in the specified version of the protocol. Request and response payloads are independent and may have different OData-Version headers according to the above rules.

    For more details, see Versioning.

    -

    If the OData-Version header is specified on an individual request or response within a batch, then it specifies the OData version for that individual request or response. Individual requests or responses that don't include the OData-Version header inherit the OData version of the overall batch request or response. This OData version does not typically vary within a batch.

    +

    If the OData-Version header is specified on an individual request or response within a batch, then it specifies the OData version for that individual request or response. Individual requests or responses that don’t include the OData-Version header inherit the OData version of the overall batch request or response. This OData version does not typically vary within a batch.

    8.2 Request Headers

    In addition to the Common Headers, the client may specify any combination of the following request headers.

    8.2.1 Header Accept

    @@ -681,18 +682,18 @@

    8.2.1 Hea

    Services MUST reject formats that specify unknown or unsupported format parameters.

    If a media type specified in the Accept header includes a charset format parameter and the request also contains an Accept-Charset header, then the Accept-Charset header MUST be used.

    If the media type specified in the Accept header does not include a charset format parameter, then the Content-Type header of the response MUST NOT contain a charset format parameter.

    -

    The service SHOULD NOT add any format parameters to the Content-Type parameter not specified in the Accept header.

    -

    If the Accept header is specified on an individual request within a batch, then it specifies the acceptable formats for that individual request. Requests within a batch that don't include the Accept header inherit the acceptable formats of the overall batch request.

    +

    The service SHOULD NOT add any format parameters to the Content-Type header not specified in the Accept header.

    +

    If the Accept header is specified on an individual request within a batch, then it specifies the acceptable formats for that individual request. Requests within a batch that don’t include the Accept header inherit the acceptable formats of the overall batch request.

    8.2.2 Header Accept-Charset

    As defined in RFC7231, the client MAY specify the set of accepted character sets with the Accept-Charset header.

    -

    If the Accept-Charset header is specified on an individual request within a batch, then it specifies the acceptable character sets for that individual request. Requests within a batch that don't include the Accept-Charset header inherit the acceptable character sets of the overall batch request.

    +

    If the Accept-Charset header is specified on an individual request within a batch, then it specifies the acceptable character sets for that individual request. Requests within a batch that don’t include the Accept-Charset header inherit the acceptable character sets of the overall batch request.

    8.2.3 Header Accept-Language

    As defined in RFC7231, the client MAY specify the set of accepted natural languages with the Accept-Language header.

    -

    If the Accept-Language header is specified on an individual request within a batch, then it specifies the acceptable languages for that individual request. Requests within a batch that don't include the Accept-Language header inherit the acceptable languages of the overall batch request.

    +

    If the Accept-Language header is specified on an individual request within a batch, then it specifies the acceptable languages for that individual request. Requests within a batch that don’t include the Accept-Language header inherit the acceptable languages of the overall batch request.

    8.2.4 Header If-Match

    As defined in RFC7232, a client MAY include an If-Match header in a request to GET, POST, PUT, PATCH or DELETE. The value of the If-Match request header MUST be an ETag value previously retrieved for the resource, or * to match any value.

    -

    If an operation on an existing resource requires an ETag, (see term Core.OptimisticConcurrency in OData-VocCore and property OptimisticConcurrencyControl of type Capabilities.NavigationPropertyRestriction in OData-VocCap) and the client does not specify an If-Match request header in a Data Modification Request or in an Action Request invoking an action bound to the resource, the service responds with a 428 Precondition Required and MUST ensure that no observable change occurs as a result of the request.

    -

    If present, the request MUST only be processed if the specified ETag value matches the current ETag value of the target resource. Services sending ETag headers with weak ETags that only depend on the representation-independent entity state MUST use the weak comparison function because it is sufficient to prevent accidental overwrites. This is a deviation from RFC7232.

    +

    If an operation on an existing resource requires an ETag, (see term Core.OptimisticConcurrency in OData-VocCore and property OptimisticConcurrencyControl of type Capabilities.NavigationPropertyRestriction in OData-VocCap) and the client does not specify an If-Match request header in a Data Modification Request or in an Action Request invoking an action bound to the resource, the service responds with a 428 Precondition Required and MUST ensure that no observable change occurs as a result of the request.

    +

    If present, the request MUST only be processed if the specified ETag value matches the current ETag value of the target resource. Services sending ETag headers with weak ETags that only depend on the representation-independent entity state MUST use the weak comparison function because it is sufficient to prevent accidental overwrites. This is a deviation from RFC7232.

    If the value does not match the current ETag value of the resource for a Data Modification Request or Action Request, the service MUST respond with 412 Precondition Failed and MUST ensure that no observable change occurs as a result of the request. In the case of an upsert, if the addressed entity does not exist the provided ETag value is considered not to match.

    An If-Match header with a value of * in a PUT or PATCH request results in an upsert request being processed as an update and not an insert.

    The If-Match header MUST NOT be specified on a batch request, but MAY be specified on individual requests within the batch.

    @@ -703,8 +704,8 @@

    8.2.6 Header Isolation (OData-Isolation)

    The Isolation header specifies the isolation of the current request from external changes. The only supported value for this header is snapshot.

    -

    If the service doesn't support Isolation:snapshot and this header was specified on the request, the service MUST NOT process the request and MUST respond with 412 Precondition Failed.

    -

    Snapshot isolation guarantees that all data returned for a request, including multiple requests within a batch or results retrieved across multiple pages, will be consistent as of a single point in time. Only data modifications made within the request (for example, by a data modification request within the same batch) are visible. The effect is as if the request generates a "snapshot" of the committed data as it existed at the start of the request.

    +

    If the service doesn’t support Isolation:snapshot and this header was specified on the request, the service MUST NOT process the request and MUST respond with 412 Precondition Failed.

    +

    Snapshot isolation guarantees that all data returned for a request, including multiple requests within a batch or results retrieved across multiple pages, will be consistent as of a single point in time. Only data modifications made within the request (for example, by a data modification request within the same batch) are visible. The effect is as if the request generates a “snapshot” of the committed data as it existed at the start of the request.

    The Isolation header may be specified on a single or batch request. If it is specified on a batch then the value is applied to all statements within the batch.

    Next links returned within a snapshot return results within the same snapshot as the initial request; the client is not required to repeat the header on each individual page request.

    The Isolation header has no effect on links other than the next link. Navigation links, read links, and edit links return the current version of the data.

    @@ -716,7 +717,7 @@

    OData-Version less than or equal to the specified OData-MaxVersion.

    If OData-MaxVersion is not specified, then the service SHOULD return responses with the same OData version over time and interpret the request as having an OData-MaxVersion equal to the maximum OData version supported by the service at its initial publication.

    -

    If the OData-MaxVersion header is specified on an individual request within a batch, then it specifies the maximum OData version for that individual request. Individual requests that don't include the OData-MaxVersion header inherit the maximum OData version of the overall batch request or response. The maximum OData version does not typically vary within a batch.

    +

    If the OData-MaxVersion header is specified on an individual request within a batch, then it specifies the maximum OData version for that individual request. Individual requests that don’t include the OData-MaxVersion header inherit the maximum OData version of the overall batch request or response. The maximum OData version does not typically vary within a batch.

    For more details, see Versioning.

    8.2.8 Header Prefer

    The Prefer header, as defined in RFC7240, allows clients to request certain behavior from the service. The service MUST ignore preference values that are either not supported or not known by the service.

    @@ -725,7 +726,7 @@

    8.2.8 Hea

    8.2.8.1 Preference allow-entityreferences (odata.allow-entityreferences)

    The allow-entityreferences preference indicates that the service is allowed to return entity references in place of entities that have previously been returned, with at least the properties requested, in the same response (for example, when serializing the expanded results of many-to-many relationships). The service MUST NOT return entity references in place of requested entities if allow-entityreferences has not been specified in the request, unless explicitly defined by other rules in this document. The syntax of the allow-entityreferences preference is defined in OData-ABNF.

    In the case the service applies the allow-entityreferences preference it MUST include a Preference-Applied response header containing the allow-entityreferences preference to indicate that entity references MAY be returned in place of entities that have previously been returned.

    -

    If the allow-entityreferences preference is specified on an individual request within a batch, then it specifies the preference for that individual request. Individual requests within a batch that don't include the allow-entityreferences preference inherit the preference of the overall batch request.

    +

    If the allow-entityreferences preference is specified on an individual request within a batch, then it specifies the preference for that individual request. Individual requests within a batch that don’t include the allow-entityreferences preference inherit the preference of the overall batch request.

    Note: The allow-entityreferences preference was named odata.allow-entityreferences in OData version 4.0. Services that support the allow-entityreferences preference SHOULD also support odata.allow-entityreferences for OData 4.0 clients and clients SHOULD use odata.allow-entityreferences for compatibility with OData 4.0 services.

    8.2.8.2 Preference callback (odata.callback)

    For scenarios in which links returned by the service are used by the client to poll for additional information, the client can specify the callback preference to request that the service notify the client when data is available.

    @@ -738,8 +739,8 @@

    Capabilities.CallbackSupported annotation term defined in OData-VocCap.

    If the service applies the callback preference it MUST include the callback preference in the Preference-Applied response header.

    -

    When the callback preference is applied to asynchronous requests, the OData service invokes the callback endpoint once it has finished processing the request. The status monitor resource, returned in the Location header of the previously returned 202 Accepted response, can then be used to retrieve the results of the asynchronously executed request.

    -

    When the callback preference is specified on a GET request to a delta link and there are no changes available, the OData service returns a 202 Accepted response with a Location header specifying the delta link to be used to check for future updates. The OData service then invokes the specified callback endpoint once new changes become available.

    +

    When the callback preference is applied to asynchronous requests, the OData service invokes the callback endpoint once it has finished processing the request. The status monitor resource, returned in the Location header of the previously returned 202 Accepted response, can then be used to retrieve the results of the asynchronously executed request.

    +

    When the callback preference is specified on a GET request to a delta link and there are no changes available, the OData service returns a 202 Accepted response with a Location header specifying the delta link to be used to check for future updates. The OData service then invokes the specified callback endpoint once new changes become available.

    Combining respond-async, callback and track-changes preferences on a GET request to a delta-link might influence the response in a couple of ways.

  • The include-annotations preference is only a hint to the service. The service MAY ignore the preference and is free to decide whether or not to return annotations not specified in the include-annotations preference.

    In the case that the client has specified the include-annotations preference in the request, the service SHOULD include a Preference-Applied response header containing the include-annotations preference to specify the annotations actually included, where applicable, in the response. This value may differ from the annotations requested in the Prefer header of the request.

    -

    If the include-annotations preference is specified on an individual request within a batch, then it specifies the preference for that individual request. Individual requests within a batch that don't include the include-annotations preference inherit the preference of the overall batch request.

    -

    Note: The include-annotations preference was named odata.include-annotations in OData version 4.0. Services that support theinclude-annotationspreference SHOULD also support odata.include-annotations for OData 4.0 clients and clients SHOULD use odata.include-annotations for compatibility with OData 4.0 services. If both include-annotations and odata.include-annotations preferences are specified in the same request, the value of the include-annotations preference SHOULD be used.

    +

    If the include-annotations preference is specified on an individual request within a batch, then it specifies the preference for that individual request. Individual requests within a batch that don’t include the include-annotations preference inherit the preference of the overall batch request.

    +

    Note: The include-annotations preference was named odata.include-annotations in OData version 4.0. Services that support the include-annotations preference SHOULD also support odata.include-annotations for OData 4.0 clients and clients SHOULD use odata.include-annotations for compatibility with OData 4.0 services. If both include-annotations and odata.include-annotations preferences are specified in the same request, the value of the include-annotations preference SHOULD be used.

    8.2.8.5 Preference maxpagesize (odata.maxpagesize)

    The maxpagesize preference is used to request that each collection within the response contain no more than the number of items specified as the positive integer value of this preference. The syntax of the maxpagesize preference is defined in OData-ABNF.

    @@ -808,14 +809,14 @@

    RFC7240.

    In OData, return=representation or return=minimal is defined for use with a POST, PUT, or PATCH Data Modification Request, or with an Action Request. Specifying a preference of return=representation or return=minimal in a GET or DELETE request does not have any effect.

    A preference of return=representation or return=minimal is allowed on an individual Data Modification Request or Action Request within a batch, subject to the same restrictions, but SHOULD return a 4xx Client Error if specified on the batch request itself.

    -

    A preference of return=minimal requests that the service invoke the request but does not return content in the response. The service MAY apply this preference by returning 204 No Content in which case it MAY include a Preference-Applied response header containing the return=minimal preference.

    +

    A preference of return=minimal requests that the service invoke the request but does not return content in the response. The service MAY apply this preference by returning 204 No Content in which case it MAY include a Preference-Applied response header containing the return=minimal preference.

    A preference of return=representation requests that the service invokes the request and returns the modified resource. The service MAY apply this preference by returning the representation of the successfully modified resource in the body of the response, formatted according to the rules specified for the requested format. In this case the service MAY include a Preference-Applied response header containing the return=representation preference.

    The return preference SHOULD NOT be applied to a batch request, but MAY be applied to individual requests within a batch.

    8.2.8.8 Preference respond-async

    -

    The respond-async preference, as defined in RFC7240, allows clients to request that the service process the request asynchronously.

    +

    The respond-async preference, as defined in RFC7240, allows clients to request that the service process the request asynchronously.

    If the client has specified respond-async in the request, the service MAY process the request asynchronously and return a 202 Accepted response.

    The respond-async preference MAY be used for batch requests, in which case it applies to the batch request as a whole and not to individual requests within the batch request.

    -

    In the case that the service applies the respond-async preference it MUST include a Preference-Applied response header containing the respond-async preference.

    +

    In the case that the service applies the respond-async preference it MUST include a Preference-Applied response header containing the respond-async preference.

    A service MAY specify the support for the respond-async preference using an annotation with term Capabilities.AsynchronousRequestsSupported, see OData-VocCap.

    Example 9: a service receiving the following header might choose to respond

    @@ -866,10 +867,10 @@

    8.3.7 Header Retry-After

    A service MAY include a Retry-After header, as defined in RFC7231, in 202 Accepted and in 3xx Redirect responses

    -

    The Retry-After header specifies the duration of time, in seconds, that the client is asked to wait before retrying the request or issuing a request to the resource returned as the value of the Location header.

    +

    The Retry-After header specifies the duration of time, in seconds, that the client is asked to wait before retrying the request or issuing a request to the resource returned as the value of the Location header.

    8.3.8 Header Vary

    If a response varies depending on the OData-Version of the response, the service MUST include a Vary header listing the OData-MaxVersion request header field to allow correct caching of the response.

    -

    If a response varies depending on the applied preferences (allow-entityreferences, include-annotations, omit-values, return), the service MUST include a Vary header listing the Prefer request header field to allow correct caching of the response.

    +

    If a response varies depending on the applied preferences (allow-entityreferences, include-annotations, omit-values, return), the service MUST include a Vary header listing the Prefer request header field to allow correct caching of the response.

    Alternatively, the server MAY include a Vary header with the special value * as defined by RFC7231, Section 8.2.1. Note that this will make it impossible for a proxy to cache the response, see RFC7240.


    9 Common Response Status Codes

    @@ -884,10 +885,10 @@

    9.1.3 Response Code 202 Accepted

    202 Accepted indicates that the Data Service Request has been accepted and has not yet completed executing asynchronously. The asynchronous handling of requests is defined in the sections on Asynchronous Requests and Asynchronous Batch Requests.

    9.1.4 Response Code 204 No Content

    -

    A request returns 204 No Content if the requested resource has the null value, or if the service applies a return=minimal preference. In this case, the response body MUST be empty.

    -

    As defined in RFC7231, a Data Modification Request that responds with 204 No Content MAY include an ETag header with a value reflecting the result of the data modification if and only if the client can reasonably "know" the new representation of the resource without actually receiving it. For a PUT request this means that the response body of a corresponding 200 OK or 201 Created response would have been identical to the request body, i.e. no server-side modification of values sent in the request body, no server-calculated values etc. For a PATCH request this means that the response body of a corresponding 200 OK or 201 Created response would have consisted of all values sent in the request body, plus (for values not sent in the request body) server-side values corresponding to the ETag value sent in the If-Match header of the PATCH request, i.e. the previous values "known" to the client.

    +

    A request returns 204 No Content if the requested resource has the null value, or if the service applies a return=minimal preference. In this case, the response body MUST be empty.

    +

    As defined in RFC7231, a Data Modification Request that responds with 204 No Content MAY include an ETag header with a value reflecting the result of the data modification if and only if the client can reasonably “know” the new representation of the resource without actually receiving it. For a PUT request this means that the response body of a corresponding 200 OK or 201 Created response would have been identical to the request body, i.e. no server-side modification of values sent in the request body, no server-calculated values etc. For a PATCH request this means that the response body of a corresponding 200 OK or 201 Created response would have consisted of all values sent in the request body, plus (for values not sent in the request body) server-side values corresponding to the ETag value sent in the If-Match header of the PATCH request, i.e. the previous values “known” to the client.

    9.1.5 Response Code 3xx Redirection

    -

    As per RFC7231, a 3xx Redirection indicates that further action needs to be taken by the client in order to fulfill the request. In this case, the response SHOULD include a Location header, as appropriate, with the URL from which the result can be obtained; it MAY include a Retry-After header.

    +

    As per RFC7231, a 3xx Redirection indicates that further action needs to be taken by the client in order to fulfill the request. In this case, the response SHOULD include a Location header, as appropriate, with the URL from which the result can be obtained; it MAY include a Retry-After header.

    9.1.6 Response Code 304 Not Modified

    As per RFC7232, a 304 Not Modified is returned when the client performs a GET request containing an If-None-Match header and the content has not changed. In this case the response SHOULD NOT include other headers in order to prevent inconsistencies between cached entity-bodies and updated headers.

    The service MUST ensure that no observable change has occurred to the state of the service as a result of any request that returns a 304 Not Modified.

    @@ -896,7 +897,7 @@

    format.

    9.2.1 Response Code 404 Not Found

    -

    404 Not Found indicates that the resource specified by the request URL does not exist. The response body MAY provide additional information.

    +

    404 Not Found indicates that the resource specified by the request URL does not exist. The response body MAY provide additional information.

    9.2.2 Response Code 405 Method Not Allowed

    405 Method Not Allowed indicates that the resource specified by the request URL does not support the request method. In this case the response MUST include an Allow header containing a list of valid request methods for the requested resource as defined in RFC7231.

    9.2.3 Response Code 406 Not Acceptable

    @@ -912,7 +913,7 @@

    9.3.1 Response Code 501 Not Implemented

    If the client requests functionality not implemented by the OData Service, the service responds with 501 Not Implemented and SHOULD include a response body describing the functionality not implemented.

    9.4 Error Response Body

    -

    The representation of an error response body is format-specific. It consists at least of the following information:

    +

    An error response body can be the result of a failure of OData processing or of the underlying infrastructure. An OData-specific error response (which can be recognized by the presence of the OData-Version header) is format-specific and consists at least of the following information:

    -

    Example 21: resource URL and corresponding context URL -- expand $ref

    +

    Example 21: resource URL and corresponding context URL — expand $ref

    http://host/service/Customers?$expand=Orders/$ref
     http://host/service/$metadata#Customers
    -

    Example 22: resource URL and corresponding context URL -- expand with $levels

    +

    Example 22: resource URL and corresponding context URL — expand with $levels

    http://host/service/Employees/Sales.Manager?$select=DirectReports
             &$expand=DirectReports($select=FirstName,LastName;$levels=4)
     http://host/service/$metadata
    @@ -1071,8 +1073,8 @@ 

    10
    {context-url}#{entity-set}{/type-name}{select-list}/$entity
     {context-url}#{singleton}{select-list}
     {context-url}#{type-name}{select-list}
    -

    For a 4.01 response, if a navigation property is explicitly expanded, then in addition to the non-suffixed names of any selected properties, navigation properties, functions or actions, the comma-separated list of properties MUST include the name of the expanded property, suffixed with the parenthesized comma-separated list of any properties of the expanded navigation property that are selected or expanded. If the expanded navigation property does not contain a nested $select or $expand, then the expanded property is suffixed with empty parentheses. If the expansion is recursive for nested children, a plus sign (+) is infixed between the navigation property name and the opening parenthesis.

    -

    For a 4.0 response, the expanded navigation property suffixed with parentheses is omitted from the select-list if it does not contain a nested $select or $expand, but MUST still be present, without a suffix, if it is explicitly selected.

    +

    For a 4.01 response, if a navigation property is explicitly expanded, then in addition to the non-suffixed names of any selected properties, navigation properties, functions or actions, the comma-separated list of properties MUST include the name of the expanded property, suffixed with the parenthesized comma-separated list of any properties of the expanded navigation property that are selected or expanded. If the expanded navigation property does not contain a nested $select or $expand, then the expanded property is suffixed with empty parentheses. If the expansion is recursive for nested children, a plus sign (+) is infixed between the navigation property name and the opening parenthesis.

    +

    For a 4.0 response, the expanded navigation property suffixed with parentheses is omitted from the select-list if it does not contain a nested $select or $expand, but MUST still be present, without a suffix, if it is explicitly selected.

    If the context URL includes only expanded navigation properties (i.e., only navigation properties suffixed with parentheses), then all structural properties are implicitly selected (same as if there were no properties listed in the select-list).

    Navigation properties with expanded references are not represented in the context URL.

    The context URL of an update request body for a collection of entities is simply the fragment #$delta.

    @@ -1221,13 +1223,13 @@

    OData-CSDLJSON describes a JSON representation for OData metadata documents and provides a JSON schema to validate their contents. The media type of the JSON representation of an OData metadata document is application/json.

    OData-CSDLXML describes an XML representation for OData metadata documents and provides an XML schema to validate their contents. The media type of the XML representation of an OData metadata document is application/xml.

    OData services can expose a metadata document that describes the data model exposed by the service. The metadata document URL MUST be the root URL of the service with $metadata appended. To retrieve this document the client issues a GET request to the metadata document URL.

    -

    If a request for metadata does not specify a format preference (via Accept header or $format) then the XML representation MUST be returned.

    +

    If a request for metadata does not specify a format preference (via Accept header or $format) then the XML representation MUST be returned.

    11.2 Requesting Data

    OData services support requests for data via HTTP GET requests.

    The path of the URL specifies the target of the request (for example; the collection of entities, entity, navigation property, structural property, or operation). Additional query operators, such as filter, sort, page, and projection operations are specified through query options.

    This section describes the types of data requests defined by OData. For complete details on the syntax for building requests, see OData-URL.

    OData services are hypermedia driven services that return URLs to the client. If a client subsequently requests the advertised resource and the URL has expired, then the service SHOULD respond with 410 Gone. If this is not feasible, the service MUST respond with 404 Not Found.

    -

    The format of the returned data is dependent upon the request and the format specified by the client, either in the Accept header or using the $format query option. If the client specifies neither an Accept header nor the $format query option, the service is allowed to return the response in any format.

    +

    The format of the returned data is dependent upon the request and the format specified by the client, either in the Accept header or using the $format query option. If the client specifies neither an Accept header nor the $format query option, the service is allowed to return the response in any format.

    11.2.1 System Query Options

    OData defines a number of system query options that allow refining the request. System query options are prefixed with the dollar ($) character, which is optional in OData 4.01. 4.01 services MUST support case-insensitive system query option names specified with or without the $ prefix. Clients that want to work with 4.0 services MUST use lower case names and specify the $ prefix.

    The result of the request MUST be as if the system query options were evaluated in the following order.

    @@ -1236,7 +1238,7 @@

    server-driven paging:

      -
    • $apply -- defined in OData-Aggregation
    • +
    • $apply — defined in OData-Aggregation
    • $compute
    • $search
    • $filter
    • @@ -1253,19 +1255,19 @@

      11.2.2 Requesting Individual Entities

      To retrieve an individual entity, the client makes a GET request to a URL that identifies the entity, e.g. its read URL.

      -

      The read URL can be obtained from a response payload containing that instance, for example as a readLink or editLink in an OData-JSON payload. In addition, services MAY support conventions for constructing a read URL using the entity's key value(s), as described in OData-URL.

      +

      The read URL can be obtained from a response payload containing that instance, for example as a readLink or editLink in an OData-JSON payload. In addition, services MAY support conventions for constructing a read URL using the entity’s key value(s), as described in OData-URL.

      The set of structural or navigation properties to return may be specified through $select or $expandsystem query options.

      Clients MUST be prepared to receive additional properties in an entity or complex type instance that are not advertised in metadata, even for types not marked as open.

      -

      Properties that are not available, for example due to permissions, are not returned. In this case, the Core.Permissions annotation, defined in OData-VocCore MUST be returned for the property with a value of None.

      +

      Properties that are not available, for example due to permissions, are not returned. In this case, the Core.Permissions annotation, defined in OData-VocCore MUST be returned for the property with a value of None.

      If no entity exists with the specified request URL, the service responds with 404 Not Found.

      11.2.3 Requesting the Media Stream of a Media Entity using $value

      A media entity is an entity that represents an out-of-band stream, such as a photograph.

      Use a media entity if the out-of-band stream is the main topic of interest and the media entity is just structured additional information attached to the stream. Use a normal entity with one or more stream properties if the structured data of the entity is the main topic of interest and the stream data is just additional information attached to the structured data.

      -

      To address the media stream represented by a media entity, clients append /$value to the resource path of the media entity URL. Services may redirect from this canonical URL to the source URL of the media stream.

      -

      Appending /$value to an entity that is not a media entity returns 400 Bad Request.

      +

      To address the media stream represented by a media entity, clients append /$value to the resource path of the media entity URL. The media type of the response is the media type of the stream, subject to content type negotiation based on the Accept header of the request. The response body is the octet-stream that represents the raw value of the media stream with that media type. Alternatively, services MAY redirect from this canonical URL to the source URL of the media stream.

      +

      Appending /$value to an entity that is not a media entity returns 400 Bad Request.

      Attempting to retrieve the media stream from a single-valued navigation property referencing a media entity whose value is null returns 404 Not Found.

      11.2.4 Requesting Individual Properties

      -

      To retrieve an individual property, the client issues a GET request to the property URL. The property URL is the entity read URL with "/" and the property name appended.

      +

      To retrieve an individual property, the client issues a GET request to the property URL. The property URL is the entity read URL with / and the property name appended.

      For complex typed properties, the path can be further extended with the name of an individual property of the complex type.

      See OData-URL for details.

      If the property is single-valued and has the null value, the service responds with 204 No Content.

      @@ -1274,7 +1276,10 @@

      11.2.4.1 Requesting a Property's Raw Value using $value

      +

      11.2.4.1 Requesting Stream Properties

      +

      If the property being requested has type Edm.Stream (see OData-URL, section 9), the media type of the response is the media type of the stream, subject to content type negotiation based on the Accept header of the request. The response body is the octet-stream that represents the raw value of the stream property with that media type.

      +

      Note this response format disregards any $format system query option.

      +

      11.2.4.2 Requesting a Property’s Raw Value using $value

      To retrieve the raw value of a primitive type property, the client sends a GET request to the property value URL. See the OData-URL document for details.

      The Content-Type of the response is determined using the Accept header and the $format system query option.

      The default format for Edm.Binary is the format specified by the Core.MediaType annotation of this property (see OData-VocCore) if this annotation is present. If not annotated, the format cannot be predicted by the client.

      @@ -1282,6 +1287,7 @@

      OData-ABNF.

      A $value request for a property that is null results in a 204 No Content response.

      If the property is not available, for example due to permissions, the service responds with 404 Not Found.

      +

      Appending /$value to the property URL of a property of type Edm.Stream returns 400 Bad Request.

      Example 32:

      GET http://host/service/Products(1)/Name/$value
      @@ -1320,9 +1326,8 @@

      If the service returns less than the full set of properties, either because the client specified a select or because the service returned a subset of properties in the absence of a select, the context URL MUST reflect the set of selected properties and projected expanded navigation properties.

      11.2.5.2 System Query Option $expand

      The $expand system query option indicates the related entities and stream values that MUST be represented inline. The service MUST return the specified content, and MAY choose to return additional information.

      -

      The value of the $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity.

      -

      For navigation properties, the navigation property name is optionally followed by a /$ref path segment or a /$count path segment, and optionally a parenthesized set of expand options (for filtering, sorting, selecting, paging, or expanding the related entities).

      -

      For a full description of the syntax used when building requests, see OData-URL.

      +

      The value of $expand is a comma-separated list of expand items. Each expand item is evaluated relative to the retrieved resource being expanded.

      +

      For a full description of the syntax used when building requests, see OData-URL, section 5.1.3.

      Example 38: for each customer entity within the Customers entity set the value of all related Orders will be represented inline

      GET http://host/service.svc/Customers?$expand=Orders
      @@ -1337,7 +1342,7 @@

      11.2.5.2.1 Expand Options

      The set of expanded entities can be further refined through the application of expand options, expressed as a semicolon-separated list of system query options, enclosed in parentheses, see OData-URL.

      -

      Allowed system query options are $filter, $select, $orderby, $skip, $top, $count, $search, $expand, $compute, and $levels.

      +

      Allowed system query options are $compute, $select, $expand, and $levels for all navigation properties, plus $filter, $orderby, $skip, $top, $count, and $search for collection-valued navigation properties.

      Example 41: for each customer entity within the Customers entity set, the value of those related Orders whose Amount is greater than 100 will be represented inline

      GET http://host/service.svc/Customers?$expand=Orders($filter=Amount gt 100)
      @@ -1355,7 +1360,7 @@
      11.
      GET http://host/service.svc/Customers?$expand=SampleModel.VipCustomer/InHouseStaff
      11.2.5.2.1.1 Expand Option $levels
      -

      The $levels expand option can be used to specify the number of levels of recursion for a hierarchy in which the related entity type is the same as, or can be cast to, the source entity type. A $levels option with a value of 1 specifies a single expand with no recursion. The same expand options are applied at each level of the hierarchy.

      +

      The $levels expand option can be used to specify the number of levels of recursion for a hierarchy in which the related entity type is the same as, or can be cast to, the source entity type. A $levels option with a value of 1 specifies a single expand with no recursion. All provided expand options except $levels are applied at each level of the hierarchy.

      Services MAY support the symbolic value max in addition to numeric values. In that case they MUST solve circular dependencies by injecting an entity reference somewhere in the circular dependency.

      Clients using $levels=max MUST be prepared to handle entity references in cases were a circular reference would occur otherwise.

      4.01 services that support max SHOULD do so in a case-insensitive manner. Clients that want to work with 4.0 services MUST use lower case.

      @@ -1384,7 +1389,7 @@

      Example 46: return all Products whose Price is less than $10.00

      GET http://host/service/Products?$filter=Price lt 10.00

      -

      The $count segment may be used within a $filter expression to limit the items returned based on the exact count of related entities or items within a collection-valued property.

      +

      The $count segment may be used within a $filter expression to limit the items returned based on the exact count of related entities or items within a collection-valued property.

      Example 47: return all Categories with less than 10 products

      GET http://host/service/Categories?$filter=Products/$count lt 10
      @@ -1439,7 +1444,7 @@
      String Functions -

    + @@ -1475,10 +1480,10 @@
    11.2.6.1.3 Parameter Aliases
    -

    Parameter aliases can be used in place of literal values in entity keys, function parameters, or within a $compute, $filter or $orderby expression. Parameters aliases are names beginning with an at sign (@).

    +

    Parameter aliases can be used in place of literal values in entity keys, function parameters, or within a $compute, $filter or $orderby expression. Parameters aliases are names beginning with an at sign (@).

    Actual parameter values are specified as query options in the query part of the request URL. The query option name is the name of the parameter alias, and the query option value is the value to be used for the specified parameter alias.

    -

    Example 48: returns all employees whose Region property matches the string parameter value "WA"

    +

    Example 48: returns all employees whose Region property matches the string parameter value WA

    GET http://host/service.svc/Employees?$filter=Region eq @p1&@p1='WA'

    Parameter aliases allow the same value to be used multiple times in a request and may be used to reference primitive, structured, or collection values.

    @@ -1496,7 +1501,7 @@

    Null values come before non-null values when sorting in ascending order and after non-null values when sorting in descending order.

    Items are sorted by the result values of the first expression, and then items with the same value for the first expression are sorted by the result value of the second expression, and so on.

    The Boolean value false comes before the value true in ascending order.

    -

    Services SHOULD order language-dependent strings according to the content-language of the response, and SHOULD annotate string properties with language-dependent order with the term Core.IsLanguageDependent, see OData-VocCore.

    +

    Services SHOULD order language-dependent strings according to the Content-Language of the response, and SHOULD annotate string properties with language-dependent order with the term Core.IsLanguageDependent, see OData-VocCore.

    Values of type Edm.Stream or any of the Geo types cannot be sorted.

    Example 50: return all Products ordered by release date in ascending order, then by rating in descending order

    @@ -1537,7 +1542,7 @@

    Example 57:

    GET http://host/service/Categories?$expand=Products($count=true)
    @@ -1549,32 +1554,32 @@

    11.2.6.6 System Query Option $search

    The $search system query option restricts the result to include only those items matching the specified search expression. The definition of what it means to match is dependent upon the implementation.

    -

    Example 58: return all Products that match the search term "bike"

    +

    Example 58: return all Products that match the search term bike

    GET http://host/service/Products?$search=bike

    The search expression can contain phrases, enclosed in double-quotes.

    -

    Example 59: return all Products that match the phrase "mountain bike"

    +

    Example 59: return all Products that match the phrase mountain bike

    GET http://host/service/Products?$search="mountain bike"

    The upper-case keyword NOT restricts the set of entities to those that do not match the specified term.

    -

    Example 60: return all Products that do not match "clothing"

    +

    Example 60: return all Products that do not match clothing

    GET http://host/service/Products?$search=NOT clothing

    Multiple terms within a search expression are separated by a space (implicit AND) or the upper-case keyword AND, indicating that all such terms must be matched.

    -

    Example 61: return all Products that match both "mountain" and "bike"

    +

    Example 61: return all Products that match both mountain and bike

    GET http://host/service/Products?$search=mountain AND bike

    The upper-case keyword OR is used to return entities that satisfy either the immediately preceding or subsequent expression.

    -

    Example 62: return all Products that match either "mountain" or "bike"

    +

    Example 62: return all Products that match mountain or bike

    GET http://host/service/Products?$search=mountain OR bike

    Parentheses within the search expression group together multiple expressions.

    -

    Example 63: return all Products that match either "mountain" or "bike" and do not match clothing

    +

    Example 63: return all Products that match mountain or bike and do not match clothing

    GET http://host/service/Products?$search=(mountain OR bike) AND NOT clothing

    The operations within a search expression MUST be evaluated in the following order: grouping operator, NOT operator, AND operator, OR operator

    @@ -1593,19 +1598,19 @@

    GET http://host/service/Suppliers(MainSupplier)/Addresses/0

    -

    To request related entities according to a particular relationship, the client issues a GET request to the source entity's request URL, followed by a forward slash and the name of the navigation property representing the relationship.

    +

    To request related entities according to a particular relationship, the client issues a GET request to the source entity’s request URL, followed by a forward slash and the name of the navigation property representing the relationship.

    If the navigation property does not exist on the entity indicated by the request URL, the service returns 404 Not Found.

    If the relationship terminates on a collection, the response MUST be the format-specific representation of the collection of related entities. If no entities are related, the response is the format-specific representation of an empty collection.

    If the relationship terminates on a single entity, the response MUST be the format-specific representation of the related single entity. If no entity is related, the service returns 204 No Content.

    -

    Example 65: return the supplier of the product with ID=1 in the Products entity set

    +

    Example 65: return the supplier of the product with ID=1 in the Products entity set

    GET http://host/service/Products(1)/Supplier

    11.2.8 Requesting Entity References

    To request entity references in place of the actual entities, the client issues a GET request with /$ref appended to the resource path.

    If the resource path does not identify an entity or a collection of entities, the service returns 404 Not Found.

    -

    If the resource path identifies a collection, the response MUST be the format-specific representation of a collection of entity references pointing to the related entities. If no entities are related, the response is the format-specific representation of an empty collection. The response MAY contain an ETag header for the collection whose value changes if the collection of references changes, i.e. a reference is added or removed.

    -

    If the resource path identifies a single existing entity, the response MUST be the format-specific representation of an entity reference. The response MAY contain an ETag header which represents the identity of the referenced entity. If the resource path terminates in a single-valued navigation path, the ETag value changes if the relationship is changed and points to a different OData entity. If the resource path is the canonical path for a single entity, the returned ETag can never change.

    +

    If the resource path identifies a collection, the response MUST be the format-specific representation of a collection of entity references pointing to the related entities. If no entities are related, the response is the format-specific representation of an empty collection. The response MAY contain an ETag header for the collection whose value changes if the collection of references changes, i.e. a reference is added or removed.

    +

    If the resource path identifies a single existing entity, the response MUST be the format-specific representation of an entity reference. The response MAY contain an ETag header which represents the identity of the referenced entity. If the resource path terminates in a single-valued navigation path, the ETag value changes if the relationship is changed and points to a different OData entity. If the resource path is the canonical path for a single entity, the returned ETag can never change.

    If the resource path terminates on a single entity and no such entity exists, the service returns either 204 No Content or 404 Not Found.

    is equivalent to a request with the Accept header set to application/json; it requests the set of Order entities represented using the JSON media type with minimal metadata, as defined in OData-JSON.

    -

    In metadata document requests, the values application/xml and application/json, along with their subtypes and parameterized variants, as well as the format-specific abbreviations xml and json, are reserved for this specification.

    +

    In metadata document requests, the values application/xml and application/json, along with their subtypes and parameterized variants, as well as the format-specific abbreviations xml and json, are reserved for this specification.

    11.2.12 System Query Option $schemaversion

    The $schemaversion system query option MAY be included in any request. For a metadata document request the value of the $schemaversion system query option addresses a specific schema version. For all other request types the value specifies the version of the schema against which the request is made. The syntax of the $schemaversion system query option is defined in OData-ABNF.

    The value of the $schemaversion system query option MUST be a version of the schema as returned in the Core.SchemaVersion annotation, defined in OData-VocCore, of a previous request to the metadata document, or * in order to specify the current version of the metadata.

    If specified, the service MUST process the request according to the specified version of the metadata.

    Clients can retrieve the current version of the metadata by making a metadata document request with a $schemaversion system query option value of *, and SHOULD include the value from the returned Core.SchemaVersion annotation in the $schemaversion system query option of subsequent requests.

    -

    If the $schemaversion system query option is not specified in a request for the metadata document, the service MUST return a version of the metadata with no breaking changes over time, and the processing of all other requests that omit the $schemaversion system query option MUST be compatible with that "unversioned" schema. For more information on breaking changes, see Model Versioning.

    -

    If the $schemaversion system query option is specified on an individual request within a batch, then it specifies the version of the schema to apply to that individual request. Individual requests within a batch that don't include the $schemaversion system query option inherit the schema version of the overall batch request.

    -

    If the $schemaversion system query option is specified, but the version of the schema doesn't exist, the request is answered with a response code 404 Not Found. The response body SHOULD provide additional information.

    +

    If the $schemaversion system query option is not specified in a request for the metadata document, the service MUST return a version of the metadata with no breaking changes over time, and the processing of all other requests that omit the $schemaversion system query option MUST be compatible with that “unversioned” schema. For more information on breaking changes, see Model Versioning.

    +

    If the $schemaversion system query option is specified on an individual request within a batch, then it specifies the version of the schema to apply to that individual request. Individual requests within a batch that don’t include the $schemaversion system query option inherit the schema version of the overall batch request.

    +

    If the $schemaversion system query option is specified, but the version of the schema doesn’t exist, the request is answered with a response code 404 Not Found. The response body SHOULD provide additional information.

    11.3 Requesting Changes

    -

    Services advertise their change-tracking capabilities by annotating entity sets with the Capabilities.ChangeTracking term defined in OData-VocCap.

    +

    Services advertise their change-tracking capabilities by annotating entity sets with the Capabilities.ChangeTracking term defined in OData-VocCap.

    Any GET request to retrieve one or more entities MAY allow change-tracking.

    -

    Clients request that the service track changes to a result by specifying the track-changes preference on a request. If supported for the request, the service includes a Preference-Applied header in the response containing the track-changes preference and includes a delta link in a result for a single entity, and on the last page of results for a collection of entities in place of the next link.

    +

    Clients request that the service track changes to a result by specifying the track-changes preference on a request. If supported for the request, the service includes a Preference-Applied header in the response containing the track-changes preference and includes a delta link in a result for a single entity, and on the last page of results for a collection of entities in place of the next link.

    Delta links are opaque, service-generated links that the client uses to retrieve subsequent changes to a result.

    Delta links are based on a defining query that describes the set of results for which changes are being tracked; for example, the request that generated the results containing the delta link. The delta link encodes the collection of entities for which changes are being tracked, along with a starting point from which to track changes. OData services may use the reserved system query option $deltatoken when building delta links. Its content is opaque, service-specific, and must only follow the rules for URL query parts.

    @@ -1695,7 +1700,7 @@

    11.3.

    11.4 Data Modification

    Updatable OData services support Create, Update, and Delete operations for some or all exposed entities. Additionally, Actions supported by a service can affect the state of the system.

    A successfully completed Data Modification Request must not violate the integrity of the data.

    -

    The client may request whether content be returned from a Create, Update, or Delete request, or the invocation of an Action, by specifying the return Prefer header.

    +

    The client may request whether content be returned from a Create, Update, or Delete request, or the invocation of an Action, by specifying the return preference.

    11.4.1 Common Data Modification Semantics

    Data Modification Requests share the following semantics.

    11.4.1.1 Use of ETags for Avoiding Update Conflicts

    Each entity has its own ETag value that MUST change when structural properties or links from that entity have changed. In addition, modifying, adding, or deleting a contained entity MAY change the ETag of the parent entity.

    Collections of entities (including collections of related entities) MAY have their own ETag value whose semantics is service-specific. It typically changes if entities are added to or removed from the collection, or if an entity in the collection is changed. The ETag of a collection of related entities reached via a navigation property MAY differ from the ETag of the entity containing the navigation property.

    -

    A Data Modification Request on an existing resource or an Action Request invoking an action bound to an existing resource MAY require optimistic concurrency control. Services SHOULD announce this via annotations with the terms Core.OptimisticConcurrency in OData-VocCore and Capabilities.NavigationRestrictions (nested property OptimisticConcurrencyControl) in OData-VocCap.

    -

    If optimistic concurrency control is required for a resource, the service MUST include an ETag header in a response to a GET request to the resource, and MAY include the ETag in a format-specific manner in responses containing that resource.

    -

    The presence of an ETag header in a response does not imply in itself that the resource requires optimistic concurrency control; the ETag may just be used for caching and/or conditional GET requests.

    +

    A Data Modification Request on an existing resource or an Action Request invoking an action bound to an existing resource MAY require optimistic concurrency control. Services SHOULD announce this via annotations with the terms Core.OptimisticConcurrency in OData-VocCore and Capabilities.NavigationRestrictions (nested property OptimisticConcurrencyControl) in OData-VocCap.

    +

    If optimistic concurrency control is required for a resource, the service MUST include an ETag header in a response to a GET request to the resource, and MAY include the ETag in a format-specific manner in responses containing that resource.

    +

    The presence of an ETag header in a response does not imply in itself that the resource requires optimistic concurrency control; the ETag may just be used for caching and/or conditional GET requests.

    If an ETag value is specified in an If-Match or If-None-Match header of a Data Modification Request or Action Request, the operation MUST only be invoked if the If-Match or If-None-Match condition is satisfied.

    If the client does not specify an If-Match request header in a Data Modification Request or Action Request on a resource that requires optimistic concurrency control, the service responds with a 428 Precondition Required and MUST ensure that no observable change occurs as a result of the request. Clients can attempt to disable optimistic concurrency control by specifying If-Match with a value of *. Services MAY reject such requests.

    For requests including an OData-Version header value of 4.01, any ETag values specified in the request body of an update request MUST be * or match the current value for the record being updated.

    @@ -1733,7 +1738,7 @@

    Preference-Applied header if it does not return a representation.

    If one or more of these query options are present and the service returns a representation, then the service MUST apply the specified query options. If it cannot apply the specified query options appropriately, it MUST NOT fail the request solely due to the presence of these query options and instead MUST return 204 No Content.

    11.4.2 Create an Entity

    -

    To create an entity in a collection, the client sends a POST request to that collection's URL. The POST body MUST contain a single valid entity representation.

    +

    To create an entity in a collection, the client sends a POST request to that collection’s URL. The POST body MUST contain a single valid entity representation.

    The entity representation MAY include references to existing entities as well as content for new related entities, but MUST NOT contain content for existing related entities. The result of the operation is the entity with relationships to all included references to existing entities as well as all related entities created inline. If the key properties for an entity include key properties of a directly related entity, those related entities MUST be included either as references to existing entities or as content for new related entities.

    An entity may also be created as the result of an Upsert operation.

    If the target URL for the collection is a navigation link, the new entity is automatically linked to the entity containing the navigation link.

    @@ -1742,77 +1747,79 @@

    1

    If the entity being created is not an open entity, additional property values beyond those specified in the metadata SHOULD NOT be sent in the request body. The service MUST fail if unable to persist all property values specified in the request.

    Properties computed by the service (annotated with the term Core.Computed, see OData-VocCore) and properties that are tied to properties of the principal entity by a referential constraint, can be omitted and MUST be ignored if included in the request.

    Properties with a defined default value, nullable properties, and collection-valued properties omitted from the request are set to the default value, null, or an empty collection, respectively.

    -

    Upon successful completion, the response MUST contain a Location header that contains the edit URL or read URL of the created entity.

    -

    Upon successful completion the service MUST respond with either 201 Created and a representation of the created entity, or 204 No Content if the request included a Prefer header with a value of return=minimal and did not include the system query options $select and $expand.

    +

    Upon successful completion, the response MUST contain a Location header that contains the edit URL or read URL of the created entity.

    +

    Upon successful completion the service MUST respond with either 201 Created and a representation of the created entity, or 204 No Content if the request included a return=minimal preference and did not include the system query options $select and $expand.

    To create a new entity with links to existing entities in a single request, the client includes references to the related entities in the request body.

    The representation for referencing related entities is format-specific.

    -

    Example 76: using the JSON format, 4.0 clients can create a new manager entity with links to two existing employees by applying the odata.bind annotation to the DirectReports navigation property

    +

    Example 76: using the JSON format, 4.0 clients can create a new manager entity with links to an existing manager (of managers) and to two existing employees by applying the odata.bind annotation to the Manager and DirectReports navigation properties

    {
       "@odata.type":"#Northwind.Manager",
       "ID": 1,
       "FirstName": "Pat",
       "LastName": "Griswold",
    -  "DirectReports@odata.bind": [
    -    "http://host/service/Employees(5)",
    -    "http://host/service/Employees(6)"
    -  ]
    -}
    + "Manager@odata.bind": "http://host/service/Employees(0)", +  "DirectReports@odata.bind": [ +    "http://host/service/Employees(5)", +    "http://host/service/Employees(6)" +  ] +}
    -

    Example 77: using the JSON format, 4.01 clients can create a new manager entity with links to two existing employees by including the entity-ids within the DirectReports navigation property

    +

    Example 77: using the JSON format, 4.01 clients can create a new manager entity with links to an existing manager (of managers) and to two existing employees by including the entity-ids within the Manager and DirectReports navigation properties

    {
       "@type":"#Northwind.Manager",
       "ID": 1,
       "FirstName": "Pat",
       "LastName": "Griswold",
    -  "DirectReports": [
    -    {"@id": "Employees(5)"},
    -    {"@id": "Employees(6)"}
    -  ]
    -}
    + "Manager": { "@id": "Employees(0)" }, +  "DirectReports": [ +    {"@id": "Employees(5)"}, +    {"@id": "Employees(6)"} +  ] +}

    Upon successful completion of the operation, the service creates the requested entity and relates it to the requested existing entities.

    If the target URL for the collection the entity is created in and binding information provided in the POST body contradicts the implicit binding information provided by the request URL, the request MUST fail, and the service responds with 400 Bad Request.

    Upon failure of the operation, the service MUST NOT create the new entity. In particular, the service MUST never create an entity in a partially valid state (with the navigation property unset).

    -

    A request to create an entity that includes related entities, represented using the appropriate inline representation, is referred to as a "deep insert".

    -

    Media entities MUST contain the base64url-encoded representation of their media stream as a virtual property $value when nested within a deep insert.

    +

    A request to create an entity that includes related entities, represented using the appropriate inline representation, is referred to as a “deep insert”.

    +

    Media entities MUST contain the format-specific representation of their media stream as a virtual property $value when nested within a deep insert.

    Each included related entity is processed observing the rules for creating an entity as if it was posted against the original target URL extended with the navigation path to this related entity.

    On success, the service MUST create all entities and relate them. If the service responds with 201 Created, the response MUST be expanded to at least the level that was present in the deep-insert request.

    -

    Clients MAY associate an id with individual nested entities in the request by using the Core.ContentID term defined in OData-VocCore. Services that respond with 201 Created SHOULD annotate the entities in the response using the same Core.ContentID value as specified in the request. Services SHOULD advertise support for deep inserts, including support for returning the Core.ContentID, through the Capabilities.DeepInsertSupport term, defined in OData-VocCap; services that advertise support through Capabilities.DeepInsertSupport MUST return the Core.ContentID for the inserted or updated entities.

    +

    Clients MAY associate an id with individual nested entities in the request by applying the Core.ContentID term using the namespace or alias defined for the OData-VocCore vocabulary in the service’s $metadata document. Services that respond with 201 Created SHOULD annotate the entities in the response using the same Core.ContentID value as specified in the request. Services SHOULD advertise support for deep inserts, including support for returning the Core.ContentID, through the Capabilities.DeepInsertSupport term, defined in OData-VocCap; services that advertise support through Capabilities.DeepInsertSupport MUST return the Core.ContentID for the inserted or updated entities.

    The continue-on-error preference is not supported for deep insert operations.

    On failure, the service MUST NOT create any of the entities.

    11.4.3 Update an Entity

    To update an individual entity, the client makes a PATCH or PUT request to a URL that identifies the entity. Services MAY restrict updates only to requests addressing the edit URL of the entity.

    Services SHOULD support PATCH as the preferred means of updating an entity. PATCH provides more resiliency between clients and services by directly modifying only those values specified by the client.

    -

    The semantics of PATCH, as defined in RFC5789, is to merge the content in the request payload with the entity's current state, applying the update only to those components specified in the request body. Collection properties and primitive properties provided in the payload corresponding to updatable properties MUST replace the value of the corresponding property in the entity or complex type. Missing properties of the containing entity or complex property, including dynamic properties, MUST NOT be directly altered unless as a side effect of changes resulting from the provided properties.

    +

    The semantics of PATCH, as defined in RFC5789, is to merge the content in the request payload with the entity’s current state, applying the update only to those components specified in the request body. Collection properties and primitive properties provided in the payload corresponding to updatable properties MUST replace the value of the corresponding property in the entity or complex type. Complex properties are updated by applying PATCH semantics recursively, see also section 11.4.9.3. Missing properties of the containing entity or complex property, including dynamic properties, MUST NOT be directly altered unless as a side effect of changes resulting from the provided properties.

    Services MAY additionally support PUT but should be aware of the potential for data-loss in round-tripping properties that the client may not know about in advance, such as open or added properties, or properties not specified in metadata. Services that support PUT MUST replace all values of structural properties with those specified in the request body. Missing non-key, updatable structural properties not defined as dependent properties within a referential constraint MUST be set to their default values. Omitting a non-nullable property with no service-generated or default value from a PUT request results in a 400 Bad Request error. Missing dynamic structural properties MUST be removed or set to null.

    -

    For requests with an OData-Version header with a value of 4.01 or greater, the media stream of a media entity can be updated by specifying the base64url-encoded representation of the media stream as a virtual property $value.

    +

    For requests with an OData-Version header with a value of 4.01 or greater, the media stream of a media entity can be updated by specifying the format-specific representation of the media stream as a virtual property $value.

    Updating a dependent property that is tied to a key property of the principal entity through a referential constraint updates the relationship to point to the entity with the specified key value. If there is no such entity, the update fails.

    -

    Updating a principle property that is tied to a dependent entity through a referential constraint on the dependent entity updates the dependent property.

    +

    Updating a principal property that is tied to a dependent entity through a referential constraint on the dependent entity updates the dependent property.

    Key and other properties marked as read-only in metadata (including computed properties), as well as dependent properties that are not tied to key properties of the principal entity, can be omitted from the request. If the request contains a value for one of these properties, the service MUST ignore that value when applying the update. Services MUST return an error if an insert or update contains a new value for a property marked as updatable that cannot currently be changed by the user (i.e., given the state of the object or permissions of the user). The service MAY return success in this case if the specified value matches the value of the property. Clients SHOULD use PATCH and specify only those properties intended to be changed.

    Entity id and entity type cannot be changed when updating an entity. However, format-specific rules might in some cases require providing entity id and entity type values in the payload when applying the update.

    For requests with an OData-Version header with a value of 4.01 or greater, if the entity representation in the request body includes an ETag value, the update MUST NOT be performed and SHOULD return 412 Precondition Failed if the supplied ETag value is not * and does not match the current ETag value for the entity. ETag values in request bodies MUST be ignored for requests containing an OData-Version header with a value of 4.0.

    If an update specifies both a binding to a single-valued navigation property and a dependent property that is tied to a key property of the principal entity according to the same navigation property, then the dependent property is ignored, and the relationship is updated according to the value specified in the binding.

    If the entity being updated is open, then additional values for properties beyond those specified in the metadata or returned in a previous request MAY be sent in the request body. The service MUST treat these as dynamic properties.

    If the entity being updated is not open, then additional values for properties beyond those specified in the metadata or returned in a previous request SHOULD NOT be sent in the request body. The service MUST fail if it is unable to persist all updatable property values specified in the request.

    -

    Upon successful completion the service responds with either 200 OK and a representation of the updated entity, or 204 No Content. The client may request that the response SHOULD include a body by specifying a Prefer header with a value of return=representation, or by specifying the system query options $select or $expand. If the service uses ETags for optimistic concurrency control, the entities in the response MUST include ETags.

    +

    Upon successful completion the service responds with either 200 OK and a representation of the updated entity, or 204 No Content. The client may request that the response SHOULD include a body by specifying a return=representation preference, or by specifying the system query options $select or $expand. If the service uses ETags for optimistic concurrency control, the entities in the response MUST include ETags.

    Update requests with an OData-Version header with a value of 4.0 MUST NOT contain related entities as inline content. Such requests MAY contain binding information for navigation properties. For single-valued navigation properties this replaces the relationship. For collection-valued navigation properties this adds to the relationship.

    -

    Payloads with an OData-Version header with a value of 4.01 or greater MAY include nested entities and entity references that specify the full set of to be related entities, or a nested delta payload representing the related entities that have been added, removed, or changed. Such a request is referred to as a "deep update". If the nested collection is represented identical to an expanded navigation property, then the set of nested entities and entity references specified in a successful update request represents the full set of entities to be related according to that relationship and MUST NOT include added links, deleted links, or deleted entities.

    +

    Payloads with an OData-Version header with a value of 4.01 or greater MAY include nested entities and entity references that specify the full set of to be related entities, or a nested delta payload representing the related entities that have been added, removed, or changed. Such a request is referred to as a “deep update”. If the nested collection is represented identical to an expanded navigation property, then the set of nested entities and entity references specified in a successful update request represents the full set of entities to be related according to that relationship and MUST NOT include added links, deleted links, or deleted entities.

    -

    Example 78: using the JSON format, a 4.01 PATCH request can update a manager entity. Following the update, the manager has three direct reports; two existing employees and one new employee named Suzanne Brown. The LastName of employee 6 is updated to Smith.

    +

    Example 78: using the JSON format, a 4.01 PATCH request can update a manager entity. Following the update, the manager has three direct reports; two existing employees and one new employee named Suzanne Brown. The LastName of employee 6 is updated to Smith.

    {
       "@type":"#Northwind.Manager",
       "FirstName" : "Patricia",
       "DirectReports": [
         {
    -      "@id": "Employees(5}"
    +      "@id": "Employees(5)"
         },
         {
    -      "@id": "Employees(6}",
    +      "@id": "Employees(6)",
           "LastName": "Smith"
         },
         {
    @@ -1831,7 +1838,7 @@ 
    -

    Example 92: return all Customers whose City property returns "Western" when passed to the Sales.SalesRegion function

    +

    Example 95: return all Customers whose City property returns Western when passed to the Sales.SalesRegion function

    GET http://host/service/Customers?
           $filter=Sales.SalesRegion(City=$it/City) eq 'Western'

    A parameter alias can be used in place of an inline parameter value. The value for the alias is specified as a separate query option using the name of the parameter alias.

    -

    Example 93: invoke a Sales.EmployeesByManager function via the function import EmployeesByManager, passing 3 for the ManagerID parameter

    +

    Example 96: invoke a Sales.EmployeesByManager function via the function import EmployeesByManager, passing 3 for the ManagerID parameter

    GET http://host/service/EmployeesByManager(ManagerID=@p1)?@p1=3

    Services MAY in addition allow implicit parameter aliases for function imports and for functions that are the last path segment of the URL. An implicit parameter alias is the parameter name, optionally preceded by an at (@) sign. When using implicit parameter aliases, parentheses MUST NOT be appended to the function (import) name. The value for each parameter MUST be specified as a separate query option with the name of the parameter alias. If a parameter name is identical to a system query option name (without the optional $ prefix), the parameter name MUST be prefixed with an at (@) sign.

    -

    Example 94: invoke a Sales.EmployeesByManager function via the function import EmployeesByManager, passing 3 for the ManagerID parameter using the implicit parameter alias

    +

    Example 97: invoke a Sales.EmployeesByManager function via the function import EmployeesByManager, passing 3 for the ManagerID parameter using the implicit parameter alias

    GET http://host/service/EmployeesByManager?ManagerID=3
    -

    Non-binding parameters annotated with the term Core.OptionalParameter defined in OData-VocCore MAY be omitted. If it is annotated and the annotation specifies a DefaultValue, the omitted parameter is interpreted as having that default value. If omitted and the annotation does not specify a default value, the service is free on how to interpret the omitted parameter.

    +

    Non-binding parameters annotated with the term Core.OptionalParameter defined in OData-VocCore MAY be omitted. If it is annotated and the annotation specifies a DefaultValue, the omitted parameter is interpreted as having that default value. If omitted and the annotation does not specify a default value, the service is free on how to interpret the omitted parameter.

    11.5.4.2 Function overload resolution

    The same function name may be used multiple times within a schema, each with a different set of parameters. For unbound overloads the combination of the function name and the unordered set of parameter names MUST identify a particular function overload. For bound overloads the combination of the function name, the binding parameter type, and the unordered set of names of the non-binding parameters MUST identify a particular function overload.

    All unbound overloads MUST have the same return type. Also, all bound overloads with a given binding parameter type MUST have the same return type.

    @@ -2137,42 +2171,43 @@

    Services SHOULD avoid ambiguity, i.e. the combination of the function name, the unordered set of non-optional non-binding parameter names, plus the binding parameter type for bound overloads SHOULD identify a particular function overload. If there is ambiguity, then services MAY return 400 Bad Request with an error response body stating that the request was ambiguous.

    11.5.5 Actions

    -

    Actions are operations exposed by an OData service that MAY have side effects when invoked. Actions MAY return data but MUST NOT be further composed with additional path segments.

    +

    Actions are operations exposed by an OData service that MAY have side effects when invoked. Actions MAY return data but MUST NOT be further composed with additional path segments.

    11.5.5.1 Invoking an Action

    To invoke an action bound to a resource, the client issues a POST request to an action URL. An action URL may be obtained from a previously returned entity representation or constructed by appending the namespace- or alias-qualified action name to a URL that identifies a resource whose type is the same as, or derives from, the type of the binding parameter of the action. The value for the binding parameter is the resource identified by the URL preceding the action name, and only the non-binding parameter values are passed in the request body according to the particular format.

    -

    Services MAY additionally support invoking actions using the unqualified action name by defining one or more default namespaces through the Core.DefaultNamespace term defined in  OData-VocCore.

    +

    Services MAY additionally support invoking actions using the unqualified action name by defining one or more default namespaces through the Core.DefaultNamespace term defined in  OData-VocCore.

    To invoke an action through an action import, the client issues a POST request to a URL identifying the action import. The canonical URL for an action import is the service root, followed by the name of the action import. When invoking an action through an action import all parameter values MUST be passed in the request body according to the particular format.

    -

    Non-binding parameters that are nullable or annotated with the term Core.OptionalParameter defined in OData-VocCore MAY be omitted from the request body. If an omitted parameter is not annotated (and thus nullable), it MUST be interpreted as having the null value. If it is annotated and the annotation specifies a DefaultValue, the omitted parameter is interpreted as having that default value. If omitted and the annotation does not specify a default value, the service is free on how to interpret the omitted parameter. Note: a nullable non-binding parameter is equivalent to being annotated as optional with a default value of null.

    +

    Non-binding parameters that are nullable or annotated with the term Core.OptionalParameter defined in OData-VocCore MAY be omitted from the request body. If an omitted parameter is not annotated (and thus nullable), it MUST be interpreted as having the null value. If it is annotated and the annotation specifies a DefaultValue, the omitted parameter is interpreted as having that default value. If omitted and the annotation does not specify a default value, the service is free on how to interpret the omitted parameter. Note: a nullable non-binding parameter is equivalent to being annotated as optional with a default value of null.

    4.01 services MUST support invoking actions with no non-binding parameters and parameterless action imports both without a request body and with a request body representing no parameters, according to the particular format. Interoperable clients SHOULD always include a request body, even when invoking actions with no non-binding parameters and parameterless action imports.

    If the action returns results, the client SHOULD use content type negotiation to request the results in the desired format, otherwise the default content type will be used.

    -

    The client can request whether any results from the action be returned using the return Prefer header.

    -

    Actions that create and return a single entity follow the rules for entity creation and return a Location header that contains the edit URL or read URL of the created entity.

    +

    The client can request whether any results from the action be returned using the return preference.

    +

    Actions that create and return a single entity follow the rules for entity creation and return a Location header that contains the edit URL or read URL of the created entity.

    +

    If the action returns a value of type Edm.Stream, the response to the POST request follows the rules for requesting stream properties.

    Actions without a return type respond with 204 No Content on success.

    -

    To request processing of the action only if the binding parameter value, an entity or collection of entities, is unmodified, the client includes the If-Match header with the latest known ETag value for the entity or collection of entities. The ETag value for a collection as a whole is transported in the ETag header of a collection response.

    -
    -

    Example 95: invoke the SampleEntities.CreateOrder action using /Customers('ALFKI') as the customer (or binding parameter). The values 2 for the quantity parameter and BLACKFRIDAY for the discountCode parameter are passed in the body of the request. Invoke the action only if the customer's ETag still matches.

    -
    POST http://host/service/Customers('ALFKI')/SampleEntities.CreateOrder
    -If-Match: W/"MjAxOS0wMy0yMVQxMzowNVo="`
    -Content-Type: application/json
    -
    -{
    -  "items": [
    -    { "product": 4001, "quantity": 2 },
    -    { "product": 7062, "quantity": 1 },
    -  ],
    -  "discountCode": "BLACKFRIDAY"
    -}
    +

    To request processing of the action only if the binding parameter value, an entity or collection of entities, is unmodified, the client includes the If-Match header with the latest known ETag value for the entity or collection of entities. The ETag value for a collection as a whole is transported in the ETag header of a collection response.

    +
    +

    Example 98: invoke the SampleEntities.CreateOrder action using Customers('ALFKI') as the customer (or binding parameter). The values 2 for the quantity parameter and BLACKFRIDAY for the discountCode parameter are passed in the body of the request. Invoke the action only if the customer’s ETag still matches.

    +
    POST http://host/service/Customers('ALFKI')/SampleEntities.CreateOrder
    +If-Match: W/"MjAxOS0wMy0yMVQxMzowNVo="
    +Content-Type: application/json
    +
    +{
    +  "items": [
    +    { "product": 4001, "quantity": 2 },
    +    { "product": 7062, "quantity": 1 },
    +  ],
    +  "discountCode": "BLACKFRIDAY"
    +}

    11.5.5.2 Action Overload Resolution

    The same action name may be used multiple times within a schema provided there is at most one unbound overload, and each bound overload specifies a different binding parameter type.

    If the action is bound and the binding parameter type is part of an inheritance hierarchy, the action overload is selected based on the type of the URL segment preceding the action name. A type-cast segment can be used to select an action defined on a particular type in the hierarchy, see OData-URL.

    11.6 Asynchronous Requests

    -

    A Prefer header with a respond-async preference allows clients to request that the service process a Data Service Request asynchronously.

    +

    A Prefer header with a respond-async preference allows clients to request that the service process a Data Service Request asynchronously.

    If the client has specified respond-async in the request, the service MAY process the request asynchronously and return a 202 Accepted response. A service MUST NOT reply to a Data Service Request with 202 Accepted if the request has not included the respond-async preference.

    -

    Responses that return 202 Accepted MUST include a Location header pointing to a status monitor resource that represents the current state of the asynchronous processing in addition to an optional Retry-After header indicating the time, in seconds, the client should wait before querying the service for status. Services MAY include a response body, for example, to provide additional status information.

    -

    A GET request to the status monitor resource again returns 202 Accepted response if the asynchronous processing has not finished. This response MUST again include a Location header and MAY include a Retry-After header to be used for a subsequent request. The Location header and optional Retry-After header may or may not contain the same values as returned by the previous request.

    +

    Responses that return 202 Accepted MUST include a Location header pointing to a status monitor resource that represents the current state of the asynchronous processing in addition to an optional Retry-After header indicating the time, in seconds, the client should wait before querying the service for status. Services MAY include a response body, for example, to provide additional status information.

    +

    A GET request to the status monitor resource again returns 202 Accepted response if the asynchronous processing has not finished. This response MUST again include a Location header and MAY include a Retry-After header to be used for a subsequent request. The Location header and optional Retry-After header may or may not contain the same values as returned by the previous request.

    A GET request to the status monitor resource returns 200 OK once the asynchronous processing has completed. For OData 4.01 and greater responses, or OData 4.0 requests that include an Accept header that does not specify application/http, the response MUST include the AsyncResult response header. Any other headers, along with the response body, represent the result of the completed asynchronous operation. If the GET request to the status monitor includes an OData-MaxVersion header with a value of 4.0 and no Accept header, or an Accept header that includes application/http, then the body of the final 200 OK response MUST be represented as an HTTP message, as described in RFC7230, which is the full HTTP response to the completed asynchronous operation.

    -

    A DELETE request sent to the status monitor resource requests that the asynchronous processing be canceled. A 200 OK or a 204 No Content response indicates that the asynchronous processing has been successfully canceled. A client can request that the DELETE should be executed asynchronously. A 202 Accepted response indicates that the cancellation is being processed asynchronously; the client can use the returned Location header (which MUST be different from the status monitor resource of the initial request) to query for the status of the cancellation. If a delete request is not supported by the service, the service returns 405 Method Not Allowed.

    +

    A DELETE request sent to the status monitor resource requests that the asynchronous processing be canceled. A 200 OK or a 204 No Content response indicates that the asynchronous processing has been successfully canceled. A client can request that the DELETE should be executed asynchronously. A 202 Accepted response indicates that the cancellation is being processed asynchronously; the client can use the returned Location header (which MUST be different from the status monitor resource of the initial request) to query for the status of the cancellation. If a delete request is not supported by the service, the service returns 405 Method Not Allowed.

    After a successful DELETE request against the status monitor resource, any subsequent GET requests for the same status monitor resource returns 404 Not Found.

    If an asynchronous request is cancelled for reasons other than the consumers issuing a DELETE request against the status monitor resource, a GET request to the status monitor resource returns 200 OK with a response body containing a single HTTP response with a status code in the 5xx Server Error range indicating that the operation was cancelled.

    The service MUST ensure that no observable change has occurred as a result of a canceled request.

    @@ -2186,8 +2221,8 @@

    11.7 B

    11.7.1 Batch Request Headers

    A batch request using the multipart batch format MUST contain a Content-Type header specifying a content type of multipart/mixed and a boundary parameter as defined in RFC2046.

    -

    Example 96: multipart batch request

    -
    POST /service/$batch HTTP/1.1`
    +

    Example 99: multipart batch request

    +
    POST /service/$batch HTTP/1.1
     Host: odata.org
     OData-Version: 4.0
     Content-Type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77b
    @@ -2196,7 +2231,7 @@ 

    -

    Example 97: JSON batch request

    +

    Example 100: JSON batch request

    POST /service/$batch HTTP/1.1
     Host: odata.org
     OData-Version: 4.01
    @@ -2216,8 +2251,8 @@ 

    OData-ABNF.

    The representation of the request identifier is format-specific, as are the rules for which individual requests require an identifier.

    11.7.4 Referencing Returned Entities

    -

    Entities created by an insert request can be referenced in the request URL of subsequent requests by using the request identifier prefixed with a $ character as the first segment of the request URL. If the Location header in the response contains a relative URL, clients MUST be able to resolve it relative to the request's URL even if that contains such a reference.

    -

    If the $-prefixed request identifier is identical to the name of a top-level system resource ($batch, $crossjoin, $all, $entity, $root, $id, $metadata, or other system resources defined according to the OData-Version of the protocol specified in the request), then the reference to the top-level system resource is used. This collision can be avoided by e.g. using only numeric request identifiers.

    +

    Entities created by an insert request can be referenced in the request URL of subsequent requests by using the request identifier prefixed with a $ character as the first segment of the request URL. If the Location header in the response contains a relative URL, clients MUST be able to resolve it relative to the request’s URL even if that contains such a reference.

    +

    If the $-prefixed request identifier is identical to the name of a top-level system resource ($batch, $crossjoin, $all, $entity, $root, $id, $metadata, or other system resources defined according to the OData-Version of the protocol specified in the request), then the reference to the top-level system resource is used. This collision can be avoided by e.g. using only numeric request identifiers.

    Services MAY also support referencing within request bodies, in which case they SHOULD advertise this support by specifying the ReferencesInRequestBodiesSupported property in the Capabilities.BatchSupport term applied to the entity container, see OData-VocCap.

    11.7.5 Referencing the ETag of an Entity

    Services MAY support the use of an ETag returned from a previous operation in an If-Match or If-None-Match header of a subsequent statement. Services SHOULD advertise this support by specifying the EtagReferencesSupported property in the Capabilities.BatchSupport annotation term applied to the entity container, see OData-VocCap.

    @@ -2238,14 +2273,14 @@

    Absolute URI with schema, host, port, and absolute resource path.
    -

    Example 98:

    -
    GET https://host:1234/path/service/People(1) HTTP/1.1 ```
    +

    Example 101:

    +
    GET https://host:1234/path/service/People(1) HTTP/1.1
    • Absolute resource path and separate Host header
    -

    Example 99:

    +

    Example 102:

    GET /path/service/People(1) HTTP/1.1
     Host: myserver.mydomain.org:1234
    @@ -2253,7 +2288,7 @@

    Resource path relative to the batch request URI.
    -

    Example 100:

    +

    Example 103:

    GET People(1) HTTP/1.1

    Services MUST support all three formats for URLs of individual requests.

    @@ -2265,7 +2300,7 @@

    Processors of batch requests MAY choose to disallow additional HTTP constructs in HTTP requests serialized within body parts. For example, a processor may choose to disallow chunked encoding to be used by such HTTP requests.

    -

    Example 101: a batch request that contains the following individual requests in the order listed

    +

    Example 104: a batch request that contains the following individual requests in the order listed

    1. A query request
    2. A change set that contains the following requests: @@ -2328,7 +2363,7 @@

      11.7.7.2 Referencing New Entities

      Entities created by an Insert request can be referenced in the request URL of subsequent requests within the same change set. Services MAY also support referencing across change sets, in which case they SHOULD advertise this support by specifying the ReferencesAcrossChangeSetsSupported property in the Capabilities.BatchSupport term applied to the entity container, see OData-VocCap.

      -

      Example 102: a batch request that contains the following operations in the order listed:

      +

      Example 105: a batch request that contains the following operations in the order listed:

      A change set that contains the following requests:

      • Insert a new entity (with Content-ID = 1)
      • @@ -2367,45 +2402,45 @@

        11.7.7.3 Referencing an ETag

        -

        Example 103: a batch request that contains the following operations in the order listed:

        +

        Example 106: a batch request that contains the following operations in the order listed:

        • Get an Employee (with Content-ID = 1)
        • Update the salary only if the employee has not changed
        -
        POST /service/$batch HTTP/1.1
        -Host: host
        -OData-Version: 4.0
        -Content-Type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77b
        -Content-Length: ###
        -
        ---batch_36522ad7-fc75-4b56-8c71-56071383e77b
        -Content-Type: application/http
        -Content-ID: 1
        -
        -GET /service/Employees(0) HTTP/1.1
        -Host: host Accept: application/json
        -
        -
        ---batch_36522ad7-fc75-4b56-8c71-56071383e77b
        -Content-Type: application/http
        -Content-ID: 2
        -
        -PATCH /service/Employees(0) HTTP/1.1
        -Host: host
        -Content-Type: application/json
        -Content-Length: ###
        -If-Match: $1
        -
        -{
        -   "Salary": 75000
        -}
        ---batch_36522ad7-fc75-4b56-8c71-56071383e77b--
        +
        POST /service/$batch HTTP/1.1
        +Host: host
        +OData-Version: 4.0
        +Content-Type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77b
        +Content-Length: ###
        +
        +--batch_36522ad7-fc75-4b56-8c71-56071383e77b
        +Content-Type: application/http
        +Content-ID: 1
        +
        +GET /service/Employees(0) HTTP/1.1
        +Host: host Accept: application/json
        +
        +
        +--batch_36522ad7-fc75-4b56-8c71-56071383e77b
        +Content-Type: application/http
        +Content-ID: 2
        +
        +PATCH /service/Employees(0) HTTP/1.1
        +Host: host
        +Content-Type: application/json
        +Content-Length: ###
        +If-Match: $1
        +
        +{
        +   "Salary": 75000
        +}
        +--batch_36522ad7-fc75-4b56-8c71-56071383e77b--

        11.7.7.4 Processing a Multipart Batch Request

        The service MUST process the individual requests and change sets within a multipart batch request in the order received. Processing stops on the first error unless the continue-on-error preference is specified with an explicit or implicit value of true.

        All requests in a change set represent a single change unit so a service MUST successfully process and apply all the requests in the change set or else apply none of them. It is up to the service implementation to define rollback semantics to undo any requests within a change set that may have been applied before another request in that same change set failed and thereby apply this all-or-nothing requirement. The service MAY execute the requests within a change set in any order and MAY return the responses to the individual requests in any order. If a request specifies a request identifier, the service MUST include the Content-ID header with the request identifier in the corresponding response so clients can correlate requests and responses.

        11.7.7.5 Multipart Batch Response

        -

        A multipart response to a batch request MUST contain a Content-Type header with value multipart/mixed.

        +

        A multipart response to a batch request MUST contain a Content-Type header with value multipart/mixed.

        The body of a multipart response to a multipart batch request MUST structurally match one-to-one with the multipart batch request body, such that the same multipart message structure defined for requests is used for responses. There are three exceptions to this rule:

        • When a request within a change set fails, the change set response is not represented using the multipart/mixed media type. Instead, a single response, using the application/http media type, is returned that applies to all requests in the change set and MUST be a valid OData error response.
        • @@ -2415,7 +2450,7 @@

          Data Service Requests. Relative URLs in each individual response are relative to the request URL of the corresponding individual request. URLs in responses MUST NOT contain $-prefixed request identifiers.

          -

          Example 104: referencing the batch request example 101 above, assume all the requests except the final query request succeed. In this case the response would be

          +

          Example 107: referencing the batch request example 101 above, assume all the requests except the final query request succeed. In this case the response would be

          HTTP/1.1 200 Ok
           OData-Version: 4.0
           Content-Length: ####
          @@ -2467,7 +2502,7 @@ 

          A service MAY return interim results to an asynchronously executing batch. It does this by responding with 200 OK to a GET request to the monitor resource and including a 202 Accepted response as the last part of the multipart response. The client can use the monitor URL returned in this 202 Accepted response to continue processing the batch response.

          Since a change set is executed atomically, 202 Accepted MUST NOT be returned within a change set.

          -

          Example 105: referencing the example 101 above again, assume that

          +

          Example 108: referencing the example 101 above again, assume that

          HTTP/1.1 202 Accepted
           Location: http://service-root/async-monitor-0
           Retry-After: ###
          @@ -2601,7 +2636,7 @@ 

          section 11.2.5.1)
        • MUST support casting to a derived type according to OData-URL if derived types are present in the model
        • MUST support $top (section 11.2.6.3)
        • -
        • MUST support /$value on media entities (section 11.1.2) and individual properties (section 11.2.4.1)
        • +
        • MUST support /$value on media entities (section 11.1.2) and individual properties (section 11.2.4.2)
        • MUST support $filter (section 11.2.6.1)
          1. MUST support eq, ne filter operations on properties of entities in the requested entity set (section 11.2.6.1.1)
          2. @@ -2631,13 +2666,13 @@

            OData-URL)
          3. MUST support the $skip system query option (section 11.2.6.4)
          4. MUST support the $count system query option (section 11.2.6.5)
          5. -
          6. MUST support $orderby asc and desc on individual properties (section 11.2.6.2)
          7. +
          8. MUST support $orderby with asc and desc on individual properties (section 11.2.6.2)
          9. MUST support $expand (section 11.2.5.2)
            1. MUST support returning references for expanded properties
            2. MUST support $filter on expanded collection-valued properties
            3. MUST support cast segment in expand with derived types
            4. -
            5. SHOULD support $orderby asc and desc on expanded collection-valued properties
            6. +
            7. SHOULD support $orderby with asc and desc on expanded collection-valued properties
            8. SHOULD support $count on expanded collection-valued properties
            9. SHOULD support $top and $skip on expanded collection-valued properties
            10. SHOULD support $search on expanded collection-valued properties
            11. @@ -2713,7 +2748,7 @@

              OData 4.01 Minimal Conformance Level
            12. MUST conform to the OData 4.0 Intermediate Conformance Level
            13. MUST support eq/ne null comparison for navigation properties with a maximum cardinality of one
            14. -
            15. MUST support the in operator
            16. +
            17. MUST support the in operator
            18. MUST support the $select option nested within $select
            19. SHOULD support the count of a filtered collection in a common expression
            20. SHOULD support equal and non-equal structural comparison
            21. @@ -2732,7 +2767,7 @@

            22. MUST support $filter on selected collection-valued properties
            23. -
            24. SHOULD support $orderby asc and desc on selected collection-valued properties
            25. +
            26. SHOULD support $orderby with asc and desc on selected collection-valued properties
            27. SHOULD support the $count on selected collection-valued properties
            28. SHOULD support $top and $skip on selected collection-valued properties
            29. SHOULD support $search on selected collection-valued properties
            30. @@ -2761,11 +2796,11 @@

              MAY support deleted entities, link entities, deleted link entities in a delta response (section 11.3)
            31. MAY support asynchronous responses (section 11.6)
            32. MAY support metadata=minimal in a JSON response (see OData-JSON)
            33. -
            34. MAY support streaming in a JSON response (see OData-JSON)
            35. +
            36. MAY support streaming in a JSON response (see OData-JSON)

            In addition, interoperable OData 4.01 clients

              -
            1. MUST send OData 4.0-compliant payloads to services that don't advertise support for 4.01 or greater through the Core.ODataVersions metadata annotation (see OData-VocCore)
            2. +
            3. MUST send OData 4.0-compliant payloads to services that don’t advertise support for 4.01 or greater through the Core.ODataVersions metadata annotation (see OData-VocCore)
            4. MUST specify identifiers in payloads and URLs in the case they are specified in $metadata
            5. MUST be prepared to receive any valid 4.01 CSDL
            6. MUST be prepared to receive any valid 4.01 response according to the requested format
            7. @@ -2779,57 +2814,54 @@

              [OData-ABNF]

              ABNF components: OData ABNF Construction Rules Version 4.02 and OData ABNF Test Cases.
              -See link in "Related work" section on cover page.

              +See link in “Related work” section on cover page.

              [OData-Aggregation]

              OData Extension for Data Aggregation Version 4.02.
              -See link in "Related work" section on cover page.

              +See link in “Related work” section on cover page.

              [OData-CSDL]

              OData Common Schema Definition Language (CSDL) JSON Representation Version 4.02.
              -See link in "Related work" section on cover page.

              +See link in “Related work” section on cover page.

              OData Common Schema Definition Language (CSDL) XML Representation Version 4.02.
              -See link in "Related work" section on cover page.

              +See link in “Related work” section on cover page.

              [OData-JSON]

              OData JSON Format Version 4.02.
              -See link in "Related work" section on cover page.

              +See link in “Related work” section on cover page.

              [OData-URL]

              OData Version 4.02. Part 2: URL Conventions.
              -See link in "Related work" section on cover page.

              +See link in “Related work” section on cover page.

              [OData-VocCap]

              OData Vocabularies Version 4.0: Capabilities Vocabulary.
              -See link in "Related work" section on cover page.

              +See link in “Related work” section on cover page.

              [OData-VocCore]

              OData Vocabularies Version 4.0: Core Vocabulary.
              -See link in "Related work" section on cover page.

              +See link in “Related work” section on cover page.

              [RFC2046]
              -

              Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types", RFC 2046, November 1996 https://tools.ietf.org/html/rfc2046.

              +

              Freed, N. and N. Borenstein, “Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types”, RFC 2046, DOI 10.17487/RFC2046, November 1996. https://www.rfc-editor.org/info/rfc2046.

              [RFC2119]
              -

              https://www.rfc-editor.org/info/rfc2119.

              +

              Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels”, BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997. https://www.rfc-editor.org/info/rfc2119.

              [RFC3987]
              -

              Duerst, M. and, M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC 3987, January 2005 https://tools.ietf.org/html/rfc3987.

              +

              Duerst, M. and M. Suignard, “Internationalized Resource Identifiers (IRIs)”, RFC 3987, DOI 10.17487/RFC3987, January 2005. https://www.rfc-editor.org/info/rfc3987.

              [RFC5646]
              -

              Phillips, A., Ed., and M. Davis, Ed., "Tags for Identifying Languages", BCP 47, RFC 5646, September 2009 http://tools.ietf.org/html/rfc5646.

              +

              Phillips, A., Ed., and M. Davis, Ed., “Tags for Identifying Languages”, BCP 47, RFC 5646, DOI 10.17487/RFC5646, September 2009. https://www.rfc-editor.org/info/rfc5646.

              [RFC5789]
              -

              Dusseault, L., and J. Snell, "Patch Method for HTTP", RFC 5789, March 2010 http://tools.ietf.org/html/rfc5789.

              -
              [RFC7493]
              -

              Bray, T., Ed., "The I-JSON Message Format", RFC7493, March 2015 https://tools.ietf.org/html/rfc7493.

              +

              Dusseault, L. and J. Snell, “PATCH Method for HTTP”, RFC 5789, DOI 10.17487/RFC5789, March 2010. https://www.rfc-editor.org/info/rfc5789.

              [RFC7230]
              -

              Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, June 2014 https://tools.ietf.org/html/rfc7230.

              +

              Fielding, R., Ed., and J. Reschke, Ed., “Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing”, RFC 7230, DOI 10.17487/RFC7230, June 2014. https://www.rfc-editor.org/info/rfc7230.

              [RFC7231]
              -

              Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", RFC 7231, June 2014 https://tools.ietf.org/html/rfc7231.

              +

              Fielding, R., Ed., and J. Reschke, Ed., “Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content”, RFC 7231, DOI 10.17487/RFC7231, June 2014. https://www.rfc-editor.org/info/rfc7231.

              [RFC7232]
              -

              Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests", RFC 7232, June 2014 https://tools.ietf.org/html/rfc7232.

              +

              Fielding, R., Ed., and J. Reschke, Ed., “Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests”, RFC 7232, DOI 10.17487/RFC7232, June 2014. https://www.rfc-editor.org/info/rfc7232.

              [RFC7240]
              -

              Snell, J., "Prefer Header for HTTP", RFC 7240, June 2014 https://tools.ietf.org/html/rfc7240.

              +

              Snell, J., “Prefer Header for HTTP”, RFC 7240, DOI 10.17487/RFC7240, June 2014. https://www.rfc-editor.org/info/rfc7240.

              [RFC7617]
              -

              Reschke, J., "The 'Basic' HTTP Authentication Scheme", RFC 7617, September 2015 https://tools.ietf.org/html/rfc7617.

              +

              Reschke, J., “The ‘Basic’ HTTP Authentication Scheme”, RFC 7617, DOI 10.17487/RFC7617, September 2015. https://www.rfc-editor.org/info/rfc7617.

              [RFC8174]
              -

              Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017
              -https://www.rfc-editor.org/info/rfc8174.

              +

              Leiba, B., “Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words”, BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017. https://www.rfc-editor.org/info/rfc8174.

              A.2 Informative References

              [ECMAScript]

              ECMAScript 2023 Language Specification, 14th Edition, June 2023. Standard ECMA-262. https://www.ecma-international.org/publications-and-standards/standards/ecma-262/.

              [GeoJSON-2008]
              -

              Butler, H., Daly, M., Doyle, A., Gillies, S., Schaub, T., and C. Schmidt, "The GeoJSON Format Specification", June 2008 http://geojson.org/geojson-spec.html.

              +

              Butler, H., Daly, M., Doyle, A., Gillies, S., Schaub, T., and C. Schmidt, “The GeoJSON Format Specification”, June 2008 http://geojson.org/geojson-spec.html.


              Appendix B. Safety, Security and Privacy Considerations

              This section is provided as a service to the application developers, information providers, and users of OData version 4.0 giving some references to starting points for securing OData services as specified. OData is a REST-full multi-format service that depends on other services and thus inherits both sides of the coin, security enhancements and concerns alike from the latter.

              @@ -2990,14 +3022,14 @@

              Appendix E. Notice

              Copyright © OASIS Open 2023. All Rights Reserved.

              -

              All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The full Policy may be found at the OASIS website.

              +

              All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the “OASIS IPR Policy”). The full Policy may be found at the OASIS website.

              This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published, and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this section are included on all such copies and derivative works. However, this document itself may not be modified in any way, including by removing the copyright notice or references to OASIS, except as needed for the purpose of developing any document or deliverable produced by an OASIS Technical Committee (in which case the rules applicable to copyrights, as set forth in the OASIS IPR Policy, must be followed) or as required to translate it into languages other than English.

              The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.

              -

              This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

              +

              This document and the information contained herein is provided on an “AS IS” basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

              As stated in the OASIS IPR Policy, the following three paragraphs in brackets apply to OASIS Standards Final Deliverable documents (Committee Specification, Candidate OASIS Standard, OASIS Standard, or Approved Errata).

              [OASIS requests that any OASIS Party or any other party that believes it has patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable, to notify OASIS TC Administrator and provide an indication of its willingness to grant patent licenses to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this deliverable.]

              [OASIS invites any party to contact the OASIS TC Administrator if it is aware of a claim of ownership of any patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable by a patent holder that is not willing to provide a license to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this OASIS Standards Final Deliverable. OASIS may include such claims on its website, but disclaims any obligation to do so.]

              -

              [OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS' procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

              -

              The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark/ for above guidance.

              +

              [OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS’ procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

              +

              The name “OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark/ for above guidance.

              diff --git a/docs/odata-protocol/odata-protocol.md b/docs/odata-protocol/odata-protocol.md index 1dce358ec..aa835ab62 100644 --- a/docs/odata-protocol/odata-protocol.md +++ b/docs/odata-protocol/odata-protocol.md @@ -62,7 +62,7 @@ The Open Data Protocol (OData) enables the creation of REST-based data services, #### Status: This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical. -TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "[Send A Comment](https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=odata)" button on the TC's web page at https://www.oasis-open.org/committees/odata/. +TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/. This specification is provided under the [RF on RAND Terms Mode](https://www.oasis-open.org/policies-guidelines/ipr/#RF-on-RAND-Mode) of the [OASIS IPR Policy](https://www.oasis-open.org/policies-guidelines/ipr/), the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php). @@ -204,7 +204,8 @@ For complete copyright information please see the full Notices section in an App - [11.2.2 Requesting Individual Entities](#RequestingIndividualEntities) - [11.2.3 Requesting the Media Stream of a Media Entity using `$value`](#RequestingtheMediaStreamofaMediaEntityusingvalue) - [11.2.4 Requesting Individual Properties](#RequestingIndividualProperties) - - [11.2.4.1 Requesting a Property's Raw Value using `$value`](#RequestingaPropertysRawValueusingvalue) + - [11.2.4.1 Requesting Stream Properties](#RequestingStreamProperties) + - [11.2.4.2 Requesting a Property's Raw Value using `$value`](#RequestingaPropertysRawValueusingvalue) - [11.2.5 Specifying Properties to Return](#SpecifyingPropertiestoReturn) - [11.2.5.1 System Query Option `$select`](#SystemQueryOptionselect) - [11.2.5.2 System Query Option `$expand`](#SystemQueryOptionexpand) @@ -375,7 +376,7 @@ All other text is normative unless otherwise labeled. Here is a customized command line which will generate HTML from this markdown file (named `odata-v4.02-csd01-part1-protocol.md`). Line breaks are added for readability only: ``` -pandoc -f gfm+tex_math_dollars+fenced_divs +pandoc -f gfm+tex_math_dollars+fenced_divs+smart -t html -o odata-v4.02-csd01-part1-protocol.html -c styles/markdown-styles-v1.7.3b.css @@ -900,7 +901,7 @@ or [stream property](#ManagingStreamProperties), in which case the The specified format MAY include format parameters. Clients MUST be prepared for the service to return custom format parameters not defined in OData and SHOULD NOT expect that such format parameters can be -ignored. Custom format parameters MUST NOT start with "odata" and +ignored. Custom format parameters MUST NOT start with `odata` and services MUST NOT require generic OData consumers to understand custom format parameters in order to correctly interpret the payload. @@ -911,7 +912,7 @@ parameters within the `Content-Type` header. As defined in [RFC7231](#rfc7231), the `Content-Encoding` header field is used as a modifier to the media-type (as indicated in the -`Content-Type`). When present, its value indicates what additional +`Content-Type` header). When present, its value indicates what additional content codings have been applied to the entity-body. A service MAY specify a list of acceptable content codings using an annotation with term @@ -1007,7 +1008,7 @@ If the media type specified in the `Accept` header does not include a contain a `charset` format parameter. The service SHOULD NOT add any format parameters to the `Content-Type` -parameter not specified in the `Accept` header. +header not specified in the `Accept` header. If the `Accept` header is specified on an individual request within a batch, then it specifies the acceptable formats for that individual @@ -1044,7 +1045,7 @@ As defined in [RFC7232](#rfc7232), a client MAY include an value previously retrieved for the resource, or `*` to match any value. If an operation on an existing resource requires an ETag, (see term -[`Core.OptimisticConcurrency`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptimisticConcurrency)` `in +[`Core.OptimisticConcurrency`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptimisticConcurrency) in [OData-VocCore](#ODataVocCore) and property `OptimisticConcurrencyControl` of type [`Capabilities.NavigationPropertyRestriction`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Capabilities.V1.md#NavigationPropertyRestriction) @@ -1057,7 +1058,7 @@ occurs as a result of the request. If present, the request MUST only be processed if the specified ETag value matches the current ETag value of the target resource. Services -sending [`ETag` headers](#HeaderETag) with weak ETags that only depend +sending [`ETag`](#HeaderETag) headers with weak ETags that only depend on the representation-independent entity state MUST use the weak comparison function because it is sufficient to prevent accidental overwrites. This is a deviation from [RFC7232](#rfc7232). @@ -1254,14 +1255,14 @@ If the service applies the `callback` preference it MUST include the When the `callback` preference is applied to asynchronous requests, the OData service invokes the callback endpoint once it has finished processing the request. The status monitor resource, returned in the -[`Location` header](#HeaderLocation) of the previously returned +[`Location`](#HeaderLocation) header of the previously returned [`202 Accepted`](#ResponseCode202Accepted) response, can then be used to retrieve the results of the asynchronously executed request. When the `callback` preference is specified on a `GET` request to a delta link and there are no changes available, the OData service returns -a [`202 Accepted`](#ResponseCode202Accepted) response with a [`Location` -header](#HeaderLocation) specifying the delta link to be used to check +a [`202 Accepted`](#ResponseCode202Accepted) response with a +[`Location`](#HeaderLocation) header specifying the delta link to be used to check for future updates. The OData service then invokes the specified callback endpoint once new changes become available. @@ -1365,7 +1366,7 @@ Prefer: include-annotations="-*" ::: example Example 5: a `Prefer` header requesting that all annotations defined -under the "display" namespace (recursively) be returned +under the `display` namespace (recursively) be returned ``` Prefer: include-annotations="display.*" ``` @@ -1381,8 +1382,8 @@ Prefer: include-annotations="display.subject" ::: example Example 7: a `Prefer` header requesting that all annotations defined -under the "display" namespace (recursively) with the qualifier -"tablet" be returned +under the `display` namespace (recursively) with the qualifier +`tablet` be returned ``` Prefer: include-annotations="display.*#tablet" ``` @@ -1407,9 +1408,9 @@ individual request. Individual requests within a batch that don't include the `include-annotations` preference inherit the preference of the overall batch request. -Note: The `include-annotations `preference was named +Note: The `include-annotations` preference was named `odata.include-annotations` in OData version 4.0. Services that support -the` include-annotations `preference SHOULD also support +the `include-annotations` preference SHOULD also support `odata.include-annotations` for OData 4.0 clients and clients SHOULD use `odata.include-annotations` for compatibility with OData 4.0 services. If both `include-annotations` and `odata.include-annotations` @@ -1516,8 +1517,8 @@ A preference of `return=minimal` requests that the service invoke the request but does not return content in the response. The service MAY apply this preference by returning [`204 No Content`](#ResponseCode204NoContent) in which case it MAY -include a [`Preference-Applied`](#HeaderPreferenceApplied)` `response -header containing the `return=minimal `preference. +include a [`Preference-Applied`](#HeaderPreferenceApplied) response +header containing the `return=minimal` preference. A preference of `return=representation` requests that the service invokes the request and returns the modified resource. The service MAY @@ -1533,7 +1534,7 @@ MAY be applied to individual requests within a batch. #### 8.2.8.8 Preference `respond-async` -The `respond-async `preference, as defined in [RFC7240](#rfc7240), +The `respond-async` preference, as defined in [RFC7240](#rfc7240), allows clients to request that the service process the request asynchronously. @@ -1547,7 +1548,7 @@ requests within the batch request. In the case that the service applies the `respond-async` preference it MUST include a -[`Preference-Applied`](#HeaderPreferenceApplied)` `response header +[`Preference-Applied`](#HeaderPreferenceApplied) response header containing the `respond-async` preference. A service MAY specify the support for the `respond-async` preference @@ -1735,8 +1736,8 @@ and in [`3xx Redirect`](#ResponseCode3xxRedirection) responses The `Retry-After` header specifies the duration of time, in seconds, that the client is asked to wait before retrying the request or issuing -a request to the resource returned as the value of the [`Location` -header](#HeaderLocation). +a request to the resource returned as the value of the +[`Location`](#HeaderLocation) header. ### 8.3.8 Header `Vary` @@ -1749,7 +1750,7 @@ allow correct caching of the response. If a response varies depending on the applied preferences ([`allow-entityreferences`](#Preferenceallowentityreferencesodataallowentityreferences), [`include-annotations`](#Preferenceincludeannotationsodataincludeannotations), -[`omit-values`](#Preferenceomitvalues)`, `[`return`](#Preferencereturnrepresentationandreturnminimal)), +[`omit-values`](#Preferenceomitvalues), [`return`](#Preferencereturnrepresentationandreturnminimal)), the service MUST include a `Vary` header listing the [`Prefer`](#HeaderPrefer) request header field to allow correct caching of the response. @@ -1800,12 +1801,13 @@ Requests](#AsynchronousBatchRequests). ### 9.1.4 Response Code `204 No Content` A request returns `204 No Content` if the requested resource has the -`null` value, or if the service applies a [`return=minimal` -preference](#Preferencereturnrepresentationandreturnminimal). In this case, the response body MUST be empty. +`null` value, or if the service applies a +[`return=minimal`](#Preferencereturnrepresentationandreturnminimal) preference. +In this case, the response body MUST be empty. As defined in [RFC7231](#rfc7231), a [Data Modification Request](#DataModification) that responds with -`204 No Content MAY `include an `ETag` header with a value reflecting +`204 No Content` MAY include an `ETag` header with a value reflecting the result of the data modification if and only if the client can reasonably "know" the new representation of the resource without actually receiving it. For a `PUT` request this means that the response @@ -1823,10 +1825,10 @@ server-side values corresponding to the `ETag` value sent in the As per [RFC7231](#rfc7231), a `3xx Redirection` indicates that further action needs to be taken by the client in order to fulfill the -request. In this case, the response SHOULD include a [`Location` -header](#HeaderLocation), as appropriate, with the URL from which the -result can be obtained; it MAY include a [`Retry-After` -header](#HeaderRetryAfter). +request. In this case, the response SHOULD include a +[`Location`](#HeaderLocation) header, as appropriate, with the URL from which the +result can be obtained; it MAY include a +[`Retry-After`](#HeaderRetryAfter) header. ### 9.1.6 Response Code `304 Not Modified` @@ -1855,7 +1857,7 @@ of the error is as defined for the appropriate [format](#Formats). ### 9.2.1 Response Code `404 Not Found` -`404 Not Found `indicates that the resource specified by the request URL +`404 Not Found` indicates that the resource specified by the request URL does not exist. The response body MAY provide additional information. ### 9.2.2 Response Code `405 Method Not Allowed` @@ -1910,7 +1912,9 @@ include a response body describing the functionality not implemented. ## 9.4 Error Response Body -The representation of an error response body is format-specific. It +An error response body can be the result of a failure of OData processing or of the underlying infrastructure. +An OData-specific error response (which can be recognized by the presence +of the [`OData-Version`](#HeaderODataVersion) header) is format-specific and consists at least of the following information: - `code`: required non-null, non-empty, language-independent string. Its value is a service-defined error code. @@ -1938,7 +1942,7 @@ concerns around information disclosure. In the case that the service encounters an error after sending a success status to the client, the service MUST leave the response malformed -according to its [content-type](#HeaderContentType). Clients MUST treat +according to its [`Content-Type`](#HeaderContentType). Clients MUST treat the entire response as being in error. Services MAY include the header [`OData-Error`](#HeaderODataError) as a @@ -2093,8 +2097,8 @@ URL fragment. ::: example Example 15: resource URL and corresponding context URL ``` -http://host/service/MainSupplier` -http://host/service/$metadata#`MainSupplier +http://host/service/MainSupplier +http://host/service/$metadata#MainSupplier ``` ::: @@ -2128,7 +2132,7 @@ the entity set name. ::: example Example 17: resource URL and corresponding context URL ``` -http://host/service/Customers(2)/Model.VipCustomer` +http://host/service/Customers(2)/Model.VipCustomer http://host/service/$metadata#Customers/Model.VipCustomer/$entity ``` ::: @@ -2177,7 +2181,8 @@ entities in the collection, see system query option ::: example Example 18: resource URL and corresponding context URL ``` -http://host/service/Customers?$select=Address,Orders,Model.VipCustomer/PreferredContact http://host/service/$metadata#Customers(Address,Orders,Model.VipCustomer/PreferredContact) +http://host/service/Customers?$select=Address,Orders,Model.VipCustomer/PreferredContact +http://host/service/$metadata#Customers(Address,Orders,Model.VipCustomer/PreferredContact) ``` ::: @@ -2247,14 +2252,14 @@ navigation properties, functions or actions, the comma-separated list of properties MUST include the name of the expanded property, suffixed with the parenthesized comma-separated list of any properties of the expanded navigation property that are selected or expanded. If the expanded -navigation property does not contain a nested `$select `or` $expand`, +navigation property does not contain a nested `$select` or `$expand`, then the expanded property is suffixed with empty parentheses. If the expansion is recursive for nested children, a plus sign (`+`) is infixed between the navigation property name and the opening parenthesis. For a 4.0 response, the expanded navigation property suffixed with parentheses is omitted from the select-list if it does not contain a -nested `$select `or` $expand`, but MUST still be present, without a +nested `$select` or `$expand`, but MUST still be present, without a suffix, if it is explicitly selected. If the context URL includes only expanded navigation properties (i.e., @@ -2266,7 +2271,7 @@ Navigation properties with expanded references are not represented in the context URL. ::: example -Example 20: resource URL and corresponding context URL - select and +Example 20: resource URL and corresponding context URL --- select and expand ``` http://host/service/Customers?$select=Name&$expand=Address/Country @@ -2275,7 +2280,7 @@ http://host/service/$metadata#Customers(Name,Address/Country()) ::: ::: example -Example 21: resource URL and corresponding context URL -- expand `$ref` +Example 21: resource URL and corresponding context URL --- expand `$ref` ``` http://host/service/Customers?$expand=Orders/$ref http://host/service/$metadata#Customers @@ -2283,7 +2288,7 @@ http://host/service/$metadata#Customers ::: ::: example -Example 22: resource URL and corresponding context URL -- expand with +Example 22: resource URL and corresponding context URL --- expand with `$levels` ``` http://host/service/Employees/Sales.Manager?$select=DirectReports @@ -2307,14 +2312,14 @@ navigation properties, functions or actions, the comma-separated list of properties MUST include the name of the expanded property, suffixed with the parenthesized comma-separated list of any properties of the expanded navigation property that are selected or expanded. If the expanded -navigation property does not contain a nested `$select `or` $expand`, +navigation property does not contain a nested `$select` or `$expand`, then the expanded property is suffixed with empty parentheses. If the expansion is recursive for nested children, a plus sign (`+`) is infixed between the navigation property name and the opening parenthesis. For a 4.0 response, the expanded navigation property suffixed with parentheses is omitted from the select-list if it does not contain a -nested `$select `or `$expand`, but MUST still be present, without a +nested `$select` or `$expand`, but MUST still be present, without a suffix, if it is explicitly selected. If the context URL includes only expanded navigation properties (i.e., @@ -2440,7 +2445,7 @@ Context URL templates: {context-url}#{entity-set}{/type-name}{select-list} {context-url}#{entity-set}{/type-name}{select-list}/$entity - {context-url}#{entity}/{property-path}`{select-list} + {context-url}#{entity}/{property-path}{select-list} {context-url}#Collection({type-name}){select-list} {context-url}#{type-name}{select-list} @@ -2481,7 +2486,7 @@ of the containing entity. ::: example Example 30: resource URL and corresponding context URL ``` -http://host/service/Customers`?$deltatoken=1234 +http://host/service/Customers?$deltatoken=1234 http://host/service/$metadata#Customers/$delta ``` ::: @@ -2603,7 +2608,7 @@ root URL of the service with `$metadata` appended. To retrieve this document the client issues a `GET` request to the metadata document URL. If a request for metadata does not specify a format preference (via -[`Accept` header](#HeaderAccept) or +[`Accept`](#HeaderAccept) header or [`$format`](#SystemQueryOptionformat)) then the XML representation MUST be returned. @@ -2628,10 +2633,10 @@ the URL has expired, then the service SHOULD respond with MUST respond with [`404 Not Found`](#ResponseCode404NotFound). The format of the returned data is dependent upon the request and the -format specified by the client, either in the [`Accept` -header](#HeaderAccept) or using the +format specified by the client, either in the +[`Accept`](#HeaderAccept) header or using the [`$format`](#SystemQueryOptionformat) query option. If -the client specifies neither an [`Accept` header](#HeaderAccept) nor the +the client specifies neither an [`Accept`](#HeaderAccept) header nor the [`$format`](#SystemQueryOptionformat) query option, the service is allowed to return the response in any format. @@ -2653,7 +2658,7 @@ processing. Prior to applying any [server-driven paging](#ServerDrivenPaging): -- `$apply` -- defined in [OData-Aggregation](#ODataAggregation) +- `$apply` --- defined in [OData-Aggregation](#ODataAggregation) - [`$compute`](#SystemQueryOptioncompute) - [`$search`](#SystemQueryOptionsearch) - [`$filter`](#SystemQueryOptionfilter) @@ -2691,7 +2696,7 @@ Properties that are not available, for example due to permissions, are not returned. In this case, the [`Core.Permissions`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#Permissions) annotation, defined in [OData-VocCore](#ODataVocCore) MUST be returned -for the property with a value of `None.` +for the property with a value of `None`. If no entity exists with the specified request URL, the service responds with [`404 Not Found`](#ResponseCode404NotFound). @@ -2709,12 +2714,17 @@ entity is the main topic of interest and the stream data is just additional information attached to the structured data. To address the media stream represented by a media entity, clients -append `/$value` to the resource path of the media entity URL. Services -may redirect from this canonical URL to the source URL of the media +append `/$value` to the resource path of the media entity URL. +The media type of the response is the +media type of the stream, subject to content type negotiation based on the +[`Accept`](#HeaderAccept) header of the request. +The response body is the octet-stream that represents the raw +value of the media stream with that media type. Alternatively, services +MAY redirect from this canonical URL to the source URL of the media stream. Appending `/$value` to an entity that is not a media entity returns -`400 Bad Request.` +`400 Bad Request`. Attempting to retrieve the media stream from a single-valued navigation property referencing a media entity whose value is null returns @@ -2723,7 +2733,7 @@ property referencing a media entity whose value is null returns ### 11.2.4 Requesting Individual Properties To retrieve an individual property, the client issues a `GET` request to -the property URL. The property URL is the entity read URL with "/" and +the property URL. The property URL is the entity read URL with `/` and the property name appended. For complex typed properties, the path can be further extended with the @@ -2744,7 +2754,19 @@ GET http://host/service/Products(1)/Name ``` ::: -#### 11.2.4.1 Requesting a Property's Raw Value using `$value` +#### 11.2.4.1 Requesting Stream Properties + +If the property being requested has type `Edm.Stream` (see +[OData-URL, section 9](#ODataURL)), the media type of the response is the +media type of the stream, subject to content type negotiation based on the +[`Accept`](#HeaderAccept) header of the request. +The response body is the octet-stream that represents the raw +value of the stream property with that media type. + +Note this response format disregards any [`$format`](#SystemQueryOptionformat) +system query option. + +#### 11.2.4.2 Requesting a Property's Raw Value using `$value` To retrieve the raw value of a primitive type property, the client sends a `GET` request to the property value URL. See the @@ -2783,6 +2805,9 @@ A `$value` request for a property that is `null` results in a If the property is not available, for example due to permissions, the service responds with [`404 Not Found`](#ResponseCode404NotFound). +Appending `/$value` to the property URL of a property of type `Edm.Stream` +returns `400 Bad Request`. + ::: example Example 32: ``` @@ -2907,18 +2932,12 @@ The `$expand` system query option indicates the related entities and stream values that MUST be represented inline. The service MUST return the specified content, and MAY choose to return additional information. -The value of the `$expand` query option is a comma-separated list of -navigation property names, stream property names, or `$value` indicating -the stream content of a media-entity. - -For navigation properties, the navigation property name is optionally -followed by a `/$ref` path segment or a `/$count` path segment, and -optionally a parenthesized set of [expand options](#ExpandOptions) (for -filtering, sorting, selecting, paging, or expanding the related -entities). +The value of `$expand` is a comma-separated list of expand items. Each +expand item is evaluated relative to the retrieved resource being +expanded. For a full description of the syntax used when building requests, see -[OData-URL](#ODataURL). +[OData-URL](#ODataURL), section 5.1.3. ::: example Example 38: for each customer entity within the Customers entity set the @@ -2951,15 +2970,18 @@ application of expand options, expressed as a semicolon-separated list of system query options, enclosed in parentheses, see [OData-URL](#ODataURL). -Allowed system query options are [`$filter`](#SystemQueryOptionfilter), +Allowed system query options are +[`$compute`](#SystemQueryOptioncompute), [`$select`](#SystemQueryOptionselect), +`$expand`, and +[`$levels`](#ExpandOptionlevels) + for all navigation properties, plus +[`$filter`](#SystemQueryOptionfilter), [`$orderby`](#SystemQueryOptionorderby), [`$skip`](#SystemQueryOptionskip), [`$top`](#SystemQueryOptiontop), -[`$count`](#SystemQueryOptioncount), -[`$search`](#SystemQueryOptionsearch), -[`$expand`](#SystemQueryOptionexpand)`,` -[`$compute`](#SystemQueryOptioncompute)`,` and -[`$levels`](#ExpandOptionlevels). +[`$count`](#SystemQueryOptioncount), and +[`$search`](#SystemQueryOptionsearch) + for collection-valued navigation properties. ::: example Example 41: for each customer entity within the `Customers` entity set, @@ -2999,8 +3021,8 @@ GET http://host/service.svc/Customers?$expand=SampleModel.VipCustomer/InHouseSta The `$levels` expand option can be used to specify the number of levels of recursion for a hierarchy in which the related entity type is the same as, or can be cast to, the source entity type. A `$levels` option -with a value of 1 specifies a single expand with no recursion. The same -expand options are applied at each level of the hierarchy. +with a value of 1 specifies a single expand with no recursion. All provided +expand options except `$levels` are applied at each level of the hierarchy. Services MAY support the symbolic value `max` in addition to numeric values. In that case they MUST solve circular dependencies by injecting @@ -3076,7 +3098,7 @@ GET http://host/service/Products?$filter=Price lt 10.00 ::: The [`$count`](#SystemQueryOptioncount) segment may be used within a -`$filter `expression to limit the items returned based on the exact +`$filter` expression to limit the items returned based on the exact count of related entities or items within a collection-valued property. ::: example @@ -3154,7 +3176,7 @@ a `null` literal that can be used in comparisons.

    - + @@ -3193,7 +3215,7 @@ a `null` literal that can be used in comparisons. Parameter aliases can be used in place of literal values in entity keys, [function parameters](#InvokingaFunction), or within a -[`$compute`](#SystemQueryOptioncompute)`,` +[`$compute`](#SystemQueryOptioncompute), [`$filter`](#SystemQueryOptionfilter) or [`$orderby`](#SystemQueryOptionorderby) expression. Parameters aliases are names beginning with an at sign (`@`). @@ -3205,7 +3227,7 @@ specified parameter alias. ::: example Example 48: returns all employees whose Region property matches the -string parameter value "WA" +string parameter value `WA` ``` GET http://host/service.svc/Employees?$filter=Region eq @p1&@p1='WA' ``` @@ -3270,7 +3292,7 @@ result value of the second expression, and so on. The Boolean value false comes before the value true in ascending order. Services SHOULD order language-dependent strings according to the -[content-language](#HeaderContentLanguage) of the response, and SHOULD +[`Content-Language`](#HeaderContentLanguage) of the response, and SHOULD annotate string properties with language-dependent order with the term [`Core.IsLanguageDependent`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#IsLanguageDependent), see [OData-VocCore](#ODataVocCore). @@ -3372,7 +3394,7 @@ GET http://host/service/Products?$count=true ::: The count of related entities can be requested by specifying -the` $count` query option within the `$expand` clause. +the `$count` query option within the `$expand` clause. ::: example Example 57: @@ -3407,7 +3429,7 @@ those items *matching* the specified search expression. The definition of what it means to match is dependent upon the implementation. ::: example -Example 58: return all Products that match the search term "bike" +Example 58: return all Products that match the search term `bike` ``` GET http://host/service/Products?$search=bike ``` @@ -3416,7 +3438,7 @@ GET http://host/service/Products?$search=bike The search expression can contain phrases, enclosed in double-quotes. ::: example -Example 59: return all Products that match the phrase "mountain bike" +Example 59: return all Products that match the phrase `mountain bike` ``` GET http://host/service/Products?$search="mountain bike" ``` @@ -3426,7 +3448,7 @@ The upper-case keyword `NOT` restricts the set of entities to those that do not match the specified term. ::: example -Example 60: return all Products that do not match "clothing" +Example 60: return all Products that do not match `clothing` ``` GET http://host/service/Products?$search=NOT clothing ``` @@ -3437,8 +3459,8 @@ Multiple terms within a search expression are separated by a space such terms must be matched. ::: example -Example 61: return all Products that match both "mountain" and -"bike" +Example 61: return all Products that match both `mountain` and +`bike` ``` GET http://host/service/Products?$search=mountain AND bike ``` @@ -3448,8 +3470,8 @@ The upper-case keyword `OR` is used to return entities that satisfy either the immediately preceding or subsequent expression. ::: example -Example 62: return all Products that match either "mountain" or -"bike" +Example 62: return all Products that match `mountain` or +`bike` ``` GET http://host/service/Products?$search=mountain OR bike ``` @@ -3459,8 +3481,8 @@ Parentheses within the search expression group together multiple expressions. ::: example -Example 63: return all Products that match either "mountain" or -"bike" and do not match clothing +Example 63: return all Products that match `mountain` or +`bike` and do not match clothing ``` GET http://host/service/Products?$search=(mountain OR bike) AND NOT clothing ``` @@ -3542,7 +3564,7 @@ entity is related, the service returns [`204 No Content`](#ResponseCode204NoContent). ::: example -Example 65: return the supplier of the product with `ID=1 `in the +Example 65: return the supplier of the product with `ID=1` in the Products entity set ``` GET http://host/service/Products(1)/Supplier @@ -3562,13 +3584,13 @@ If the resource path identifies a collection, the response MUST be the format-specific representation of a collection of entity references pointing to the related entities. If no entities are related, the response is the format-specific representation of an empty collection. -The response MAY contain an [ETag header](#HeaderETag) for the +The response MAY contain an [`ETag`](#HeaderETag) header for the collection whose value changes if the collection of references changes, i.e. a reference is added or removed. If the resource path identifies a single existing entity, the response MUST be the format-specific representation of an entity reference. The -response MAY contain an [ETag header](#HeaderETag) which represents the +response MAY contain an [`ETag`](#HeaderETag) header which represents the identity of the referenced entity. If the resource path terminates in a single-valued navigation path, the ETag value changes if the relationship is changed and points to a different OData entity. If the @@ -3651,7 +3673,7 @@ GET http://host/service/Products/$count ::: With 4.01 services the `/$count` segment MAY be used in combination with -the `/$filter path` segment to count the items in the filtered +the `/$filter` path segment to count the items in the filtered collection. ::: example @@ -3738,7 +3760,7 @@ using the JSON media type with minimal metadata, as defined in In [metadata document requests](#MetadataDocumentRequest), the values `application/xml` and `application/json`, along with their subtypes and parameterized variants, as well as the format-specific abbreviations -`xml` and `json,` are reserved for this specification. +`xml` and `json`, are reserved for this specification. ### 11.2.12 System Query Option `$schemaversion` @@ -3790,7 +3812,7 @@ body SHOULD provide additional information. Services advertise their change-tracking capabilities by annotating entity sets with the -[`Capabilities`.`ChangeTracking`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Capabilities.V1.md#ChangeTracking) +[`Capabilities.ChangeTracking`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Capabilities.V1.md#ChangeTracking) term defined in [OData-VocCap](#ODataVocCap). Any `GET` request to retrieve one or more entities MAY allow @@ -3799,7 +3821,7 @@ change-tracking. Clients request that the service track changes to a result by specifying the [`track-changes`](#Preferencetrackchangesodatatrackchanges) preference on a request. If supported for the request, the service includes a -[`Preference-Applied`](#HeaderPreferenceApplied)` `header in the +[`Preference-Applied`](#HeaderPreferenceApplied) header in the response containing the `track-changes` preference and includes a *delta link* in a result for a single entity, and on the last page of results for a collection of entities in place of the next link. @@ -3891,8 +3913,8 @@ appended to the path of a delta link in order to get just the number of changes available. The count includes all added, changed, or deleted entities, as well as added or deleted links. -The results of a request against the delta link may span multiple pages -but MUST be ordered by the service across all pages in such a way as to +The results of a request against the delta link may span one or more pages +and MUST be ordered by the service across all pages in such a way as to guarantee consistency when applied in order to the response which contained the delta link. @@ -3937,7 +3959,7 @@ must not violate the integrity of the data. The client may request whether content be returned from a Create, Update, or Delete request, or the invocation of an Action, by specifying -the [`return` Prefer header](#Preferencereturnrepresentationandreturnminimal). +the [`return`](#Preferencereturnrepresentationandreturnminimal) preference. ### 11.4.1 Common Data Modification Semantics @@ -3962,18 +3984,18 @@ A [Data Modification Request](#DataModification) on an existing resource or an [Action Request](#Actions) invoking an action bound to an existing resource MAY require optimistic concurrency control. Services SHOULD announce this via annotations with the terms -[`Core.OptimisticConcurrency`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptimisticConcurrency)` `in +[`Core.OptimisticConcurrency`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptimisticConcurrency) in [OData-VocCore](#ODataVocCore) and [`Capabilities.NavigationRestrictions`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Capabilities.V1.md#NavigationRestrictions) (nested property `OptimisticConcurrencyControl`) in [OData-VocCap](#ODataVocCap). If optimistic concurrency control is required for a resource, the -service MUST include an [ETag header](#HeaderETag) in a response to a +service MUST include an [`ETag`](#HeaderETag) header in a response to a `GET` request to the resource, and MAY include the ETag in a format-specific manner in responses containing that resource. -The presence of an [ETag header](#HeaderETag) in a response does not +The presence of an [`ETag`](#HeaderETag) header in a response does not imply in itself that the resource requires optimistic concurrency control; the ETag may just be used for caching and/or conditional `GET` requests. @@ -4113,16 +4135,15 @@ Properties with a defined default value, nullable properties, and collection-valued properties omitted from the request are set to the default value, null, or an empty collection, respectively. -Upon successful completion, the response MUST contain a [`Location` -header](#HeaderLocation) that contains the edit URL or read URL of the +Upon successful completion, the response MUST contain a +[`Location`](#HeaderLocation) header that contains the edit URL or read URL of the created entity. Upon successful completion the service MUST respond with either [`201 Created`](#ResponseCode201Created) and a representation of the created entity, or [`204 No Content`](#ResponseCode204NoContent) if the -request included a [Prefer -header](#Preferencereturnrepresentationandreturnminimal) with a value of -[`return=minimal`](#Preferencereturnrepresentationandreturnminimal) and did not +request included a +[`return=minimal`](#Preferencereturnrepresentationandreturnminimal) preference and did not include the system query options [`$select`](#SystemQueryOptionselect) and [`$expand`](#SystemQueryOptionexpand). @@ -4136,14 +4157,15 @@ The representation for referencing related entities is format-specific. ::: example Example 76: using the JSON format, 4.0 clients can create a new manager -entity with links to two existing employees by applying the `odata.bind` -annotation to the `DirectReports` navigation property +entity with links to an existing manager (of managers) and to two existing employees by applying the `odata.bind` +annotation to the `Manager` and `DirectReports` navigation properties ```json {   "@odata.type":"#Northwind.Manager",   "ID": 1,   "FirstName": "Pat",   "LastName": "Griswold", + "Manager@odata.bind": "http://host/service/Employees(0)",   "DirectReports@odata.bind": [     "http://host/service/Employees(5)",     "http://host/service/Employees(6)" @@ -4154,14 +4176,15 @@ annotation to the `DirectReports` navigation property ::: example Example 77: using the JSON format, 4.01 clients can create a new manager -entity with links to two existing employees by including the entity-ids -within the `DirectReports` navigation property +entity with links to an existing manager (of managers) and to two existing employees by including the entity-ids +within the `Manager` and `DirectReports` navigation properties ```json {   "@type":"#Northwind.Manager",   "ID": 1,   "FirstName": "Pat",   "LastName": "Griswold", + "Manager": { "@id": "Employees(0)" },   "DirectReports": [     {"@id": "Employees(5)"},     {"@id": "Employees(6)"} @@ -4188,7 +4211,7 @@ A request to create an entity that includes related entities, represented using the appropriate inline representation, is referred to as a "deep insert". -Media entities MUST contain the base64url-encoded representation of +Media entities MUST contain the format-specific representation of their media stream as a virtual property `$value` when nested within a deep insert. @@ -4202,9 +4225,9 @@ service responds with [`201 Created`](#ResponseCode201Created), the response MUS least the level that was present in the deep-insert request. Clients MAY associate an id with individual nested entities in the -request by using the +request by applying the [`Core.ContentID`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#ContentID) -term defined in [OData-VocCore](#ODataVocCore). Services that respond +term using the namespace or alias defined for the [OData-VocCore](#ODataVocCore) vocabulary in the service's `$metadata` document. Services that respond with [`201 Created`](#ResponseCode201Created) SHOULD annotate the entities in the response using the same [`Core.ContentID`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#ContentID) @@ -4241,8 +4264,10 @@ the content in the request payload with the entity's current state, applying the update only to those components specified in the request body. Collection properties and primitive properties provided in the payload corresponding to updatable properties MUST replace the value of -the corresponding property in the entity or complex type. Missing -properties of the containing entity or complex property, including +the corresponding property in the entity or complex type. +Complex properties are updated by applying `PATCH` semantics recursively, +see also [section 11.4.9.3](#UpdateaComplexProperty). +Missing properties of the containing entity or complex property, including dynamic properties, MUST NOT be directly altered unless as a side effect of changes resulting from the provided properties. @@ -4260,7 +4285,7 @@ removed or set to `null`. For requests with an `OData-Version` header with a value of `4.01` or greater, the media stream of a media entity can be updated by specifying -the base64url-encoded representation of the media stream as a virtual +the format-specific representation of the media stream as a virtual property `$value`. Updating a dependent property that is tied to a key property of the @@ -4268,7 +4293,7 @@ principal entity through a referential constraint updates the relationship to point to the entity with the specified key value. If there is no such entity, the update fails. -Updating a principle property that is tied to a dependent entity through +Updating a principal property that is tied to a dependent entity through a referential constraint on the dependent entity updates the dependent property. @@ -4318,8 +4343,7 @@ Upon successful completion the service responds with either [`200 OK`](#ResponseCode200OK) and a representation of the updated entity, or [`204 No Content`](#ResponseCode204NoContent). The client may request that the response SHOULD include a body by specifying a -[`Prefer` header](#Preferencereturnrepresentationandreturnminimal) with a value of -[`return=representation`](#Preferencereturnrepresentationandreturnminimal), or by +[`return=representation`](#Preferencereturnrepresentationandreturnminimal) preference, or by specifying the system query options [`$select`](#SystemQueryOptionselect) or [`$expand`](#SystemQueryOptionexpand). If the service uses ETags for @@ -4349,17 +4373,17 @@ NOT include added links, deleted links, or deleted entities. Example 78: using the JSON format, a 4.01 `PATCH` request can update a manager entity. Following the update, the manager has three direct reports; two existing employees and one new employee named -`Suzanne Brown`. The `LastName` of employee `6` is updated to `Smith.` +`Suzanne Brown`. The `LastName` of employee 6 is updated to `Smith`. ```json {   "@type":"#Northwind.Manager",   "FirstName" : "Patricia",   "DirectReports": [     { -      "@id": "Employees(5}" +      "@id": "Employees(5)"     },     { -      "@id": "Employees(6}", +      "@id": "Employees(6)",       "LastName": "Smith"     },     { @@ -4483,12 +4507,12 @@ that are not tied to key properties of the principal entity, MUST be ignored by the service in processing the Upsert request. To ensure that an update request is not treated as an insert, the client -MAY specify an [`If-Match` header](#HeaderIfMatch) in the update +MAY specify an [`If-Match`](#HeaderIfMatch) header in the update request. The service MUST NOT treat an update request containing an `If-Match` header as an insert. A `PUT` or `PATCH` request MUST NOT be treated as an update if an -[`If-None-Match` header](#HeaderIfNoneMatch) is specified with a value +[`If-None-Match`](#HeaderIfNoneMatch) header is specified with a value of `*`. ### 11.4.5 Delete an Entity @@ -4497,8 +4521,8 @@ To delete an individual entity, the client makes a `DELETE` request to a URL that identifies the entity. Services MAY restrict deletes only to requests addressing the [edit URL](#ReadURLsandEditURLs) of the entity. -The request body SHOULD be empty. Singleton entities can be deleted if -they are nullable. Services supporting this SHOULD advertise it by +The request body SHOULD be empty. Top-level singleton entities can be deleted if +they are nullable. Services supporting this MAY advertise it by annotating the singleton with the term `Capabilities.DeleteRestrictions` (nested property `Deletable` with value `true`) defined in [OData-VocCap](#ODataVocCap). @@ -4613,15 +4637,14 @@ OData format supported by the service. It is not possible to set the structural properties of the media entity when creating the media entity. -Upon successful completion, the response MUST contain [`Location` -header](#HeaderLocation) that contains the edit URL of the created media +Upon successful completion, the response MUST contain +[`Location`](#HeaderLocation) header that contains the edit URL of the created media entity. Upon successful completion the service responds with either [`201 Created`](#ResponseCode201Created), or -[`204 No Content`](#ResponseCode204NoContent)if the request included a -[Prefer header](#Preferencereturnrepresentationandreturnminimal) with a value of -[`return=minimal`](#Preferencereturnrepresentationandreturnminimal). +[`204 No Content`](#ResponseCode204NoContent) if the request included a +[`return=minimal`](#Preferencereturnrepresentationandreturnminimal) preference. #### 11.4.7.2 Update a Media Entity Stream @@ -4658,6 +4681,43 @@ are properties of type `Edm.Stream`. The values for stream properties do not usually appear in the entity payload. Instead, the values are generally read or written through URLs. +::: example +Example 80: read an entity and select a stream property +``` +GET http://host/service/Products(1)?$select=Thumbnail +``` +would only include control information for the stream property, not the stream data itself +```json +{ + "@context": "http://host/service/$metadata#Products/$entity", + ... + "Thumbnail@mediaReadLink": "http://server/Thumbnail546.jpg", + "Thumbnail@mediaEditLink": "http://server/uploads/Thumbnail546.jpg", + ... +} +``` +The stream data can then be requested using the media read link: +``` +GET http://server/Thumbnail546.jpg +``` +::: + +Services SHOULD support direct property access to a stream property's canonical URL. +The response MAY be a redirect to the media read link of the stream property +if the media read link is different from the canonical URL. + +::: example +Example 81: directly read a stream property of an entity +``` +GET http://host/service/Products(1)/Thumbnail +``` +can return [`200 OK`](#ResponseCode200OK) and the stream data (see [section 11.2.4.1](#RequestingStreamProperties)), +or a [`3xx Redirect`](#ResponseCode3xxRedirection) to the media read link of the stream property. +::: + +Note: for scenarios in which the media value can only be inlined, +the property should instead be modeled with type `Edm.Binary`. + #### 11.4.8.1 Update Stream Values A successful `PUT` request to the edit URL of a stream property changes @@ -4695,6 +4755,13 @@ A successful `DELETE` request to the edit URL of a stream property attempts to set the property to null and results in an error if the property is non-nullable. +::: example +Example 82: delete the stream value using the media edit link retrieved in [example 80](#entityWithStreamProperty) +``` +DELETE http://server/uploads/Thumbnail546.jpg +``` +::: + Attempting to request a stream property whose value is null results in [`204 No Content`](#ResponseCode204NoContent). @@ -4724,9 +4791,8 @@ property. Upon successful completion the service responds with either [`200 OK`](#ResponseCode200OK) or [`204 No Content`](#ResponseCode204NoContent). The client may request -that the response SHOULD include a body by specifying a [Prefer -header](#Preferencereturnrepresentationandreturnminimal) with a value of -[`return=representation`](#Preferencereturnrepresentationandreturnminimal). +that the response SHOULD include a body by specifying a +[`return=representation`](#Preferencereturnrepresentationandreturnminimal) preference. Services MUST return an error if the property is not updatable. @@ -4759,11 +4825,15 @@ property to null. A successful `PATCH` request to the edit URL for a complex typed property updates that property. The request body MUST contain a single -valid representation for the target complex type. +valid representation for the declared type of the complex property or one of its derived types. The service MUST directly modify only those properties of the complex type specified in the payload of the `PATCH` request. +If a complex-typed property is set to a different type in a `PATCH` request, +properties shared through inheritance, as well as dynamic properties, are retained (unless overwritten by new values in the payload). +Other properties of the original type are discarded. + The service MAY additionally support clients sending a `PUT` request to a URL that specifies a complex type. In this case, the service MUST replace the entire complex property with the values specified in the @@ -4772,9 +4842,8 @@ request body and set all unspecified properties to their default value. Upon successful completion the service responds with either [`200 OK`](#ResponseCode200OK) or [`204 No Content`](#ResponseCode204NoContent). The client may request -that the response SHOULD include a body by specifying a [Prefer -header](#Preferencereturnrepresentationandreturnminimal) with a value of -[`return=representation`](#Preferencereturnrepresentationandreturnminimal). +that the response SHOULD include a body by specifying a +[`return=representation`](#Preferencereturnrepresentationandreturnminimal) preference. Services MUST return an error if the property is not updatable. @@ -4791,10 +4860,9 @@ request body. A successful `POST` request to the edit URL of a collection property adds an item to the collection. The body of the request MUST be a single item to be added to the collection. If the collection is ordered, the -item is added to the end of the collection, and +item is added to the end of the collection, and if the collection supports positional insert [`$index`](#RequestinganIndividualMemberofanOrderedCollection) MAY be used to specify -a zero-based ordinal position to insert the new value, with a negative -value indicating an ordinal position from the end of the collection. +the insert position. A successful `DELETE` request to the edit URL of a collection property deletes all items in that collection. @@ -4803,11 +4871,10 @@ Since collection members have no individual identity, `PATCH` is not supported for collection properties. Upon successful completion the service responds with either -[`200 OK`](#ResponseCode200OK) or +[`200 OK`](#ResponseCode200OK) and a representation of the updated collection, or [`204 No Content`](#ResponseCode204NoContent). The client may request -that the response SHOULD include a body by specifying a [Prefer -header](#Preferencereturnrepresentationandreturnminimal) with a value of -[`return=representation`](#Preferencereturnrepresentationandreturnminimal). +that the response SHOULD include a body by specifying a +[`return=representation`](#Preferencereturnrepresentationandreturnminimal) preference. Services MUST return an error if the property is not updatable. @@ -4840,7 +4907,7 @@ ordinal number indexes from the end of the collection, with -1 representing an insert as the last item in the collection. ::: example -Example 80: Insert a new email address at the second position +Example 83: Insert a new email address at the second position ```json POST /service/Customers('ALFKI')/EmailAddresses?$index=1 Content-Type: application/json @@ -4962,7 +5029,7 @@ semantics described in [Update a Collection of Entities](#UpdateaCollectionofEntities) applies. ::: example -Example 81: change the color of all beige-brown products +Example 84: change the color of all beige-brown products ```json PATCH /service/Products/$filter(@bar)/$each?@bar=Color eq 'beige-brown' @@ -5007,7 +5074,7 @@ The request resource path of the collection MAY contain type-cast or filter segments to subset the collection. ::: example -Example 82: delete all products older than 3 +Example 85: delete all products older than 3 ``` DELETE /service/Products/$filter(Age gt 3)/$each ``` @@ -5057,7 +5124,7 @@ by that URL is used as the *binding parameter value*. Only aliases defined in the metadata document of the service can be used in URLs. ::: example -Example 83: the function `MostRecentOrder` can be bound to any URL that +Example 86: the function `MostRecentOrder` can be bound to any URL that identifies a `SampleModel.Customer` ```xml @@ -5068,7 +5135,7 @@ identifies a `SampleModel.Customer` ::: ::: example -Example 84: invoke the `MostRecentOrder` function with the value of the +Example 87: invoke the `MostRecentOrder` function with the value of the binding parameter `customer` being the entity identified by `http://host/service/Customers(6)` ``` @@ -5077,7 +5144,7 @@ GET http://host/service/Customers(6)/SampleModel.MostRecentOrder() ::: ::: example -Example 85: the function `Comparison` can be bound to any URL that +Example 88: the function `Comparison` can be bound to any URL that identifies a collection of entities ```xml @@ -5088,7 +5155,7 @@ identifies a collection of entities ::: ::: example -Example 86: invoke the `Comparison` function on the set of red products +Example 89: invoke the `Comparison` function on the set of red products ``` GET http://host/service/Products/$filter(Color eq 'Red')/Diff.Comparison() ``` @@ -5111,7 +5178,7 @@ result type of the bound operation. If the bound operation returns a collection, the response is a collection of collections. ::: example -Example 87: invoke the `MostRecentOrder` function on each entity in the +Example 90: invoke the `MostRecentOrder` function on each entity in the entity set `Customers` ``` GET http://host/service/Customers/$each/SampleModel.MostRecentOrder() @@ -5139,7 +5206,7 @@ or entity collection within the payload. The representation of an action or function depends on the [format](#Formats). ::: example -Example 88: given a `GET` request to +Example 91: given a `GET` request to `http://host/service/Customers('ALFKI')`, the service might respond with a Customer that includes the `SampleEntities.MostRecentOrder` function bound to the entity @@ -5166,8 +5233,8 @@ Services can advertise that a function or action is not available for a particular instance by setting its value to null. ::: example -Example 89: the `SampleEntities.MostRecentOrder` function is not -available for customer 'ALFKI' +Example 92: the `SampleEntities.MostRecentOrder` function is not +available for customer `ALFKI` ```json {   "@context": ..., @@ -5206,7 +5273,7 @@ ampersand (`&`) or a question mark (`?`). Services MAY additionally support invoking functions using the unqualified function name by defining one or more [default namespaces](#DefaultNamespaces) through the -[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace)` `term +[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace) term defined in  [OData-VocCore](#ODataVocCore). Functions can be used within [`$filter`](#SystemQueryOptionfilter) or @@ -5236,7 +5303,7 @@ segment is a multi-valued navigation property, a `POST` request may be used to create a new entity in the identified collection. ::: example -Example 90: add a new item to the list of items of the shopping cart +Example 93: add a new item to the list of items of the shopping cart returned by the composable `MyShoppingCart` function import ``` POST http://host/service/MyShoppingCart()/Items @@ -5245,6 +5312,10 @@ POST http://host/service/MyShoppingCart()/Items ``` ::: +If the function returns a value of type `Edm.Stream` and no additional path +segments follow the function invocation, the response to the `GET` request +follows the rules for [requesting stream properties](#RequestingStreamProperties). + Parameter values passed to functions MUST be specified either as a URL literal (for primitive values) or as a JSON formatted OData object (for complex values, or collections of primitive or complex values). Entity @@ -5281,7 +5352,7 @@ Each parameter value is represented as a name/value pair in the format and `Value` is the parameter value. ::: example -Example 91: invoke a `Sales.EmployeesByManager` function which takes a +Example 94: invoke a `Sales.EmployeesByManager` function which takes a single `ManagerID` parameter via the function import `EmployeesByManager` ``` @@ -5290,8 +5361,8 @@ GET http://host/service/EmployeesByManager(ManagerID=3) ::: ::: example -Example 92: return all `Customers` whose City property returns -"Western" when passed to the `Sales.SalesRegion` function +Example 95: return all Customers whose `City` property returns +`Western` when passed to the `Sales.SalesRegion` function ``` GET http://host/service/Customers?       $filter=Sales.SalesRegion(City=$it/City) eq 'Western' @@ -5303,7 +5374,7 @@ parameter value. The value for the alias is specified as a separate query option using the name of the parameter alias. ::: example -Example 93: invoke a `Sales.EmployeesByManager` function via the +Example 96: invoke a `Sales.EmployeesByManager` function via the function import `EmployeesByManager`, passing 3 for the `ManagerID` parameter ``` @@ -5323,7 +5394,7 @@ optional `$` prefix), the parameter name MUST be prefixed with an at (`@`) sign. ::: example -Example 94: invoke a `Sales.EmployeesByManager` function via the +Example 97: invoke a `Sales.EmployeesByManager` function via the function import `EmployeesByManager`, passing 3 for the `ManagerID` parameter using the implicit parameter alias ``` @@ -5332,7 +5403,7 @@ GET http://host/service/EmployeesByManager?ManagerID=3 ::: Non-binding parameters annotated with the term -[`Core.OptionalParameter`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptionalParameter)` `defined +[`Core.OptionalParameter`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptionalParameter) defined in [OData-VocCore](#ODataVocCore) MAY be omitted. If it is annotated and the annotation specifies a `DefaultValue`, the omitted parameter is interpreted as having that default value. If omitted and the annotation @@ -5382,7 +5453,7 @@ request was ambiguous. ### 11.5.5 Actions Actions are operations exposed by an OData service that MAY have side -effects when invoked. Actions MAY return data but` `MUST NOT be further +effects when invoked. Actions MAY return data but MUST NOT be further composed with additional path segments. #### 11.5.5.1 Invoking an Action @@ -5401,7 +5472,7 @@ according to the particular format. Services MAY additionally support invoking actions using the unqualified action name by defining one or more [default namespaces](#DefaultNamespaces) through the -[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace)` `term +[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace) term defined in  [OData-VocCore](#ODataVocCore). To invoke an action through an action import, the client issues a `POST` @@ -5412,7 +5483,7 @@ values MUST be passed in the request body according to the particular format. Non-binding parameters that are nullable or annotated with the term -[`Core.OptionalParameter`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptionalParameter)` `defined +[`Core.OptionalParameter`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptionalParameter) defined in [OData-VocCore](#ODataVocCore) MAY be omitted from the request body. If an omitted parameter is not annotated (and thus nullable), it MUST be interpreted as having the `null` value. If it is annotated and the @@ -5435,13 +5506,16 @@ negotiation to request the results in the desired format, otherwise the default content type will be used. The client can request whether any results from the action be returned -using the [`return Prefer` header](#Preferencereturnrepresentationandreturnminimal). +using the [`return`](#Preferencereturnrepresentationandreturnminimal) preference. Actions that create and return a single entity follow the rules for -[entity creation](#CreateanEntity) and return a [`Location` -header](#HeaderLocation) that contains the edit URL or read URL of the +[entity creation](#CreateanEntity) and return a +[`Location`](#HeaderLocation) header that contains the edit URL or read URL of the created entity. +If the action returns a value of type `Edm.Stream`, the response to the `POST` request +follows the rules for [requesting stream properties](#RequestingStreamProperties). + Actions without a return type respond with [`204 No Content`](#ResponseCode204NoContent) on success. @@ -5449,18 +5523,18 @@ To request processing of the action only if the binding parameter value, an entity or collection of entities, is unmodified, the client includes the [`If-Match`](#HeaderIfMatch) header with the latest known ETag value for the entity or collection of entities. The ETag value for a -collection as a whole is transported in the `ETag` header of a +collection as a whole is transported in the [`ETag`](#HeaderETag) header of a collection response. ::: example -Example 95: invoke the `SampleEntities.CreateOrder` action using -`/Customers('ALFKI') `as the customer (or binding parameter). The values +Example 98: invoke the `SampleEntities.CreateOrder` action using +`Customers('ALFKI')` as the customer (or binding parameter). The values `2` for the `quantity` parameter and `BLACKFRIDAY` for the `discountCode` parameter are passed in the body of the request. Invoke the action only if the customer's ETag still matches. ```json POST http://host/service/Customers('ALFKI')/SampleEntities.CreateOrder -If-Match: W/"MjAxOS0wMy0yMVQxMzowNVo="` +If-Match: W/"MjAxOS0wMy0yMVQxMzowNVo=" Content-Type: application/json { @@ -5487,7 +5561,7 @@ see [OData-URL](#ODataURL). ## 11.6 Asynchronous Requests -A [Prefer](#HeaderPrefer) header with a +A [`Prefer`](#HeaderPrefer) header with a [`respond-async`](#Preferencerespondasync) preference allows clients to request that the service process a [Data Service Request](#DataServiceRequests) asynchronously. @@ -5499,18 +5573,18 @@ NOT reply to a [Data Service Request](#DataServiceRequests) with `202 Accepted` if the request has not included the `respond-async` preference. -Responses that return `202 Accepted` MUST include a [`Location` -header](#HeaderLocation) pointing to a *status monitor resource* that +Responses that return `202 Accepted` MUST include a +[`Location`](#HeaderLocation) header pointing to a *status monitor resource* that represents the current state of the asynchronous processing in addition -to an optional [`Retry-After` header](#HeaderRetryAfter) indicating the +to an optional [`Retry-After`](#HeaderRetryAfter) header indicating the time, in seconds, the client should wait before querying the service for status. Services MAY include a response body, for example, to provide additional status information. A `GET` request to the status monitor resource again returns `202 Accepted` response if the asynchronous processing has not finished. -This response MUST again include a [`Location` header](#HeaderLocation) -and MAY include a [`Retry-After` header](#HeaderRetryAfter) to be used for a subsequent request. The +This response MUST again include a [`Location`](#HeaderLocation) header +and MAY include a [`Retry-After`](#HeaderRetryAfter) header to be used for a subsequent request. The `Location` header and optional `Retry-After` header may or may not contain the same values as returned by the previous request. @@ -5533,7 +5607,7 @@ asynchronous processing be canceled. A `200 OK` or a been successfully canceled. A client can request that the `DELETE` should be executed asynchronously. A `202 Accepted` response indicates that the cancellation is being processed asynchronously; the client can -use the returned [`Location` header](#HeaderLocation) (which MUST be +use the returned [`Location`](#HeaderLocation) header (which MUST be different from the status monitor resource of the initial request) to query for the status of the cancellation. If a delete request is not supported by the service, the service returns @@ -5589,9 +5663,9 @@ format](#MultipartBatchFormat) MUST contain a [RFC2046](#rfc2046). ::: example -Example 96: multipart batch request +Example 99: multipart batch request ``` -POST /service/$batch HTTP/1.1` +POST /service/$batch HTTP/1.1 Host: odata.org OData-Version: 4.0 Content-Type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77b @@ -5604,7 +5678,7 @@ A batch request using the JSON batch format MUST contain a `Content-Type` header specifying a content type of `application/json`. ::: example -Example 97: JSON batch request +Example 100: JSON batch request ``` POST /service/$batch HTTP/1.1 Host: odata.org @@ -5671,7 +5745,7 @@ clients MUST be able to resolve it relative to the request's URL even if that contains such a reference. If the `$`-prefixed request identifier is identical to the name of a -top-level system resource (`$batch`, `$crossjoin,` `$all,` `$entity`, +top-level system resource (`$batch`, `$crossjoin`, `$all`, `$entity`, `$root`, `$id`, `$metadata`, or other system resources defined according to the [`OData-Version`](#HeaderODataVersion) of the protocol specified in the request), then the reference to the top-level system resource is @@ -5756,15 +5830,16 @@ set can use one of the following three formats: - Absolute URI with schema, host, port, and absolute resource path. ::: example -Example 98: +Example 101: +``` +GET https://host:1234/path/service/People(1) HTTP/1.1 ``` -GET https://host:1234/path/service/People(1) HTTP/1.1 ``` ::: - Absolute resource path and separate `Host` header ::: example -Example 99: +Example 102: ``` GET /path/service/People(1) HTTP/1.1 Host: myserver.mydomain.org:1234 @@ -5774,7 +5849,7 @@ Host: myserver.mydomain.org:1234 - Resource path relative to the batch request URI. ::: example -Example 100: +Example 103: ``` GET People(1) HTTP/1.1 ``` @@ -5790,8 +5865,8 @@ need not be percent-encoded. Each body part that represents a single request MUST NOT include: -- `authentication` or `authorization` related HTTP headers -- `Expect`, `From`, `Max-Forwards`, `Range`, or `TE` headers +- `authentication` or `authorization` related HTTP headers +- `Expect`, `From`, `Max-Forwards`, `Range`, or `TE` headers Processors of batch requests MAY choose to disallow additional HTTP constructs in HTTP requests serialized within body parts. For example, a @@ -5799,7 +5874,7 @@ processor may choose to disallow chunked encoding to be used by such HTTP requests. ::: example -Example 101: a batch request that contains the following individual +Example 104: a batch request that contains the following individual requests in the order listed 1. A query request @@ -5878,7 +5953,7 @@ which case they SHOULD advertise this support by specifying the term applied to the entity container, see [OData-VocCap](#ODataVocCap). ::: example -Example 102: a batch request that contains the following operations in +Example 105: a batch request that contains the following operations in the order listed: A change set that contains the following requests: @@ -5921,7 +5996,7 @@ Content-Length: ### #### 11.7.7.3 Referencing an ETag ::: example -Example 103: a batch request that contains the following operations in +Example 106: a batch request that contains the following operations in the order listed: - Get an Employee (with `Content-ID = 1`) - Update the salary only if the employee has not changed @@ -5980,7 +6055,7 @@ response so clients can correlate requests and responses. #### 11.7.7.5 Multipart Batch Response A multipart response to a batch request MUST contain a `Content-Type` -header with value `multipart/mixed.` +header with value `multipart/mixed`. The body of a multipart response to a multipart batch request MUST structurally match one-to-one with the multipart batch request body, @@ -6019,7 +6094,7 @@ URL of the corresponding individual request. URLs in responses MUST NOT contain `$`-prefixed request identifiers. ::: example -Example 104: referencing the batch request example 101 above, assume all +Example 107: referencing the batch request example 101 above, assume all the requests except the final query request succeed. In this case the response would be ``` @@ -6096,7 +6171,7 @@ Since a change set is executed atomically, a change set. ::: example -Example 105: referencing the example 101 above again, assume that +Example 108: referencing the example 101 above again, assume that ``` HTTP/1.1 202 Accepted Location: http://service-root/async-monitor-0 @@ -6317,7 +6392,7 @@ unsupported functionality ([section 9.3.1](#ResponseCode501NotImplemented)) 4. MUST support casting to a derived type according to [OData-URL](#ODataURL) if derived types are present in the model 5. MUST support `$top` ([section 11.2.6.3](#SystemQueryOptiontop)) -6. MUST support `/$value` on media entities ([section 11.1.2](#MetadataDocumentRequest)) and individual properties ([section 11.2.4.1](#RequestingaPropertysRawValueusingvalue)) +6. MUST support `/$value` on media entities ([section 11.1.2](#MetadataDocumentRequest)) and individual properties ([section 11.2.4.2](#RequestingaPropertysRawValueusingvalue)) 7. MUST support `$filter` ([section 11.2.6.1](#SystemQueryOptionfilter)) 1. MUST support `eq`, `ne` filter operations on properties of entities in the requested entity set ([section 11.2.6.1.1](#BuiltinFilterOperations)) @@ -6363,13 +6438,13 @@ collection-valued properties (section 5.1.1.10 in [OData-URL](#ODataURL)) 6. MUST support the `$skip` system query option ([section 11.2.6.4](#SystemQueryOptionskip)) 7. MUST support the `$count` system query option ([section 11.2.6.5](#SystemQueryOptioncount)) -8. MUST support `$orderby` `asc` and `desc` on individual properties +8. MUST support `$orderby` with `asc` and `desc` on individual properties ([section 11.2.6.2](#SystemQueryOptionorderby)) 9. MUST support `$expand` ([section 11.2.5.2](#SystemQueryOptionexpand)) 1. MUST support returning references for expanded properties 2. MUST support `$filter` on expanded collection-valued properties 3. MUST support cast segment in expand with derived types - 4. SHOULD support `$orderby` `asc` and `desc` on expanded + 4. SHOULD support `$orderby` with `asc` and `desc` on expanded collection-valued properties 5. SHOULD support `$count` on expanded collection-valued properties 6. SHOULD support `$top` and `$skip` on expanded collection-valued @@ -6497,7 +6572,7 @@ Level](#OData401MinimalConformanceLevel) Level](#OData40IntermediateConformanceLevel) 3. MUST support `eq/ne null` comparison for navigation properties with a maximum cardinality of one -4. MUST support the [`in`](#BuiltinFilterOperations)` `operator +4. MUST support the [`in`](#BuiltinFilterOperations) operator 5. MUST support the `$select` option nested within `$select` 6. SHOULD support the count of a filtered collection in a common expression @@ -6522,7 +6597,7 @@ expression 4. MUST support `$compute` system query option 5. MUST support nested options in `$select` 1. MUST support `$filter` on selected collection-valued properties - 2. SHOULD support `$orderby` `asc` and `desc` on selected + 2. SHOULD support `$orderby` with `asc` and `desc` on selected collection-valued properties 3. SHOULD support the `$count` on selected collection-valued properties @@ -6576,7 +6651,7 @@ in a delta response ([section 11.3](#RequestingChanges)) 13. MAY support asynchronous responses ([section 11.6](#AsynchronousRequests)) 14. MAY support `metadata=minimal` in a JSON response (see [OData-JSON](#ODataJSON)) -15. MAY support `streaming `in a JSON response (see +15. MAY support `streaming` in a JSON response (see [OData-JSON](#ODataJSON)) In addition, interoperable OData 4.01 clients @@ -6641,50 +6716,47 @@ _OData Vocabularies Version 4.0: Core Vocabulary._ See link in "[Related work](#RelatedWork)" section on cover page. ###### [RFC2046] -_Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types", RFC 2046, November 1996_ -https://tools.ietf.org/html/rfc2046. +_Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types", RFC 2046, DOI 10.17487/RFC2046, November 1996_. +https://www.rfc-editor.org/info/rfc2046. ###### [RFC2119] +_Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997_. https://www.rfc-editor.org/info/rfc2119. ###### [RFC3987] -_Duerst, M. and, M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC 3987, January 2005_ -https://tools.ietf.org/html/rfc3987. +_Duerst, M. and M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC 3987, DOI 10.17487/RFC3987, January 2005_. +https://www.rfc-editor.org/info/rfc3987. ###### [RFC5646] -_Phillips, A., Ed., and M. Davis, Ed., "Tags for Identifying Languages", BCP 47, RFC 5646, September 2009_ -http://tools.ietf.org/html/rfc5646. +_Phillips, A., Ed., and M. Davis, Ed., "Tags for Identifying Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646, September 2009_. +https://www.rfc-editor.org/info/rfc5646. ###### [RFC5789] -_Dusseault, L., and J. Snell, "Patch Method for HTTP", RFC 5789, March 2010_ -http://tools.ietf.org/html/rfc5789. - -###### [RFC7493] -_Bray, T., Ed., "The I-JSON Message Format", RFC7493, March 2015_ -https://tools.ietf.org/html/rfc7493. +_Dusseault, L. and J. Snell, "PATCH Method for HTTP", RFC 5789, DOI 10.17487/RFC5789, March 2010_. +https://www.rfc-editor.org/info/rfc5789. ###### [RFC7230] -_Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, June 2014_ -https://tools.ietf.org/html/rfc7230. +_Fielding, R., Ed., and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, DOI 10.17487/RFC7230, June 2014_. +https://www.rfc-editor.org/info/rfc7230. ###### [RFC7231] -_Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", RFC 7231, June 2014_ -https://tools.ietf.org/html/rfc7231. +_Fielding, R., Ed., and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", RFC 7231, DOI 10.17487/RFC7231, June 2014_. +https://www.rfc-editor.org/info/rfc7231. ###### [RFC7232] -_Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests", RFC 7232, June 2014_ -https://tools.ietf.org/html/rfc7232. +_Fielding, R., Ed., and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests", RFC 7232, DOI 10.17487/RFC7232, June 2014_. +https://www.rfc-editor.org/info/rfc7232. ###### [RFC7240] -_Snell, J., "Prefer Header for HTTP", RFC 7240, June 2014_ -https://tools.ietf.org/html/rfc7240. +_Snell, J., "Prefer Header for HTTP", RFC 7240, DOI 10.17487/RFC7240, June 2014_. +https://www.rfc-editor.org/info/rfc7240. ###### [RFC7617] -_Reschke, J., "The 'Basic' HTTP Authentication Scheme", RFC 7617, September 2015_ -https://tools.ietf.org/html/rfc7617. +_Reschke, J., "The 'Basic' HTTP Authentication Scheme", RFC 7617, DOI 10.17487/RFC7617, September 2015_. +https://www.rfc-editor.org/info/rfc7617. ###### [RFC8174] -_Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_ +_Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_. https://www.rfc-editor.org/info/rfc8174. ## A.2 Informative References diff --git a/docs/odata-temporal-ext/odata-temporal-ext.html b/docs/odata-temporal-ext/odata-temporal-ext.html index fe5427e4c..857a48083 100644 --- a/docs/odata-temporal-ext/odata-temporal-ext.html +++ b/docs/odata-temporal-ext/odata-temporal-ext.html @@ -150,12 +150,12 @@

    Abstract:

    This specification defines how to represent and interact with time-dependent data using the Open Data Protocol (OData).

    Status:

    -

    This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical.

    -

    TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/.

    -

    This specification is provided under the RF on RAND Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php).

    -

    Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product's prose narrative document(s), the content in the separate plain text file prevails.

    +

    This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the “Latest stage” location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical.

    +

    TC members should send comments on this specification to the TC’s email list. Others should send comments to the TC’s public comment list, after subscribing to it by following the instructions at the “Send A Comment” button on the TC’s web page at https://www.oasis-open.org/committees/odata/.

    +

    This specification is provided under the RF on RAND Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC’s web page (https://www.oasis-open.org/committees/odata/ipr.php).

    +

    Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product’s prose narrative document(s), the content in the separate plain text file prevails.

    Key words:

    -

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

    +

    The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

    Citation format:

    When referencing this specification the following citation format should be used:

    [OData-Temporal-v4.0]

    @@ -163,7 +163,7 @@

    Citation format:

    Notices

    Copyright © OASIS Open 2022. All Rights Reserved.

    Distributed under the terms of the OASIS IPR Policy.

    -

    The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs.

    +

    The name “OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs.

    For complete copyright information please see the full Notices section in an Appendix below.


    Table of Contents

    @@ -251,32 +251,32 @@

    1.2 Glossary

    1.2.1 Definitions of Terms

    1.2.1.1 Application Time

    -

    Application time is used to describe data that is known to change over time, for example the budget of a department, or which department an employee works for. Application time may capture planned changes in the future, for example transferring an employee to a new department next month or capturing next year's budget for a department. Both future and past data can be changed.

    +

    Application time is used to describe data that is known to change over time, for example the budget of a department, or which department an employee works for. Application time may capture planned changes in the future, for example transferring an employee to a new department next month or capturing next year’s budget for a department. Both future and past data can be changed.

    1.2.1.2 System Time

    -

    System time is used to record when data became known by the "system of record". System time does not extend into the future, and record entries are only added and are never changed.

    -

    System time is never manipulated directly, and typically not visible in APIs, except for "last changed at" time stamps, and the corresponding properties are read-only.

    +

    System time is used to record when data became known by the “system of record”. System time does not extend into the future, and record entries are only added and are never changed.

    +

    System time is never manipulated directly, and typically not visible in APIs, except for “last changed at” time stamps, and the corresponding properties are read-only.

    As system time is typically not visible in APIs, we do not consider this in the remainder of this document.

    1.2.1.3 Temporal Object

    A temporal object is a set of data whose change over time is tracked by the service as a sequence of time slices.

    1.2.1.4 Time Slice

    A piece of temporal data with attached time period, documenting that the data did not change during this time period.

    Time slices for the same temporal object are non-overlapping, so for any given point in time there is at most one slice whose time period contains that point in time.

    -

    Time slices for a temporal object need not cover the complete timeline. There can be points in time for which no time slice exists, indicating that the object's values are not known to the service.

    +

    Time slices for a temporal object need not cover the complete timeline. There can be points in time for which no time slice exists, indicating that the object’s values are not known to the service.

    1.2.1.4.1 Closed-Open Semantics

    Time slices typically use closed-open semantics, following [SQL:2011]. This means the start is part of the period, the end is not part of the period, and for directly adjacent time slices the end of the earlier time slice is identical to the start of the next time slice. The period start must be less than the period end.

    1.2.1.4.2 Closed-Closed Semantics

    Some software systems predating the availability of temporal databases and with data type date for the application-time period start and end use closed-closed semantics. Temporal services on top of these systems can either convert their period end boundaries on-the-fly by adding one day on the way out and subtracting one day on the way in, or alternatively express the used time slice semantics via annotations.

    1.2.1.5 Snapshot Entity Set

    -

    An entity in a snapshot entity set represents a temporal object at a specified point in time. When the entity is addressed via a resource path (directly or via related resources), the point in time must be specified, see section "Propagation of Temporal Query Options" for details on how to determine this point in time.

    -

    The entity's id and its canonical URL are independent of this point in time. Hence, they are sufficient to reference the entity but not address it. In other words: the entity can be considered a function that maps each point in time to an instance of the entity type. That function can be referenced but only its values can be addressed.

    +

    An entity in a snapshot entity set represents a temporal object at a specified point in time. When the entity is addressed via a resource path (directly or via related resources), the point in time must be specified, see section “Propagation of Temporal Query Options” for details on how to determine this point in time.

    +

    The entity’s id and its canonical URL are independent of this point in time. Hence, they are sufficient to reference the entity but not address it. In other words: the entity can be considered a function that maps each point in time to an instance of the entity type. That function can be referenced but only its values can be addressed.

    Without a point in time, statements about individual structural or navigation properties of the entity or even about its existence cannot be made, and change tracking is not possible.

    Snapshot entity sets MUST be annotated with a Timeline of type TimelineSnapshot.

    1.2.1.6 Timeline Entity Set

    An entity in a timeline entity set represents one time slice of a temporal object, and all time slices of that temporal object are part of the entity set.

    -

    The entity's id and its canonical URL depend on the period of application time of the corresponding time slice. Referencing and addressing the entity are equivalent concepts, unlike in the snapshot case.

    +

    The entity’s id and its canonical URL depend on the period of application time of the corresponding time slice. Referencing and addressing the entity are equivalent concepts, unlike in the snapshot case.

    The response to a time-range request need not reflect the time-slice cut of the underlying data model.

    Services MAY condense/defragment adjacent time slices that do not differ in represented properties other than the period boundaries. This reduces the payload size, and it also avoids potential information leakage if the service only publishes a projection of the underlying data model.

    -

    Services MAY also split time slices to align their boundaries with nested expanded time slices to represent a "coarsest common slicing" across an expand tree.

    +

    Services MAY also split time slices to align their boundaries with nested expanded time slices to represent a “coarsest common slicing” across an expand tree.

    Timeline entity sets MUST be annotated with a Timeline of type TimelineVisible.

    1.2.2 Document Conventions

    Keywords defined by this specification use this monospaced font.

    @@ -289,7 +289,7 @@

    Here is a customized command line which will generate HTML from this markdown file (named odata-temporal-ext-v4.0-csd04.md). Line breaks are added for readability only:

    -
    pandoc -f gfm+tex_math_dollars+fenced_divs
    +
    pandoc -f gfm+tex_math_dollars+fenced_divs+smart
            -t html
            -o odata-temporal-ext-v4.0-csd04.html
            -c styles/markdown-styles-v1.7.3b.css
    @@ -309,13 +309,13 @@ 

    2 Overview

  • When did or will something happen?
  • When did we learn that it happened?
  • -

    This leads to two "directions" or "dimensions" of time (measured as a date or date-plus-time value):

    +

    This leads to two “directions” or “dimensions” of time (measured as a date or date-plus-time value):

    • Application time, also called actual time, business time, effective time, or valid time, and
    • System time, also called recording time, audit time, or transaction time.
    -

    Keeping track of time is typically done by storing data together with the time period for which that data is deemed valid or effective, using separate periods for application time and system time, and the time periods are part of the logical key for "records". See [SQL:2011] or [Kulkarni] on how this is done in the SQL standard.

    -

    A consumer's perspective on this data can be different: even if time is tracked internally, the period of time may or may not be visible in a consumer's perspective, and even if visible the related properties are often not considered part of an entity's identity. For example, an employee is still the same person even after switching to another department.

    +

    Keeping track of time is typically done by storing data together with the time period for which that data is deemed valid or effective, using separate periods for application time and system time, and the time periods are part of the logical key for “records”. See [SQL:2011] or [Kulkarni] on how this is done in the SQL standard.

    +

    A consumer’s perspective on this data can be different: even if time is tracked internally, the period of time may or may not be visible in a consumer’s perspective, and even if visible the related properties are often not considered part of an entity’s identity. For example, an employee is still the same person even after switching to another department.

    The goals of this extension are:

  • Records of type TimelineVisible MAY specify the property ObjectKey.
      -
    • ObjectKey is the “sub-key” or “alternate key” that identifies time slices for a single temporal object. It is only necessary if the annotated entity set can contain time slices for more than one temporal object. The object key is a collection of property paths whose value combination uniquely identifies a temporal object.
    • +
    • ObjectKey is the “sub-key” or “alternate key” that identifies time slices for a single temporal object. It is only necessary if the annotated entity set can contain time slices for more than one temporal object. The object key is a collection of property paths whose value combination uniquely identifies a temporal object.
  • SupportedActions is a collection of qualified names of temporal actions that may be bound to the annotated entity set. These can be the standard actions defined in this specification, or service-specific actions.
  • @@ -609,12 +1410,12 @@

    now() with period start and end of type Edm.Date.

    +

    Note that there is no literal for “today” as clients and services can be in different time zones and thus can have different notions of which date is “today”. Clients are advised to use concrete temporal values and should avoid using the URL function now() with period start and end of type Edm.Date.

    Note that services may allow service-defined functions for temporal expressions, for example to deal with fiscal years in a particular company.

    4.2 Querying Temporal Data

    Temporal query options allow point-in-time as well as time-range queries. They take a temporal expression as their argument whose result type MUST match the type of the corresponding time period start and end.

    Adding temporal query options to a request does not alter the response shape, it only affects the returned data.

    -

    Temporal query options can be used with data modification operations, in which case they do not alter the modification semantics of the request, they only affect the response. That is, they only influence the "implicit GET" after successful data modification.

    +

    Temporal query options can be used with data modification operations, in which case they do not alter the modification semantics of the request, they only affect the response. That is, they only influence the “implicit GET” after successful data modification.

    If no temporal query options are specified,

    • timeline entity sets return all time slices, and
    • @@ -629,7 +1430,7 @@

      $at nested within $expand
    • by a $at value propagated along $expand
    • by $at in the query option part of the request URL, which applies to every segment of the resource path and paths that occur in system query options
    • -
    • by the default value "now" - the logic for determining this value is service-specific
    • +
    • by the default value “now” — the logic for determining this value is service-specific
    • For entities in a timeline entity set the time interval for filtering time slices is determined by the first applicable rule:

        @@ -641,7 +1442,7 @@

        4.2.2

        The $at query option takes a temporal expression as its argument. It retrieves the snapshot whose application time period contains the value of $at.

        For timeline entity sets and collection-valued navigation to timeline entity sets, $at=<point-in-time> is shorthand for

        -

        $from=<point-in-time>&$toInclusive=<point-in-time>

        +

        $from=<point-in-time>&$toInclusive=<point-in-time>

        The query option $at can be combined with $filter and $search. Only entities satisfying all specified criteria are returned.

        @@ -669,7 +1470,7 @@

        4.2.2

        Example 11: retrieve multiple employees at a past point in time

        GET /api-1/Employees?$filter=contains(Name,'i')&$at=2012-01-01
        -

        results in one time slice for each employee matching the filter at the specified point in time - note that E401 back then does not satisfy this condition

        +

        results in one time slice for each employee matching the filter at the specified point in time — note that E401 back then does not satisfy this condition

        {
           "@odata.context": "$metadata#Employees",
           "value": [
        @@ -731,7 +1532,7 @@ 

        $from=<point-in-time>&$toInclusive=<point-in-time>

        -

        The result is restricted to time slices whose application-time period overlaps with the interval defined by the query option values, taking the closed-open or closed-closed semantics of the entity set's time slices into account. The benefit of the query options is that the client does not have to inspect the temporal annotations to determine the property names of the period boundaries, the period semantics, and get all comparison operators right.

        +

        The result is restricted to time slices whose application-time period overlaps with the interval defined by the query option values, taking the closed-open or closed-closed semantics of the entity set’s time slices into account. The benefit of the query options is that the client does not have to inspect the temporal annotations to determine the property names of the period boundaries, the period semantics, and get all comparison operators right.

        For timeline entity sets with closed-open semantics $from=<start>&$to=<end> is shorthand for

        4.2.4 Interaction with Standard System Query Options

        -

        For snapshot entity sets the point in time for representing data is determined following the rules in section "Propagation of Temporal Query Options" and evaluated first, then all other system query options are evaluated on the data valid at that point in time, including the query option $apply defined in OData-Aggregation.

        -

        For timeline entity sets the interval for filtering data is determined following the rules in section "Propagation of Temporal Query Options" and evaluated as an additional criterion for $filter in the evaluation sequence defined in OData-Protocol, section "System Query Options", which is evaluated after the query option $apply.

        +

        For snapshot entity sets the point in time for representing data is determined following the rules in section “Propagation of Temporal Query Options” and evaluated first, then all other system query options are evaluated on the data valid at that point in time, including the query option $apply defined in OData-Aggregation.

        +

        For timeline entity sets the interval for filtering data is determined following the rules in section “Propagation of Temporal Query Options” and evaluated as an additional criterion for $filter in the evaluation sequence defined in OData-Protocol, section “System Query Options”, which is evaluated after the query option $apply.

        Example 16: retrieve employee history over a period of application time and filter on job title

        GET /api-2/Employees?$expand=history(
        @@ -938,7 +1739,7 @@ 

          ] }

        -

        The lambda operators any() and all() are not influenced by temporal query options, they are interpreted for each time slice on the filtered collection, meaning "any related time slice satisfying the lambda expression" and "all related time slices satisfy the lambda expression". The lambda expressions however can contain sub-expressions working on the period boundaries.

        +

        The lambda operators any() and all() are not influenced by temporal query options, they are interpreted for each time slice on the filtered collection, meaning “any related time slice satisfying the lambda expression” and “all related time slices satisfy the lambda expression”. The lambda expressions however can contain sub-expressions working on the period boundaries.

        Example 17: filter employees on their name at any point in time

        GET /api-2/Employees?$expand=history($select=Name,Jobtitle)
        @@ -977,7 +1778,7 @@ 

        4.3.1 Direct Modification of Time Slices

        -

        The temporal query options $at, $from and $to/$toInclusive can be used with data modification operations, in which case they do not alter the modification semantics of the request, they only affect the response of the "implicit GET" after the data modification.

        +

        The temporal query options $at, $from and $to/$toInclusive can be used with data modification operations, in which case they do not alter the modification semantics of the request, they only affect the response of the “implicit GET” after the data modification.

        Modification of time slices SHOULD be done with the temporal actions defined in the next section and its subsections.

        This specification does not define the behavior of standard insert, update, upsert, or delete requests on temporal entity sets, and potential side-effects of direct modification requests to period boundaries and adjacent time slices are beyond the scope of this specification as the underlying business logic will vary from service to service.

        4.3.2 Operations on Temporal Objects

        @@ -998,15 +1799,15 @@

        UnitOfTime of the collection. In particular, ClosedClosedPeriods governs whether the period end of type Edm.Date is the last day in the period or the first day after the period. The upper period boundary for items in deltaTimeslices need not be supplied; if it has no declared default value, it defaults to max.

        This works identical to the SQL statement UPDATE FOR PORTION OF:

          -
        1. The "delta time slices" in deltaTimeslices are processed in the order of the collection.
        2. +
        3. The “delta time slices” in deltaTimeslices are processed in the order of the collection.
        4. For each delta time slice all time slices from the bound collection are selected whose temporal object key values are identical to the values of corresponding properties present in the delta time slice, and whose application-time period overlaps with the period of the delta time slice.
        5. -
        6. Selected time slices whose period is not fully included in the period of the delta time slice are split into two or three consecutive time slices, one with fully included period, and one or two with a non-overlapping period immediately before or after the delta time slice's period.
        7. +
        8. Selected time slices whose period is not fully included in the period of the delta time slice are split into two or three consecutive time slices, one with fully included period, and one or two with a non-overlapping period immediately before or after the delta time slice’s period.
        9. Then all fully included time slices (including ones created in the previous step) are updated following the rules for updating entities specified in OData-Protocol.
        10. Gaps between selected time slices in the period to update are not affected.

        On success it returns the created or updated time slices.

        -

        Example 18: Change a department's budget during a period of application time with api-2 (visible timeline)

        +

        Example 18: Change a department’s budget during a period of application time with api-2 (visible timeline)

        POST /api-2/Departments('D08')/history/Temporal.Update
         Content-Type: application/json
         
        @@ -1148,7 +1949,7 @@ 

        -

        Example 19: Change an employee's job title during a period of application time with api-1 (snapshot). Note that the period boundaries are not visible in api-1 and are provided as PeriodStart and PeriodEnd next to the Timeslice data. The PeriodEnd is omitted, meaning the end of application time.

        +

        Example 19: Change an employee’s job title during a period of application time with api-1 (snapshot). Note that the period boundaries are not visible in api-1 and are provided as PeriodStart and PeriodEnd next to the Timeslice data. The PeriodEnd is omitted, meaning the end of application time.

        POST /api-1/Employees/Temporal.Update
         Content-Type: application/json
          
        @@ -1439,7 +2240,7 @@ 

        UnitOfTime of the collection. In particular, ClosedClosedPeriods governs whether the period end of type Edm.Date is the last day in the period or the first day after the period.

        This works identical to the SQL statement DELETE FOR PORTION OF:

          -
        1. The "delta time slices" in deltaTimeslices are processed in the order of the collection.
        2. +
        3. The “delta time slices” in deltaTimeslices are processed in the order of the collection.
        4. For each delta time slice all time slices from the bound collection are selected whose temporal object key values are identical to the values of corresponding properties present in the delta time slice, and whose application-time period overlaps with the period of the delta time slice.
        5. Selected time slices whose period is not fully included in the period of the delta time slice are split into two consecutive time slices, one with non-overlapping, and one with fully included period.
        6. Then all fully included time slices (including ones created in the previous step) are deleted following the rules for deleting entities specified in OData-Protocol.
        7. @@ -1463,45 +2264,45 @@

          [OData-ABNF]

          ABNF components: OData ABNF Construction Rules Version 4.02 and OData ABNF Test Cases.
          -See link in "Related work" section on cover page.

          +See link in “Related work” section on cover page.

          [OData-Aggregation]

          OData Extension for Data Aggregation Version 4.0.
          -See link in "Related work" section on cover page.

          +See link in “Related work” section on cover page.

          [OData-CSDL]

          OData Common Schema Definition Language (CSDL) JSON Representation Version 4.02.
          -See link in "Related work" section on cover page.

          +See link in “Related work” section on cover page.

          OData Common Schema Definition Language (CSDL) XML Representation Version 4.02.
          -See link in "Related work" section on cover page.

          +See link in “Related work” section on cover page.

          [OData-Protocol]

          OData Version 4.02. Part 1: Protocol.
          -See link in "Related work" section on cover page.

          +See link in “Related work” section on cover page.

          [OData-URL]

          OData Version 4.02. Part 2: URL Conventions.
          -See link in "Related work" section on cover page.

          +See link in “Related work” section on cover page.

          [OData-VocCap]

          OData Vocabularies Version 4.0: Capabilities Vocabulary.
          -See link in "Related work" section on cover page.

          +See link in “Related work” section on cover page.

          [OData-VocCore]

          OData Vocabularies Version 4.0: Core Vocabulary.
          -See link in "Related work" section on cover page.

          +See link in “Related work” section on cover page.

          [OData-VocTemporal]

          OData Temporal Vocabulary.
          -See link in "Additional artifacts" section on cover page.

          +See link in “Additional artifacts” section on cover page.

          [RFC2119]
          -

          Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997
          +

          Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels”, BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997
          https://www.rfc-editor.org/info/rfc2119.

          [RFC8174]
          -

          Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017
          +

          Leiba, B., “Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words”, BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017
          https://www.rfc-editor.org/info/rfc8174.

          A.2 Informative References

          [Fowler]
          -

          Martin Fowler, "Temporal Patterns", 16 February 2005
          +

          Martin Fowler, “Temporal Patterns”, 16 February 2005
          http://martinfowler.com/eaaDev/timeNarrative.html.

          [Kulkarni]
          -

          Krishna Kulkarni, "Temporal Features in SQL standard", September 2012
          +

          Krishna Kulkarni, “Temporal Features in SQL standard”, September 2012
          https://dbs.uni-leipzig.de/file/Temporal%20features%20in%20SQL2011.pdf.

          [Snodgrass]
          -

          Richard T. Snodgrass, "Developing Time-Oriented Database Applications in SQL", Morgan Kaufmann Publishers, Inc., San Francisco, July, 1999, ISBN 1-55860-436-7
          +

          Richard T. Snodgrass, “Developing Time-Oriented Database Applications in SQL”, Morgan Kaufmann Publishers, Inc., San Francisco, July, 1999, ISBN 1-55860-436-7
          http://www2.cs.arizona.edu/people/rts/tdbbook.pdf and http://www2.cs.arizona.edu/people/rts/pp30-31.pdf.

          [SQL:2011]

          ISO/IEC 9075-2:2011 Information technology - Database languages - SQL - Part 2: Foundation (SQL/Foundation).

          @@ -1627,14 +2428,14 @@

          Appendix D. Notice

          Copyright © OASIS Open 2023. All Rights Reserved.

          -

          All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The full Policy may be found at the OASIS website.

          +

          All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the “OASIS IPR Policy”). The full Policy may be found at the OASIS website.

          This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published, and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this section are included on all such copies and derivative works. However, this document itself may not be modified in any way, including by removing the copyright notice or references to OASIS, except as needed for the purpose of developing any document or deliverable produced by an OASIS Technical Committee (in which case the rules applicable to copyrights, as set forth in the OASIS IPR Policy, must be followed) or as required to translate it into languages other than English.

          The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.

          -

          This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

          +

          This document and the information contained herein is provided on an “AS IS” basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

          As stated in the OASIS IPR Policy, the following three paragraphs in brackets apply to OASIS Standards Final Deliverable documents (Committee Specification, Candidate OASIS Standard, OASIS Standard, or Approved Errata).

          [OASIS requests that any OASIS Party or any other party that believes it has patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable, to notify OASIS TC Administrator and provide an indication of its willingness to grant patent licenses to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this deliverable.]

          [OASIS invites any party to contact the OASIS TC Administrator if it is aware of a claim of ownership of any patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable by a patent holder that is not willing to provide a license to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this OASIS Standards Final Deliverable. OASIS may include such claims on its website, but disclaims any obligation to do so.]

          -

          [OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS' procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

          -

          The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark/ for above guidance.

          +

          [OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS’ procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

          +

          The name “OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark/ for above guidance.

          diff --git a/docs/odata-temporal-ext/odata-temporal-ext.md b/docs/odata-temporal-ext/odata-temporal-ext.md index 0716934f4..b16755037 100644 --- a/docs/odata-temporal-ext/odata-temporal-ext.md +++ b/docs/odata-temporal-ext/odata-temporal-ext.md @@ -69,7 +69,7 @@ This specification defines how to represent and interact with time-dependent dat #### Status: This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical. -TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "[Send A Comment](https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=odata)" button on the TC's web page at https://www.oasis-open.org/committees/odata/. +TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/. This specification is provided under the [RF on RAND Terms Mode](https://www.oasis-open.org/policies-guidelines/ipr/#RF-on-RAND-Mode) of the [OASIS IPR Policy](https://www.oasis-open.org/policies-guidelines/ipr/), the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php). @@ -296,7 +296,7 @@ All other text is normative unless otherwise labeled. Here is a customized command line which will generate HTML from this markdown file (named `odata-temporal-ext-v4.0-csd04.md`). Line breaks are added for readability only: ``` -pandoc -f gfm+tex_math_dollars+fenced_divs +pandoc -f gfm+tex_math_dollars+fenced_divs+smart -t html -o odata-temporal-ext-v4.0-csd04.html -c styles/markdown-styles-v1.7.3b.css @@ -372,7 +372,192 @@ Example 2: model for `api-1` with snapshot entit application time), key properties marked with {id} ::: -
          Employee
          Employee
          ID: Edm.String {id}
          ID: Edm.String {id}
          Name: Edm.String
          Name: Edm.String
          Jobtitle: Edm.String
          Jobtitle: Edm.String
          Department
          Department
          ID: Edm.String {id}
          ID: Edm.String {id}
          Name: Edm.String
          Name: Edm.String
          \*
          Employees
          \*...
          1
          Department
          1...
          Text is not SVG - cannot display
          + + + + + + + + + +
          +
          +
          + Employee +
          +
          +
          +
          + + Employee + +
          +
          + + + +
          +
          +
          + ID: Edm.String {id} +
          +
          +
          +
          + + ID: Edm.String {id} + +
          +
          + + + +
          +
          +
          + Name: Edm.String +
          +
          +
          +
          + + Name: Edm.String + +
          +
          + + + +
          +
          +
          + Jobtitle: Edm.String +
          +
          +
          +
          + + Jobtitle: Edm.String + +
          +
          + + + + + + +
          +
          +
          + Department +
          +
          +
          +
          + + Department + +
          +
          + + + +
          +
          +
          + ID: Edm.String {id} +
          +
          +
          +
          + + ID: Edm.String {id} + +
          +
          + + + +
          +
          +
          + Name: Edm.String +
          +
          +
          +
          + + Name: Edm.String + +
          +
          + + + + + + +
          +
          +
          +
          + + * + +
          +
          + + Employees + +
          +
          +
          +
          +
          + + *... + +
          +
          + + + +
          +
          +
          +
          +
          + + 1 + +
          +
          + + Department + +
          +
          +
          +
          +
          +
          + + 1... + +
          +
          +
          + + + + + Text is not SVG - cannot display + + + +
          and @@ -381,7 +566,361 @@ Example 3: model for `api-2` with timeline entit application time), key properties marked with {id} ::: -
          Employee_history
          Employee_history
          From: Edm.Date {id}
          From: Edm.Date {id}
          To: Edm.Date
          To: Edm.Date
          Name: Edm.String
          Name: Edm.String
          Jobtitle: Edm.String
          Jobtitle: Edm.String
          Department_history
          Department_history
          From: Edm.Date {id}
          From: Edm.Date {id}
          To: Edm.Date
          To: Edm.Date
          Name: Edm.String
          Name: Edm.String
          Budget: Edm.Decimal
          Budget: Edm.Decimal
          Employee
          Employee
          ID: Edm.String {id}
          ID: Edm.String {id}
          Department
          Department
          ID: Edm.String {id}
          ID: Edm.String {id}
          \*
          Employees
          \*...
          \*
          history
          \*...
          \*
          history
          \*...
          1
          Department
          1...
          Text is not SVG - cannot display
          + + + + + + + + + +
          +
          +
          + Employee_history +
          +
          +
          +
          + + Employee_history + +
          +
          + + + +
          +
          +
          + From: Edm.Date {id} +
          +
          +
          +
          + + From: Edm.Date {id} + +
          +
          + + + +
          +
          +
          + To: Edm.Date +
          +
          +
          +
          + + To: Edm.Date + +
          +
          + + + +
          +
          +
          + Name: Edm.String +
          +
          +
          +
          + + Name: Edm.String + +
          +
          + + + +
          +
          +
          + Jobtitle: Edm.String +
          +
          +
          +
          + + Jobtitle: Edm.String + +
          +
          + + + + + + +
          +
          +
          + Department_history +
          +
          +
          +
          + + Department_history + +
          +
          + + + +
          +
          +
          + From: Edm.Date {id} +
          +
          +
          +
          + + From: Edm.Date {id} + +
          +
          + + + +
          +
          +
          + To: Edm.Date +
          +
          +
          +
          + + To: Edm.Date + +
          +
          + + + +
          +
          +
          + Name: Edm.String +
          +
          +
          +
          + + Name: Edm.String + +
          +
          + + + +
          +
          +
          + Budget: Edm.Decimal +
          +
          +
          +
          + + Budget: Edm.Decimal + +
          +
          + + + + + + +
          +
          +
          + Employee +
          +
          +
          +
          + + Employee + +
          +
          + + + +
          +
          +
          + ID: Edm.String {id} +
          +
          +
          +
          + + ID: Edm.String {id} + +
          +
          + + + + + + +
          +
          +
          + Department +
          +
          +
          +
          + + Department + +
          +
          + + + +
          +
          +
          + ID: Edm.String {id} +
          +
          +
          +
          + + ID: Edm.String {id} + +
          +
          + + + + + +
          +
          +
          +
          + + * + +
          +
          + + Employees + +
          +
          +
          +
          +
          + + *... + +
          +
          + + + + + +
          +
          +
          +
          + + * + +
          +
          + history +
          +
          +
          +
          +
          + + *... + +
          +
          + + + + + +
          +
          +
          +
          + + * + +
          +
          + history +
          +
          +
          +
          +
          + + *... + +
          +
          + + + +
          +
          +
          +
          +
          + + 1 + +
          +
          + + Department + +
          +
          +
          +
          +
          +
          + + 1... + +
          +
          + + +
          + + + + + Text is not SVG - cannot display + + + +
          ## 2.2 Example Data @@ -393,7 +932,266 @@ Example 4: simple storage model: object key in dark green, temporal sub-key in light green, foreign keys in orange, non-key fields in blue ::: -
          Employee
          Employee
          ID: String {id}
          ID: String {id}
          From: Date {id}
          From: Date {id}
          To: Date
          To: Date
          Name: String
          Name: String
          Jobtitle: String
          Jobtitle: String
          Department.ID
          Department.ID
          Department
          Department
          ID: String {id}
          ID: String {id}
          From: Date {id}
          From: Date {id}
          To: Date
          To: Date
          Name: String
          Name: String
          Budget: Decimal
          Budget: Decimal
          1
          1
          Text is not SVG - cannot display
          + + + + + + + + + +
          +
          +
          + Employee +
          +
          +
          +
          + + Employee + +
          +
          + + + + +
          +
          +
          + ID: String {id} +
          +
          +
          +
          + + ID: String {id} + +
          +
          + + + + +
          +
          +
          + From: Date {id} +
          +
          +
          +
          + + From: Date {id} + +
          +
          + + + + +
          +
          +
          + To: Date +
          +
          +
          +
          + + To: Date + +
          +
          + + + + +
          +
          +
          + Name: String +
          +
          +
          +
          + + Name: String + +
          +
          + + + + +
          +
          +
          + Jobtitle: String +
          +
          +
          +
          + + Jobtitle: String + +
          +
          + + + + +
          +
          +
          + Department.ID +
          +
          +
          +
          + + Department.ID + +
          +
          + + + + + + +
          +
          +
          + Department +
          +
          +
          +
          + + Department + +
          +
          + + + + +
          +
          +
          + ID: String {id} +
          +
          +
          +
          + + ID: String {id} + +
          +
          + + + + +
          +
          +
          + From: Date {id} +
          +
          +
          +
          + + From: Date {id} + +
          +
          + + + + +
          +
          +
          + To: Date +
          +
          +
          +
          + + To: Date + +
          +
          + + + + +
          +
          +
          + Name: String +
          +
          +
          +
          + + Name: String + +
          +
          + + + + +
          +
          +
          + Budget: Decimal +
          +
          +
          +
          + + Budget: Decimal + +
          +
          + + + +
          +
          +
          +
          +
          + 1 +
          +
          +
          +
          +
          +
          + + 1 + +
          +
          + + +
          + + + + + Text is not SVG - cannot display + + + +
          The period start date is used as the temporal sub-key for identifying time slices together with the key of the temporal object. @@ -504,8 +1302,8 @@ structured type with the following properties: - If the period end property does not specify a default value, a default value of "ad infinitum" is assumed. - Records of type `TimelineVisible` MAY specify the property `ObjectKey`. - - `ObjectKey` is the “sub-key” or “alternate key” that identifies time slices for a single temporal object. It is only necessary if the annotated entity set can contain time slices - for more than one temporal object. `The object key is `a collection of + - `ObjectKey` is the "sub-key" or "alternate key" that identifies time slices for a single temporal object. It is only necessary if the annotated entity set can contain time slices + for more than one temporal object. The object key is a collection of property paths whose value combination uniquely identifies a temporal object. - `SupportedActions` is a collection of @@ -678,7 +1476,7 @@ applicable rule: 2. by a [`$at`](#QueryOptionat) value propagated along `$expand` 3. by [`$at`](#QueryOptionat) in the query option part of the request URL, which applies to every segment of the resource path and paths that occur in system query options -4. by the default value "now" - the logic for determining this value is service-specific +4. by the default value "now" --- the logic for determining this value is service-specific For entities in a [timeline entity set](#TimelineEntitySet) the time interval for filtering time slices is determined by the first @@ -698,7 +1496,7 @@ For timeline entity sets and collection-valued navigation to timeline entity sets, `$at=` is shorthand for ::: indent -[`$from`](#QueryOptionsfromtoandtoInclusive)=`&`[`$toInclusive`](#QueryOptionsfromtoandtoInclusive)`=` +[`$from`](#QueryOptionsfromtoandtoInclusive)`=&`[`$toInclusive`](#QueryOptionsfromtoandtoInclusive)`=` ::: The query option `$at` can be combined with `$filter` and `$search`. @@ -743,7 +1541,7 @@ Example 11: retrieve multiple employees at a past point in time GET /api-1/Employees?$filter=contains(Name,'i')&$at=2012-01-01 ``` results in one time slice for each employee matching the filter at the -specified point in time - note that E401 back then does not satisfy +specified point in time --- note that E401 back then does not satisfy this condition ```json { diff --git a/docs/odata-url-conventions/odata-url-conventions.html b/docs/odata-url-conventions/odata-url-conventions.html index 04988f8b2..b42a14963 100644 --- a/docs/odata-url-conventions/odata-url-conventions.html +++ b/docs/odata-url-conventions/odata-url-conventions.html @@ -141,12 +141,12 @@

          Abstract:

          The Open Data Protocol (OData) enables the creation of REST-based data services, which allow resources, identified using Uniform Resource Locators (URLs) and defined in an Entity Data Model (EDM), to be published and edited by Web clients using simple HTTP messages. This specification defines a set of recommended (but not required) rules for constructing URLs to identify the data and metadata exposed by an OData service as well as a set of reserved URL query string operators.

          Status:

          -

          This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical.

          -

          TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/.

          -

          This specification is provided under the RF on RAND Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php).

          -

          Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product's prose narrative document(s), the content in the separate plain text file prevails.

          +

          This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the “Latest stage” location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical.

          +

          TC members should send comments on this specification to the TC’s email list. Others should send comments to the TC’s public comment list, after subscribing to it by following the instructions at the “Send A Comment” button on the TC’s web page at https://www.oasis-open.org/committees/odata/.

          +

          This specification is provided under the RF on RAND Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC’s web page (https://www.oasis-open.org/committees/odata/ipr.php).

          +

          Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product’s prose narrative document(s), the content in the separate plain text file prevails.

          Key words:

          -

          The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

          +

          The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

          Citation format:

          When referencing this specification the following citation format should be used:

          [OData-v4.02-Part2]

          @@ -154,7 +154,7 @@

          Citation format:

          Notices

          Copyright © OASIS Open 2023. All Rights Reserved.

          Distributed under the terms of the OASIS IPR Policy.

          -

          The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs.

          +

          The name “OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs.

          For complete copyright information please see the full Notices section in an Appendix below.


          Table of Contents

          @@ -258,7 +258,7 @@

          Table of Contents

  • 5.1.1.7 String Functions

    After applying these steps defined by RFC3986 the following steps MUST be performed:

      -
    • Split undecoded query at "&" into query options, and each query option at the first "=" into query option name and query option value
    • +
    • Split undecoded query at “&” into query options, and each query option at the first “=” into query option name and query option value
    • Percent-decode path segments, query option names, and query option values exactly once
    • Interpret path segments, query option names, and query option values according to OData rules
    @@ -474,17 +474,17 @@

    OData-ABNF.

    Below is a (non-normative) snippet from OData-ABNF:

    resourcePath = entitySetName                  [collectionNavigation]
    -             / singleton                      [singleNavigation]
    +             / singletonEntity                [singleNavigation]
                  / actionImportCall
                  / entityColFunctionImportCall    [ collectionNavigation ]
                  / entityFunctionImportCall       [ singleNavigation ]
                  / complexColFunctionImportCall   [ collectionPath ]
                  / complexFunctionImportCall      [ complexPath ]
                  / primitiveColFunctionImportCall [ collectionPath ]
    -             / primitiveFunctionImportCall    [ singlePath ]
    -             / functionImportCallNoParens
    -             / crossjoin
    -             / '$all'                         [ "/" qualifiedEntityTypeName ]
    + / primitiveFunctionImportCall [ primitivePath ] + / functionImportCallNoParens [ querySegment ] + / crossjoin [ querySegment ] + / %s"$all" [ "/" optionallyQualifiedEntityTypeName ]

  • Since OData has a uniform composable URL syntax and associated rules there are many ways to address a collection of entities, including, but not limited to:

    5.1.1.3 Grouping

    -

    The Grouping operator (open and close parenthesis "( )") controls the evaluation order of an expression. The Grouping operator returns the expression grouped inside the parenthesis.

    +

    The Grouping operator (open and close parenthesis “( )”) controls the evaluation order of an expression. The Grouping operator returns the expression grouped inside the parenthesis.

    Example 68: all products because 9 mod 3 is 0

    http://host/service/Products?$filter=(4 add 5) mod (4 sub 1) eq 0
    @@ -1079,7 +1079,7 @@
    5.1.1.5.2 cont

    The contains function with ordered collection parameter values returns true if the first collection can be transformed into the second collection by removing zero or more items from the beginning or the end of the first collection.

    The containsMethodCallExpr syntax rule defines how the contains function is invoked.

    -

    Example 70: all customers with a CompanyName that contains 'Alfreds'

    +

    Example 70: all customers with a CompanyName that contains Alfreds

    http://host/service/Customers?$filter=contains(CompanyName,'Alfreds')
    5.1.1.5.3 endswith
    @@ -1090,7 +1090,7 @@
    5.1.1.5.3 ends

    The endswith function with ordered collection parameter values returns true if the first collection can be transformed into the second collection by removing zero or more items from the beginning of the first collection.

    The endsWithMethodCallExpr syntax rule defines how the endswith function is invoked.

    -

    Example 71: all customers with a CompanyName that ends with 'Futterkiste'

    +

    Example 71: all customers with a CompanyName that ends with Futterkiste

    http://host/service/Customers?$filter=endswith(CompanyName,'Futterkiste')
    5.1.1.5.4 indexof
    @@ -1101,7 +1101,7 @@
    5.1.1.5.4 indexof

    The indexof function with ordered collection parameter values returns the zero-based index of the first occurrence of the second collection in the first collection, or -1 if the first collection does not contain the second collection.

    The indexOfMethodCallExpr syntax rule defines how the indexof function is invoked.

    -

    Example 72: all customers with a CompanyName containing 'lfreds' starting at the second character

    +

    Example 72: all customers with a CompanyName containing lfreds starting at the second character

    http://host/service/Customers?$filter=indexof(CompanyName,'lfreds') eq 1
    5.1.1.5.5 length
    @@ -1123,7 +1123,7 @@
    5.1.1.5.6 The startswith function with ordered collection parameter values returns true if the first collection can be transformed into the second collection by removing zero or more items from the end of the first collection.

    The startsWithMethodCallExpr syntax rule defines how the startswith function is invoked.

    -

    Example 74: all customers with a CompanyName that starts with 'Alfr'

    +

    Example 74: all customers with a CompanyName that starts with Alfr

    http://host/service/Customers?$filter=startswith(CompanyName,'Alfr')
    5.1.1.5.7 substring
    @@ -1141,11 +1141,11 @@
    5.1.1.5.7 s

    A negative start index N, if supported, returns a string/collection starting N characters/items before the end of the string/collection.

    The substringMethodCallExpr syntax rule defines how the substring function is invoked.

    -

    Example 75: all customers with a CompanyName of 'lfreds Futterkiste' once the first character has been removed

    +

    Example 75: all customers with a CompanyName of lfreds Futterkiste once the first character has been removed

    http://host/service/Customers?$filter=substring(CompanyName,1) eq 'lfreds Futterkiste'
    -

    Example 76: all customers with a CompanyName that has 'lf' as the second and third characters, e.g, 'Alfreds Futterkiste'

    +

    Example 76: all customers with a CompanyName that has lf as the second and third characters, e.g, Alfreds Futterkiste

    http://host/service/Customers?$filter=substring(CompanyName,1,2) eq 'lf'

    5.1.1.6 Collection Functions

    @@ -1192,20 +1192,20 @@
    5. hassubsequence([1,2],[1,1,2])

    5.1.1.7 String Functions

    -
    5.1.1.7.1 matchesPattern
    -

    The matchesPattern function has the following signature:

    -
    Edm.Boolean matchesPattern(Edm.String,Edm.String)
    -

    The second parameter MUST evaluate to a string containing an [ECMAScript] (JavaScript) regular expression. The matchesPattern function returns true if the first parameter evaluates to a string matching that regular expression, using syntax and semantics of [ECMAScript] regular expressions, otherwise it returns false.

    +
    5.1.1.7.1 matchespattern
    +

    The matchespattern function has the following signature:

    +
    Edm.Boolean matchespattern(Edm.String,Edm.String)
    +

    The second parameter MUST evaluate to a string containing an [ECMAScript] (JavaScript) regular expression. The matchespattern function returns true if the first parameter evaluates to a string matching that regular expression, using syntax and semantics of [ECMAScript] regular expressions, otherwise it returns false.

    Example 81: all customers with a CompanyName that match the (percent-encoded) regular expression ^A.*e$

    -
    http://host/service/Customers?$filter=matchesPattern(CompanyName,'%5EA.*e$')
    +
    http://host/service/Customers?$filter=matchespattern(CompanyName,'%5EA.*e$')
    5.1.1.7.2 tolower

    The tolower function has the following signature:

    Edm.String tolower(Edm.String)

    The tolower function returns the input parameter string value with all uppercase characters converted to lowercase according to Unicode rules. The toLowerMethodCallExpr syntax rule defines how the tolower function is invoked.

    -

    Example 82: all customers with a CompanyName that equals 'alfreds futterkiste' once any uppercase characters have been converted to lowercase

    +

    Example 82: all customers with a CompanyName that equals alfreds futterkiste once any uppercase characters have been converted to lowercase

    http://host/service/Customers?$filter=tolower(CompanyName) eq 'alfreds futterkiste'
    5.1.1.7.3 toupper
    @@ -1213,7 +1213,7 @@
    5.1.1.7.3 toupper
    Edm.String toupper(Edm.String)

    The toupper function returns the input parameter string value with all lowercase characters converted to uppercase according to Unicode rules. The toUpperMethodCallExpr syntax rule defines how the toupper function is invoked.

    -

    Example 83: all customers with a CompanyName that equals 'ALFREDS FUTTERKISTE' once any lowercase characters have been converted to uppercase

    +

    Example 83: all customers with a CompanyName that equals ALFREDS FUTTERKISTE once any lowercase characters have been converted to uppercase

    http://host/service/Customers?$filter=toupper(CompanyName) eq 'ALFREDS FUTTERKISTE'
    5.1.1.7.4 trim
    @@ -1361,7 +1361,7 @@
    5.1.1.10.1 castThe null value can be cast to any type.
  • Primitive types are cast to Edm.String or a type definition based on it by using the literal representation used in payloads, and WKT (well-known text) format for Geo types, see rules fullCollectionLiteral, fullLineStringLiteral, fullMultiPointLiteral, fullMultiLineStringLiteral, fullMultiPolygonLiteral, fullPointLiteral, and fullPolygonLiteral in OData-ABNF. The cast fails if the target type specifies an insufficient MaxLength.
  • Edm.String, or a type definition based on Edm.String, can be cast to a primitive type if the string contains a literal representation for the target type.
  • -
  • Numeric primitive types are cast to each other with appropriate rounding. The cast fails if the integer part doesn't fit into the target type.
  • +
  • Numeric primitive types are cast to each other with appropriate rounding. The cast fails if the integer part doesn’t fit into the target type.
  • Edm.DateTimeOffset, Edm.Duration, and Edm.TimeOfDay values can be cast to the same type with a different precision with appropriate rounding.
  • Non-Unicode string values can be cast to a Unicode string type definition. Unicode string values can be cast to a non-Unicode string type definition if the Unicode string only contains ASCII characters.
  • Structured types are assignable to their type or a direct or indirect base type.
  • @@ -1393,7 +1393,7 @@
    5.1.1.11.1

    The geo.distance function has the following signatures:

    Edm.Double geo.distance(Edm.GeographyPoint,Edm.GeographyPoint)
     Edm.Double geo.distance(Edm.GeometryPoint,Edm.GeometryPoint)
    -

    The geo.distance function returns the shortest distance between the two points in the coordinate reference system signified by the two points' SRIDs.

    +

    The geo.distance function returns the shortest distance between the two points in the coordinate reference system signified by the two points’ SRIDs.

    5.1.1.11.2 geo.intersects

    The geo.intersects function has the following signatures:

    Edm.Boolean geo.intersects(Edm.GeographyPoint,Edm.GeographyPolygon)
    @@ -1408,8 +1408,8 @@ 

    5.1.1.12.1 case

    The case function has the following signature:

    expression case(Edm.Boolean:expression, ..., Edm.Boolean:expression)
    -

    Each parameter is a pair of expressions separated by a colon (:), where the first expression -- the condition -- MUST be a Boolean expression, and the second expression -- the result -- may evaluate to any type.

    -

    The case function evaluates the condition in each pair, starting with the leftmost pair, and stops as soon as a condition evaluates to true. It then returns the value of the result of this pair. It returns null if none of the conditions in any pair evaluates to true. Clients can specify a last pair whose condition is true to get a non-null "default/else/otherwise" result.

    +

    Each parameter is a pair of expressions separated by a colon (:), where the first expression — the condition — MUST be a Boolean expression, and the second expression — the result — may evaluate to any type.

    +

    The case function evaluates the condition in each pair, starting with the leftmost pair, and stops as soon as a condition evaluates to true. It then returns the value of the result of this pair. It returns null if none of the conditions in any pair evaluates to true. Clients can specify a last pair whose condition is true to get a non-null “default/else/otherwise” result.

    Clients SHOULD ensure that the results in all pairs are compatible. If all results are of the same type, the type of the case expression is of that type. If all results are of numeric type, then the type of the case expression is a numeric type capable of representing any of these expressions according to standard type promotion rules.

    Services MAY support case expressions containing parameters of incompatible types, in which case the case expression is treated as Edm.Untyped and its value has the type of the parameter expression selected by the case statement.

    @@ -1417,11 +1417,11 @@
    5.1.1.12.1 case$compute=case(X gt 0:1,X lt 0:-1,true:0) as SignumX

    5.1.1.13 Lambda Operators

    -

    OData defines two operators that evaluate a Boolean expression on a collection. Both must be prepended with a navigation path that identifies a collection.

    +

    OData defines two operators that evaluate a Boolean expression on a collection. Both must be prepended with a path expression that identifies a collection.

    4.01 Services MUST support case-insensitive lambda operator names. Clients that want to work with 4.0 services MUST use lower case lambda operator names.

    -

    The argument of a lambda operator is a case-sensitive lambda variable name followed by a colon (:) and a Boolean expression that uses the lambda variable name to refer to properties of members of the collection identified by the navigation path.

    +

    The argument of a lambda operator is a case-sensitive lambda variable name followed by a colon (:) and a Boolean expression that uses the lambda variable name to refer to properties of the instance or of members of the collection identified by the path expression.

    If the name chosen for the lambda variable matches a property name of the current resource referenced by the resource path, the lambda variable takes precedence. Clients can prefix properties of the current resource referenced by the resource path with $it.

    -

    Other path expressions in the Boolean expression neither prefixed with the lambda variable nor $it are evaluated in the scope of the collection instances at the origin of the navigation path prepended to the lambda operator.

    +

    Other path expressions in the Boolean expression neither prefixed with the lambda variable nor $it are evaluated in the scope of the instance or of members of the collection at the origin of the path expression prepended to the lambda operator.

    5.1.1.13.1 any

    The any operator applies a Boolean expression to each member of a collection and returns true if and only if the expression is true for any member of the collection, otherwise it returns false. This implies that the any operator always returns false for an empty collection.

    The any operator can be used without an argument expression. This short form returns false if and only if the collection is empty.

    @@ -1487,7 +1487,7 @@
    duration". Enumeration literals in OData 4.0 required prefixing with the qualified type name of the enumeration.

    +

    Duration literals in OData 4.0 required prefixing with “duration”. Enumeration literals in OData 4.0 required prefixing with the qualified type name of the enumeration.

    In OData 4.01, services MUST support duration and enumeration literals with or without the type prefix. OData clients that want to operate across OData 4.0 and OData 4.01 services should always include the prefix for duration and enumeration types.

    5.1.1.14.2 Complex and Collection Literals

    Complex literals and collection literals in URLs are represented as JSON objects and arrays according to the arrayOrObject rule in OData-ABNF. Such literals MUST NOT appear in the path portion of the URL but can be passed to bound functions and function imports in path segments by using parameter aliases.

    @@ -1514,7 +1514,7 @@
    5.1.1.14.4 $it
    http://host/service/Customers(1)/EmailAddresses?$filter=endswith($it,'.com')
    -

    Example 106: customers along with their orders that shipped to the same city as the customer's address. The nested filter expression is evaluated in the context of Orders; $it allows referring to values in the outer context of Customers.

    +

    Example 106: customers along with their orders that shipped to the same city as the customer’s address. The nested filter expression is evaluated in the context of Orders; $it allows referring to values in the outer context of Customers.

    http://host/service/Customers?$expand=Orders($filter=$it/Address/City eq ShipTo/City)
    @@ -1565,7 +1565,7 @@

    Core.Messages annotation

    http://host/service/Employees?$filter=@Core.Messages/any(m:m/severity eq 'error')

    -

    Services MAY additionally support the use of the unqualified term name by defining one or more default namespaces through the Core.DefaultNamespace annotation term defined in OData-VocCore. For more information on default namespaces, see Default Namespaces in OData-Protocol. This short notation however uses the same name pattern as parameter aliases. If a query option is specified as a parameter alias, then any occurrence of the parameter alias name in an expression MUST evaluate to the parameter alias value and MUST NOT evaluate to the annotation value of an identical unqualified term name.

    +

    Services MAY additionally support the use of the unqualified term name by defining one or more default namespaces through the Core.DefaultNamespace annotation term defined in OData-VocCore. For more information on default namespaces, see Default Namespaces in OData-Protocol. This short notation however uses the same name pattern as parameter aliases. If a query option is specified as a parameter alias, then any occurrence of the parameter alias name in an expression MUST evaluate to the parameter alias value and MUST NOT evaluate to the annotation value of an identical unqualified term name.

    5.1.1.17 Operator Precedence

    OData services MUST use the following operator precedence for supported operators when evaluating $filter and $orderby expressions. Operators are listed by category in order of precedence from highest to lowest. Operators in the same category have equal precedence:

    Added section about fundamentals of input and output sets
    Algorithmic descriptions of transformations
    Added join and outerjoin transformations, replaced expand by addnested
    Added transformations orderby, skip, top, nest
    Added transformations for recursive hierarchies, updated related filter functions
    Added functions evaluable on a collection, introduced keyword $these
    Merged section 4 “Representation of Aggregated Instances” into section 3
    Remove actions and functions (except set transformations) on aggregated entities, adapted section “Actions and Functions on Aggregated Entities”
    Committee Specification 032023-08-302023-09-19 Ralf Handl
    Gerald Krause
    Heiko Theißen
    Non-material changes from public review feedback
    matchesPattern
    matchesPattern(CompanyName,'%5EA.*e$')
    matchespattern
    matchespattern(CompanyName,'%5EA.*e$')
    tolower
    tolower(CompanyName) eq 'alfreds futterkiste'
    toupper
    toupper(CompanyName) eq 'ALFREDS FUTTERKISTE'
    trim
    trim(CompanyName) eq 'Alfreds Futterkiste'
    hassubset
    hassubset([4,1,3],[3,1])
    hassubsequence
    hassubsequence([4,1,3,1],[1,1])
    String Functions
    matchesPattern
    matchesPattern(CompanyName,'%5EA.*e$')
    matchespattern
    matchespattern(CompanyName,'%5EA.*e$')
    tolower
    tolower(CompanyName) eq 'alfreds futterkiste'
    toupper
    toupper(CompanyName) eq 'ALFREDS FUTTERKISTE'
    trim
    trim(CompanyName) eq 'Alfreds Futterkiste'
    @@ -1725,9 +1725,9 @@

    $filter, $select, $orderby, $skip, $top, $count, $search, and $expand.

    +

    Query options can be applied to an expanded navigation property by appending a semicolon-separated list of query options, enclosed in parentheses, to the navigation property name. Allowed system query options are $compute, $select, $expand, and $levels for all navigation properties, plus $filter, $orderby, $skip, $top, $count, and $search for collection-valued navigation properties.

    Example 117: all categories and for each category all related products with a discontinued date equal to null

    http://host/service/Categories?$expand=Products($filter=DiscontinuedDate eq null)
    @@ -1783,9 +1783,9 @@

    Cyclic navigation properties (whose target type is identical or can be cast to its source type) can be recursively expanded using the special $levels option. The value of the $levels option is either a positive integer to specify the number of levels to expand, or the literal string max to specify the maximum expansion level supported by that service. A $levels option with a value of 1 specifies a single expand with no recursion.

    -

    Example 123: all employees with their manager, manager's manager, and manager's manager's manager

    +

    Example 123: all employees with their manager, manager’s manager, and manager’s manager’s manager

    http://host/service/Employees?$expand=ReportsTo($levels=3)

    It is also possible to expand all declared and dynamic navigation properties using a star (*). To retrieve references to all related entities use */$ref, and to expand all related entities with a certain distance use the star operator with the $levels option. The star operator can be combined with explicitly named navigation properties, which take precedence over the star operator.

    @@ -1800,12 +1800,12 @@

    -

    Example 126: include Employee's Photo stream property along with other properties of the customer

    +

    Example 126: include Employee’s Photo stream property along with other properties of the customer

    http://host/service/Employees?$expand=Photo

    -

    Specifying $value for a media entity includes the media entity's stream value inline according to the specified format.

    +

    Specifying $value for a media entity includes the media entity’s stream value inline according to the specified format.

    -

    Example 127: Include the Product's media stream along with other properties of the product

    +

    Example 127: Include the Product’s media stream along with other properties of the product

    http://host/service/Products?$expand=$value

    5.1.4 System Query Option $select

    @@ -1826,7 +1826,7 @@

    Example 128: rating and release date of all products

    http://host/service/Products?$select=Rating,ReleaseDate
    @@ -1864,15 +1864,14 @@

    5.1.5 System Query Option $orderby

    The $orderby system query option allows clients to request resources in a particular order.

    The semantics of $orderby are covered in the OData-Protocol document.

    The OData-ABNF orderby syntax rule defines the formal grammar of the $orderby query option.

    5.1.6 System Query Options $top and $skip

    The $top system query option requests the number of items in the queried collection to be included in the result. The $skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. A client can request a particular page of items by combining $top and $skip.

    -

    The semantics of $top and $skip are covered in the OData-Protocol document. The OData-ABNF top and skip syntax rules define the formal grammar of the $top and $skip query options respectively.

    +

    The semantics of $top and $skip are covered in the OData-Protocol document. The OData-ABNF top and skip syntax rules define the formal grammar of the $top and $skip query options respectively.

    5.1.7 System Query Option $count

    The $count system query option allows clients to request a count of the matching resources included with the resources in the response. The $count query option has a Boolean value of true or false.

    The semantics of $count is covered in the OData-Protocol document.

    @@ -1941,7 +1940,7 @@

    -

    Example 139: JSON array of strings as parameter alias value -- note that [, ], and " need to be percent-encoded in real URLs, the clear-text representation used here is just for readability

    +

    Example 139: JSON array of strings as parameter alias value — note that [, ], and " need to be percent-encoded in real URLs, the clear-text representation used here is just for readability

    http://host/service/Products/Model.WithIngredients(Ingredients=@i)?@i=["Carrots","Ginger","Oranges"]

    @@ -1955,31 +1954,30 @@

    [OData-ABNF]

    ABNF components: OData ABNF Construction Rules Version 4.02 and OData ABNF Test Cases.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-CSDL]

    OData Common Schema Definition Language (CSDL) JSON Representation Version 4.02.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    OData Common Schema Definition Language (CSDL) XML Representation Version 4.02.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-JSON]

    OData JSON Format Version 4.02.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-Protocol]

    OData Version 4.02. Part 1: Protocol.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-VocCap]

    OData Vocabularies Version 4.0: Capabilities Vocabulary.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [OData-VocCore]

    OData Vocabularies Version 4.0: Core Vocabulary.
    -See link in "Related work" section on cover page.

    +See link in “Related work” section on cover page.

    [RFC2119]
    -

    https://www.rfc-editor.org/info/rfc2119.

    +

    Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels”, BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997. https://www.rfc-editor.org/info/rfc2119.

    [RFC3986]
    -

    Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", IETF RFC3986, January 2005 https://tools.ietf.org/html/rfc3986.

    +

    Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax”, STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005. https://www.rfc-editor.org/info/rfc3986.

    [RFC8174]
    -

    Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017
    -https://www.rfc-editor.org/info/rfc8174.

    +

    Leiba, B., “Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words”, BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017. https://www.rfc-editor.org/info/rfc8174.

    [XML-Schema-2]

    W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes. D. Peterson, S. Gao, C. M. Sperberg-McQueen, H. S. Thompson, P. V. Biron, A. Malhotra, Editors, W3C Recommendation, 5 April 2012.
    http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/. Latest version available at http://www.w3.org/TR/xmlschema11-2/.

    @@ -1988,7 +1986,8 @@
    [ECMAScript]

    ECMAScript 2023 Language Specification, 14th Edition, June 2023. Standard ECMA-262. https://www.ecma-international.org/publications-and-standards/standards/ecma-262/.


    Appendix B. Safety, Security and Privacy Considerations

    -

    TODO: do we have considerations specific to URLs, for example length, encoding, privacy (use $batch if in doubt), ...?

    + +

    Appendix C. Acknowledgments

    C.1 Participants

    @@ -2074,14 +2073,14 @@

    Appendix E. Notice

    Copyright © OASIS Open 2023. All Rights Reserved.

    -

    All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The full Policy may be found at the OASIS website.

    +

    All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the “OASIS IPR Policy”). The full Policy may be found at the OASIS website.

    This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published, and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this section are included on all such copies and derivative works. However, this document itself may not be modified in any way, including by removing the copyright notice or references to OASIS, except as needed for the purpose of developing any document or deliverable produced by an OASIS Technical Committee (in which case the rules applicable to copyrights, as set forth in the OASIS IPR Policy, must be followed) or as required to translate it into languages other than English.

    The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.

    -

    This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

    +

    This document and the information contained herein is provided on an “AS IS” basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

    As stated in the OASIS IPR Policy, the following three paragraphs in brackets apply to OASIS Standards Final Deliverable documents (Committee Specification, Candidate OASIS Standard, OASIS Standard, or Approved Errata).

    [OASIS requests that any OASIS Party or any other party that believes it has patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable, to notify OASIS TC Administrator and provide an indication of its willingness to grant patent licenses to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this deliverable.]

    [OASIS invites any party to contact the OASIS TC Administrator if it is aware of a claim of ownership of any patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable by a patent holder that is not willing to provide a license to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this OASIS Standards Final Deliverable. OASIS may include such claims on its website, but disclaims any obligation to do so.]

    -

    [OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS' procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

    -

    The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark/ for above guidance.

    +

    [OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS’ procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

    +

    The name “OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark/ for above guidance.

    diff --git a/docs/odata-url-conventions/odata-url-conventions.md b/docs/odata-url-conventions/odata-url-conventions.md index c7d4865c2..16839b538 100644 --- a/docs/odata-url-conventions/odata-url-conventions.md +++ b/docs/odata-url-conventions/odata-url-conventions.md @@ -62,7 +62,7 @@ The Open Data Protocol (OData) enables the creation of REST-based data services, #### Status: This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical. -TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "[Send A Comment](https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=odata)" button on the TC's web page at https://www.oasis-open.org/committees/odata/. +TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/. This specification is provided under the [RF on RAND Terms Mode](https://www.oasis-open.org/policies-guidelines/ipr/#RF-on-RAND-Mode) of the [OASIS IPR Policy](https://www.oasis-open.org/policies-guidelines/ipr/), the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php). @@ -169,7 +169,7 @@ For complete copyright information please see the full Notices section in an App - [5.1.1.6.1 `hassubset`](#hassubset) - [5.1.1.6.2 `hassubsequence`](#hassubsequence) - [5.1.1.7 String Functions](#StringFunctions) - - [5.1.1.7.1 `matchesPattern`](#matchesPattern) + - [5.1.1.7.1 `matchespattern`](#matchespattern) - [5.1.1.7.2 `tolower`](#tolower) - [5.1.1.7.3 `toupper`](#toupper) - [5.1.1.7.4 `trim`](#trim) @@ -303,7 +303,7 @@ All other text is normative unless otherwise labeled. Here is a customized command line which will generate HTML from this markdown file (named `odata-v4.02-csd01-part2-url-conventions.md`). Line breaks are added for readability only: ``` -pandoc -f gfm+tex_math_dollars+fenced_divs +pandoc -f gfm+tex_math_dollars+fenced_divs+smart -t html -o odata-v4.02-csd01-part2-url-conventions.html -c styles/markdown-styles-v1.7.3b.css @@ -513,17 +513,17 @@ Below is a (non-normative) snippet from [OData-ABNF](#ODataABNF): ``` resourcePath = entitySetName [collectionNavigation] - / singleton [singleNavigation] + / singletonEntity [singleNavigation] / actionImportCall / entityColFunctionImportCall [ collectionNavigation ] / entityFunctionImportCall [ singleNavigation ] / complexColFunctionImportCall [ collectionPath ] / complexFunctionImportCall [ complexPath ] / primitiveColFunctionImportCall [ collectionPath ] - / primitiveFunctionImportCall [ singlePath ] - / functionImportCallNoParens - / crossjoin - / '$all' [ "/" qualifiedEntityTypeName ] + / primitiveFunctionImportCall [ primitivePath ] + / functionImportCallNoParens [ querySegment ] + / crossjoin [ querySegment ] + / %s"$all" [ "/" optionallyQualifiedEntityTypeName ] ``` Since OData has a uniform composable URL syntax and associated rules @@ -540,8 +540,8 @@ http://host/service/Products - By navigating a collection-valued navigation property (see rule: `entityColNavigationProperty`) -- By invoking a function that returns a -collection of entities (see rule: `entityColFunctionCall`) +- By invoking a function import that returns a +collection of entities (see rule: `entityColFunctionImportCall`) ::: example Example 9: function with parameters in resource path @@ -557,16 +557,16 @@ http://host/service/ProductsByColor(color=@color)?@color='red' ``` ::: -- By invoking an action that returns a -collection of entities (see rule: `actionCall`) +- By invoking an action import that returns a +collection of entities (see rule: `actionImportCall`) Likewise there are many ways to address a single entity. Sometimes a single entity can be accessed directly, for example by: -- Invoking a function that returns a -single entity (see rule: `entityFunctionCall`) -- Invoking an action that returns a single -entity (see rule: `actionCall`) +- Invoking a function import that returns a +single entity (see rule: `entityFunctionImportCall`) +- Invoking an action import that returns a single +entity (see rule: `actionImportCall`) - Addressing a singleton ::: example @@ -838,7 +838,7 @@ key properties of the related entity that take part in the referential constraint MUST be omitted from URLs using key-as-segment convention. ::: example -Example 27: key predicate of related entity - no key segments for key +Example 27: key predicate of related entity --- no key segments for key properties of related entity with a referential constraint to preceding key segments ``` @@ -925,7 +925,7 @@ defined in the [OData-Protocol](#ODataProtocol) document. Services MAY additionally support the use of the unqualified name of an action or function in a URL by defining one or more default namespaces through the -[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace)` `term +[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace) term defined in [OData-VocCore](#ODataVocCore). For more information on default namespaces, see Default Namespaces in [OData-Protocol](#ODataProtocol). @@ -997,7 +997,7 @@ To address the raw value of the number of items in a collection, clients append `/$count` to the resource path of the URL identifying the entity set or collection. -The `/$count `path suffix identifies the integer count of records in the +The `/$count` path suffix identifies the integer count of records in the collection and SHOULD NOT be combined with the system query options [`$top`](#SystemQueryOptionstopandskip), [`$skip`](#SystemQueryOptionstopandskip), @@ -1055,9 +1055,9 @@ Collections of entities are modeled as entity sets, collection-valued navigation properties, or operation results. For entity sets, results of operations associated with an entity set -through an `EntitySet `or `EntitySetPath` declaration, or +through an `EntitySet` or `EntitySetPath` declaration, or collection-valued navigation properties with a -`NavigationPropertyBinding `or `ContainsTarget=true `specification, +`NavigationPropertyBinding` or `ContainsTarget=true` specification, members of the collection can be addressed by convention by appending the parenthesized key to the URL specifying the collection of entities, or by using the [key-as-segment convention](#KeyasSegmentConvention) if @@ -1138,9 +1138,9 @@ http://host/service/Customers/Model.VipCustomer Example 37: entity restricted to a `VipCustomer` instance, resulting in `404 Not Found` if the customer with key `1` is not a `VipCustomer` ``` -http://host/service/`Customers/Model.VipCustomer(1) +http://host/service/Customers/Model.VipCustomer(1) -http://host/service/`Customers(1)/Model.VipCustomer +http://host/service/Customers(1)/Model.VipCustomer ``` ::: @@ -1190,7 +1190,7 @@ combined with the [`$filter`](#SystemQueryOptionfilter) system query option. ::: example -Example 41: red products that cost less than 10 -- combining path +Example 41: red products that cost less than 10 --- combining path segment and system query option ``` GET Products/$filter(@foo)?@foo=Price lt 10&$filter=Color eq 'red' @@ -1198,7 +1198,7 @@ GET Products/$filter(@foo)?@foo=Price lt 10&$filter=Color eq 'red' ::: ::: example -Example 42: red products that cost less than 10 -- combine two path +Example 42: red products that cost less than 10 --- combine two path segments ``` GET Products/$filter(@p)/$filter(@c)?@p=Price lt 10&@c=Color eq 'red' @@ -1262,7 +1262,7 @@ stream. ::: example Example 45: request the media stream for the picture with the key value -`Sunset4321299432:` +`Sunset4321299432`: ``` http://host/service/Pictures('Sunset4321299432')/$value ``` @@ -1285,7 +1285,7 @@ the corresponding entity set, with a target type equal to the declared entity type of the corresponding entity set. The [`$filter`](#SystemQueryOptionfilter) and -[`$orderby`](#SystemQueryOptionorderby)` `query options can be specified +[`$orderby`](#SystemQueryOptionorderby) query options can be specified using properties of the entities in the selected entity sets, prepended with the entity set as the navigation property name. @@ -1380,7 +1380,7 @@ Requests to paths ending in `/$query` MUST use the `POST` verb. Query options specified in the request body and query options specified in the request URL are processed together. -The request body MUST use the content-type `text/plain`. It contains the +The request body MUST use `Content-Type: text/plain`. It contains the query portion of the URL and MUST use the same percent-encoding as in URLs (especially: no spaces, tabs, or line breaks allowed) and MUST follow the syntax rules described in chapter Query Options. @@ -1413,7 +1413,7 @@ System query options are query string parameters that control the amount and order of the data returned for the resource identified by the URL. The names of all system query options are optionally prefixed with a dollar (`$`) character. 4.01 Services MUST support case-insensitive -system query option names specified with or without the `$ `prefix. +system query option names specified with or without the `$` prefix. Clients that want to work with 4.0 services MUST use lower case names and specify the `$` prefix. @@ -1559,7 +1559,7 @@ greater than `-INF`. The Boolean value `true` is greater than `false`. Services SHOULD order language-dependent strings according to the -content-language of the response, and SHOULD annotate string properties +`Content-Language` of the response, and SHOULD annotate string properties with language-dependent order with the term [`Core.IsLanguageDependent`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#IsLanguageDependent), see [OData-VocCore](#ODataVocCore). @@ -1584,7 +1584,7 @@ than `INF`. The Boolean value `false` is less than `true`. Services SHOULD order language-dependent strings according to the -content-language of the response, and SHOULD annotate string properties +`Content-Language` of the response, and SHOULD annotate string properties with language-dependent order with the term [`Core.IsLanguageDependent`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#IsLanguageDependent), see [OData-VocCore](#ODataVocCore). @@ -1644,49 +1644,49 @@ The following examples illustrate the use and semantics of each of the logical operators. ::: example -Example 50: all products with a `Name` equal to 'Milk' +Example 50: all products with a `Name` equal to `Milk` ``` http://host/service/Products?$filter=Name eq 'Milk' ``` ::: ::: example -Example 51: all products with a `Name` not equal to 'Milk' +Example 51: all products with a `Name` not equal to `Milk` ``` http://host/service/Products?$filter=Name ne 'Milk' ``` ::: ::: example -Example 52: all products with a Name greater than 'Milk': +Example 52: all products with a `Name` greater than `Milk`: ``` http://host/service/Products?$filter=Name gt 'Milk' ``` ::: ::: example -Example 53: all products with a Name greater than or equal to 'Milk': +Example 53: all products with a `Name` greater than or equal to `Milk`: ``` http://host/service/Products?$filter=Name ge 'Milk' ``` ::: ::: example -Example 54: all products with a Name less than 'Milk': +Example 54: all products with a `Name` less than `Milk`: ``` http://host/service/Products?$filter=Name lt 'Milk' ``` ::: ::: example -Example 55: all products with a Name less than or equal to 'Milk': +Example 55: all products with a `Name` less than or equal to `Milk`: ``` -http://host/service/Products?$filter=Name le 'Milk'` +http://host/service/Products?$filter=Name le 'Milk' ``` ::: ::: example -Example 56: all products with the Name 'Milk' that also have a Price +Example 56: all products with a `Name` equal to `Milk` that also have a `Price` less than 2.55: ``` http://host/service/Products?$filter=Name eq 'Milk' and Price lt 2.55 @@ -1694,15 +1694,15 @@ http://host/service/Products?$filter=Name eq 'Milk' and Price lt 2.55 ::: ::: example -Example 57: all products that either have the Name 'Milk' or have a -Price less than 2.55: +Example 57: all products that either have a `Name` equal to `Milk` or have a +`Price` less than 2.55: ``` http://host/service/Products?$filter=Name eq 'Milk' or Price lt 2.55 ``` ::: ::: example -Example 58: all products that do not have a Name that ends with 'ilk': +Example 58: all products that do not have a `Name` that ends with `ilk`: ``` http://host/service/Products?$filter=not endswith(Name,'ilk') ``` @@ -1716,7 +1716,7 @@ http://host/service/Products?$filter=style has Sales.Pattern'Yellow' ::: ::: example -Example 60: all products whose `name` value is 'Milk' or 'Cheese': +Example 60: all products whose `Name` is `Milk` or `Cheese`: ``` http://host/service/Products?$filter=Name in ('Milk', 'Cheese') ``` @@ -1771,7 +1771,7 @@ or `variable` if any operand has variable scale. The `sub` operator is also valid for the following time-related operands: -- `DateTimeOffset` `sub` `Duration` +- `DateTimeOffset sub Duration` results in a `DateTimeOffset` - `Duration sub Duration` results in a `Duration` @@ -1980,7 +1980,7 @@ The `containsMethodCallExpr` syntax rule defines how the `contains` function is invoked. ::: example -Example 70: all customers with a `CompanyName` that contains `'Alfreds'` +Example 70: all customers with a `CompanyName` that contains `Alfreds` ``` http://host/service/Customers?$filter=contains(CompanyName,'Alfreds') ``` @@ -2012,7 +2012,7 @@ function is invoked. ::: example Example 71: all customers with a `CompanyName` that ends with -`'Futterkiste'` +`Futterkiste` ``` http://host/service/Customers?$filter=endswith(CompanyName,'Futterkiste') ``` @@ -2043,7 +2043,7 @@ The `indexOfMethodCallExpr` syntax rule defines how the `indexof` function is invoked. ::: example -Example 72: all customers with a `CompanyName` containing '`lfreds'` +Example 72: all customers with a `CompanyName` containing `lfreds` starting at the second character ``` http://host/service/Customers?$filter=indexof(CompanyName,'lfreds') eq 1 @@ -2101,7 +2101,7 @@ The `startsWithMethodCallExpr` syntax rule defines how the `startswith` function is invoked. ::: example -Example 74: all customers with a `CompanyName` that starts with `'Alfr'` +Example 74: all customers with a `CompanyName` that starts with `Alfr` ``` http://host/service/Customers?$filter=startswith(CompanyName,'Alfr') ``` @@ -2155,7 +2155,7 @@ The `substringMethodCallExpr` syntax rule defines how the `substring` function is invoked. ::: example -Example 75: all customers with a `CompanyName` of `'lfreds Futterkiste'` +Example 75: all customers with a `CompanyName` of `lfreds Futterkiste` once the first character has been removed ``` http://host/service/Customers?$filter=substring(CompanyName,1) eq 'lfreds Futterkiste' @@ -2163,8 +2163,8 @@ http://host/service/Customers?$filter=substring(CompanyName,1) eq 'lfreds Futter ::: ::: example -Example 76: all customers with a `CompanyName` that has '`lf' `as the -second and third characters, e.g, '`Alfreds Futterkiste`' +Example 76: all customers with a `CompanyName` that has `lf` as the +second and third characters, e.g, `Alfreds Futterkiste` ``` http://host/service/Customers?$filter=substring(CompanyName,1,2) eq 'lf' ``` @@ -2247,17 +2247,17 @@ hassubsequence([1,2],[1,1,2]) #### 5.1.1.7 String Functions -##### 5.1.1.7.1 `matchesPattern` +##### 5.1.1.7.1 `matchespattern` -The `matchesPattern` function has the following signature: +The `matchespattern` function has the following signature: ``` -Edm.Boolean matchesPattern(Edm.String,Edm.String) +Edm.Boolean matchespattern(Edm.String,Edm.String) ``` The second parameter MUST evaluate to a string containing an [**[ECMAScript]**](#ECMAScript) (JavaScript) regular expression. The -`matchesPattern` function returns true if the first parameter evaluates +`matchespattern` function returns true if the first parameter evaluates to a string matching that regular expression, using syntax and semantics of [**[ECMAScript]**](#ECMAScript) regular expressions, otherwise it returns false. @@ -2266,7 +2266,7 @@ returns false. Example 81: all customers with a `CompanyName` that match the (percent-encoded) regular expression `^A.*e$` ``` -http://host/service/Customers?$filter=matchesPattern(CompanyName,'%5EA.*e$') +http://host/service/Customers?$filter=matchespattern(CompanyName,'%5EA.*e$') ``` ::: @@ -2285,7 +2285,7 @@ function is invoked. ::: example Example 82: all customers with a `CompanyName` that equals -`'alfreds futterkiste'` once any uppercase characters have been +`alfreds futterkiste` once any uppercase characters have been converted to lowercase ``` http://host/service/Customers?$filter=tolower(CompanyName) eq 'alfreds futterkiste' @@ -2307,7 +2307,7 @@ function is invoked. ::: example Example 83: all customers with a `CompanyName` that equals -`'ALFREDS FUTTERKISTE'` once any lowercase characters have been +`ALFREDS FUTTERKISTE` once any lowercase characters have been converted to uppercase ``` http://host/service/Customers?$filter=toupper(CompanyName) eq 'ALFREDS FUTTERKISTE' @@ -2799,8 +2799,8 @@ expression case(Edm.Boolean:expression, ..., Edm.Boolean:expression) ``` Each parameter is a pair of expressions separated by a colon (`:`), -where the first expression -- the condition -- MUST be a Boolean -expression, and the second expression -- the result -- may evaluate to +where the first expression --- the condition --- MUST be a Boolean +expression, and the second expression --- the result --- may evaluate to any type. The case function evaluates the condition in each pair, starting with @@ -2831,7 +2831,7 @@ $compute=case(X gt 0:1,X lt 0:-1,true:0) as SignumX #### 5.1.1.13 Lambda Operators OData defines two operators that evaluate a Boolean expression on a -collection. Both must be prepended with a navigation path that +collection. Both must be prepended with a path expression that identifies a collection. 4.01 Services MUST support case-insensitive lambda operator names. @@ -2840,8 +2840,8 @@ operator names. The argument of a lambda operator is a case-sensitive lambda variable name followed by a colon (`:`) and a Boolean expression that uses the -lambda variable name to refer to properties of members of the collection -identified by the navigation path. +lambda variable name to refer to properties of the instance or of members of the collection +identified by the path expression. If the name chosen for the lambda variable matches a property name of the current resource referenced by the resource path, the lambda @@ -2850,7 +2850,7 @@ resource referenced by the resource path with [`$it`](#it). Other path expressions in the Boolean expression neither prefixed with the lambda variable nor `$it` are evaluated in the scope of the -collection instances at the origin of the navigation path prepended to +instance or of members of the collection at the origin of the path expression prepended to the lambda operator. ##### 5.1.1.13.1 `any` @@ -3187,7 +3187,7 @@ http://host/service/Employees?$filter=@Core.Messages/any(m:m/severity eq 'error' Services MAY additionally support the use of the unqualified term name by defining one or more default namespaces through the -[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace)` `annotation +[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace) annotation term defined in [OData-VocCore](#ODataVocCore). For more information on default namespaces, see Default Namespaces in [OData-Protocol](#ODataProtocol). This short notation however uses the same name pattern as parameter @@ -3244,9 +3244,9 @@ rules, in order: - If either operand is `Edm.Double`, the other operand is converted to type `Edm.Double`. - Otherwise, if either operand is `Edm.Single`, the other operand is converted to type `Edm.Single`. - Otherwise, if either operand is of type `Edm.Decimal`, the other operand is converted to `Edm.Decimal`. -- Otherwise, if either operand is `Edm.Int64`, the other operand is converted to type `Edm.Int64.` -- Otherwise, if either operand is `Edm.Int32`, the other operand is converted to type `Edm.Int32.` -- Otherwise, if either operand is `Edm.Int16`, the other operand is converted to type `Edm.Int16. ` +- Otherwise, if either operand is `Edm.Int64`, the other operand is converted to type `Edm.Int64`. +- Otherwise, if either operand is `Edm.Int32`, the other operand is converted to type `Edm.Int32`. +- Otherwise, if either operand is `Edm.Int16`, the other operand is converted to type `Edm.Int16`. Each of these promotions uses the same semantics as a `castExpression` to promote an operand to the target type. @@ -3329,14 +3329,15 @@ A path MUST NOT appear in more than one expand item. Query options can be applied to an expanded navigation property by appending a semicolon-separated list of query options, enclosed in -parentheses, to the navigation property name. Allowed system query -options are [`$filter`](#SystemQueryOptionfilter), +parentheses, to the navigation property name. Allowed system query options are +[`$compute`](#SystemQueryOptioncompute), [`$select`](#SystemQueryOptionselect), +`$expand`, and [`$levels`](#ExpandOptionlevels) for all navigation properties, plus +[`$filter`](#SystemQueryOptionfilter), [`$orderby`](#SystemQueryOptionorderby), -[`$skip`](#SystemQueryOptionstopandskip), -[`$top`](#SystemQueryOptionstopandskip), -[`$count`](#SystemQueryOptioncount), -[`$search`](#SystemQueryOptionsearch), and `$expand`. +[`$skip`](#SystemQueryOptionstopandskip), [`$top`](#SystemQueryOptionstopandskip), +[`$count`](#SystemQueryOptioncount), and +[`$search`](#SystemQueryOptionsearch) for collection-valued navigation properties. ::: example Example 117: all categories and for each category all related products @@ -3402,13 +3403,13 @@ http://host/service/Categories?$expand=Products/Sales.PremierProduct/$ref($filte ``` ::: -Cyclic navigation properties (whose target type is identical or can be +Cyclic navigation properties (whose target type is identical or can be cast to its source type) can be recursively expanded using the special `$levels` option. The value of the `$levels` option is either a positive integer to specify the number of levels to expand, or the literal string `max` to specify the maximum expansion level supported by that service. A `$levels` option with a value of 1 specifies a single expand with no -recursion. +recursion. ::: example Example 123: all employees with their manager, manager's manager, and @@ -3457,7 +3458,7 @@ Specifying `$value` for a media entity includes the media entity's stream value inline according to the specified format. ::: example -Example 127: Include the `Product`'s media stream along with other +Example 127: Include the Product's media stream along with other properties of the product ``` http://host/service/Products?$expand=$value @@ -3510,10 +3511,10 @@ The `$select` system query option is interpreted relative to the entity type or complex type of the resources identified by the resource path section of the URL. Each select item in the `$select` clause indicates that the response MUST include the declared or dynamic properties, -actions and functions identified by that select item. The simplest form -of a select item explicitly requests a property defined on the entity -type of the resources identified by the resource path section of the -URL. +actions and functions identified by that select item. If a select item is a path expression traversing an entity or complex property that is `null` on an instance, then +the null-valued entity or complex property is included and represented as `null`. +The simplest form of a select item explicitly requests a property defined on the entity +type of the resources identified by the resource path section of the URL. ::: example Example 128: rating and release date of all products @@ -3633,15 +3634,11 @@ http://host/service/Products?$select=ID,Model.ActionName,Model2.* ``` ::: -When multiple select item exist in a `select clause`, then the total set +When multiple select item exist in a `$select` clause, then the total set of properties, open properties, navigation properties, actions and functions to be returned is equal to the union of the set of those identified by each select item. -If a select item is a path expression requesting a component of a -complex property and the complex property is `null` on an instance, then -the component is treated as `null` as well. - ### 5.1.5 System Query Option `$orderby` The `$orderby` system query option allows clients to request resources @@ -3664,7 +3661,7 @@ particular page of items by combining `$top` and `$skip`. The semantics of `$top` and `$skip` are covered in the [OData-Protocol](#ODataProtocol) document. The [OData-ABNF](#ODataABNF) `top` and `skip` syntax rules define the formal grammar of the `$top` and -`$skip `query options respectively. +`$skip` query options respectively. ### 5.1.7 System Query Option `$count` @@ -3859,7 +3856,7 @@ http://host/service/Movies?$filter=Title eq @title&@title='Wizard of Oz' ::: ::: example -Example 139: JSON array of strings as parameter alias value -- note that +Example 139: JSON array of strings as parameter alias value --- note that `[`, `]`, and `"` need to be percent-encoded in real URLs, the clear-text representation used here is just for readability ``` @@ -3915,14 +3912,15 @@ _OData Vocabularies Version 4.0: Core Vocabulary._ See link in "[Related work](#RelatedWork)" section on cover page. ###### [RFC2119] +_Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997_. https://www.rfc-editor.org/info/rfc2119. ###### [RFC3986] -_Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", IETF RFC3986, January 2005_ -https://tools.ietf.org/html/rfc3986. +_Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005_. +https://www.rfc-editor.org/info/rfc3986. ###### [RFC8174] -_Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_ +_Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_. https://www.rfc-editor.org/info/rfc8174. ###### [XML-Schema-2] @@ -3938,7 +3936,7 @@ _ECMAScript 2023 Language Specification, 14th Edition_, June 2023. Standard ECMA # Appendix B. Safety, Security and Privacy Considerations -TODO: do we have considerations specific to URLs, for example length, encoding, privacy (use $batch if in doubt), ...? + ------- diff --git a/lib/README.md b/lib/README.md index 09c5ae282..40483f2b7 100644 --- a/lib/README.md +++ b/lib/README.md @@ -22,6 +22,7 @@ The [`number.js`](number.js) module generates a single Markdown document by prep - Generate section and example numbers - Generate a table of contents - Resolve references +- Include files like `$$$include images/drawing.svg$$$` - Replace placeholders like `$$$pagetitle$$$` with values from a [`meta.yaml`](../odata-data-aggregation-ext/meta.yaml) file - Join multiple lines that end with a single space into one line - Sections of the file between `: varXXX` and `:` or between `::: {.varXXX ...}` and `:::` belong to a variant. One source file can contain several variants. @@ -89,7 +90,11 @@ The [`pdf.js`](pdf.js) module uses a headless browser ([`puppeteer`](https://git The following scripts can be executed manually or as part of a GitHub Action: -- [`npm run build`](build.js) runs the conversion and writes the Markdown output as well as the HTML output into the [`docs/*`](../docs) folder. The Markdown file starts with a byte-order mark (`EF BB BF`) so that it is recognized as UTF-8 when loaded from github.io. +- [`npm run build`](build.js) runs the conversion and writes the following into the [`docs/*`](../docs) folder: + - the Markdown output + - the HTML output + - a copy of the common [`styles`](../styles) folder + - a copy of the document-specific `*/images` folder, if this exists. - [`npm run pdf`](build-pdf.mjs) runs the PDF conversion and writes the PDF document into the [`docs/*`](../docs) folder. - [`npm test`](../test) runs a test suite. diff --git a/lib/build.js b/lib/build.js index ca1371e42..b538990d6 100644 --- a/lib/build.js +++ b/lib/build.js @@ -10,6 +10,13 @@ iterator(function (srcname, name, variant, meta) { fs.cpSync(`${__dirname}/../styles`, `${__dirname}/../docs/${name}/styles`, { recursive: true, }); + const srcImages = `${__dirname}/../${srcname}/images`; + if (fs.existsSync(srcImages)) { + const targetImages = `${__dirname}/../docs/${name}/images`; + if (fs.existsSync(targetImages)) + fs.rmSync(targetImages, { recursive: true }); + fs.cpSync(srcImages, targetImages, { recursive: true }); + } var md = fs.createWriteStream(`${__dirname}/../docs/${name}/${name}.md`); var html = pandoc({ "--metadata-file": `${__dirname}/../${srcname}/${variant}.yaml`, diff --git a/lib/number.js b/lib/number.js index 2d8efa6fa..a1c9357dd 100644 --- a/lib/number.js +++ b/lib/number.js @@ -15,7 +15,7 @@ class Number { this.meta = meta || yaml.load( - fs.readFileSync(dir + "/" + (this.variant || "meta") + ".yaml") + fs.readFileSync(dir + "/" + (this.variant || "meta") + ".yaml"), ); } @@ -71,7 +71,7 @@ class Number { this.toc[m[1]] = { sub: [] }; if (m[1].endsWith("sec")) { m = line.match( - / ##([A-Za-z0-9.]+)(?:_[A-Za-z0-9]+)?\s+(.+)$/ + / ##([A-Za-z0-9.]+)(?:_[A-Za-z0-9]+)?\s+(.+)$/, ); m[3] = m[2].replace(/[^A-Za-z0-9]/g, ""); } @@ -112,10 +112,10 @@ class Number { } this.match++; } - }.bind(this) + }.bind(this), ) .on("close", resolve); - }.bind(this) + }.bind(this), ); } @@ -134,19 +134,28 @@ class Number { function (line) { lineno++; if (this.skip(line)) return; - var m1 = line.match(/^\$\$\$(.*?isec)\$\$\$$/); + var m1 = line.match(/^\$\$\$include\s+(.*?)\$\$\$\s*$/); + if (m1) { + try { + out.write(fs.readFileSync(this.dir + "/" + m1[1])); + } catch (e) { + this.errors.push(e); + } + return; + } + m1 = line.match(/^\$\$\$(.*?isec)\$\$\$\s*$/); if (m1) this.tableofcontents(this.toc[m1[1]]?.sub || [], out, ""); else { line = line.replace( /\$\$\$(.*?)\$\$\$/g, function (m, p) { return this.meta[p] || m; - }.bind(this) + }.bind(this), ); for (var m, regex = /\]\(#(.*?)\)/g; (m = regex.exec(line)); ) if (!this.refs[m[1]]) this.errors.push( - `${this.dir}/${file}(${lineno}): Undefined link #${m[1]}` + `${this.dir}/${file}(${lineno}): Undefined link #${m[1]}`, ); m = line.match(/ ##([A-Za-z0-9.]+)(_([A-Za-z0-9]+))?/); var outline = line; @@ -171,19 +180,19 @@ class Number { if (r) return `${r}](#${p})`; else { this.errors.push( - `${this.dir}/${file}(${lineno}): Undefined link ##${p}` + `${this.dir}/${file}(${lineno}): Undefined link ##${p}`, ); return `~~${p}~~]`; } - }.bind(this) - ) + }.bind(this), + ), ); if (!/\S\s$/.test(line)) out.write("\n"); } - }.bind(this) + }.bind(this), ) .on("close", resolve); - }.bind(this) + }.bind(this), ); } @@ -192,7 +201,7 @@ class Number { out.write( `${indent}- [${ s.number.startsWith("i") ? "" : s.number + " " - }${s.name.replace(/,? $/, "")}](#${s.href})\n` + }${s.name.replace(/,? $/, "")}](#${s.href})\n`, ); this.tableofcontents(s.sub, out, indent + " "); } diff --git a/lib/pandoc.js b/lib/pandoc.js index cef502082..19ba3b16d 100644 --- a/lib/pandoc.js +++ b/lib/pandoc.js @@ -3,7 +3,7 @@ const { spawn } = require("child_process"); module.exports = function (options) { var opts = [ "-f", - "gfm+tex_math_dollars+fenced_divs", + "gfm+tex_math_dollars+fenced_divs+smart", "-t", "html", "-c", diff --git a/lib/server.js b/lib/server.js index c9e90dcae..07961651a 100644 --- a/lib/server.js +++ b/lib/server.js @@ -10,18 +10,26 @@ const liveReloadServer = livereload.createServer({ extraExts: ["md"] }); liveReloadServer.watch(path.join(__dirname, "..")); const connectLivereload = require("connect-livereload"); +const statics = { images: {} }; -var app = express() +const app = express() + .enable("strict routing") .use(connectLivereload()) - .use("/styles", express.static(`${__dirname}/../styles`)) .get("/", function (_req, res, _next) { var docs = []; iterator(function (srcname, name, variant) { - docs.push(`
  • ${name}
  • `); + docs.push( + `
  • ${name}
  • `, + ); }); res.send(`

    Documents

      ${docs.join("")}
    `); }) - .get("/:doc", function (req, res, next) { + .get("/:doc", function (req, res, _next) { + var url = new URL("s://" + req.originalUrl); + url.pathname += "/"; + res.redirect(url.href.substring(4)); + }) + .get("/:doc/", function (req, res, next) { try { var branch = execSync("git branch --show-current", { cwd: __dirname, @@ -31,7 +39,7 @@ var app = express() try { var number = new Number( __dirname + "/../" + req.params.doc, - req.query.variant + req.query.variant, ); var meta = `${__dirname}/../${req.params.doc}/${ req.query.variant || "meta" @@ -50,6 +58,12 @@ var app = express() } catch (err) { next(); } + }) + .use("/:doc/styles", express.static(`${__dirname}/../styles`)) + .use("/:doc/images", function (req, res, next) { + (statics.images[req.params.doc] ||= express.static( + `${__dirname}/../${req.params.doc}/images`, + ))(req, res, next); }); if (module.parent) module.exports = app; diff --git a/odata-csdl/0 frontmatter.md b/odata-csdl/0 frontmatter.md index 28fa418ae..5b0e56f1e 100644 --- a/odata-csdl/0 frontmatter.md +++ b/odata-csdl/0 frontmatter.md @@ -76,7 +76,7 @@ $$$description$$$ #### Status: This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical. -TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "[Send A Comment](https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=odata)" button on the TC's web page at https://www.oasis-open.org/committees/odata/. +TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/. This specification is provided under the [RF on RAND Terms Mode](https://www.oasis-open.org/policies-guidelines/ipr/#RF-on-RAND-Mode) of the [OASIS IPR Policy](https://www.oasis-open.org/policies-guidelines/ipr/), the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php). diff --git a/odata-csdl/1 Introduction.md b/odata-csdl/1 Introduction.md index 54ba31c12..8ea5a1033 100644 --- a/odata-csdl/1 Introduction.md +++ b/odata-csdl/1 Introduction.md @@ -27,6 +27,12 @@ Schema Definition Language (XSD) 1.1 as described in ## ##subsec Changes from Earlier Versions +Section | Feature / Change | Issue +--------|------------------|------ +[Section ##PathEvaluation]| +New path evaluation rules for annotations targeting annotations and external targeting via container| +[ODATA-1420](https://issues.oasis-open.org/browse/ODATA-1420) + ## ##subsec Glossary ### ##subsubsec Definitions of Terms @@ -64,7 +70,7 @@ All other text is normative unless otherwise labeled. Here is a customized command line which will generate HTML from this markdown file (named `$$$filename$$$.md`). Line breaks are added for readability only: ``` -pandoc -f gfm+tex_math_dollars+fenced_divs +pandoc -f gfm+tex_math_dollars+fenced_divs+smart -t html -o $$$filename$$$.html -c styles/markdown-styles-v1.7.3b.css @@ -433,17 +439,17 @@ Type|Meaning `Edm.Date` |Date without a time-zone offset `Edm.DateTimeOffset` |Date and time with a time-zone offset, no leap seconds `Edm.Decimal` |Numeric values with decimal representation -`Edm.Double` |IEEE 754 binary64 floating-point number (15-17 decimal digits) +`Edm.Double` |IEEE 754 binary64 floating-point number (15--17 decimal digits) `Edm.Duration` |Signed duration in days, hours, minutes, and (sub)seconds `Edm.Guid` |16-byte (128-bit) unique identifier `Edm.Int16` |Signed 16-bit integer `Edm.Int32` |Signed 32-bit integer `Edm.Int64` |Signed 64-bit integer `Edm.SByte` |Signed 8-bit integer -`Edm.Single` |IEEE 754 binary32 floating-point number (6-9 decimal digits) +`Edm.Single` |IEEE 754 binary32 floating-point number (6--9 decimal digits) `Edm.Stream` |Binary data stream `Edm.String` |Sequence of characters -`Edm.TimeOfDay` |Clock time 00:00-23:59:59.999999999999 +`Edm.TimeOfDay` |Clock time 00:00--23:59:59.999999999999 `Edm.Geography` |Abstract base type for all Geography types `Edm.GeographyPoint` |A point in a round-earth coordinate system `Edm.GeographyLineString` |Line string in a round-earth coordinate system @@ -488,6 +494,305 @@ representation of primitive type values in URLs and [OData-JSON](#ODataJSON) for the representation in requests and responses. +## ##subsec Type Facets + +The facets in the following subsections modify or constrain the acceptable values of primitive typed model elements, +for example a [structural property](#StructuralProperty), +action or function [parameter](#Parameter), +action or function [return type](#ReturnType), or +[term](#Term). + +For single-valued model elements the facets apply to the value of the +model element. For collection-valued model elements the facets apply to the items +in the collection. + +### ##subsubsec MaxLength + +A positive integer value specifying the maximum length of a binary, +stream or string value. For binary or stream values this is the octet +length of the binary data, for string values it is the character length +(number of code points for Unicode). + +If no maximum length is specified, clients SHOULD expect arbitrary +length. + +::: {.varjson .rep} +### ##isec Type Facet Members +### ##subisec `$MaxLength` + +The value of `$MaxLength` is a positive integer. + +Note: [OData-CSDL-XML](#ODataCSDL) defines a symbolic +value `max` that is only allowed in OData 4.0 responses. This symbolic +value is not allowed in CDSL JSON documents at all. Services MAY instead +specify the concrete maximum length supported for the type by the +service or omit the member entirely. +::: + +::: {.varxml .rep} +### ##isec Type Facet Attributes +### ##subisec Attribute `MaxLength` + +The value of `MaxLength` is a positive integer or the symbolic value +`max` as a shorthand for the maximum length supported for the type by +the service. + +Note: the symbolic value `max` is only allowed in OData 4.0 responses; +it is deprecated in OData 4.01. While clients MUST be prepared for this +symbolic value, OData 4.01 and greater services MUST NOT return the +symbolic value `max` and MAY instead specify the concrete maximum length +supported for the type by the service or omit the attribute entirely. +::: + +### ##subsubsec Precision + +For a decimal value: the maximum number of significant decimal digits of +the model element's value; it MUST be a positive integer. + +For a temporal value (datetime-with-timezone-offset, duration, or +time-of-day): the number of decimal places allowed in the seconds +portion of the value; it MUST be a non-negative integer between zero and +twelve. + +Note: service authors SHOULD be aware that some clients are unable to +support a precision greater than 28 for decimal values and 7 for +temporal values. Client developers MUST be aware of the potential +for data loss when round-tripping values of greater precision. Updating +via `PATCH` and exclusively specifying modified values will reduce +the risk for unintended data loss. + +Note: model elements with duration values and a granularity less than seconds +(e.g. minutes, hours, days) can be annotated with term +[`Measures.DurationGranularity`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Measures.V1.md#DurationGranularity), +see [OData-VocMeasures](#ODataVocMeasures). + +::: {.varjson .rep} +### ##subisec `$Precision` + +The value of `$Precision` is a number. + +Absence of `$Precision` means unspecified precision both for decimal and temporal values. +::: + +::: {.varjson .example} +Example ##ex: `Precision` facet applied to the `DateTimeOffset` type +```json +"SuggestedTimes": { + "$Type": "Edm.DateTimeOffset", + "$Collection": true, + "$Precision": 6 +} +``` +::: + +::: {.varxml .rep} +### ##subisec Attribute `Precision` + +The value of `Precision` is a number. + +If not specified for a decimal value, the decimal value has +unspecified precision. + +If not specified for a temporal value, the temporal value has a +precision of zero. +::: + +::: {.varxml .example} +Example ##ex: [`Precision`](#Precision) facet applied to the +`DateTimeOffset` type +```xml + +``` +::: + +### ##subsubsec Scale + +A non-negative integer value specifying the maximum number of digits +allowed to the right of the decimal point, or one of the symbolic values +`floating` or `variable`. + +The value `floating` means that the decimal value represents a +decimal floating-point number whose number of significant digits is the +value of the [`Precision`](#Precision) facet. OData 4.0 responses MUST +NOT specify the value `floating`. + +The value `variable` means that the number of digits to the right of the +decimal point can vary from zero to the value of the +[`Precision`](#Precision) facet. + +An integer value means that the number of digits to the right of the +decimal point may vary from zero to the value of the `Scale` facet, and +the number of digits to the left of the decimal point may vary from one +to the value of the `Precision` facet minus the value of the `Scale` +facet. If `Precision` is equal to `Scale`, a single zero MUST precede +the decimal point. + +The value of `Scale` MUST be less than or equal to the value of +[`Precision`](#Precision). + +Note: if the underlying data store allows negative scale, services may +use a [`Precision`](#Precision) with the absolute value of the negative +scale added to the actual number of significant decimal digits, and +client-provided values may have to be rounded before being stored. + +::: {.varjson .rep} +### ##subisec `$Scale` + +The value of `$Scale` is a number or a string with one of the symbolic +values `floating` or `variable`. + +Services SHOULD use lower-case values; clients SHOULD accept values in a +case-insensitive manner. + +Absence of `$Scale` means `variable`. +::: + +::: {.varjson .example} +Example ##ex: [`Precision`](#Precision)`=3` and `Scale=2`. +Allowed values: 1.23, 0.23, 3.14 and 0.7, not allowed values: 123, 12.3 +```json +"Amount32": { + "$Type": "Edm.Decimal", + "$Precision": 3, + "$Scale": 2 +} +``` +::: + +::: {.varjson .example} +Example ##ex: `Precision=2` equals `Scale`. +Allowed values: 0.23, 0.7, not allowed values: 1.23, 1.2 +```json +"Amount22": { + "$Type": "Edm.Decimal", + "$Precision": 2, + "$Scale": 2 +} +``` +::: + +::: {.varjson .example} +Example ##ex: `Precision=3` and a variable `Scale`. +Allowed values: 0.123, 1.23, 0.23, 0.7, 123 and 12.3, not allowed +values: 12.34, 1234 and 123.4 due to the limited precision. +```json +"Amount3v": { + "$Type": "Edm.Decimal", + "$Precision": 3 +} +``` +::: + +::: {.varjson .example} +Example ##ex: `Precision=7` and a floating `Scale`. +Allowed values: -1.234567e3, 1e-101, 9.999999e96, not allowed values: +1e-102 and 1e97 due to the limited precision. +```json +"Amount7f": { + "$Type": "Edm.Decimal", + "$Precision": 7, + "$Scale": "floating" +} +``` +::: + +::: {.varxml .rep} +### ##subisec Attribute `Scale` + +The value of `Scale` is a number or one of the symbolic values +`floating` or `variable`. + +Services SHOULD use lower-case values; clients SHOULD accept values in a +case-insensitive manner. + +If not specified, the `Scale` facet defaults to zero. +::: + +::: {.varxml .example} +Example ##ex: [`Precision`](#Precision)`=3` and `Scale=2`. +Allowed values: 1.23, 0.23, 3.14 and 0.7, not allowed values: 123, 12.3 +(the [`Nullable`](#Nullable) attribute can be ignored in these examples) +```xml + +``` +::: + +::: {.varxml .example} +Example ##ex: `Precision=2` equals `Scale`. +Allowed values: 0.23, 0.7, not allowed values: 1.23, 1.2 +```xml + +``` +::: + +::: {.varxml .example} +Example ##ex: `Precision=3` and a variable `Scale`. +Allowed values: 0.123, 1.23, 0.23, 0.7, 123 and 12.3, not allowed +values: 12.34, 1234 and 123.4 due to the limited precision. +```xml + +``` +::: + +::: {.varxml .example} +Example ##ex: `Precision=7` and a floating `Scale`. +Allowed values: -1.234567e3, 1e-101, 9.999999e96, not allowed values: +1e-102 and 1e97 due to the limited precision. +```xml + +``` +::: + +### ##subsubsec Unicode + +For a string-typed model element the `Unicode` facet indicates whether the it +might contain and accept string values with Unicode characters (code +points) beyond the ASCII character set. The value `false` indicates that +the it will only contain and accept string values with characters +limited to the ASCII character set. + +If no value is specified, the `Unicode` facet defaults to `true`. + +::: {.varjson .rep} +### ##subisec `$Unicode` + +The value of `$Unicode` is one of the Boolean literals `true` or +`false`. Absence of the member means `true`. +::: + +::: {.varxml .rep} +### ##subisec Attribute `Unicode` + +The value of `Unicode` is one of the Boolean literals `true` or `false`. +Absence of the attribute means `true`. +::: + +### ##subsubsec SRID + +For a geometry- or geography-typed model element the `SRID` facet identifies which +spatial reference system is applied to its values. + +The value of the `SRID` facet MUST be a non-negative integer or the +special value `variable`. If no value is specified, the facet defaults +to `0` for `Geometry` types or `4326` for `Geography` types. + +The valid values of the `SRID` facet and their meanings are as defined +by the European Petroleum Survey Group [EPSG](#_EPSG). + +::: {.varjson .rep} +### ##subisec `$SRID` + +The value of `$SRID` is a string containing a number or the symbolic +value `variable`. +::: + +::: {.varxml .rep} +### ##subisec Attribute `SRID` + +The value of `SRID` is a number or the symbolic value `variable`. +::: + ## ##subsec Built-In Abstract Types The following built-in abstract types can be used within a model: @@ -526,9 +831,7 @@ be used anywhere a corresponding concrete type can be used, except: - cannot be used as the underlying type of a type definition or enumeration type. - `Collection(Edm.PrimitiveType)` - - cannot be used as the type of a property or term. - - cannot be used as the type of a parameter or the return type of - an action or function. + - cannot be used. - `Collection(Edm.Untyped)` - cannot be returned in a payload with an `OData-Version` header of `4.0`. Services should treat untyped properties as dynamic diff --git a/odata-csdl/12 Action and Function.md b/odata-csdl/12 Action and Function.md index b75ca57e9..ec8e594e6 100644 --- a/odata-csdl/12 Action and Function.md +++ b/odata-csdl/12 Action and Function.md @@ -156,7 +156,7 @@ explicitly indicated, it is unbound. Bound actions or functions are invoked on resources matching the type of the binding parameter. The binding parameter can be of any type, and it -MAY be [nullable](#Nullable). +MAY be nullable. Unbound actions are invoked from the entity container through an [action import](#ActionImport). @@ -240,7 +240,7 @@ The value of `IsComposable` is one of the Boolean literals `true` or The return type of an action or function overload MAY be any type in scope, or a collection of any type in scope. -The facets [`Nullable`](#Nullable), [`MaxLength`](#MaxLength), +The facets [`MaxLength`](#MaxLength), [`Precision`](#Precision), [`Scale`](#Scale), and [`SRID`](#SRID) can be used as appropriate to specify value restrictions of the return type, as well as the [`Unicode`](#Unicode) facet for 4.01 and greater payloads. diff --git a/odata-csdl/13 Entity Container.md b/odata-csdl/13 Entity Container.md index 318c6e1b8..7a826a547 100644 --- a/odata-csdl/13 Entity Container.md +++ b/odata-csdl/13 Entity Container.md @@ -399,10 +399,10 @@ If the entity type of an entity set or singleton declares navigation properties, a navigation property binding allows describing which entity set or singleton will contain the related entities. -An [entity set](#EntitySet) or a [singleton](#Singleton) SHOULD specify -a navigation property binding for each [navigation -property](#NavigationProperty) of its entity type, including navigation -properties defined on complex typed properties or derived types. +An [entity set](#EntitySet) or a [singleton](#Singleton) SHOULD contain a navigation +property binding for each non-containment navigation property that can be reached +from the entity type through a sequence of type casts, complex properties, +or containment navigation properties. If omitted, clients MUST assume that the target entity set or singleton can vary per related entity. @@ -553,7 +553,7 @@ Example ##ex: for an entity set in any container in scope ::: {.varxml .example} Example ##ex: binding `Supplier` on `Products` contained within -`Categories – binding applies to all suppliers of all products of all categories` +`Categories` – binding applies to all suppliers of all products of all categories ```xml + + + + + + + + + + + +``` +:::: + +Path evaluation for the annotations in the next block starts at the declared +type `self.B` of the hosting property `A2`. +:::: varjson +```json + "Container": { + "$Kind": "EntityContainer", + "SetA": { + "$Collection": true, + "$Type": "self.A" + } + }, + "$Annotations": { + "self.Container/SetA/A2": { + "@Core.Description#viaset@Core.IsLanguageDependent": { + "$Path": "B1" + }, + "@Core.Description#viaset": "..." + }, + "self.Container/SetA/A2/@Core.Description#viaset": { + "@Core.IsLanguageDependent": { + "$Path": "B1" + } + }, +``` +:::: + +:::: varxml +```xml + + + + + + + + + + + +``` +:::: + +Path evaluation for the annotations in the final block starts at the outermost +type `self.A` named in the target path. +:::: varjson +```json + "self.A/A2": { + "@Core.Description#external@Core.IsLanguageDependent": { + "$Path": "A1" + }, + "@Core.Description#external": "..." + }, + "self.A/A2/@Core.Description": { + "@Core.IsLanguageDependent": { + "$Path": "A1" + } + } + } +} +``` +:::: + +:::: varxml +```xml + + + + + + + + + +``` +:::: + +::: #### ##subsubsubsec Annotation Path The annotation path expression provides a value for terms or term properties that specify the [built-in types](#BuiltInTypesfordefiningVocabularyTerms) -`Edm.AnnotationPath or Edm.ModelElementPath`. Its argument is a [model +`Edm.AnnotationPath` or `Edm.ModelElementPath`. Its argument is a [model path](#PathExpressions) with the following restriction: - A non-null path MUST resolve to an annotation. @@ -1468,7 +1649,7 @@ Example ##ex: The model element path expression provides a value for terms or term properties that specify the [built-in -type](#BuiltInTypesfordefiningVocabularyTerms)` Edm.ModelElementPath`. Its +type](#BuiltInTypesfordefiningVocabularyTerms) `Edm.ModelElementPath`. Its argument is a [model path](#PathExpressions). The value of the model element path expression is the path itself, not @@ -1510,7 +1691,7 @@ Example ##ex: The navigation property path expression provides a value for terms or term properties that specify the [built-in types](#BuiltInTypesfordefiningVocabularyTerms) -`Edm.NavigationPropertyPath, Edm.AnyPropertyPath, or Edm.ModelElementPath`. +`Edm.NavigationPropertyPath`, `Edm.AnyPropertyPath`, or `Edm.ModelElementPath`. Its argument is a [model path](#PathExpressions) with the following restriction: - A non-null path MUST resolve to a model @@ -1569,7 +1750,7 @@ Example ##ex: The property path expression provides a value for terms or term properties that specify one of the [built-in types](#BuiltInTypesfordefiningVocabularyTerms) -`Edm.PropertyPath, Edm.AnyPropertyPath, or Edm.ModelElementPath`. Its +`Edm.PropertyPath`, `Edm.AnyPropertyPath`, or `Edm.ModelElementPath`. Its argument is a [model path](#PathExpressions) with the following restriction: - A non-null path MUST resolve to a model @@ -1831,7 +2012,7 @@ Example ##ex: "S" ] ] -} +} ``` ::: @@ -2191,7 +2372,7 @@ the member name of the enumeration value. #### ##subsubsubsec Function `odata.fillUriTemplate` The `odata.fillUriTemplate` client-side function takes two or more -expressions as arguments and returns a value of type `Edm.String.` +expressions as arguments and returns a value of type `Edm.String`. The first argument MUST be of type `Edm.String` and specifies a URI template according to [RFC6570](#rfc6570), the other arguments MUST be @@ -2251,6 +2432,7 @@ Name property of the Actor entity The `odata.matchesPattern` client-side function takes two string expressions as arguments and returns a Boolean value. +It is the counterpart of the identically named URL function [OData-URL, section 5.1.1.7.1](#ODataURL). The function returns true if the second expression evaluates to an [ECMAScript](#_ECMAScript) (JavaScript) regular expression and @@ -2287,7 +2469,7 @@ Example ##ex: all non-empty `FirstName` values not containing the letters #### ##subsubsubsec Function `odata.uriEncode` -The `odata.uriEncode `client-side function takes one argument of +The `odata.uriEncode` client-side function takes one argument of primitive type and returns the URL-encoded OData literal that can be used as a key value in OData URLs or in the query part of OData URLs. diff --git a/odata-csdl/15 Identifier and Path Values.md b/odata-csdl/15 Identifier and Path Values.md index a3b68dc6f..7b8566c28 100644 --- a/odata-csdl/15 Identifier and Path Values.md +++ b/odata-csdl/15 Identifier and Path Values.md @@ -108,7 +108,6 @@ Example ##ex: "@Core.DefaultNamespace": true, "Product": { "$Kind": "EntityType", - "$HasStream": true, "$Key": [ "ID" ], @@ -311,7 +310,7 @@ Example ##ex: - + @@ -464,7 +463,7 @@ Example ##ex: } } } -} +} ``` ::: diff --git a/odata-csdl/4 CSDL Document.md b/odata-csdl/4 CSDL Document.md index 9c6c18c07..c119d00bc 100644 --- a/odata-csdl/4 CSDL Document.md +++ b/odata-csdl/4 CSDL Document.md @@ -55,9 +55,9 @@ other CSDL documents. The `Version` attribute specifies the OData protocol version of the service. For OData 4.0 responses the value of this attribute MUST be -`4.0.` For OData 4.01 responses the value of this attribute MUST be -`4.01.` Services MUST return an OData 4.0 response if the request was -made with an `OData-MaxVersion `header with a value of `4.0`. +`4.0`. For OData 4.01 responses the value of this attribute MUST be +`4.01`. Services MUST return an OData 4.0 response if the request was +made with an `OData-MaxVersion` header with a value of `4.0`. ### ##isec Element `edmx:DataServices` diff --git a/odata-csdl/5 Schema.md b/odata-csdl/5 Schema.md index e6a0d259c..ec8cd626d 100644 --- a/odata-csdl/5 Schema.md +++ b/odata-csdl/5 Schema.md @@ -423,7 +423,7 @@ see [OData-VocCore](#ODataVocCore). ::: {.varjson .rep} ### ##subisec `$HasStream` -The value of `$HasStream `is one of the Boolean literals `true` or +The value of `$HasStream` is one of the Boolean literals `true` or `false`. Absence of the member means `false`. ::: diff --git a/odata-csdl/7 Structural Property.md b/odata-csdl/7 Structural Property.md index 0c891825a..0b5a24dbb 100644 --- a/odata-csdl/7 Structural Property.md +++ b/odata-csdl/7 Structural Property.md @@ -38,7 +38,7 @@ the member value is an object. The property object MAY contain the member `$Kind` with a string value of `Property`. This member SHOULD be omitted to reduce document size. -It MAY contain the member [`$Type`](#Type), [`$Collection`](#Type), +It MAY contain the members [`$Type`](#Type), [`$Collection`](#Type), [`$Nullable`](#Nullable), [`$MaxLength`](#MaxLength), [`$Unicode`](#Unicode), [`$Precision`](#Precision), [`$Scale`](#Scale), [`$SRID`](#SRID), and [`$DefaultValue`](#DefaultValue). @@ -68,7 +68,7 @@ Example ##ex: complex type with two properties `Dimension` and `Length` ### ##isec Element `edm:Property` The `edm:Property` element MUST contain the `Name` and the `Type` -attribute, and it MAY contain the facet attributes +attribute, and it MAY contain the attributes [`Nullable`](#Nullable), [`MaxLength`](#MaxLength), [`Unicode`](#Unicode), [`Precision`](#Precision), [`Scale`](#Scale), [`SRID`](#SRID), and [`DefaultValue`](#DefaultValue). @@ -153,15 +153,7 @@ value ``` ::: -## ##subsec Type Facets - -Facets modify or constrain the acceptable values of a property. - -For single-valued properties the facets apply to the value of the -property. For collection-valued properties the facets apply to the items -in the collection. - -### ##subsubsec Nullable +## ##subsec Nullable A Boolean value specifying whether the property can have the value `null`. @@ -175,7 +167,7 @@ The value of `$Nullable` is one of the Boolean literals `true` or For single-valued properties the value `true` means that the property allows the `null` value. -For collection-valued properties the property value will always be a +For collection-valued properties the value will always be a collection that MAY be empty. In this case `$Nullable` applies to items of the collection and specifies whether the collection MAY contain `null` values. @@ -190,7 +182,7 @@ The value of `Nullable` is one of the Boolean literals `true` or For single-valued properties the value `true` means that the property allows the `null` value. -For collection-valued properties the property value will always be a +For collection-valued properties the value will always be a collection that MAY be empty. In this case the `Nullable` attribute applies to items of the collection and specifies whether the collection MAY contain `null` values. @@ -206,298 +198,9 @@ cannot assume any default value. Clients SHOULD be prepared for this situation even in OData 4.01 responses. ::: -### ##subsubsec MaxLength - -A positive integer value specifying the maximum length of a binary, -stream or string value. For binary or stream values this is the octet -length of the binary data, for string values it is the character length -(number of code points for Unicode). - -If no maximum length is specified, clients SHOULD expect arbitrary -length. - -::: {.varjson .rep} -### ##subisec `$MaxLength` - -The value of `$MaxLength` is a positive integer. - -Note: [OData-CSDL-XML](#ODataCSDL) defines a symbolic -value `max` that is only allowed in OData 4.0 responses. This symbolic -value is not allowed in CDSL JSON documents at all. Services MAY instead -specify the concrete maximum length supported for the type by the -service or omit the member entirely. -::: - -::: {.varxml .rep} -### ##subisec Attribute `MaxLength` - -The value of `MaxLength` is a positive integer or the symbolic value -`max` as a shorthand for the maximum length supported for the type by -the service. - -Note: the symbolic value `max` is only allowed in OData 4.0 responses; -it is deprecated in OData 4.01. While clients MUST be prepared for this -symbolic value, OData 4.01 and greater services MUST NOT return the -symbolic value `max` and MAY instead specify the concrete maximum length -supported for the type by the service or omit the attribute entirely. -::: - -### ##subsubsec Precision - -For a decimal value: the maximum number of significant decimal digits of -the property's value; it MUST be a positive integer. - -For a temporal value (datetime-with-timezone-offset, duration, or -time-of-day): the number of decimal places allowed in the seconds -portion of the value; it MUST be a non-negative integer between zero and -twelve. - -Note: service authors SHOULD be aware that some clients are unable to -support a precision greater than 28 for decimal properties and 7 for -temporal properties. Client developers MUST be aware of the potential -for data loss when round-tripping values of greater precision. Updating -via `PATCH` and exclusively specifying modified properties will reduce -the risk for unintended data loss. - -Note: duration properties supporting a granularity less than seconds -(e.g. minutes, hours, days) can be annotated with term -[`Measures.DurationGranularity`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Measures.V1.md#DurationGranularity), -see [OData-VocMeasures](#ODataVocMeasures). - -::: {.varjson .rep} -### ##subisec `$Precision` - -The value of `$Precision` is a number. - -Absence of `$Precision` means arbitrary precision. -::: - -::: {.varjson .example} -Example ##ex: `Precision` facet applied to the `DateTimeOffset` type -```json -"SuggestedTimes": { - "$Type": "Edm.DateTimeOffset", - "$Collection": true, - "$Precision": 6 -} -``` -::: - -::: {.varxml .rep} -### ##subisec Attribute `Precision` - -The value of `Precision` is a number. - -If not specified for a decimal property, the decimal property has -arbitrary precision. - -If not specified for a temporal property, the temporal property has a -precision of zero. -::: - -::: {.varxml .example} -Example ##ex: [`Precision`](#Precision) facet applied to the -`DateTimeOffset` type -```xml - -``` -::: - -### ##subsubsec Scale - -A non-negative integer value specifying the maximum number of digits -allowed to the right of the decimal point, or one of the symbolic values -`floating` or `variable`. - -The value `floating` means that the decimal property represents a -decimal floating-point number whose number of significant digits is the -value of the [`Precision`](#Precision) facet. OData 4.0 responses MUST -NOT specify the value `floating`. - -The value `variable` means that the number of digits to the right of the -decimal point can vary from zero to the value of the -[`Precision`](#Precision) facet. - -An integer value means that the number of digits to the right of the -decimal point may vary from zero to the value of the `Scale` facet, and -the number of digits to the left of the decimal point may vary from one -to the value of the `Precision` facet minus the value of the `Scale` -facet. If `Precision` is equal to `Scale`, a single zero MUST precede -the decimal point. - -The value of `Scale` MUST be less than or equal to the value of -[`Precision`](#Precision). - -Note: if the underlying data store allows negative scale, services may -use a [`Precision`](#Precision) with the absolute value of the negative -scale added to the actual number of significant decimal digits, and -client-provided values may have to be rounded before being stored. - -::: {.varjson .rep} -### ##subisec `$Scale` - -The value of `$Scale` is a number or a string with one of the symbolic -values `floating` or `variable`. - -Services SHOULD use lower-case values; clients SHOULD accept values in a -case-insensitive manner. - -Absence of `$Scale` means `variable`. -::: - -::: {.varjson .example} -Example ##ex: [`Precision`](#Precision)`=3` and `Scale=2`. -Allowed values: 1.23, 0.23, 3.14 and 0.7, not allowed values: 123, 12.3 -```json -"Amount32": { - "$Nullable": true, - "$Type": "Edm.Decimal", - "$Precision": 3, - "$Scale": 2 -} -``` -::: - -::: {.varjson .example} -Example ##ex: `Precision=2` equals `Scale`. -Allowed values: 0.23, 0.7, not allowed values: 1.23, 1.2 -```json -"Amount22": { - "$Nullable": true, - "$Type": "Edm.Decimal", - "$Precision": 2, - "$Scale": 2 -} -``` -::: - -::: {.varjson .example} -Example ##ex: `Precision=3` and a variable `Scale`. -Allowed values: 0.123, 1.23, 0.23, 0.7, 123 and 12.3, not allowed -values: 12.34, 1234 and 123.4 due to the limited precision. -```json -"Amount3v": { - "$Nullable": true, - "$Type": "Edm.Decimal", - "$Precision": 3 -} -``` -::: - -::: {.varjson .example} -Example ##ex: `Precision=7` and a floating `Scale`. -Allowed values: -1.234567e3, 1e-101, 9.999999e96, not allowed values: -1e-102 and 1e97 due to the limited precision. -```json -"Amount7f": { - "$Nullable": true, - "$Type": "Edm.Decimal", - "$Precision": 7, - "$Scale": "floating" -} -``` -::: - -::: {.varxml .rep} -### ##subisec Attribute `Scale` - -The value of `Scale` is a number or one of the symbolic values -`floating` or `variable`. - -Services SHOULD use lower-case values; clients SHOULD accept values in a -case-insensitive manner. - -If not specified, the `Scale` facet defaults to zero. -::: - -::: {.varxml .example} -Example ##ex: [`Precision`](#Precision)`=3` and `Scale=2`. -Allowed values: 1.23, 0.23, 3.14 and 0.7, not allowed values: 123, 12.3 -```xml - -``` -::: - -::: {.varxml .example} -Example ##ex: `Precision=2` equals `Scale`. -Allowed values: 0.23, 0.7, not allowed values: 1.23, 1.2 -```xml - -``` -::: - -::: {.varxml .example} -Example ##ex: `Precision=3` and a variable `Scale`. -Allowed values: 0.123, 1.23, 0.23, 0.7, 123 and 12.3, not allowed -values: 12.34, 1234 and 123.4 due to the limited precision. -```xml - -``` -::: - -::: {.varxml .example} -Example ##ex: `Precision=7` and a floating `Scale`. -Allowed values: -1.234567e3, 1e-101, 9.999999e96, not allowed values: -1e-102 and 1e97 due to the limited precision. -```xml - -``` -::: - -### ##subsubsec Unicode - -For a string property the `Unicode` facet indicates whether the property -might contain and accept string values with Unicode characters (code -points) beyond the ASCII character set. The value `false` indicates that -the property will only contain and accept string values with characters -limited to the ASCII character set. - -If no value is specified, the `Unicode` facet defaults to `true`. - -::: {.varjson .rep} -### ##subisec `$Unicode` - -The value of `$Unicode` is one of the Boolean literals `true` or -`false`. Absence of the member means `true`. -::: - -::: {.varxml .rep} -### ##subisec Attribute `Unicode` - -The value of `Unicode` is one of the Boolean literals `true` or `false`. -Absence of the attribute means `true`. -::: - -### ##subsubsec SRID - -For a geometry or geography property the `SRID` facet identifies which -spatial reference system is applied to values of the property on type -instances. - -The value of the `SRID` facet MUST be a non-negative integer or the -special value `variable`. If no value is specified, the facet defaults -to `0` for `Geometry` types or `4326` for `Geography` types. - -The valid values of the `SRID` facet and their meanings are as defined -by the European Petroleum Survey Group [EPSG](#_EPSG). - -::: {.varjson .rep} -### ##subisec `$SRID` - -The value of `$SRID` is a string containing a number or the symbolic -value `variable`. -::: - -::: {.varxml .rep} -### ##subisec Attribute `SRID` - -The value of `SRID` is a number or the symbolic value `variable`. -::: - -### ##subsubsec Default Value +## ##subsec Default Value -A primitive or enumeration property MAY define a default value that is +A primitive- or enumeration-typed property MAY define a default value that is used if the property is not explicitly represented in an annotation or the body of a request or response. @@ -854,10 +557,10 @@ the target of the navigation). The type of the dependent property MUST match the type of the principal property, or both types MUST be complex types. -If the principle property references an entity, then the dependent +If the principal property references an entity, then the dependent property must reference the same entity. -If the principle property's value is a complex type instance, then the +If the principal property's value is a complex type instance, then the dependent property's value must be a complex type instance with the same properties, each with the same values. diff --git a/odata-csdl/Appendix.md b/odata-csdl/Appendix.md index 51b26a9c1..051230f21 100644 --- a/odata-csdl/Appendix.md +++ b/odata-csdl/Appendix.md @@ -85,23 +85,23 @@ _Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14 https://www.rfc-editor.org/info/rfc2119. ###### [RFC6570] -_Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., and D. Orchard, “URI Template”, RFC 6570, March 2012_. -http://tools.ietf.org/html/rfc6570. +_Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., and D. Orchard, "URI Template", RFC 6570, DOI 10.17487/RFC6570, March 2012_. +https://www.rfc-editor.org/info/rfc6570. : varjson ###### [RFC7493] -_Bray, T., Ed., "The I-JSON Message Format", RFC7493, March 2015_. -https://tools.ietf.org/html/rfc7493. +_The I-JSON Message Format", RFC 7493, DOI 10.17487/RFC7493, March 2015_. +https://www.rfc-editor.org/info/rfc7493. : ###### [RFC8174] _Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_. -http://www.rfc-editor.org/info/rfc8174. +https://www.rfc-editor.org/info/rfc8174. : varjson ###### [RFC8259] -_Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", RFC 8259, December 2017_. -http://tools.ietf.org/html/rfc8259. +_Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, DOI 10.17487/RFC8259, December 2017_. +https://www.rfc-editor.org/info/rfc8259. : : varxml @@ -125,7 +125,7 @@ http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/. Latest version available ## ##subasec Informative References ###### [OpenUI5] -_OpenUI5 Version 1.40.10 - OData V4 Metadata JSON Format_. +_OpenUI5 Version 1.40.10 --- OData V4 Metadata JSON Format_. https://openui5.hana.ondemand.com/1.40.10/#docs/guide/87aac894a40640f89920d7b2a414499b.html. ------- diff --git a/odata-data-aggregation-ext/0 frontmatter.md b/odata-data-aggregation-ext/0 frontmatter.md index 2effc04fe..82f2c2343 100644 --- a/odata-data-aggregation-ext/0 frontmatter.md +++ b/odata-data-aggregation-ext/0 frontmatter.md @@ -67,7 +67,7 @@ $$$description$$$ #### Status: This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical. -TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "[Send A Comment](https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=odata)" button on the TC's web page at https://www.oasis-open.org/committees/odata/. +TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/. This specification is provided under the [RF on RAND Terms Mode](https://www.oasis-open.org/policies-guidelines/ipr/#RF-on-RAND-Mode) of the [OASIS IPR Policy](https://www.oasis-open.org/policies-guidelines/ipr/), the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php). diff --git a/odata-data-aggregation-ext/1 Introduction.md b/odata-data-aggregation-ext/1 Introduction.md index 5413a4085..1456fcf93 100644 --- a/odata-data-aggregation-ext/1 Introduction.md +++ b/odata-data-aggregation-ext/1 Introduction.md @@ -57,7 +57,7 @@ All other text is normative unless otherwise labeled. Here is a customized command line which will generate HTML from this markdown file (named `$$$filename$$$.md`). Line breaks are added for readability only: ``` -pandoc -f gfm+tex_math_dollars+fenced_divs +pandoc -f gfm+tex_math_dollars+fenced_divs+smart -t html -o $$$filename$$$.html -c styles/markdown-styles-v1.7.3b.css diff --git a/odata-data-aggregation-ext/meta.yaml b/odata-data-aggregation-ext/meta.yaml index c737a9f57..903f3557f 100644 --- a/odata-data-aggregation-ext/meta.yaml +++ b/odata-data-aggregation-ext/meta.yaml @@ -3,9 +3,9 @@ subtitle: Committee Specification 03 filename: odata-data-aggregation-ext-v4.0-cs03 stage: cs03 previousStage: csd04 -pubdate: 30 August 2023 -pubdateISO: '2023-08-30' +pubdate: 19 September 2023 +pubdateISO: '2023-09-19' copyright: © OASIS Open 2023 description: This specification adds basic grouping and aggregation functionality (e.g. sum, min, and max) - to the Open Data Protocol (OData) without changing any of the base principles of OData. \ No newline at end of file + to the Open Data Protocol (OData) without changing any of the base principles of OData. diff --git a/odata-json-format/0 frontmatter.md b/odata-json-format/0 frontmatter.md index 2132cfd61..3ea22f209 100644 --- a/odata-json-format/0 frontmatter.md +++ b/odata-json-format/0 frontmatter.md @@ -58,7 +58,7 @@ $$$description$$$ #### Status: This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical. -TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "[Send A Comment](https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=odata)" button on the TC's web page at https://www.oasis-open.org/committees/odata/. +TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/. This specification is provided under the [RF on RAND Terms Mode](https://www.oasis-open.org/policies-guidelines/ipr/#RF-on-RAND-Mode) of the [OASIS IPR Policy](https://www.oasis-open.org/policies-guidelines/ipr/), the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php). diff --git a/odata-json-format/1 Introduction.md b/odata-json-format/1 Introduction.md index 6137f04c0..8e923a0e7 100644 --- a/odata-json-format/1 Introduction.md +++ b/odata-json-format/1 Introduction.md @@ -51,7 +51,7 @@ All other text is normative unless otherwise labeled. Here is a customized command line which will generate HTML from this markdown file (named `$$$filename$$$.md`). Line breaks are added for readability only: ``` -pandoc -f gfm+tex_math_dollars+fenced_divs +pandoc -f gfm+tex_math_dollars+fenced_divs+smart -t html -o $$$filename$$$.html -c styles/markdown-styles-v1.7.3b.css diff --git a/odata-json-format/10 Media Entity.md b/odata-json-format/10 Media Entity.md index 1b8322cc3..ac05f3e0e 100644 --- a/odata-json-format/10 Media Entity.md +++ b/odata-json-format/10 Media Entity.md @@ -153,7 +153,7 @@ first name/value pair in the response. The `count` name/value pair represents the number of entities in the collection. If present and the [`streaming=true`](#PayloadOrderingConstraints) -content-type parameter is set, it MUST come before the +media type parameter is set, it MUST come before the `value` name/value pair. If the response represents a partial result, the `count` name/value pair MUST appear in the first partial response, and it MAY appear in subsequent partial responses (in diff --git a/odata-json-format/15 Delta Payload.md b/odata-json-format/15 Delta Payload.md index 046e33e06..f7241623a 100644 --- a/odata-json-format/15 Delta Payload.md +++ b/odata-json-format/15 Delta Payload.md @@ -50,11 +50,11 @@ or deleted links. Example ##ex: a 4.01 delta response with five changes, in order of occurrence - 1. `ContactName` for customer 'BOTTM' was changed to "Susan Halvenstern" - 2. Order 10643 was removed from customer 'ALFKI' - 3. Order 10645 was added to customer 'BOTTM' + 1. `ContactName` for customer `BOTTM` was changed to `Susan Halvenstern` + 2. Order 10643 was removed from customer `ALFKI` + 3. Order 10645 was added to customer `BOTTM` 4. The shipping information for order 10643 was updated - 5. Customer 'ANTON' was deleted + 5. Customer `ANTON` was deleted ```json { @@ -116,7 +116,7 @@ have changed, and MAY include additional properties. If a property of an entity is dependent upon the property of another entity within the expanded set of entities being tracked, then both the -change to the dependent property as well as the change to the principle +change to the dependent property as well as the change to the principal property or [added](#AddedLink)/[deleted link](#DeletedLink) corresponding to the change to the dependent property are returned in the delta response. @@ -162,12 +162,12 @@ links](#DeletedLink). Example ##ex: 4.01 delta response customers with expanded orders represented inline as a delta - 1. Customer 'BOTTM': - 1. `ContactName` was changed to "Susan Halvenstern" + 1. Customer `BOTTM`: + 1. `ContactName` was changed to `Susan Halvenstern` 2. Order 10645 was added - 2. Customer 'ALFKI': + 2. Customer `ALFKI`: 1. Order 10643 was removed - 3. Customer 'ANTON' was deleted + 3. Customer `ANTON` was deleted ```json { @@ -255,10 +255,10 @@ In OData 4.0 payloads the deleted-entity object MUST include the following properties, regardless of the specified [`metadata`](#ControllingtheAmountofControlInformationinResponses) value: -- Control information [`context`](#ControlInformationcontextodatacontext) - The context URL fragment MUST be +- Control information [`context`](#ControlInformationcontextodatacontext) --- The context URL fragment MUST be `#{entity-set}/$deletedEntity`, where `{entity-set}` is the entity set of the deleted entity -- `id` - The [id](#ControlInformationidodataid) of the deleted entity +- `id` --- The [id](#ControlInformationidodataid) of the deleted entity (same as the [id](#ControlInformationidodataid) returned or computed when calling GET on resource), which may be absolute or [relative](#RelativeURLs) @@ -268,12 +268,12 @@ following optional property, regardless of the specified [`metadata`](#ControllingtheAmountofControlInformationinResponses) value, and MAY include [annotations](#InstanceAnnotations): -- `reason` - either `deleted`, if the entity was deleted (destroyed), +- `reason` --- either `deleted`, if the entity was deleted (destroyed), or `changed` if the entity was removed from membership in the result (i.e., due to a data change). ::: example -Example ##ex: deleted entity in OData 4.0 response - note that `id` is +Example ##ex: deleted entity in OData 4.0 response --- note that `id` is a property, not control information ```json { @@ -313,7 +313,7 @@ following properties, regardless of the specified from the response _or_ the entity-id is not identical to the canonical URL of the entity. For [ordered payloads](#PayloadOrderingConstraints), the control information - `id,` if present, MUST immediately follow the control + `id`, if present, MUST immediately follow the control information [`removed`](#ControlInformationremovedodataremoved). @@ -368,13 +368,13 @@ The link object MUST include the following properties, regardless of the specifi the context URL fragment MUST be `#{entity-set}/$link`, where `{entity-set}` is the entity set containing the source entity -- `source` - The [id](#ControlInformationidodataid) of the entity from which +- `source` --- The [id](#ControlInformationidodataid) of the entity from which the relationship is defined, which may be absolute or [relative](#RelativeURLs) -- `relationship` - The path from the source object to the navigation property which MAY +- `relationship` --- The path from the source object to the navigation property which MAY traverse one or more complex properties, type cast segments, or members of ordered collections -- `target` - The [id](#ControlInformationidodataid) of the related entity, +- `target` --- The [id](#ControlInformationidodataid) of the related entity, which may be absolute or [relative](#RelativeURLs) ## ##subsec Deleted Link @@ -392,16 +392,16 @@ path in the initial request, unless either of the following is true: `source` and `relationship`. The deleted-link object MUST include the following properties, regardless of the specified [`metadata`](#ControllingtheAmountofControlInformationinResponses) value, and MAY include [annotations](#InstanceAnnotations): -- [`context`](#ControlInformationcontextodatacontext) - the context URL fragment MUST be +- [`context`](#ControlInformationcontextodatacontext) --- the context URL fragment MUST be `#{entity-set}/$deletedLink`, where `{entity-set}` is the entity set containing the source entity -- `source` - The [id](#ControlInformationidodataid) of the entity from which +- `source` --- The [id](#ControlInformationidodataid) of the entity from which the relationship is defined, which may be absolute or [relative](#RelativeURLs) -- `relationship` - The path from the source object to the navigation property which MAY +- `relationship` --- The path from the source object to the navigation property which MAY traverse one or more complex properties, type cast segments, or members of ordered collections -- `target` - The [id](#ControlInformationidodataid) of the related entity for +- `target` --- The [id](#ControlInformationidodataid) of the related entity for multi-valued navigation properties, which may be absolute or [relative](#RelativeURLs). For delta payloads that do not specify an `OData-Version` header value of `4.0`, @@ -422,16 +422,16 @@ entities, as well as [added](#AddedLink) or ::: example Example ##ex: 4.01 delta response customers with expanded orders represented inline as a delta - 1. Add customer 'EASTC' - 2. Change `ContactName` of customer 'AROUT' - 3. Delete customer 'ANTON' - 4. Change customer 'ALFKI': + 1. Add customer `EASTC` + 2. Change `ContactName` of customer `AROUT` + 3. Delete customer `ANTON` + 4. Change customer `ALFKI`: 1. Create order 11011 2. Add link to existing order 10692 3. Change `ShippedDate` of related order 10835 4. Delete link to order 10643 - 5. Add link between customer 'ANATR' and order 10643 - 6. Delete link between customer 'DUMON' and order 10311 + 5. Add link between customer `ANATR` and order 10643 + 6. Delete link between customer `DUMON` and order 10311 ```json { "@context": "#$delta", diff --git a/odata-json-format/19 Batch Requests and Responses.md b/odata-json-format/19 Batch Requests and Responses.md index 00944e295..359d3443c 100644 --- a/odata-json-format/19 Batch Requests and Responses.md +++ b/odata-json-format/19 Batch Requests and Responses.md @@ -39,7 +39,7 @@ batch request URL, or a relative path (not starting with a forward slash `/`). If the first segment of a relative path starts with a `$` character and is not identical to the name of a top-level system -resource (`$batch`, `$crossjoin,` `$all,` `$entity`, `$root,` +resource (`$batch`, `$crossjoin`, `$all`, `$entity`, `$root`, `$id`, `$metadata`, or other system resources defined according to the `OData-Version` of the protocol specified in the request), then this first segment is replaced with the diff --git a/odata-json-format/4 Common Characteristics.md b/odata-json-format/4 Common Characteristics.md index 366a04275..9c7014567 100644 --- a/odata-json-format/4 Common Characteristics.md +++ b/odata-json-format/4 Common Characteristics.md @@ -15,7 +15,7 @@ Requests and responses with a JSON message body MUST have a `Content-Type` header value of `application/json`. Requests MAY add the `charset` parameter to the content type. -Allowed values are `UTF-8`,` UTF-16`, and +Allowed values are `UTF-8`, `UTF-16`, and `UTF-32`. If no `charset` parameter is present, `UTF-8` MUST be assumed. @@ -153,7 +153,7 @@ cannot be assumed to support streaming. JSON producers are encouraged to follow the payload ordering constraints whenever possible (and include the `streaming=true` -content-type parameter) to support the maximum set of client scenarios. +media type parameter) to support the maximum set of client scenarios. To support streaming scenarios the following payload ordering constraints have to be met: @@ -307,7 +307,7 @@ information: [`type`](#ControlInformationtypeodatatype) control information unless their type is `Double`. - The special floating-point values `-INF`, `INF`, and - `NaN `are serialized as strings and MUST have a + `NaN` are serialized as strings and MUST have a [`type`](#ControlInformationtypeodatatype) control information to specify the numeric type of the property. - String values do have a first class representation in JSON, but there is an @@ -319,6 +319,9 @@ information: should be treated as a string value unless the property is known (from the metadata document) to have a different type. +The `type` control information can be absent in properties nested in an instance of type `Edm.Untyped`. +In particular, individual primitive values within a collection cannot have `type` control information. + For more information on namespace- and alias-qualified names, see [OData-CSDLJSON](#ODataCSDL) or [OData-CSDLXML](#ODataCSDL). @@ -341,10 +344,8 @@ metadata document of the same service with a dynamic property of type ::: ::: example -Example ##ex: entity of type -`Model.VipCustomer` defined in the -metadata` `document of a different -service +Example ##ex: entity of type `Model.VipCustomer` defined in the +metadata document of a different service ```json { "@context": "http://host/service/$metadata#Customers/$entity", @@ -397,11 +398,11 @@ The `id` control information contains the entity-id, see identical to the canonical URL of the entity, as defined in [OData-URL](#ODataURL). -The `id `control information MUST appear in responses if +The `id` control information MUST appear in responses if [`metadata=full`](#metadatafullodatametadatafull) is requested, or if [`metadata=minimal`](#metadataminimalodatametadataminimal) -is requested and any of a non-transient entity\'s key fields are omitted +is requested and any of a non-transient entity's key fields are omitted from the response _or_ the entity-id is not identical to the canonical URL of the entity after @@ -533,7 +534,7 @@ For [media entities](#MediaEntity) and [stream properties](#StreamProperty) at least one of the control information `mediaEditLink` and `mediaReadLink` MUST be included in responses if they don\'t follow standard URL conventions as defined -in [OData-URL](#ODataURL) or if +in [OData-URL](#ODataURL), sections 4.6 Addressing a property and 4.14 Addressing the Media Stream of a Media Entity, or if [`metadata=full`](#metadatafullodatametadatafull) is requested. @@ -551,7 +552,7 @@ doesn't follow standard URL conventions relative to the read link of the entity and the associated `mediaEditLink` is not present. -The `mediaContentType `control information MAY be included; +The `mediaContentType` control information MAY be included; its value SHOULD match the media type of the binary stream represented by the `mediaReadLink` URL. This is only a hint; the actual media type will be included in the `Content-Type` header when diff --git a/odata-json-format/5 Service Document.md b/odata-json-format/5 Service Document.md index 3e6f5df8f..09ab16a27 100644 --- a/odata-json-format/5 Service Document.md +++ b/odata-json-format/5 Service Document.md @@ -104,7 +104,7 @@ represented as a name/value pair within the object. The order properties appear within the object is considered insignificant. An entity in a payload may be a complete entity, a projected entity (see -_System Query Option_ `$select` +_System Query Option_ `$select` in [OData-Protocol](#ODataProtocol)), or a partial entity update (see _Update an Entity_ in [OData-Protocol](#ODataProtocol)). diff --git a/odata-json-format/7 Structural Property.md b/odata-json-format/7 Structural Property.md index 9ba42be97..b98aae8cf 100644 --- a/odata-json-format/7 Structural Property.md +++ b/odata-json-format/7 Structural Property.md @@ -4,19 +4,19 @@ # ##sec Structural Property A property within an entity or complex type instance is represented as a -name/value pair. The name MUST be the name of the property; the value is +name/value pair. The name MUST be the name of the property; a non-null value is represented depending on its type as a [primitive value](#PrimitiveValue), a [complex value](#ComplexValue), a [collection of primitive values](#CollectionofPrimitiveValues), or a [collection of complex values](#CollectionofComplexValues). +Null values are represented as the JSON literal `null`. + ## ##subsec Primitive Value Primitive values are represented following the rules of [RFC8259](#rfc8259). -Null values are represented as the JSON literal `null`. - Values of type `Edm.Boolean` are represented as the JSON literals `true` and `false` @@ -146,6 +146,10 @@ Example ##ex: partial collection of strings with next link ``` ::: +A collection of primitive values that occurs in a property of type `Edm.Untyped` +is interpreted as a collection of `Edm.Boolean`, `Edm.String`, and `Edm.Decimal` values, +depending on the JavaScript type. + ## ##subsec Collection of Complex Values A collection of complex values is represented as a JSON array; each @@ -383,7 +387,7 @@ Example ##ex: submit a partial update request to: - modify the name of an existing category - assign an existing product with the id 42 to the category - assign an existing product 57 to the category and update its name -- create a new product named "Wedges" and assign it to the category +- create a new product named `Wedges` and assign it to the category At the end of the request, the updated category contains exactly the three specified products. @@ -461,18 +465,23 @@ An entity or complex type instance can have one or more stream properties. The actual stream data is not usually contained in the representation. Instead stream property data is generally read and edited via URLs. +- Stream properties requested with `$select` or included in the default selection are represented by +[`media*`](#ControlInformationmediaodatamedia) control information. +- Stream properties requested with `$expand` or implicitly expanded are represented as a property with its value. + +See [OData-Protocol](#ODataProtocol) for details on the system query options `$select` and `$expand`. Depending on the [metadata level](#ControllingtheAmountofControlInformationinResponses), the stream property MAY be annotated to provide the read link, edit -link, media type, and ETag of the media stream through a set of -[`media*`](#ControlInformationmediaodatamedia) control information. +link, media type, and ETag of the media stream through their `media*` control information. If the actual stream data is included inline, the control information [`mediaContentType`](#ControlInformationmediaodatamedia) MUST be present to indicate how the included stream property value is represented. Stream property values of media type `application/json` or one of its subtypes, optionally with format parameters, are represented -as native JSON. Values of top-level type `text`, for example +as native JSON. Values of top-level type `text` with an explicit or +default `charset` of `utf-8` or `us-ascii`, for example `text/plain`, are represented as a string, with JSON string escaping rules applied. Included stream data of other media types is represented as a base64url-encoded string value, see diff --git a/odata-json-format/Appendix.md b/odata-json-format/Appendix.md index 5d520f7a7..6aea417d2 100644 --- a/odata-json-format/Appendix.md +++ b/odata-json-format/Appendix.md @@ -39,40 +39,40 @@ _OData Vocabularies Version 4.0: Core Vocabulary._ See link in "[Related work](#RelatedWork)" section on cover page. ###### [RFC2119] -_Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997_ +_Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997_. https://www.rfc-editor.org/info/rfc2119. ###### [RFC3986] -_Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", IETF RFC3986, January 2005_ -https://tools.ietf.org/html/rfc3986. +_Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005_. +https://www.rfc-editor.org/info/rfc3986. ###### [RFC3987] -_Duerst, M. and, M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC 3987, January 2005_ -https://tools.ietf.org/html/rfc3987. +_Duerst, M. and M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC 3987, DOI 10.17487/RFC3987, January 2005_. +https://www.rfc-editor.org/info/rfc3987. ###### [RFC4648] -_Josefsson, S,, "The Base16, Base32, and Base64 Data Encodings", RFC 4648, October 2006_ -https://tools.ietf.org/html/rfc4648. +_Josefsson, S., "The Base16, Base32, and Base64 Data Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006_. +https://www.rfc-editor.org/info/rfc4648. ###### [RFC5646] -_Phillips, A., Ed., and M. Davis, Ed., "Tags for Identifying Languages", BCP 47, RFC 5646, September 2009_ -http://tools.ietf.org/html/rfc5646. +_Phillips, A., Ed., and M. Davis, Ed., "Tags for Identifying Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646, September 2009_. +https://www.rfc-editor.org/info/rfc5646. ###### [RFC7493] -_Bray, T., Ed., "The I-JSON Message Format", RFC7493, March 2015_ -https://tools.ietf.org/html/rfc7493. +_Bray, T., Ed., "The I-JSON Message Format", RFC 7493, DOI 10.17487/RFC7493, March 2015_. +https://www.rfc-editor.org/info/rfc7493. ###### [RFC7946] -_Howard Butler, Martin Daly, Alan Doyle, Sean Gillies, Stefan Hagen and Tim Schaub, "The GeoJSON Format", RFC 7946, August 2016._ -http://tools.ietf.org/html/rfc7946. +_Butler, H., Daly, M., Doyle, A., Gillies, S., Hagen, S., and T. Schaub, "The GeoJSON Format", RFC 7946, DOI 10.17487/RFC7946, August 2016_. +https://www.rfc-editor.org/info/rfc7946. ###### [RFC8174] -_Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_ +_Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_. https://www.rfc-editor.org/info/rfc8174. ###### [RFC8259] -_Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", RFC 8259, December 2017_ -http://tools.ietf.org/html/rfc8259. +_Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, DOI 10.17487/RFC8259, December 2017_. +https://www.rfc-editor.org/info/rfc8259. ## ##subasec Informative References diff --git a/odata-protocol/0 frontmatter.md b/odata-protocol/0 frontmatter.md index 74363ef1b..cdc8713e5 100644 --- a/odata-protocol/0 frontmatter.md +++ b/odata-protocol/0 frontmatter.md @@ -62,7 +62,7 @@ $$$description$$$ #### Status: This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical. -TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "[Send A Comment](https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=odata)" button on the TC's web page at https://www.oasis-open.org/committees/odata/. +TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/. This specification is provided under the [RF on RAND Terms Mode](https://www.oasis-open.org/policies-guidelines/ipr/#RF-on-RAND-Mode) of the [OASIS IPR Policy](https://www.oasis-open.org/policies-guidelines/ipr/), the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php). diff --git a/odata-protocol/1 Introduction.md b/odata-protocol/1 Introduction.md index 7e0d76e79..8ec33d691 100644 --- a/odata-protocol/1 Introduction.md +++ b/odata-protocol/1 Introduction.md @@ -56,7 +56,7 @@ All other text is normative unless otherwise labeled. Here is a customized command line which will generate HTML from this markdown file (named `$$$filename$$$.md`). Line breaks are added for readability only: ``` -pandoc -f gfm+tex_math_dollars+fenced_divs +pandoc -f gfm+tex_math_dollars+fenced_divs+smart -t html -o $$$filename$$$.html -c styles/markdown-styles-v1.7.3b.css diff --git a/odata-protocol/10 Context URL.md b/odata-protocol/10 Context URL.md index 812078bfe..bb64c6c96 100644 --- a/odata-protocol/10 Context URL.md +++ b/odata-protocol/10 Context URL.md @@ -146,8 +146,8 @@ URL fragment. ::: example Example ##ex: resource URL and corresponding context URL ``` -http://host/service/MainSupplier` -http://host/service/$metadata#`MainSupplier +http://host/service/MainSupplier +http://host/service/$metadata#MainSupplier ``` ::: @@ -181,7 +181,7 @@ the entity set name. ::: example Example ##ex: resource URL and corresponding context URL ``` -http://host/service/Customers(2)/Model.VipCustomer` +http://host/service/Customers(2)/Model.VipCustomer http://host/service/$metadata#Customers/Model.VipCustomer/$entity ``` ::: @@ -230,7 +230,7 @@ entities in the collection, see system query option ::: example Example ##ex: resource URL and corresponding context URL ``` -http://host/service/Customers?$select=Address,Orders,Model.VipCustomer/PreferredContact +http://host/service/Customers?$select=Address,Orders,Model.VipCustomer/PreferredContact http://host/service/$metadata#Customers(Address,Orders,Model.VipCustomer/PreferredContact) ``` ::: @@ -301,14 +301,14 @@ navigation properties, functions or actions, the comma-separated list of properties MUST include the name of the expanded property, suffixed with the parenthesized comma-separated list of any properties of the expanded navigation property that are selected or expanded. If the expanded -navigation property does not contain a nested `$select `or` $expand`, +navigation property does not contain a nested `$select` or `$expand`, then the expanded property is suffixed with empty parentheses. If the expansion is recursive for nested children, a plus sign (`+`) is infixed between the navigation property name and the opening parenthesis. For a 4.0 response, the expanded navigation property suffixed with parentheses is omitted from the select-list if it does not contain a -nested `$select `or` $expand`, but MUST still be present, without a +nested `$select` or `$expand`, but MUST still be present, without a suffix, if it is explicitly selected. If the context URL includes only expanded navigation properties (i.e., @@ -320,7 +320,7 @@ Navigation properties with expanded references are not represented in the context URL. ::: example -Example ##ex: resource URL and corresponding context URL - select and +Example ##ex: resource URL and corresponding context URL --- select and expand ``` http://host/service/Customers?$select=Name&$expand=Address/Country @@ -329,7 +329,7 @@ http://host/service/$metadata#Customers(Name,Address/Country()) ::: ::: example -Example ##ex: resource URL and corresponding context URL -- expand `$ref` +Example ##ex: resource URL and corresponding context URL --- expand `$ref` ``` http://host/service/Customers?$expand=Orders/$ref http://host/service/$metadata#Customers @@ -337,7 +337,7 @@ http://host/service/$metadata#Customers ::: ::: example -Example ##ex: resource URL and corresponding context URL -- expand with +Example ##ex: resource URL and corresponding context URL --- expand with `$levels` ``` http://host/service/Employees/Sales.Manager?$select=DirectReports @@ -361,14 +361,14 @@ navigation properties, functions or actions, the comma-separated list of properties MUST include the name of the expanded property, suffixed with the parenthesized comma-separated list of any properties of the expanded navigation property that are selected or expanded. If the expanded -navigation property does not contain a nested `$select `or` $expand`, +navigation property does not contain a nested `$select` or `$expand`, then the expanded property is suffixed with empty parentheses. If the expansion is recursive for nested children, a plus sign (`+`) is infixed between the navigation property name and the opening parenthesis. For a 4.0 response, the expanded navigation property suffixed with parentheses is omitted from the select-list if it does not contain a -nested `$select `or `$expand`, but MUST still be present, without a +nested `$select` or `$expand`, but MUST still be present, without a suffix, if it is explicitly selected. If the context URL includes only expanded navigation properties (i.e., @@ -494,7 +494,7 @@ Context URL templates: {context-url}#{entity-set}{/type-name}{select-list} {context-url}#{entity-set}{/type-name}{select-list}/$entity - {context-url}#{entity}/{property-path}`{select-list} + {context-url}#{entity}/{property-path}{select-list} {context-url}#Collection({type-name}){select-list} {context-url}#{type-name}{select-list} @@ -535,7 +535,7 @@ of the containing entity. ::: example Example ##ex: resource URL and corresponding context URL ``` -http://host/service/Customers`?$deltatoken=1234 +http://host/service/Customers?$deltatoken=1234 http://host/service/$metadata#Customers/$delta ``` ::: diff --git a/odata-protocol/11 Data Service Requests.md b/odata-protocol/11 Data Service Requests.md index e3db32113..007dee2ad 100644 --- a/odata-protocol/11 Data Service Requests.md +++ b/odata-protocol/11 Data Service Requests.md @@ -78,7 +78,7 @@ root URL of the service with `$metadata` appended. To retrieve this document the client issues a `GET` request to the metadata document URL. If a request for metadata does not specify a format preference (via -[`Accept` header](#HeaderAccept) or +[`Accept`](#HeaderAccept) header or [`$format`](#SystemQueryOptionformat)) then the XML representation MUST be returned. @@ -103,10 +103,10 @@ the URL has expired, then the service SHOULD respond with MUST respond with [`404 Not Found`](#ResponseCode404NotFound). The format of the returned data is dependent upon the request and the -format specified by the client, either in the [`Accept` -header](#HeaderAccept) or using the +format specified by the client, either in the +[`Accept`](#HeaderAccept) header or using the [`$format`](#SystemQueryOptionformat) query option. If -the client specifies neither an [`Accept` header](#HeaderAccept) nor the +the client specifies neither an [`Accept`](#HeaderAccept) header nor the [`$format`](#SystemQueryOptionformat) query option, the service is allowed to return the response in any format. @@ -129,7 +129,7 @@ processing. Prior to applying any [server-driven paging](#ServerDrivenPaging): -- `$apply` -- defined in [OData-Aggregation](#ODataAggregation) +- `$apply` --- defined in [OData-Aggregation](#ODataAggregation) - [`$compute`](#SystemQueryOptioncompute) - [`$search`](#SystemQueryOptionsearch) - [`$filter`](#SystemQueryOptionfilter) @@ -167,7 +167,7 @@ Properties that are not available, for example due to permissions, are not returned. In this case, the [`Core.Permissions`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#Permissions) annotation, defined in [OData-VocCore](#ODataVocCore) MUST be returned -for the property with a value of `None.` +for the property with a value of `None`. If no entity exists with the specified request URL, the service responds with [`404 Not Found`](#ResponseCode404NotFound). @@ -185,12 +185,17 @@ entity is the main topic of interest and the stream data is just additional information attached to the structured data. To address the media stream represented by a media entity, clients -append `/$value` to the resource path of the media entity URL. Services -may redirect from this canonical URL to the source URL of the media +append `/$value` to the resource path of the media entity URL. +The media type of the response is the +media type of the stream, subject to content type negotiation based on the +[`Accept`](#HeaderAccept) header of the request. +The response body is the octet-stream that represents the raw +value of the media stream with that media type. Alternatively, services +MAY redirect from this canonical URL to the source URL of the media stream. Appending `/$value` to an entity that is not a media entity returns -`400 Bad Request.` +`400 Bad Request`. Attempting to retrieve the media stream from a single-valued navigation property referencing a media entity whose value is null returns @@ -199,7 +204,7 @@ property referencing a media entity whose value is null returns ### ##subsubsec Requesting Individual Properties To retrieve an individual property, the client issues a `GET` request to -the property URL. The property URL is the entity read URL with "/" and +the property URL. The property URL is the entity read URL with `/` and the property name appended. For complex typed properties, the path can be further extended with the @@ -220,6 +225,18 @@ GET http://host/service/Products(1)/Name ``` ::: +#### ##subsubsubsec Requesting Stream Properties + +If the property being requested has type `Edm.Stream` (see +[OData-URL, section 9](#ODataURL)), the media type of the response is the +media type of the stream, subject to content type negotiation based on the +[`Accept`](#HeaderAccept) header of the request. +The response body is the octet-stream that represents the raw +value of the stream property with that media type. + +Note this response format disregards any [`$format`](#SystemQueryOptionformat) +system query option. + #### ##subsubsubsec Requesting a Property's Raw Value using `$value` To retrieve the raw value of a primitive type property, the client sends @@ -259,6 +276,9 @@ A `$value` request for a property that is `null` results in a If the property is not available, for example due to permissions, the service responds with [`404 Not Found`](#ResponseCode404NotFound). +Appending `/$value` to the property URL of a property of type `Edm.Stream` +returns `400 Bad Request`. + ::: example Example ##ex: ``` @@ -383,18 +403,12 @@ The `$expand` system query option indicates the related entities and stream values that MUST be represented inline. The service MUST return the specified content, and MAY choose to return additional information. -The value of the `$expand` query option is a comma-separated list of -navigation property names, stream property names, or `$value` indicating -the stream content of a media-entity. - -For navigation properties, the navigation property name is optionally -followed by a `/$ref` path segment or a `/$count` path segment, and -optionally a parenthesized set of [expand options](#ExpandOptions) (for -filtering, sorting, selecting, paging, or expanding the related -entities). +The value of `$expand` is a comma-separated list of expand items. Each +expand item is evaluated relative to the retrieved resource being +expanded. For a full description of the syntax used when building requests, see -[OData-URL](#ODataURL). +[OData-URL](#ODataURL), section 5.1.3. ::: example Example ##ex: for each customer entity within the Customers entity set the @@ -427,15 +441,18 @@ application of expand options, expressed as a semicolon-separated list of system query options, enclosed in parentheses, see [OData-URL](#ODataURL). -Allowed system query options are [`$filter`](#SystemQueryOptionfilter), +Allowed system query options are +[`$compute`](#SystemQueryOptioncompute), [`$select`](#SystemQueryOptionselect), +`$expand`, and +[`$levels`](#ExpandOptionlevels) + for all navigation properties, plus +[`$filter`](#SystemQueryOptionfilter), [`$orderby`](#SystemQueryOptionorderby), [`$skip`](#SystemQueryOptionskip), [`$top`](#SystemQueryOptiontop), -[`$count`](#SystemQueryOptioncount), -[`$search`](#SystemQueryOptionsearch), -[`$expand`](#SystemQueryOptionexpand)`,` -[`$compute`](#SystemQueryOptioncompute)`,` and -[`$levels`](#ExpandOptionlevels). +[`$count`](#SystemQueryOptioncount), and +[`$search`](#SystemQueryOptionsearch) + for collection-valued navigation properties. ::: example Example ##ex: for each customer entity within the `Customers` entity set, @@ -475,8 +492,8 @@ GET http://host/service.svc/Customers?$expand=SampleModel.VipCustomer/InHouseSta The `$levels` expand option can be used to specify the number of levels of recursion for a hierarchy in which the related entity type is the same as, or can be cast to, the source entity type. A `$levels` option -with a value of 1 specifies a single expand with no recursion. The same -expand options are applied at each level of the hierarchy. +with a value of 1 specifies a single expand with no recursion. All provided +expand options except `$levels` are applied at each level of the hierarchy. Services MAY support the symbolic value `max` in addition to numeric values. In that case they MUST solve circular dependencies by injecting @@ -552,7 +569,7 @@ GET http://host/service/Products?$filter=Price lt 10.00 ::: The [`$count`](#SystemQueryOptioncount) segment may be used within a -`$filter `expression to limit the items returned based on the exact +`$filter` expression to limit the items returned based on the exact count of related entities or items within a collection-valued property. ::: example @@ -630,7 +647,7 @@ a `null` literal that can be used in comparisons.
    - + @@ -669,7 +686,7 @@ a `null` literal that can be used in comparisons. Parameter aliases can be used in place of literal values in entity keys, [function parameters](#InvokingaFunction), or within a -[`$compute`](#SystemQueryOptioncompute)`,` +[`$compute`](#SystemQueryOptioncompute), [`$filter`](#SystemQueryOptionfilter) or [`$orderby`](#SystemQueryOptionorderby) expression. Parameters aliases are names beginning with an at sign (`@`). @@ -681,7 +698,7 @@ specified parameter alias. ::: example Example ##ex: returns all employees whose Region property matches the -string parameter value "WA" +string parameter value `WA` ``` GET http://host/service.svc/Employees?$filter=Region eq @p1&@p1='WA' ``` @@ -746,7 +763,7 @@ result value of the second expression, and so on. The Boolean value false comes before the value true in ascending order. Services SHOULD order language-dependent strings according to the -[content-language](#HeaderContentLanguage) of the response, and SHOULD +[`Content-Language`](#HeaderContentLanguage) of the response, and SHOULD annotate string properties with language-dependent order with the term [`Core.IsLanguageDependent`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#IsLanguageDependent), see [OData-VocCore](#ODataVocCore). @@ -848,7 +865,7 @@ GET http://host/service/Products?$count=true ::: The count of related entities can be requested by specifying -the` $count` query option within the `$expand` clause. +the `$count` query option within the `$expand` clause. ::: example Example ##ex: @@ -883,7 +900,7 @@ those items *matching* the specified search expression. The definition of what it means to match is dependent upon the implementation. ::: example -Example ##ex: return all Products that match the search term "bike" +Example ##ex: return all Products that match the search term `bike` ``` GET http://host/service/Products?$search=bike ``` @@ -892,7 +909,7 @@ GET http://host/service/Products?$search=bike The search expression can contain phrases, enclosed in double-quotes. ::: example -Example ##ex: return all Products that match the phrase "mountain bike" +Example ##ex: return all Products that match the phrase `mountain bike` ``` GET http://host/service/Products?$search="mountain bike" ``` @@ -902,7 +919,7 @@ The upper-case keyword `NOT` restricts the set of entities to those that do not match the specified term. ::: example -Example ##ex: return all Products that do not match "clothing" +Example ##ex: return all Products that do not match `clothing` ``` GET http://host/service/Products?$search=NOT clothing ``` @@ -913,8 +930,8 @@ Multiple terms within a search expression are separated by a space such terms must be matched. ::: example -Example ##ex: return all Products that match both "mountain" and -"bike" +Example ##ex: return all Products that match both `mountain` and +`bike` ``` GET http://host/service/Products?$search=mountain AND bike ``` @@ -924,8 +941,8 @@ The upper-case keyword `OR` is used to return entities that satisfy either the immediately preceding or subsequent expression. ::: example -Example ##ex: return all Products that match either "mountain" or -"bike" +Example ##ex: return all Products that match `mountain` or +`bike` ``` GET http://host/service/Products?$search=mountain OR bike ``` @@ -935,8 +952,8 @@ Parentheses within the search expression group together multiple expressions. ::: example -Example ##ex: return all Products that match either "mountain" or -"bike" and do not match clothing +Example ##ex: return all Products that match `mountain` or +`bike` and do not match clothing ``` GET http://host/service/Products?$search=(mountain OR bike) AND NOT clothing ``` @@ -1018,7 +1035,7 @@ entity is related, the service returns [`204 No Content`](#ResponseCode204NoContent). ::: example -Example ##ex: return the supplier of the product with `ID=1 `in the +Example ##ex: return the supplier of the product with `ID=1` in the Products entity set ``` GET http://host/service/Products(1)/Supplier @@ -1038,13 +1055,13 @@ If the resource path identifies a collection, the response MUST be the format-specific representation of a collection of entity references pointing to the related entities. If no entities are related, the response is the format-specific representation of an empty collection. -The response MAY contain an [ETag header](#HeaderETag) for the +The response MAY contain an [`ETag`](#HeaderETag) header for the collection whose value changes if the collection of references changes, i.e. a reference is added or removed. If the resource path identifies a single existing entity, the response MUST be the format-specific representation of an entity reference. The -response MAY contain an [ETag header](#HeaderETag) which represents the +response MAY contain an [`ETag`](#HeaderETag) header which represents the identity of the referenced entity. If the resource path terminates in a single-valued navigation path, the ETag value changes if the relationship is changed and points to a different OData entity. If the @@ -1127,7 +1144,7 @@ GET http://host/service/Products/$count ::: With 4.01 services the `/$count` segment MAY be used in combination with -the `/$filter path` segment to count the items in the filtered +the `/$filter` path segment to count the items in the filtered collection. ::: example @@ -1214,7 +1231,7 @@ using the JSON media type with minimal metadata, as defined in In [metadata document requests](#MetadataDocumentRequest), the values `application/xml` and `application/json`, along with their subtypes and parameterized variants, as well as the format-specific abbreviations -`xml` and `json,` are reserved for this specification. +`xml` and `json`, are reserved for this specification. ### ##subsubsec System Query Option `$schemaversion` @@ -1266,7 +1283,7 @@ body SHOULD provide additional information. Services advertise their change-tracking capabilities by annotating entity sets with the -[`Capabilities`.`ChangeTracking`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Capabilities.V1.md#ChangeTracking) +[`Capabilities.ChangeTracking`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Capabilities.V1.md#ChangeTracking) term defined in [OData-VocCap](#ODataVocCap). Any `GET` request to retrieve one or more entities MAY allow @@ -1275,7 +1292,7 @@ change-tracking. Clients request that the service track changes to a result by specifying the [`track-changes`](#Preferencetrackchangesodatatrackchanges) preference on a request. If supported for the request, the service includes a -[`Preference-Applied`](#HeaderPreferenceApplied)` `header in the +[`Preference-Applied`](#HeaderPreferenceApplied) header in the response containing the `track-changes` preference and includes a *delta link* in a result for a single entity, and on the last page of results for a collection of entities in place of the next link. @@ -1368,8 +1385,8 @@ appended to the path of a delta link in order to get just the number of changes available. The count includes all added, changed, or deleted entities, as well as added or deleted links. -The results of a request against the delta link may span multiple pages -but MUST be ordered by the service across all pages in such a way as to +The results of a request against the delta link may span one or more pages +and MUST be ordered by the service across all pages in such a way as to guarantee consistency when applied in order to the response which contained the delta link. diff --git a/odata-protocol/11.4 Data Modification.md b/odata-protocol/11.4 Data Modification.md index 76ec0c6c5..4e55d3564 100644 --- a/odata-protocol/11.4 Data Modification.md +++ b/odata-protocol/11.4 Data Modification.md @@ -9,7 +9,7 @@ must not violate the integrity of the data. The client may request whether content be returned from a Create, Update, or Delete request, or the invocation of an Action, by specifying -the [`return` Prefer header](#Preferencereturnrepresentationandreturnminimal). +the [`return`](#Preferencereturnrepresentationandreturnminimal) preference. ### ##subsubsec Common Data Modification Semantics @@ -34,18 +34,18 @@ A [Data Modification Request](#DataModification) on an existing resource or an [Action Request](#Actions) invoking an action bound to an existing resource MAY require optimistic concurrency control. Services SHOULD announce this via annotations with the terms -[`Core.OptimisticConcurrency`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptimisticConcurrency)` `in +[`Core.OptimisticConcurrency`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptimisticConcurrency) in [OData-VocCore](#ODataVocCore) and [`Capabilities.NavigationRestrictions`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Capabilities.V1.md#NavigationRestrictions) (nested property `OptimisticConcurrencyControl`) in [OData-VocCap](#ODataVocCap). If optimistic concurrency control is required for a resource, the -service MUST include an [ETag header](#HeaderETag) in a response to a +service MUST include an [`ETag`](#HeaderETag) header in a response to a `GET` request to the resource, and MAY include the ETag in a format-specific manner in responses containing that resource. -The presence of an [ETag header](#HeaderETag) in a response does not +The presence of an [`ETag`](#HeaderETag) header in a response does not imply in itself that the resource requires optimistic concurrency control; the ETag may just be used for caching and/or conditional `GET` requests. @@ -185,16 +185,15 @@ Properties with a defined default value, nullable properties, and collection-valued properties omitted from the request are set to the default value, null, or an empty collection, respectively. -Upon successful completion, the response MUST contain a [`Location` -header](#HeaderLocation) that contains the edit URL or read URL of the +Upon successful completion, the response MUST contain a +[`Location`](#HeaderLocation) header that contains the edit URL or read URL of the created entity. Upon successful completion the service MUST respond with either [`201 Created`](#ResponseCode201Created) and a representation of the created entity, or [`204 No Content`](#ResponseCode204NoContent) if the -request included a [Prefer -header](#Preferencereturnrepresentationandreturnminimal) with a value of -[`return=minimal`](#Preferencereturnrepresentationandreturnminimal) and did not +request included a +[`return=minimal`](#Preferencereturnrepresentationandreturnminimal) preference and did not include the system query options [`$select`](#SystemQueryOptionselect) and [`$expand`](#SystemQueryOptionexpand). @@ -208,14 +207,15 @@ The representation for referencing related entities is format-specific. ::: example Example ##ex: using the JSON format, 4.0 clients can create a new manager -entity with links to two existing employees by applying the `odata.bind` -annotation to the `DirectReports` navigation property +entity with links to an existing manager (of managers) and to two existing employees by applying the `odata.bind` +annotation to the `Manager` and `DirectReports` navigation properties ```json {   "@odata.type":"#Northwind.Manager",   "ID": 1,   "FirstName": "Pat",   "LastName": "Griswold", + "Manager@odata.bind": "http://host/service/Employees(0)",   "DirectReports@odata.bind": [     "http://host/service/Employees(5)",     "http://host/service/Employees(6)" @@ -226,14 +226,15 @@ annotation to the `DirectReports` navigation property ::: example Example ##ex: using the JSON format, 4.01 clients can create a new manager -entity with links to two existing employees by including the entity-ids -within the `DirectReports` navigation property +entity with links to an existing manager (of managers) and to two existing employees by including the entity-ids +within the `Manager` and `DirectReports` navigation properties ```json {   "@type":"#Northwind.Manager",   "ID": 1,   "FirstName": "Pat",   "LastName": "Griswold", + "Manager": { "@id": "Employees(0)" },   "DirectReports": [     {"@id": "Employees(5)"},     {"@id": "Employees(6)"} @@ -260,7 +261,7 @@ A request to create an entity that includes related entities, represented using the appropriate inline representation, is referred to as a "deep insert". -Media entities MUST contain the base64url-encoded representation of +Media entities MUST contain the format-specific representation of their media stream as a virtual property `$value` when nested within a deep insert. @@ -274,9 +275,9 @@ service responds with [`201 Created`](#ResponseCode201Created), the response MUS least the level that was present in the deep-insert request. Clients MAY associate an id with individual nested entities in the -request by using the +request by applying the [`Core.ContentID`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#ContentID) -term defined in [OData-VocCore](#ODataVocCore). Services that respond +term using the namespace or alias defined for the [OData-VocCore](#ODataVocCore) vocabulary in the service's `$metadata` document. Services that respond with [`201 Created`](#ResponseCode201Created) SHOULD annotate the entities in the response using the same [`Core.ContentID`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#ContentID) @@ -313,8 +314,10 @@ the content in the request payload with the entity's current state, applying the update only to those components specified in the request body. Collection properties and primitive properties provided in the payload corresponding to updatable properties MUST replace the value of -the corresponding property in the entity or complex type. Missing -properties of the containing entity or complex property, including +the corresponding property in the entity or complex type. +Complex properties are updated by applying `PATCH` semantics recursively, +see also [section ##UpdateaComplexProperty]. +Missing properties of the containing entity or complex property, including dynamic properties, MUST NOT be directly altered unless as a side effect of changes resulting from the provided properties. @@ -332,7 +335,7 @@ removed or set to `null`. For requests with an `OData-Version` header with a value of `4.01` or greater, the media stream of a media entity can be updated by specifying -the base64url-encoded representation of the media stream as a virtual +the format-specific representation of the media stream as a virtual property `$value`. Updating a dependent property that is tied to a key property of the @@ -340,7 +343,7 @@ principal entity through a referential constraint updates the relationship to point to the entity with the specified key value. If there is no such entity, the update fails. -Updating a principle property that is tied to a dependent entity through +Updating a principal property that is tied to a dependent entity through a referential constraint on the dependent entity updates the dependent property. @@ -390,8 +393,7 @@ Upon successful completion the service responds with either [`200 OK`](#ResponseCode200OK) and a representation of the updated entity, or [`204 No Content`](#ResponseCode204NoContent). The client may request that the response SHOULD include a body by specifying a -[`Prefer` header](#Preferencereturnrepresentationandreturnminimal) with a value of -[`return=representation`](#Preferencereturnrepresentationandreturnminimal), or by +[`return=representation`](#Preferencereturnrepresentationandreturnminimal) preference, or by specifying the system query options [`$select`](#SystemQueryOptionselect) or [`$expand`](#SystemQueryOptionexpand). If the service uses ETags for @@ -421,17 +423,17 @@ NOT include added links, deleted links, or deleted entities. Example ##ex: using the JSON format, a 4.01 `PATCH` request can update a manager entity. Following the update, the manager has three direct reports; two existing employees and one new employee named -`Suzanne Brown`. The `LastName` of employee `6` is updated to `Smith.` +`Suzanne Brown`. The `LastName` of employee 6 is updated to `Smith`. ```json {   "@type":"#Northwind.Manager",   "FirstName" : "Patricia",   "DirectReports": [     { -      "@id": "Employees(5}" +      "@id": "Employees(5)"     },     { -      "@id": "Employees(6}", +      "@id": "Employees(6)",       "LastName": "Smith"     },     { @@ -555,12 +557,12 @@ that are not tied to key properties of the principal entity, MUST be ignored by the service in processing the Upsert request. To ensure that an update request is not treated as an insert, the client -MAY specify an [`If-Match` header](#HeaderIfMatch) in the update +MAY specify an [`If-Match`](#HeaderIfMatch) header in the update request. The service MUST NOT treat an update request containing an `If-Match` header as an insert. A `PUT` or `PATCH` request MUST NOT be treated as an update if an -[`If-None-Match` header](#HeaderIfNoneMatch) is specified with a value +[`If-None-Match`](#HeaderIfNoneMatch) header is specified with a value of `*`. ### ##subsubsec Delete an Entity @@ -569,8 +571,8 @@ To delete an individual entity, the client makes a `DELETE` request to a URL that identifies the entity. Services MAY restrict deletes only to requests addressing the [edit URL](#ReadURLsandEditURLs) of the entity. -The request body SHOULD be empty. Singleton entities can be deleted if -they are nullable. Services supporting this SHOULD advertise it by +The request body SHOULD be empty. Top-level singleton entities can be deleted if +they are nullable. Services supporting this MAY advertise it by annotating the singleton with the term `Capabilities.DeleteRestrictions` (nested property `Deletable` with value `true`) defined in [OData-VocCap](#ODataVocCap). @@ -685,15 +687,14 @@ OData format supported by the service. It is not possible to set the structural properties of the media entity when creating the media entity. -Upon successful completion, the response MUST contain [`Location` -header](#HeaderLocation) that contains the edit URL of the created media +Upon successful completion, the response MUST contain +[`Location`](#HeaderLocation) header that contains the edit URL of the created media entity. Upon successful completion the service responds with either [`201 Created`](#ResponseCode201Created), or -[`204 No Content`](#ResponseCode204NoContent)if the request included a -[Prefer header](#Preferencereturnrepresentationandreturnminimal) with a value of -[`return=minimal`](#Preferencereturnrepresentationandreturnminimal). +[`204 No Content`](#ResponseCode204NoContent) if the request included a +[`return=minimal`](#Preferencereturnrepresentationandreturnminimal) preference. #### ##subsubsubsec Update a Media Entity Stream @@ -730,6 +731,43 @@ are properties of type `Edm.Stream`. The values for stream properties do not usually appear in the entity payload. Instead, the values are generally read or written through URLs. +::: example +Example ##ex_entityWithStreamProperty: read an entity and select a stream property +``` +GET http://host/service/Products(1)?$select=Thumbnail +``` +would only include control information for the stream property, not the stream data itself +```json +{ + "@context": "http://host/service/$metadata#Products/$entity", + ... + "Thumbnail@mediaReadLink": "http://server/Thumbnail546.jpg", + "Thumbnail@mediaEditLink": "http://server/uploads/Thumbnail546.jpg", + ... +} +``` +The stream data can then be requested using the media read link: +``` +GET http://server/Thumbnail546.jpg +``` +::: + +Services SHOULD support direct property access to a stream property's canonical URL. +The response MAY be a redirect to the media read link of the stream property +if the media read link is different from the canonical URL. + +::: example +Example ##ex: directly read a stream property of an entity +``` +GET http://host/service/Products(1)/Thumbnail +``` +can return [`200 OK`](#ResponseCode200OK) and the stream data (see [section ##RequestingStreamProperties]), +or a [`3xx Redirect`](#ResponseCode3xxRedirection) to the media read link of the stream property. +::: + +Note: for scenarios in which the media value can only be inlined, +the property should instead be modeled with type `Edm.Binary`. + #### ##subsubsubsec Update Stream Values A successful `PUT` request to the edit URL of a stream property changes @@ -767,6 +805,13 @@ A successful `DELETE` request to the edit URL of a stream property attempts to set the property to null and results in an error if the property is non-nullable. +::: example +Example ##ex: delete the stream value using the media edit link retrieved in [example ##entityWithStreamProperty] +``` +DELETE http://server/uploads/Thumbnail546.jpg +``` +::: + Attempting to request a stream property whose value is null results in [`204 No Content`](#ResponseCode204NoContent). @@ -796,9 +841,8 @@ property. Upon successful completion the service responds with either [`200 OK`](#ResponseCode200OK) or [`204 No Content`](#ResponseCode204NoContent). The client may request -that the response SHOULD include a body by specifying a [Prefer -header](#Preferencereturnrepresentationandreturnminimal) with a value of -[`return=representation`](#Preferencereturnrepresentationandreturnminimal). +that the response SHOULD include a body by specifying a +[`return=representation`](#Preferencereturnrepresentationandreturnminimal) preference. Services MUST return an error if the property is not updatable. @@ -831,11 +875,16 @@ property to null. A successful `PATCH` request to the edit URL for a complex typed property updates that property. The request body MUST contain a single -valid representation for the target complex type. +valid representation for the declared type of the complex property or one of its derived types. The service MUST directly modify only those properties of the complex type specified in the payload of the `PATCH` request. +If a complex-typed property is set to a different type in a `PATCH` request, +properties shared through inheritance, as well as dynamic properties, +are retained (unless overwritten by new values in the payload). +Other properties of the original type are discarded. + The service MAY additionally support clients sending a `PUT` request to a URL that specifies a complex type. In this case, the service MUST replace the entire complex property with the values specified in the @@ -844,9 +893,8 @@ request body and set all unspecified properties to their default value. Upon successful completion the service responds with either [`200 OK`](#ResponseCode200OK) or [`204 No Content`](#ResponseCode204NoContent). The client may request -that the response SHOULD include a body by specifying a [Prefer -header](#Preferencereturnrepresentationandreturnminimal) with a value of -[`return=representation`](#Preferencereturnrepresentationandreturnminimal). +that the response SHOULD include a body by specifying a +[`return=representation`](#Preferencereturnrepresentationandreturnminimal) preference. Services MUST return an error if the property is not updatable. @@ -863,10 +911,9 @@ request body. A successful `POST` request to the edit URL of a collection property adds an item to the collection. The body of the request MUST be a single item to be added to the collection. If the collection is ordered, the -item is added to the end of the collection, and +item is added to the end of the collection, and if the collection supports positional insert [`$index`](#RequestinganIndividualMemberofanOrderedCollection) MAY be used to specify -a zero-based ordinal position to insert the new value, with a negative -value indicating an ordinal position from the end of the collection. +the insert position. A successful `DELETE` request to the edit URL of a collection property deletes all items in that collection. @@ -875,11 +922,10 @@ Since collection members have no individual identity, `PATCH` is not supported for collection properties. Upon successful completion the service responds with either -[`200 OK`](#ResponseCode200OK) or +[`200 OK`](#ResponseCode200OK) and a representation of the updated collection, or [`204 No Content`](#ResponseCode204NoContent). The client may request -that the response SHOULD include a body by specifying a [Prefer -header](#Preferencereturnrepresentationandreturnminimal) with a value of -[`return=representation`](#Preferencereturnrepresentationandreturnminimal). +that the response SHOULD include a body by specifying a +[`return=representation`](#Preferencereturnrepresentationandreturnminimal) preference. Services MUST return an error if the property is not updatable. diff --git a/odata-protocol/11.5 Operations.md b/odata-protocol/11.5 Operations.md index e00bc941d..8b07226b6 100644 --- a/odata-protocol/11.5 Operations.md +++ b/odata-protocol/11.5 Operations.md @@ -130,7 +130,7 @@ particular instance by setting its value to null. ::: example Example ##ex: the `SampleEntities.MostRecentOrder` function is not -available for customer 'ALFKI' +available for customer `ALFKI` ```json {   "@context": ..., @@ -169,7 +169,7 @@ ampersand (`&`) or a question mark (`?`). Services MAY additionally support invoking functions using the unqualified function name by defining one or more [default namespaces](#DefaultNamespaces) through the -[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace)` `term +[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace) term defined in  [OData-VocCore](#ODataVocCore). Functions can be used within [`$filter`](#SystemQueryOptionfilter) or @@ -208,6 +208,10 @@ POST http://host/service/MyShoppingCart()/Items ``` ::: +If the function returns a value of type `Edm.Stream` and no additional path +segments follow the function invocation, the response to the `GET` request +follows the rules for [requesting stream properties](#RequestingStreamProperties). + Parameter values passed to functions MUST be specified either as a URL literal (for primitive values) or as a JSON formatted OData object (for complex values, or collections of primitive or complex values). Entity @@ -253,8 +257,8 @@ GET http://host/service/EmployeesByManager(ManagerID=3) ::: ::: example -Example ##ex: return all `Customers` whose City property returns -"Western" when passed to the `Sales.SalesRegion` function +Example ##ex: return all Customers whose `City` property returns +`Western` when passed to the `Sales.SalesRegion` function ``` GET http://host/service/Customers?       $filter=Sales.SalesRegion(City=$it/City) eq 'Western' @@ -295,7 +299,7 @@ GET http://host/service/EmployeesByManager?ManagerID=3 ::: Non-binding parameters annotated with the term -[`Core.OptionalParameter`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptionalParameter)` `defined +[`Core.OptionalParameter`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptionalParameter) defined in [OData-VocCore](#ODataVocCore) MAY be omitted. If it is annotated and the annotation specifies a `DefaultValue`, the omitted parameter is interpreted as having that default value. If omitted and the annotation @@ -345,7 +349,7 @@ request was ambiguous. ### ##subsubsec Actions Actions are operations exposed by an OData service that MAY have side -effects when invoked. Actions MAY return data but` `MUST NOT be further +effects when invoked. Actions MAY return data but MUST NOT be further composed with additional path segments. #### ##subsubsubsec Invoking an Action @@ -364,7 +368,7 @@ according to the particular format. Services MAY additionally support invoking actions using the unqualified action name by defining one or more [default namespaces](#DefaultNamespaces) through the -[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace)` `term +[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace) term defined in  [OData-VocCore](#ODataVocCore). To invoke an action through an action import, the client issues a `POST` @@ -375,7 +379,7 @@ values MUST be passed in the request body according to the particular format. Non-binding parameters that are nullable or annotated with the term -[`Core.OptionalParameter`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptionalParameter)` `defined +[`Core.OptionalParameter`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptionalParameter) defined in [OData-VocCore](#ODataVocCore) MAY be omitted from the request body. If an omitted parameter is not annotated (and thus nullable), it MUST be interpreted as having the `null` value. If it is annotated and the @@ -398,13 +402,16 @@ negotiation to request the results in the desired format, otherwise the default content type will be used. The client can request whether any results from the action be returned -using the [`return Prefer` header](#Preferencereturnrepresentationandreturnminimal). +using the [`return`](#Preferencereturnrepresentationandreturnminimal) preference. Actions that create and return a single entity follow the rules for -[entity creation](#CreateanEntity) and return a [`Location` -header](#HeaderLocation) that contains the edit URL or read URL of the +[entity creation](#CreateanEntity) and return a +[`Location`](#HeaderLocation) header that contains the edit URL or read URL of the created entity. +If the action returns a value of type `Edm.Stream`, the response to the `POST` request +follows the rules for [requesting stream properties](#RequestingStreamProperties). + Actions without a return type respond with [`204 No Content`](#ResponseCode204NoContent) on success. @@ -412,18 +419,18 @@ To request processing of the action only if the binding parameter value, an entity or collection of entities, is unmodified, the client includes the [`If-Match`](#HeaderIfMatch) header with the latest known ETag value for the entity or collection of entities. The ETag value for a -collection as a whole is transported in the `ETag` header of a +collection as a whole is transported in the [`ETag`](#HeaderETag) header of a collection response. ::: example Example ##ex: invoke the `SampleEntities.CreateOrder` action using -`/Customers('ALFKI') `as the customer (or binding parameter). The values +`Customers('ALFKI')` as the customer (or binding parameter). The values `2` for the `quantity` parameter and `BLACKFRIDAY` for the `discountCode` parameter are passed in the body of the request. Invoke the action only if the customer's ETag still matches. ```json POST http://host/service/Customers('ALFKI')/SampleEntities.CreateOrder -If-Match: W/"MjAxOS0wMy0yMVQxMzowNVo="` +If-Match: W/"MjAxOS0wMy0yMVQxMzowNVo=" Content-Type: application/json { @@ -450,7 +457,7 @@ see [OData-URL](#ODataURL). ## ##subsec Asynchronous Requests -A [Prefer](#HeaderPrefer) header with a +A [`Prefer`](#HeaderPrefer) header with a [`respond-async`](#Preferencerespondasync) preference allows clients to request that the service process a [Data Service Request](#DataServiceRequests) asynchronously. @@ -462,18 +469,18 @@ NOT reply to a [Data Service Request](#DataServiceRequests) with `202 Accepted` if the request has not included the `respond-async` preference. -Responses that return `202 Accepted` MUST include a [`Location` -header](#HeaderLocation) pointing to a *status monitor resource* that +Responses that return `202 Accepted` MUST include a +[`Location`](#HeaderLocation) header pointing to a *status monitor resource* that represents the current state of the asynchronous processing in addition -to an optional [`Retry-After` header](#HeaderRetryAfter) indicating the +to an optional [`Retry-After`](#HeaderRetryAfter) header indicating the time, in seconds, the client should wait before querying the service for status. Services MAY include a response body, for example, to provide additional status information. A `GET` request to the status monitor resource again returns `202 Accepted` response if the asynchronous processing has not finished. -This response MUST again include a [`Location` header](#HeaderLocation) -and MAY include a [`Retry-After` header](#HeaderRetryAfter) to be used for a subsequent request. The +This response MUST again include a [`Location`](#HeaderLocation) header +and MAY include a [`Retry-After`](#HeaderRetryAfter) header to be used for a subsequent request. The `Location` header and optional `Retry-After` header may or may not contain the same values as returned by the previous request. @@ -496,7 +503,7 @@ asynchronous processing be canceled. A `200 OK` or a been successfully canceled. A client can request that the `DELETE` should be executed asynchronously. A `202 Accepted` response indicates that the cancellation is being processed asynchronously; the client can -use the returned [`Location` header](#HeaderLocation) (which MUST be +use the returned [`Location`](#HeaderLocation) header (which MUST be different from the status monitor resource of the initial request) to query for the status of the cancellation. If a delete request is not supported by the service, the service returns diff --git a/odata-protocol/11.7 Batch Requests.md b/odata-protocol/11.7 Batch Requests.md index 6ceb42e4b..44e0d670b 100644 --- a/odata-protocol/11.7 Batch Requests.md +++ b/odata-protocol/11.7 Batch Requests.md @@ -30,7 +30,7 @@ format](#MultipartBatchFormat) MUST contain a ::: example Example ##ex: multipart batch request ``` -POST /service/$batch HTTP/1.1` +POST /service/$batch HTTP/1.1 Host: odata.org OData-Version: 4.0 Content-Type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77b @@ -110,7 +110,7 @@ clients MUST be able to resolve it relative to the request's URL even if that contains such a reference. If the `$`-prefixed request identifier is identical to the name of a -top-level system resource (`$batch`, `$crossjoin,` `$all,` `$entity`, +top-level system resource (`$batch`, `$crossjoin`, `$all`, `$entity`, `$root`, `$id`, `$metadata`, or other system resources defined according to the [`OData-Version`](#HeaderODataVersion) of the protocol specified in the request), then the reference to the top-level system resource is @@ -197,7 +197,7 @@ set can use one of the following three formats: ::: example Example ##ex: ``` -GET https://host:1234/path/service/People(1) HTTP/1.1  +GET https://host:1234/path/service/People(1) HTTP/1.1 ``` ::: @@ -230,8 +230,8 @@ need not be percent-encoded. Each body part that represents a single request MUST NOT include: -- `authentication` or `authorization` related HTTP headers -- `Expect`, `From`, `Max-Forwards`, `Range`, or `TE` headers +- `authentication` or `authorization` related HTTP headers +- `Expect`, `From`, `Max-Forwards`, `Range`, or `TE` headers Processors of batch requests MAY choose to disallow additional HTTP constructs in HTTP requests serialized within body parts. For example, a @@ -422,7 +422,7 @@ response so clients can correlate requests and responses. #### ##subsubsubsec Multipart Batch Response A multipart response to a batch request MUST contain a `Content-Type` -header with value `multipart/mixed.` +header with value `multipart/mixed`. The body of a multipart response to a multipart batch request MUST structurally match one-to-one with the multipart batch request body, diff --git a/odata-protocol/12 Conformance.md b/odata-protocol/12 Conformance.md index df016cd9e..f7f0cdca9 100644 --- a/odata-protocol/12 Conformance.md +++ b/odata-protocol/12 Conformance.md @@ -180,13 +180,13 @@ collection-valued properties (section 5.1.1.10 in [OData-URL](#ODataURL)) 6. MUST support the `$skip` system query option ([section ##SystemQueryOptionskip]) 7. MUST support the `$count` system query option ([section ##SystemQueryOptioncount]) -8. MUST support `$orderby` `asc` and `desc` on individual properties +8. MUST support `$orderby` with `asc` and `desc` on individual properties ([section ##SystemQueryOptionorderby]) 9. MUST support `$expand` ([section ##SystemQueryOptionexpand]) 1. MUST support returning references for expanded properties 2. MUST support `$filter` on expanded collection-valued properties 3. MUST support cast segment in expand with derived types - 4. SHOULD support `$orderby` `asc` and `desc` on expanded + 4. SHOULD support `$orderby` with `asc` and `desc` on expanded collection-valued properties 5. SHOULD support `$count` on expanded collection-valued properties 6. SHOULD support `$top` and `$skip` on expanded collection-valued @@ -315,7 +315,7 @@ Level](#OData401MinimalConformanceLevel) Level](#OData40IntermediateConformanceLevel) 3. MUST support `eq/ne null` comparison for navigation properties with a maximum cardinality of one -4. MUST support the [`in`](#BuiltinFilterOperations)` `operator +4. MUST support the [`in`](#BuiltinFilterOperations) operator 5. MUST support the `$select` option nested within `$select` 6. SHOULD support the count of a filtered collection in a common expression @@ -340,7 +340,7 @@ expression 4. MUST support `$compute` system query option 5. MUST support nested options in `$select` 1. MUST support `$filter` on selected collection-valued properties - 2. SHOULD support `$orderby` `asc` and `desc` on selected + 2. SHOULD support `$orderby` with `asc` and `desc` on selected collection-valued properties 3. SHOULD support the `$count` on selected collection-valued properties @@ -394,7 +394,7 @@ in a delta response ([section ##RequestingChanges]) 13. MAY support asynchronous responses ([section ##AsynchronousRequests]) 14. MAY support `metadata=minimal` in a JSON response (see [OData-JSON](#ODataJSON)) -15. MAY support `streaming `in a JSON response (see +15. MAY support `streaming` in a JSON response (see [OData-JSON](#ODataJSON)) In addition, interoperable OData 4.01 clients diff --git a/odata-protocol/8 Header Fields.md b/odata-protocol/8 Header Fields.md index 76d79daa8..ea5b84cf4 100644 --- a/odata-protocol/8 Header Fields.md +++ b/odata-protocol/8 Header Fields.md @@ -23,7 +23,7 @@ or [stream property](#ManagingStreamProperties), in which case the The specified format MAY include format parameters. Clients MUST be prepared for the service to return custom format parameters not defined in OData and SHOULD NOT expect that such format parameters can be -ignored. Custom format parameters MUST NOT start with "odata" and +ignored. Custom format parameters MUST NOT start with `odata` and services MUST NOT require generic OData consumers to understand custom format parameters in order to correctly interpret the payload. @@ -34,7 +34,7 @@ parameters within the `Content-Type` header. As defined in [RFC7231](#rfc7231), the `Content-Encoding` header field is used as a modifier to the media-type (as indicated in the -`Content-Type`). When present, its value indicates what additional +`Content-Type` header). When present, its value indicates what additional content codings have been applied to the entity-body. A service MAY specify a list of acceptable content codings using an annotation with term @@ -130,7 +130,7 @@ If the media type specified in the `Accept` header does not include a contain a `charset` format parameter. The service SHOULD NOT add any format parameters to the `Content-Type` -parameter not specified in the `Accept` header. +header not specified in the `Accept` header. If the `Accept` header is specified on an individual request within a batch, then it specifies the acceptable formats for that individual @@ -167,7 +167,7 @@ As defined in [RFC7232](#rfc7232), a client MAY include an value previously retrieved for the resource, or `*` to match any value. If an operation on an existing resource requires an ETag, (see term -[`Core.OptimisticConcurrency`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptimisticConcurrency)` `in +[`Core.OptimisticConcurrency`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#OptimisticConcurrency) in [OData-VocCore](#ODataVocCore) and property `OptimisticConcurrencyControl` of type [`Capabilities.NavigationPropertyRestriction`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Capabilities.V1.md#NavigationPropertyRestriction) @@ -180,7 +180,7 @@ occurs as a result of the request. If present, the request MUST only be processed if the specified ETag value matches the current ETag value of the target resource. Services -sending [`ETag` headers](#HeaderETag) with weak ETags that only depend +sending [`ETag`](#HeaderETag) headers with weak ETags that only depend on the representation-independent entity state MUST use the weak comparison function because it is sufficient to prevent accidental overwrites. This is a deviation from [RFC7232](#rfc7232). @@ -377,14 +377,14 @@ If the service applies the `callback` preference it MUST include the When the `callback` preference is applied to asynchronous requests, the OData service invokes the callback endpoint once it has finished processing the request. The status monitor resource, returned in the -[`Location` header](#HeaderLocation) of the previously returned +[`Location`](#HeaderLocation) header of the previously returned [`202 Accepted`](#ResponseCode202Accepted) response, can then be used to retrieve the results of the asynchronously executed request. When the `callback` preference is specified on a `GET` request to a delta link and there are no changes available, the OData service returns -a [`202 Accepted`](#ResponseCode202Accepted) response with a [`Location` -header](#HeaderLocation) specifying the delta link to be used to check +a [`202 Accepted`](#ResponseCode202Accepted) response with a +[`Location`](#HeaderLocation) header specifying the delta link to be used to check for future updates. The OData service then invokes the specified callback endpoint once new changes become available. @@ -491,7 +491,7 @@ Prefer: include-annotations="-*" ::: example Example ##ex: a `Prefer` header requesting that all annotations defined -under the "display" namespace (recursively) be returned +under the `display` namespace (recursively) be returned ``` Prefer: include-annotations="display.*" ``` @@ -507,8 +507,8 @@ Prefer: include-annotations="display.subject" ::: example Example ##ex: a `Prefer` header requesting that all annotations defined -under the "display" namespace (recursively) with the qualifier -"tablet" be returned +under the `display` namespace (recursively) with the qualifier +`tablet` be returned ``` Prefer: include-annotations="display.*#tablet" ``` @@ -533,9 +533,9 @@ individual request. Individual requests within a batch that don't include the `include-annotations` preference inherit the preference of the overall batch request. -Note: The `include-annotations `preference was named +Note: The `include-annotations` preference was named `odata.include-annotations` in OData version 4.0. Services that support -the` include-annotations `preference SHOULD also support +the `include-annotations` preference SHOULD also support `odata.include-annotations` for OData 4.0 clients and clients SHOULD use `odata.include-annotations` for compatibility with OData 4.0 services. If both `include-annotations` and `odata.include-annotations` @@ -642,8 +642,8 @@ A preference of `return=minimal` requests that the service invoke the request but does not return content in the response. The service MAY apply this preference by returning [`204 No Content`](#ResponseCode204NoContent) in which case it MAY -include a [`Preference-Applied`](#HeaderPreferenceApplied)` `response -header containing the `return=minimal `preference. +include a [`Preference-Applied`](#HeaderPreferenceApplied) response +header containing the `return=minimal` preference. A preference of `return=representation` requests that the service invokes the request and returns the modified resource. The service MAY @@ -659,7 +659,7 @@ MAY be applied to individual requests within a batch. #### ##subsubsubsec Preference `respond-async` -The `respond-async `preference, as defined in [RFC7240](#rfc7240), +The `respond-async` preference, as defined in [RFC7240](#rfc7240), allows clients to request that the service process the request asynchronously. @@ -673,7 +673,7 @@ requests within the batch request. In the case that the service applies the `respond-async` preference it MUST include a -[`Preference-Applied`](#HeaderPreferenceApplied)` `response header +[`Preference-Applied`](#HeaderPreferenceApplied) response header containing the `respond-async` preference. A service MAY specify the support for the `respond-async` preference @@ -861,8 +861,8 @@ and in [`3xx Redirect`](#ResponseCode3xxRedirection) responses The `Retry-After` header specifies the duration of time, in seconds, that the client is asked to wait before retrying the request or issuing -a request to the resource returned as the value of the [`Location` -header](#HeaderLocation). +a request to the resource returned as the value of the +[`Location`](#HeaderLocation) header. ### ##subsubsec Header `Vary` @@ -875,7 +875,7 @@ allow correct caching of the response. If a response varies depending on the applied preferences ([`allow-entityreferences`](#Preferenceallowentityreferencesodataallowentityreferences), [`include-annotations`](#Preferenceincludeannotationsodataincludeannotations), -[`omit-values`](#Preferenceomitvalues)`, `[`return`](#Preferencereturnrepresentationandreturnminimal)), +[`omit-values`](#Preferenceomitvalues), [`return`](#Preferencereturnrepresentationandreturnminimal)), the service MUST include a `Vary` header listing the [`Prefer`](#HeaderPrefer) request header field to allow correct caching of the response. @@ -926,13 +926,13 @@ Requests](#AsynchronousBatchRequests). ### ##subsubsec Response Code `204 No Content` A request returns `204 No Content` if the requested resource has the -`null` value, or if the service applies a [`return=minimal` -preference](#Preferencereturnrepresentationandreturnminimal). +`null` value, or if the service applies a +[`return=minimal`](#Preferencereturnrepresentationandreturnminimal) preference. In this case, the response body MUST be empty. As defined in [RFC7231](#rfc7231), a [Data Modification Request](#DataModification) that responds with -`204 No Content MAY `include an `ETag` header with a value reflecting +`204 No Content` MAY include an `ETag` header with a value reflecting the result of the data modification if and only if the client can reasonably "know" the new representation of the resource without actually receiving it. For a `PUT` request this means that the response @@ -950,10 +950,10 @@ server-side values corresponding to the `ETag` value sent in the As per [RFC7231](#rfc7231), a `3xx Redirection` indicates that further action needs to be taken by the client in order to fulfill the -request. In this case, the response SHOULD include a [`Location` -header](#HeaderLocation), as appropriate, with the URL from which the -result can be obtained; it MAY include a [`Retry-After` -header](#HeaderRetryAfter). +request. In this case, the response SHOULD include a +[`Location`](#HeaderLocation) header, as appropriate, with the URL from which the +result can be obtained; it MAY include a +[`Retry-After`](#HeaderRetryAfter) header. ### ##subsubsec Response Code `304 Not Modified` @@ -982,7 +982,7 @@ of the error is as defined for the appropriate [format](#Formats). ### ##subsubsec Response Code `404 Not Found` -`404 Not Found `indicates that the resource specified by the request URL +`404 Not Found` indicates that the resource specified by the request URL does not exist. The response body MAY provide additional information. ### ##subsubsec Response Code `405 Method Not Allowed` @@ -1037,7 +1037,9 @@ include a response body describing the functionality not implemented. ## ##subsec Error Response Body -The representation of an error response body is format-specific. It +An error response body can be the result of a failure of OData processing or of the underlying infrastructure. +An OData-specific error response (which can be recognized by the presence +of the [`OData-Version`](#HeaderODataVersion) header) is format-specific and consists at least of the following information: - `code`: required non-null, non-empty, language-independent string. Its value is a service-defined error code. @@ -1065,7 +1067,7 @@ concerns around information disclosure. In the case that the service encounters an error after sending a success status to the client, the service MUST leave the response malformed -according to its [content-type](#HeaderContentType). Clients MUST treat +according to its [`Content-Type`](#HeaderContentType). Clients MUST treat the entire response as being in error. Services MAY include the header [`OData-Error`](#HeaderODataError) as a diff --git a/odata-protocol/Appendix.md b/odata-protocol/Appendix.md index bc49beaef..caa5ac333 100644 --- a/odata-protocol/Appendix.md +++ b/odata-protocol/Appendix.md @@ -43,50 +43,47 @@ _OData Vocabularies Version 4.0: Core Vocabulary._ See link in "[Related work](#RelatedWork)" section on cover page. ###### [RFC2046] -_Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types", RFC 2046, November 1996_ -https://tools.ietf.org/html/rfc2046. +_Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types", RFC 2046, DOI 10.17487/RFC2046, November 1996_. +https://www.rfc-editor.org/info/rfc2046. ###### [RFC2119] +_Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997_. https://www.rfc-editor.org/info/rfc2119. ###### [RFC3987] -_Duerst, M. and, M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC 3987, January 2005_ -https://tools.ietf.org/html/rfc3987. +_Duerst, M. and M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC 3987, DOI 10.17487/RFC3987, January 2005_. +https://www.rfc-editor.org/info/rfc3987. ###### [RFC5646] -_Phillips, A., Ed., and M. Davis, Ed., "Tags for Identifying Languages", BCP 47, RFC 5646, September 2009_ -http://tools.ietf.org/html/rfc5646. +_Phillips, A., Ed., and M. Davis, Ed., "Tags for Identifying Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646, September 2009_. +https://www.rfc-editor.org/info/rfc5646. ###### [RFC5789] -_Dusseault, L., and J. Snell, "Patch Method for HTTP", RFC 5789, March 2010_ -http://tools.ietf.org/html/rfc5789. - -###### [RFC7493] -_Bray, T., Ed., "The I-JSON Message Format", RFC7493, March 2015_ -https://tools.ietf.org/html/rfc7493. +_Dusseault, L. and J. Snell, "PATCH Method for HTTP", RFC 5789, DOI 10.17487/RFC5789, March 2010_. +https://www.rfc-editor.org/info/rfc5789. ###### [RFC7230] -_Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, June 2014_ -https://tools.ietf.org/html/rfc7230. +_Fielding, R., Ed., and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, DOI 10.17487/RFC7230, June 2014_. +https://www.rfc-editor.org/info/rfc7230. ###### [RFC7231] -_Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", RFC 7231, June 2014_ -https://tools.ietf.org/html/rfc7231. +_Fielding, R., Ed., and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", RFC 7231, DOI 10.17487/RFC7231, June 2014_. +https://www.rfc-editor.org/info/rfc7231. ###### [RFC7232] -_Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests", RFC 7232, June 2014_ -https://tools.ietf.org/html/rfc7232. +_Fielding, R., Ed., and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests", RFC 7232, DOI 10.17487/RFC7232, June 2014_. +https://www.rfc-editor.org/info/rfc7232. ###### [RFC7240] -_Snell, J., "Prefer Header for HTTP", RFC 7240, June 2014_ -https://tools.ietf.org/html/rfc7240. +_Snell, J., "Prefer Header for HTTP", RFC 7240, DOI 10.17487/RFC7240, June 2014_. +https://www.rfc-editor.org/info/rfc7240. ###### [RFC7617] -_Reschke, J., "The 'Basic' HTTP Authentication Scheme", RFC 7617, September 2015_ -https://tools.ietf.org/html/rfc7617. +_Reschke, J., "The 'Basic' HTTP Authentication Scheme", RFC 7617, DOI 10.17487/RFC7617, September 2015_. +https://www.rfc-editor.org/info/rfc7617. ###### [RFC8174] -_Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_ +_Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_. https://www.rfc-editor.org/info/rfc8174. ## ##subasec Informative References diff --git a/odata-temporal-ext/0 frontmatter.md b/odata-temporal-ext/0 frontmatter.md index 8bbbb4e98..e705ac656 100644 --- a/odata-temporal-ext/0 frontmatter.md +++ b/odata-temporal-ext/0 frontmatter.md @@ -69,7 +69,7 @@ $$$description$$$ #### Status: This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical. -TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "[Send A Comment](https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=odata)" button on the TC's web page at https://www.oasis-open.org/committees/odata/. +TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/. This specification is provided under the [RF on RAND Terms Mode](https://www.oasis-open.org/policies-guidelines/ipr/#RF-on-RAND-Mode) of the [OASIS IPR Policy](https://www.oasis-open.org/policies-guidelines/ipr/), the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php). diff --git a/odata-temporal-ext/1 Introduction.md b/odata-temporal-ext/1 Introduction.md index 552b60489..0e552ef61 100644 --- a/odata-temporal-ext/1 Introduction.md +++ b/odata-temporal-ext/1 Introduction.md @@ -147,7 +147,7 @@ All other text is normative unless otherwise labeled. Here is a customized command line which will generate HTML from this markdown file (named `$$$filename$$$.md`). Line breaks are added for readability only: ``` -pandoc -f gfm+tex_math_dollars+fenced_divs +pandoc -f gfm+tex_math_dollars+fenced_divs+smart -t html -o $$$filename$$$.html -c styles/markdown-styles-v1.7.3b.css diff --git a/odata-temporal-ext/2 Overview.md b/odata-temporal-ext/2 Overview.md index 3a4853bde..160f42f93 100644 --- a/odata-temporal-ext/2 Overview.md +++ b/odata-temporal-ext/2 Overview.md @@ -58,7 +58,7 @@ Example ##ex_api1: model for `api-1` with snapshot entity sets (hidden application time), key properties marked with {id} ::: -
    Employee
    Employee
    ID: Edm.String {id}
    ID: Edm.String {id}
    Name: Edm.String
    Name: Edm.String
    Jobtitle: Edm.String
    Jobtitle: Edm.String
    Department
    Department
    ID: Edm.String {id}
    ID: Edm.String {id}
    Name: Edm.String
    Name: Edm.String
    \*
    Employees
    \*...
    1
    Department
    1...
    Text is not SVG - cannot display
    +$$$include diagrams/api-1.drawio.svg$$$ and @@ -67,7 +67,7 @@ Example ##ex_api2: model for `api-2` with timeline entity sets (visible application time), key properties marked with {id} ::: -
    Employee_history
    Employee_history
    From: Edm.Date {id}
    From: Edm.Date {id}
    To: Edm.Date
    To: Edm.Date
    Name: Edm.String
    Name: Edm.String
    Jobtitle: Edm.String
    Jobtitle: Edm.String
    Department_history
    Department_history
    From: Edm.Date {id}
    From: Edm.Date {id}
    To: Edm.Date
    To: Edm.Date
    Name: Edm.String
    Name: Edm.String
    Budget: Edm.Decimal
    Budget: Edm.Decimal
    Employee
    Employee
    ID: Edm.String {id}
    ID: Edm.String {id}
    Department
    Department
    ID: Edm.String {id}
    ID: Edm.String {id}
    \*
    Employees
    \*...
    \*
    history
    \*...
    \*
    history
    \*...
    1
    Department
    1...
    Text is not SVG - cannot display
    +$$$include diagrams/api-2.drawio.svg$$$ ## ##subsec Example Data @@ -79,7 +79,7 @@ Example ##ex: simple storage model: object key in dark green, temporal sub-key in light green, foreign keys in orange, non-key fields in blue ::: -
    Employee
    Employee
    ID: String {id}
    ID: String {id}
    From: Date {id}
    From: Date {id}
    To: Date
    To: Date
    Name: String
    Name: String
    Jobtitle: String
    Jobtitle: String
    Department.ID
    Department.ID
    Department
    Department
    ID: String {id}
    ID: String {id}
    From: Date {id}
    From: Date {id}
    To: Date
    To: Date
    Name: String
    Name: String
    Budget: Decimal
    Budget: Decimal
    1
    1
    Text is not SVG - cannot display
    +$$$include diagrams/db.drawio.svg$$$ The period start date is used as the temporal sub-key for identifying time slices together with the key of the temporal object. diff --git a/odata-temporal-ext/3 Vocabulary.md b/odata-temporal-ext/3 Vocabulary.md index 2d1ae80eb..a5981fc64 100644 --- a/odata-temporal-ext/3 Vocabulary.md +++ b/odata-temporal-ext/3 Vocabulary.md @@ -32,9 +32,9 @@ structured type with the following properties: - If the period end property does not specify a default value, a default value of "ad infinitum" is assumed. - Records of type `TimelineVisible` MAY specify the property `ObjectKey`. - - `ObjectKey` is the “sub-key” or “alternate key” that identifies time slices for a single temporal object. + - `ObjectKey` is the "sub-key" or "alternate key" that identifies time slices for a single temporal object. It is only necessary if the annotated entity set can contain time slices - for more than one temporal object. `The object key is `a collection of + for more than one temporal object. The object key is a collection of property paths whose value combination uniquely identifies a temporal object. - `SupportedActions` is a collection of diff --git a/odata-temporal-ext/4 Temporal Requests.md b/odata-temporal-ext/4 Temporal Requests.md index 14fcaab62..b708fb8de 100644 --- a/odata-temporal-ext/4 Temporal Requests.md +++ b/odata-temporal-ext/4 Temporal Requests.md @@ -72,7 +72,7 @@ applicable rule: 2. by a [`$at`](#QueryOptionat) value propagated along `$expand` 3. by [`$at`](#QueryOptionat) in the query option part of the request URL, which applies to every segment of the resource path and paths that occur in system query options -4. by the default value "now" - the logic for determining this value is service-specific +4. by the default value "now" --- the logic for determining this value is service-specific For entities in a [timeline entity set](#TimelineEntitySet) the time interval for filtering time slices is determined by the first @@ -92,7 +92,7 @@ For timeline entity sets and collection-valued navigation to timeline entity sets, `$at=` is shorthand for ::: indent -[`$from`](#QueryOptionsfromtoandtoInclusive)=`&`[`$toInclusive`](#QueryOptionsfromtoandtoInclusive)`=` +[`$from`](#QueryOptionsfromtoandtoInclusive)`=&`[`$toInclusive`](#QueryOptionsfromtoandtoInclusive)`=` ::: The query option `$at` can be combined with `$filter` and `$search`. @@ -137,7 +137,7 @@ Example ##ex: retrieve multiple employees at a past point in time GET /api-1/Employees?$filter=contains(Name,'i')&$at=2012-01-01 ``` results in one time slice for each employee matching the filter at the -specified point in time - note that E401 back then does not satisfy +specified point in time --- note that E401 back then does not satisfy this condition ```json { diff --git a/odata-temporal-ext/diagrams/README.md b/odata-temporal-ext/diagrams/README.md deleted file mode 100644 index f3feb3edf..000000000 --- a/odata-temporal-ext/diagrams/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Diagrams in the [Draw.io](https://marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio) `example-model.drawio` file are exported as `*.svg` and then embedded into the `.md` files without changes. - -Note: star `*` characters in a diagram description needs to be escaped as `\*` to avoid -interpretation as markdown. diff --git a/odata-temporal-ext/diagrams/api-1.drawio.svg b/odata-temporal-ext/diagrams/api-1.drawio.svg new file mode 100644 index 000000000..d0414882c --- /dev/null +++ b/odata-temporal-ext/diagrams/api-1.drawio.svg @@ -0,0 +1,186 @@ + + + + + + + + + +
    +
    +
    + Employee +
    +
    +
    +
    + + Employee + +
    +
    + + + +
    +
    +
    + ID: Edm.String {id} +
    +
    +
    +
    + + ID: Edm.String {id} + +
    +
    + + + +
    +
    +
    + Name: Edm.String +
    +
    +
    +
    + + Name: Edm.String + +
    +
    + + + +
    +
    +
    + Jobtitle: Edm.String +
    +
    +
    +
    + + Jobtitle: Edm.String + +
    +
    + + + + + + +
    +
    +
    + Department +
    +
    +
    +
    + + Department + +
    +
    + + + +
    +
    +
    + ID: Edm.String {id} +
    +
    +
    +
    + + ID: Edm.String {id} + +
    +
    + + + +
    +
    +
    + Name: Edm.String +
    +
    +
    +
    + + Name: Edm.String + +
    +
    + + + + + + +
    +
    +
    +
    + + * + +
    +
    + + Employees + +
    +
    +
    +
    +
    + + *... + +
    +
    + + + +
    +
    +
    +
    +
    + + 1 + +
    +
    + + Department + +
    +
    +
    +
    +
    +
    + + 1... + +
    +
    +
    + + + + + Text is not SVG - cannot display + + + +
    diff --git a/odata-temporal-ext/diagrams/api-1.svg b/odata-temporal-ext/diagrams/api-1.svg deleted file mode 100644 index b17470763..000000000 --- a/odata-temporal-ext/diagrams/api-1.svg +++ /dev/null @@ -1 +0,0 @@ -
    Employee
    Employee
    ID: Edm.String {id}
    ID: Edm.String {id}
    Name: Edm.String
    Name: Edm.String
    Jobtitle: Edm.String
    Jobtitle: Edm.String
    Department
    Department
    ID: Edm.String {id}
    ID: Edm.String {id}
    Name: Edm.String
    Name: Edm.String
    \*
    Employees
    \*...
    1
    Department
    1...
    Text is not SVG - cannot display
    \ No newline at end of file diff --git a/odata-temporal-ext/diagrams/api-2.drawio.svg b/odata-temporal-ext/diagrams/api-2.drawio.svg new file mode 100644 index 000000000..b4cfe12b8 --- /dev/null +++ b/odata-temporal-ext/diagrams/api-2.drawio.svg @@ -0,0 +1,355 @@ + + + + + + + + + +
    +
    +
    + Employee_history +
    +
    +
    +
    + + Employee_history + +
    +
    + + + +
    +
    +
    + From: Edm.Date {id} +
    +
    +
    +
    + + From: Edm.Date {id} + +
    +
    + + + +
    +
    +
    + To: Edm.Date +
    +
    +
    +
    + + To: Edm.Date + +
    +
    + + + +
    +
    +
    + Name: Edm.String +
    +
    +
    +
    + + Name: Edm.String + +
    +
    + + + +
    +
    +
    + Jobtitle: Edm.String +
    +
    +
    +
    + + Jobtitle: Edm.String + +
    +
    + + + + + + +
    +
    +
    + Department_history +
    +
    +
    +
    + + Department_history + +
    +
    + + + +
    +
    +
    + From: Edm.Date {id} +
    +
    +
    +
    + + From: Edm.Date {id} + +
    +
    + + + +
    +
    +
    + To: Edm.Date +
    +
    +
    +
    + + To: Edm.Date + +
    +
    + + + +
    +
    +
    + Name: Edm.String +
    +
    +
    +
    + + Name: Edm.String + +
    +
    + + + +
    +
    +
    + Budget: Edm.Decimal +
    +
    +
    +
    + + Budget: Edm.Decimal + +
    +
    + + + + + + +
    +
    +
    + Employee +
    +
    +
    +
    + + Employee + +
    +
    + + + +
    +
    +
    + ID: Edm.String {id} +
    +
    +
    +
    + + ID: Edm.String {id} + +
    +
    + + + + + + +
    +
    +
    + Department +
    +
    +
    +
    + + Department + +
    +
    + + + +
    +
    +
    + ID: Edm.String {id} +
    +
    +
    +
    + + ID: Edm.String {id} + +
    +
    + + + + + +
    +
    +
    +
    + + * + +
    +
    + + Employees + +
    +
    +
    +
    +
    + + *... + +
    +
    + + + + + +
    +
    +
    +
    + + * + +
    +
    + history +
    +
    +
    +
    +
    + + *... + +
    +
    + + + + + +
    +
    +
    +
    + + * + +
    +
    + history +
    +
    +
    +
    +
    + + *... + +
    +
    + + + +
    +
    +
    +
    +
    + + 1 + +
    +
    + + Department + +
    +
    +
    +
    +
    +
    + + 1... + +
    +
    + + +
    + + + + + Text is not SVG - cannot display + + + +
    diff --git a/odata-temporal-ext/diagrams/api-2.svg b/odata-temporal-ext/diagrams/api-2.svg deleted file mode 100644 index f832e2925..000000000 --- a/odata-temporal-ext/diagrams/api-2.svg +++ /dev/null @@ -1 +0,0 @@ -
    Employee_history
    Employee_history
    From: Edm.Date {id}
    From: Edm.Date {id}
    To: Edm.Date
    To: Edm.Date
    Name: Edm.String
    Name: Edm.String
    Jobtitle: Edm.String
    Jobtitle: Edm.String
    Department_history
    Department_history
    From: Edm.Date {id}
    From: Edm.Date {id}
    To: Edm.Date
    To: Edm.Date
    Name: Edm.String
    Name: Edm.String
    Budget: Edm.Decimal
    Budget: Edm.Decimal
    Employee
    Employee
    ID: Edm.String {id}
    ID: Edm.String {id}
    Department
    Department
    ID: Edm.String {id}
    ID: Edm.String {id}
    \*
    Employees
    \*...
    \*
    history
    \*...
    \*
    history
    \*...
    1
    Department
    1...
    Text is not SVG - cannot display
    \ No newline at end of file diff --git a/odata-temporal-ext/diagrams/db.drawio.svg b/odata-temporal-ext/diagrams/db.drawio.svg new file mode 100644 index 000000000..e1fa16baf --- /dev/null +++ b/odata-temporal-ext/diagrams/db.drawio.svg @@ -0,0 +1,260 @@ + + + + + + + + + +
    +
    +
    + Employee +
    +
    +
    +
    + + Employee + +
    +
    + + + + +
    +
    +
    + ID: String {id} +
    +
    +
    +
    + + ID: String {id} + +
    +
    + + + + +
    +
    +
    + From: Date {id} +
    +
    +
    +
    + + From: Date {id} + +
    +
    + + + + +
    +
    +
    + To: Date +
    +
    +
    +
    + + To: Date + +
    +
    + + + + +
    +
    +
    + Name: String +
    +
    +
    +
    + + Name: String + +
    +
    + + + + +
    +
    +
    + Jobtitle: String +
    +
    +
    +
    + + Jobtitle: String + +
    +
    + + + + +
    +
    +
    + Department.ID +
    +
    +
    +
    + + Department.ID + +
    +
    + + + + + + +
    +
    +
    + Department +
    +
    +
    +
    + + Department + +
    +
    + + + + +
    +
    +
    + ID: String {id} +
    +
    +
    +
    + + ID: String {id} + +
    +
    + + + + +
    +
    +
    + From: Date {id} +
    +
    +
    +
    + + From: Date {id} + +
    +
    + + + + +
    +
    +
    + To: Date +
    +
    +
    +
    + + To: Date + +
    +
    + + + + +
    +
    +
    + Name: String +
    +
    +
    +
    + + Name: String + +
    +
    + + + + +
    +
    +
    + Budget: Decimal +
    +
    +
    +
    + + Budget: Decimal + +
    +
    + + + +
    +
    +
    +
    +
    + 1 +
    +
    +
    +
    +
    +
    + + 1 + +
    +
    + + +
    + + + + + Text is not SVG - cannot display + + + +
    diff --git a/odata-temporal-ext/diagrams/db.svg b/odata-temporal-ext/diagrams/db.svg deleted file mode 100644 index 0cc58df72..000000000 --- a/odata-temporal-ext/diagrams/db.svg +++ /dev/null @@ -1 +0,0 @@ -
    Employee
    Employee
    ID: String {id}
    ID: String {id}
    From: Date {id}
    From: Date {id}
    To: Date
    To: Date
    Name: String
    Name: String
    Jobtitle: String
    Jobtitle: String
    Department.ID
    Department.ID
    Department
    Department
    ID: String {id}
    ID: String {id}
    From: Date {id}
    From: Date {id}
    To: Date
    To: Date
    Name: String
    Name: String
    Budget: Decimal
    Budget: Decimal
    1
    1
    Text is not SVG - cannot display
    \ No newline at end of file diff --git a/odata-temporal-ext/diagrams/example-model.drawio b/odata-temporal-ext/diagrams/example-model.drawio deleted file mode 100644 index 3e804637c..000000000 --- a/odata-temporal-ext/diagrams/example-model.drawio +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/odata-url-conventions/0 frontmatter.md b/odata-url-conventions/0 frontmatter.md index d0e5069a8..a80365853 100644 --- a/odata-url-conventions/0 frontmatter.md +++ b/odata-url-conventions/0 frontmatter.md @@ -62,7 +62,7 @@ $$$description$$$ #### Status: This document was last revised or approved by the OASIS Open Data Protocol (OData) TC on the above date. The level of approval is also listed above. Check the "Latest stage" location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata#technical. -TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "[Send A Comment](https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=odata)" button on the TC's web page at https://www.oasis-open.org/committees/odata/. +TC members should send comments on this specification to the TC's email list. Others should send comments to the TC's public comment list, after subscribing to it by following the instructions at the "Send A Comment" button on the TC's web page at https://www.oasis-open.org/committees/odata/. This specification is provided under the [RF on RAND Terms Mode](https://www.oasis-open.org/policies-guidelines/ipr/#RF-on-RAND-Mode) of the [OASIS IPR Policy](https://www.oasis-open.org/policies-guidelines/ipr/), the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC's web page (https://www.oasis-open.org/committees/odata/ipr.php). diff --git a/odata-url-conventions/1 Introduction.md b/odata-url-conventions/1 Introduction.md index f34801c3d..f64a2616b 100644 --- a/odata-url-conventions/1 Introduction.md +++ b/odata-url-conventions/1 Introduction.md @@ -61,7 +61,7 @@ All other text is normative unless otherwise labeled. Here is a customized command line which will generate HTML from this markdown file (named `$$$filename$$$.md`). Line breaks are added for readability only: ``` -pandoc -f gfm+tex_math_dollars+fenced_divs +pandoc -f gfm+tex_math_dollars+fenced_divs+smart -t html -o $$$filename$$$.html -c styles/markdown-styles-v1.7.3b.css diff --git a/odata-url-conventions/4 Resource Path.md b/odata-url-conventions/4 Resource Path.md index ff7a73a65..7b6500dd0 100644 --- a/odata-url-conventions/4 Resource Path.md +++ b/odata-url-conventions/4 Resource Path.md @@ -78,17 +78,17 @@ Below is a (non-normative) snippet from [OData-ABNF](#ODataABNF): ``` resourcePath = entitySetName [collectionNavigation] - / singleton [singleNavigation] + / singletonEntity [singleNavigation] / actionImportCall / entityColFunctionImportCall [ collectionNavigation ] / entityFunctionImportCall [ singleNavigation ] / complexColFunctionImportCall [ collectionPath ] / complexFunctionImportCall [ complexPath ] / primitiveColFunctionImportCall [ collectionPath ] - / primitiveFunctionImportCall [ singlePath ] - / functionImportCallNoParens - / crossjoin - / '$all' [ "/" qualifiedEntityTypeName ] + / primitiveFunctionImportCall [ primitivePath ] + / functionImportCallNoParens [ querySegment ] + / crossjoin [ querySegment ] + / %s"$all" [ "/" optionallyQualifiedEntityTypeName ] ``` Since OData has a uniform composable URL syntax and associated rules @@ -105,8 +105,8 @@ http://host/service/Products - By navigating a collection-valued navigation property (see rule: `entityColNavigationProperty`) -- By invoking a function that returns a -collection of entities (see rule: `entityColFunctionCall`) +- By invoking a function import that returns a +collection of entities (see rule: `entityColFunctionImportCall`) ::: example Example ##ex: function with parameters in resource path @@ -122,16 +122,16 @@ http://host/service/ProductsByColor(color=@color)?@color='red' ``` ::: -- By invoking an action that returns a -collection of entities (see rule: `actionCall`) +- By invoking an action import that returns a +collection of entities (see rule: `actionImportCall`) Likewise there are many ways to address a single entity. Sometimes a single entity can be accessed directly, for example by: -- Invoking a function that returns a -single entity (see rule: `entityFunctionCall`) -- Invoking an action that returns a single -entity (see rule: `actionCall`) +- Invoking a function import that returns a +single entity (see rule: `entityFunctionImportCall`) +- Invoking an action import that returns a single +entity (see rule: `actionImportCall`) - Addressing a singleton ::: example @@ -403,7 +403,7 @@ key properties of the related entity that take part in the referential constraint MUST be omitted from URLs using key-as-segment convention. ::: example -Example ##ex: key predicate of related entity - no key segments for key +Example ##ex: key predicate of related entity --- no key segments for key properties of related entity with a referential constraint to preceding key segments ``` @@ -490,7 +490,7 @@ defined in the [OData-Protocol](#ODataProtocol) document. Services MAY additionally support the use of the unqualified name of an action or function in a URL by defining one or more default namespaces through the -[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace)` `term +[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace) term defined in [OData-VocCore](#ODataVocCore). For more information on default namespaces, see Default Namespaces in [OData-Protocol](#ODataProtocol). @@ -562,7 +562,7 @@ To address the raw value of the number of items in a collection, clients append `/$count` to the resource path of the URL identifying the entity set or collection. -The `/$count `path suffix identifies the integer count of records in the +The `/$count` path suffix identifies the integer count of records in the collection and SHOULD NOT be combined with the system query options [`$top`](#SystemQueryOptionstopandskip), [`$skip`](#SystemQueryOptionstopandskip), @@ -621,9 +621,9 @@ Collections of entities are modeled as entity sets, collection-valued navigation properties, or operation results. For entity sets, results of operations associated with an entity set -through an `EntitySet `or `EntitySetPath` declaration, or +through an `EntitySet` or `EntitySetPath` declaration, or collection-valued navigation properties with a -`NavigationPropertyBinding `or `ContainsTarget=true `specification, +`NavigationPropertyBinding` or `ContainsTarget=true` specification, members of the collection can be addressed by convention by appending the parenthesized key to the URL specifying the collection of entities, or by using the [key-as-segment convention](#KeyasSegmentConvention) if @@ -704,9 +704,9 @@ http://host/service/Customers/Model.VipCustomer Example ##ex: entity restricted to a `VipCustomer` instance, resulting in `404 Not Found` if the customer with key `1` is not a `VipCustomer` ``` -http://host/service/`Customers/Model.VipCustomer(1) +http://host/service/Customers/Model.VipCustomer(1) -http://host/service/`Customers(1)/Model.VipCustomer +http://host/service/Customers(1)/Model.VipCustomer ``` ::: @@ -756,7 +756,7 @@ combined with the [`$filter`](#SystemQueryOptionfilter) system query option. ::: example -Example ##ex: red products that cost less than 10 -- combining path +Example ##ex: red products that cost less than 10 --- combining path segment and system query option ``` GET Products/$filter(@foo)?@foo=Price lt 10&$filter=Color eq 'red' @@ -764,7 +764,7 @@ GET Products/$filter(@foo)?@foo=Price lt 10&$filter=Color eq 'red' ::: ::: example -Example ##ex: red products that cost less than 10 -- combine two path +Example ##ex: red products that cost less than 10 --- combine two path segments ``` GET Products/$filter(@p)/$filter(@c)?@p=Price lt 10&@c=Color eq 'red' @@ -828,7 +828,7 @@ stream. ::: example Example ##ex: request the media stream for the picture with the key value -`Sunset4321299432:` +`Sunset4321299432`: ``` http://host/service/Pictures('Sunset4321299432')/$value ``` @@ -851,7 +851,7 @@ the corresponding entity set, with a target type equal to the declared entity type of the corresponding entity set. The [`$filter`](#SystemQueryOptionfilter) and -[`$orderby`](#SystemQueryOptionorderby)` `query options can be specified +[`$orderby`](#SystemQueryOptionorderby) query options can be specified using properties of the entities in the selected entity sets, prepended with the entity set as the navigation property name. @@ -946,7 +946,7 @@ Requests to paths ending in `/$query` MUST use the `POST` verb. Query options specified in the request body and query options specified in the request URL are processed together. -The request body MUST use the content-type `text/plain`. It contains the +The request body MUST use `Content-Type: text/plain`. It contains the query portion of the URL and MUST use the same percent-encoding as in URLs (especially: no spaces, tabs, or line breaks allowed) and MUST follow the syntax rules described in chapter Query Options. diff --git a/odata-url-conventions/5 Query Options.md b/odata-url-conventions/5 Query Options.md index 72830adc7..b3d4d617a 100644 --- a/odata-url-conventions/5 Query Options.md +++ b/odata-url-conventions/5 Query Options.md @@ -16,7 +16,7 @@ System query options are query string parameters that control the amount and order of the data returned for the resource identified by the URL. The names of all system query options are optionally prefixed with a dollar (`$`) character. 4.01 Services MUST support case-insensitive -system query option names specified with or without the `$ `prefix. +system query option names specified with or without the `$` prefix. Clients that want to work with 4.0 services MUST use lower case names and specify the `$` prefix. @@ -162,7 +162,7 @@ greater than `-INF`. The Boolean value `true` is greater than `false`. Services SHOULD order language-dependent strings according to the -content-language of the response, and SHOULD annotate string properties +`Content-Language` of the response, and SHOULD annotate string properties with language-dependent order with the term [`Core.IsLanguageDependent`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#IsLanguageDependent), see [OData-VocCore](#ODataVocCore). @@ -187,7 +187,7 @@ than `INF`. The Boolean value `false` is less than `true`. Services SHOULD order language-dependent strings according to the -content-language of the response, and SHOULD annotate string properties +`Content-Language` of the response, and SHOULD annotate string properties with language-dependent order with the term [`Core.IsLanguageDependent`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#IsLanguageDependent), see [OData-VocCore](#ODataVocCore). @@ -247,49 +247,49 @@ The following examples illustrate the use and semantics of each of the logical operators. ::: example -Example ##ex: all products with a `Name` equal to 'Milk' +Example ##ex: all products with a `Name` equal to `Milk` ``` http://host/service/Products?$filter=Name eq 'Milk' ``` ::: ::: example -Example ##ex: all products with a `Name` not equal to 'Milk' +Example ##ex: all products with a `Name` not equal to `Milk` ``` http://host/service/Products?$filter=Name ne 'Milk' ``` ::: ::: example -Example ##ex: all products with a Name greater than 'Milk': +Example ##ex: all products with a `Name` greater than `Milk`: ``` http://host/service/Products?$filter=Name gt 'Milk' ``` ::: ::: example -Example ##ex: all products with a Name greater than or equal to 'Milk': +Example ##ex: all products with a `Name` greater than or equal to `Milk`: ``` http://host/service/Products?$filter=Name ge 'Milk' ``` ::: ::: example -Example ##ex: all products with a Name less than 'Milk': +Example ##ex: all products with a `Name` less than `Milk`: ``` http://host/service/Products?$filter=Name lt 'Milk' ``` ::: ::: example -Example ##ex: all products with a Name less than or equal to 'Milk': +Example ##ex: all products with a `Name` less than or equal to `Milk`: ``` -http://host/service/Products?$filter=Name le 'Milk'` +http://host/service/Products?$filter=Name le 'Milk' ``` ::: ::: example -Example ##ex: all products with the Name 'Milk' that also have a Price +Example ##ex: all products with a `Name` equal to `Milk` that also have a `Price` less than 2.55: ``` http://host/service/Products?$filter=Name eq 'Milk' and Price lt 2.55 @@ -297,15 +297,15 @@ http://host/service/Products?$filter=Name eq 'Milk' and Price lt 2.55 ::: ::: example -Example ##ex: all products that either have the Name 'Milk' or have a -Price less than 2.55: +Example ##ex: all products that either have a `Name` equal to `Milk` or have a +`Price` less than 2.55: ``` http://host/service/Products?$filter=Name eq 'Milk' or Price lt 2.55 ``` ::: ::: example -Example ##ex: all products that do not have a Name that ends with 'ilk': +Example ##ex: all products that do not have a `Name` that ends with `ilk`: ``` http://host/service/Products?$filter=not endswith(Name,'ilk') ``` @@ -319,7 +319,7 @@ http://host/service/Products?$filter=style has Sales.Pattern'Yellow' ::: ::: example -Example ##ex: all products whose `name` value is 'Milk' or 'Cheese': +Example ##ex: all products whose `Name` is `Milk` or `Cheese`: ``` http://host/service/Products?$filter=Name in ('Milk', 'Cheese') ``` @@ -377,7 +377,7 @@ or `variable` if any operand has variable scale. The `sub` operator is also valid for the following time-related operands: -- `DateTimeOffset` `sub` `Duration` +- `DateTimeOffset sub Duration` results in a `DateTimeOffset` - `Duration sub Duration` results in a `Duration` @@ -586,7 +586,7 @@ The `containsMethodCallExpr` syntax rule defines how the `contains` function is invoked. ::: example -Example ##ex: all customers with a `CompanyName` that contains `'Alfreds'` +Example ##ex: all customers with a `CompanyName` that contains `Alfreds` ``` http://host/service/Customers?$filter=contains(CompanyName,'Alfreds') ``` @@ -618,7 +618,7 @@ function is invoked. ::: example Example ##ex: all customers with a `CompanyName` that ends with -`'Futterkiste'` +`Futterkiste` ``` http://host/service/Customers?$filter=endswith(CompanyName,'Futterkiste') ``` @@ -649,7 +649,7 @@ The `indexOfMethodCallExpr` syntax rule defines how the `indexof` function is invoked. ::: example -Example ##ex: all customers with a `CompanyName` containing '`lfreds'` +Example ##ex: all customers with a `CompanyName` containing `lfreds` starting at the second character ``` http://host/service/Customers?$filter=indexof(CompanyName,'lfreds') eq 1 @@ -707,7 +707,7 @@ The `startsWithMethodCallExpr` syntax rule defines how the `startswith` function is invoked. ::: example -Example ##ex: all customers with a `CompanyName` that starts with `'Alfr'` +Example ##ex: all customers with a `CompanyName` that starts with `Alfr` ``` http://host/service/Customers?$filter=startswith(CompanyName,'Alfr') ``` @@ -761,7 +761,7 @@ The `substringMethodCallExpr` syntax rule defines how the `substring` function is invoked. ::: example -Example ##ex: all customers with a `CompanyName` of `'lfreds Futterkiste'` +Example ##ex: all customers with a `CompanyName` of `lfreds Futterkiste` once the first character has been removed ``` http://host/service/Customers?$filter=substring(CompanyName,1) eq 'lfreds Futterkiste' @@ -769,8 +769,8 @@ http://host/service/Customers?$filter=substring(CompanyName,1) eq 'lfreds Futter ::: ::: example -Example ##ex: all customers with a `CompanyName` that has '`lf' `as the -second and third characters, e.g, '`Alfreds Futterkiste`' +Example ##ex: all customers with a `CompanyName` that has `lf` as the +second and third characters, e.g, `Alfreds Futterkiste` ``` http://host/service/Customers?$filter=substring(CompanyName,1,2) eq 'lf' ``` @@ -853,17 +853,17 @@ hassubsequence([1,2],[1,1,2]) #### ##subsubsubsec String Functions -##### ##subsubsubsubsec `matchesPattern` +##### ##subsubsubsubsec `matchespattern` -The `matchesPattern` function has the following signature: +The `matchespattern` function has the following signature: ``` -Edm.Boolean matchesPattern(Edm.String,Edm.String) +Edm.Boolean matchespattern(Edm.String,Edm.String) ``` The second parameter MUST evaluate to a string containing an [**[ECMAScript]**](#ECMAScript) (JavaScript) regular expression. The -`matchesPattern` function returns true if the first parameter evaluates +`matchespattern` function returns true if the first parameter evaluates to a string matching that regular expression, using syntax and semantics of [**[ECMAScript]**](#ECMAScript) regular expressions, otherwise it returns false. @@ -872,7 +872,7 @@ returns false. Example ##ex: all customers with a `CompanyName` that match the (percent-encoded) regular expression `^A.*e$` ``` -http://host/service/Customers?$filter=matchesPattern(CompanyName,'%5EA.*e$') +http://host/service/Customers?$filter=matchespattern(CompanyName,'%5EA.*e$') ``` ::: @@ -891,7 +891,7 @@ function is invoked. ::: example Example ##ex: all customers with a `CompanyName` that equals -`'alfreds futterkiste'` once any uppercase characters have been +`alfreds futterkiste` once any uppercase characters have been converted to lowercase ``` http://host/service/Customers?$filter=tolower(CompanyName) eq 'alfreds futterkiste' @@ -913,7 +913,7 @@ function is invoked. ::: example Example ##ex: all customers with a `CompanyName` that equals -`'ALFREDS FUTTERKISTE'` once any lowercase characters have been +`ALFREDS FUTTERKISTE` once any lowercase characters have been converted to uppercase ``` http://host/service/Customers?$filter=toupper(CompanyName) eq 'ALFREDS FUTTERKISTE' @@ -1405,8 +1405,8 @@ expression case(Edm.Boolean:expression, ..., Edm.Boolean:expression) ``` Each parameter is a pair of expressions separated by a colon (`:`), -where the first expression -- the condition -- MUST be a Boolean -expression, and the second expression -- the result -- may evaluate to +where the first expression --- the condition --- MUST be a Boolean +expression, and the second expression --- the result --- may evaluate to any type. The case function evaluates the condition in each pair, starting with @@ -1437,7 +1437,7 @@ $compute=case(X gt 0:1,X lt 0:-1,true:0) as SignumX #### ##subsubsubsec Lambda Operators OData defines two operators that evaluate a Boolean expression on a -collection. Both must be prepended with a navigation path that +collection. Both must be prepended with a path expression that identifies a collection. 4.01 Services MUST support case-insensitive lambda operator names. @@ -1446,8 +1446,8 @@ operator names. The argument of a lambda operator is a case-sensitive lambda variable name followed by a colon (`:`) and a Boolean expression that uses the -lambda variable name to refer to properties of members of the collection -identified by the navigation path. +lambda variable name to refer to properties of the instance or of members of the collection +identified by the path expression. If the name chosen for the lambda variable matches a property name of the current resource referenced by the resource path, the lambda @@ -1456,7 +1456,7 @@ resource referenced by the resource path with [`$it`](#it). Other path expressions in the Boolean expression neither prefixed with the lambda variable nor `$it` are evaluated in the scope of the -collection instances at the origin of the navigation path prepended to +instance or of members of the collection at the origin of the path expression prepended to the lambda operator. ##### ##subsubsubsubsec `any` @@ -1793,7 +1793,7 @@ http://host/service/Employees?$filter=@Core.Messages/any(m:m/severity eq 'error' Services MAY additionally support the use of the unqualified term name by defining one or more default namespaces through the -[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace)` `annotation +[`Core.DefaultNamespace`](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#DefaultNamespace) annotation term defined in [OData-VocCore](#ODataVocCore). For more information on default namespaces, see Default Namespaces in [OData-Protocol](#ODataProtocol). This short notation however uses the same name pattern as parameter @@ -1850,9 +1850,9 @@ rules, in order: - If either operand is `Edm.Double`, the other operand is converted to type `Edm.Double`. - Otherwise, if either operand is `Edm.Single`, the other operand is converted to type `Edm.Single`. - Otherwise, if either operand is of type `Edm.Decimal`, the other operand is converted to `Edm.Decimal`. -- Otherwise, if either operand is `Edm.Int64`, the other operand is converted to type `Edm.Int64.` -- Otherwise, if either operand is `Edm.Int32`, the other operand is converted to type `Edm.Int32.` -- Otherwise, if either operand is `Edm.Int16`, the other operand is converted to type `Edm.Int16. ` +- Otherwise, if either operand is `Edm.Int64`, the other operand is converted to type `Edm.Int64`. +- Otherwise, if either operand is `Edm.Int32`, the other operand is converted to type `Edm.Int32`. +- Otherwise, if either operand is `Edm.Int16`, the other operand is converted to type `Edm.Int16`. Each of these promotions uses the same semantics as a `castExpression` to promote an operand to the target type. @@ -1935,14 +1935,18 @@ A path MUST NOT appear in more than one expand item. Query options can be applied to an expanded navigation property by appending a semicolon-separated list of query options, enclosed in -parentheses, to the navigation property name. Allowed system query -options are [`$filter`](#SystemQueryOptionfilter), +parentheses, to the navigation property name. +Allowed system query options are +[`$compute`](#SystemQueryOptioncompute), [`$select`](#SystemQueryOptionselect), +`$expand`, and +[`$levels`](#ExpandOptionlevels) for all navigation properties, plus +[`$filter`](#SystemQueryOptionfilter), [`$orderby`](#SystemQueryOptionorderby), -[`$skip`](#SystemQueryOptionstopandskip), -[`$top`](#SystemQueryOptionstopandskip), -[`$count`](#SystemQueryOptioncount), -[`$search`](#SystemQueryOptionsearch), and `$expand`. +[`$skip`](#SystemQueryOptionstopandskip), [`$top`](#SystemQueryOptionstopandskip), +[`$count`](#SystemQueryOptioncount), and +[`$search`](#SystemQueryOptionsearch) + for collection-valued navigation properties. ::: example Example ##ex: all categories and for each category all related products @@ -2008,13 +2012,13 @@ http://host/service/Categories?$expand=Products/Sales.PremierProduct/$ref($filte ``` ::: -Cyclic navigation properties (whose target type is identical or can be +Cyclic navigation properties (whose target type is identical or can be cast to its source type) can be recursively expanded using the special `$levels` option. The value of the `$levels` option is either a positive integer to specify the number of levels to expand, or the literal string `max` to specify the maximum expansion level supported by that service. A `$levels` option with a value of 1 specifies a single expand with no -recursion. +recursion. ::: example Example ##ex: all employees with their manager, manager's manager, and @@ -2063,7 +2067,7 @@ Specifying `$value` for a media entity includes the media entity's stream value inline according to the specified format. ::: example -Example ##ex: Include the `Product`'s media stream along with other +Example ##ex: Include the Product's media stream along with other properties of the product ``` http://host/service/Products?$expand=$value @@ -2116,10 +2120,11 @@ The `$select` system query option is interpreted relative to the entity type or complex type of the resources identified by the resource path section of the URL. Each select item in the `$select` clause indicates that the response MUST include the declared or dynamic properties, -actions and functions identified by that select item. The simplest form -of a select item explicitly requests a property defined on the entity -type of the resources identified by the resource path section of the -URL. +actions and functions identified by that select item. +If a select item is a path expression traversing an entity or complex property that is `null` on an instance, then +the null-valued entity or complex property is included and represented as `null`. +The simplest form of a select item explicitly requests a property defined on the entity +type of the resources identified by the resource path section of the URL. ::: example Example ##ex: rating and release date of all products @@ -2239,15 +2244,11 @@ http://host/service/Products?$select=ID,Model.ActionName,Model2.* ``` ::: -When multiple select item exist in a `select clause`, then the total set +When multiple select item exist in a `$select` clause, then the total set of properties, open properties, navigation properties, actions and functions to be returned is equal to the union of the set of those identified by each select item. -If a select item is a path expression requesting a component of a -complex property and the complex property is `null` on an instance, then -the component is treated as `null` as well. - ### ##subsubsec System Query Option `$orderby` The `$orderby` system query option allows clients to request resources @@ -2270,7 +2271,7 @@ particular page of items by combining `$top` and `$skip`. The semantics of `$top` and `$skip` are covered in the [OData-Protocol](#ODataProtocol) document. The [OData-ABNF](#ODataABNF) `top` and `skip` syntax rules define the formal grammar of the `$top` and -`$skip `query options respectively. +`$skip` query options respectively. ### ##subsubsec System Query Option `$count` @@ -2465,7 +2466,7 @@ http://host/service/Movies?$filter=Title eq @title&@title='Wizard of Oz' ::: ::: example -Example ##ex: JSON array of strings as parameter alias value -- note that +Example ##ex: JSON array of strings as parameter alias value --- note that `[`, `]`, and `"` need to be percent-encoded in real URLs, the clear-text representation used here is just for readability ``` diff --git a/odata-url-conventions/Appendix.md b/odata-url-conventions/Appendix.md index a0989b4c7..e95b448c6 100644 --- a/odata-url-conventions/Appendix.md +++ b/odata-url-conventions/Appendix.md @@ -39,14 +39,15 @@ _OData Vocabularies Version 4.0: Core Vocabulary._ See link in "[Related work](#RelatedWork)" section on cover page. ###### [RFC2119] +_Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997_. https://www.rfc-editor.org/info/rfc2119. ###### [RFC3986] -_Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", IETF RFC3986, January 2005_ -https://tools.ietf.org/html/rfc3986. +_Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005_. +https://www.rfc-editor.org/info/rfc3986. ###### [RFC8174] -_Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_ +_Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017_. https://www.rfc-editor.org/info/rfc8174. ###### [XML-Schema-2] @@ -63,7 +64,7 @@ https://www.ecma-international.org/publications-and-standards/standards/ecma-262 # Appendix ##asec Safety, Security and Privacy Considerations -TODO: do we have considerations specific to URLs, for example length, encoding, privacy (use $batch if in doubt), ...? + ------- diff --git a/package.json b/package.json index 4d33eca48..3b3813213 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "odata-specs", "version": "1.0.0", "description": "", - "main": "number.js", + "main": "lib/server.js", "scripts": { "build": "node lib/build.js", "pdf": "node lib/build-pdf.js", @@ -11,7 +11,7 @@ "clean-xxx": "node lib/clean.mjs odata-xxx/temp odata-xxx-v4.0" }, "author": "", - "license": "ISC", + "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "c8": "^8.0.0", "express": "^4",
    hassubset
    hassubset([4,1,3],[3,1])
    hassubsequence
    hassubsequence([4,1,3,1],[1,1])
    String Functions
    matchesPattern
    matchesPattern(CompanyName,'%5EA.*e$')
    matchespattern
    matchespattern(CompanyName,'%5EA.*e$')
    tolower
    tolower(CompanyName) eq 'alfreds futterkiste'
    toupper
    toupper(CompanyName) eq 'ALFREDS FUTTERKISTE'
    trim
    trim(CompanyName) eq 'Alfreds Futterkiste'