Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-34

Control verbosity of $metadata response: include annotations or documentation

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_WD01
    • Fix Version/s: V4.0_WD01
    • Component/s: Protocol
    • Labels:
      None
    • Environment:

      [Proposed]

    • Proposal:
      Hide

      Add a new Prefer preference value, defined as follows:

      odataVocabularies = "odata-vocabularies" "=" DQUOTE [ vocabularyIdentifier [ COMMA vocabularyIdentifier] ] DQUOTE
      vocabularyIdentifier = STAR | [excludeOperator] ("Edm.Documentation" | vocabularyNamespace )
      vocabularyNamespace = namespace ["." STAR]
      excludeOperator = "-"

      The value of odata-vocabularies is a comma separated list of vocabulary namespaces to include or exclude in a data or metadata response, with "*" representing all, and "Edm.Documentation" representing documentation elements within a metadata document. Prefer is (as always) a hint which can be ignored by the service. In the absence of the odata-vocabularies preference, the service is free to decide which vocabulary elements to return.

      The most specific identifier always takes precedence (so a specific namespace takes precedence over *). The behavior if the same identifier value is specified to both be excluded and included is undefined; the service may return or omit the specified vocabulary but must not raise an exception.

      Services MAY include the Preference-Applied header in the response to specify the specific vocabularies that may have been included in the response where appropriate but SHOULD NOT specify * or excluded vocabularies.

      Examples:

      Include all vocabularies, including documentation elements within a metadata document:
      Prefer: odata-vocabularies="*"
      Do not include any vocabularies or documentation elements:
      Prefer: odata-vocabularies=""
      Include only documentation elements:
      Prefer: odata-vocabularies="Edm.Documentation"
      Include all vocabularies, but exclude documentation elements within a metadata document:
      Prefer: odata-vocabularies="*,-Edm.Documentation"
      Include only vocabularies defined directly under the odata namespace:
      Prefer: odata-vocabularies="odata"
      Include only vocabularies defined anywhere within the odata namespace:
      Prefer: odata-vocabularies="odata.*"

      Accepted: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/47355/latest/odata_meeting-14_on-20121101-minutes.html

      Show
      Add a new Prefer preference value, defined as follows: odataVocabularies = "odata-vocabularies" "=" DQUOTE [ vocabularyIdentifier [ COMMA vocabularyIdentifier] ] DQUOTE vocabularyIdentifier = STAR | [excludeOperator] ("Edm.Documentation" | vocabularyNamespace ) vocabularyNamespace = namespace ["." STAR] excludeOperator = "-" The value of odata-vocabularies is a comma separated list of vocabulary namespaces to include or exclude in a data or metadata response, with "*" representing all, and "Edm.Documentation" representing documentation elements within a metadata document. Prefer is (as always) a hint which can be ignored by the service. In the absence of the odata-vocabularies preference, the service is free to decide which vocabulary elements to return. The most specific identifier always takes precedence (so a specific namespace takes precedence over *). The behavior if the same identifier value is specified to both be excluded and included is undefined; the service may return or omit the specified vocabulary but must not raise an exception. Services MAY include the Preference-Applied header in the response to specify the specific vocabularies that may have been included in the response where appropriate but SHOULD NOT specify * or excluded vocabularies. Examples: Include all vocabularies, including documentation elements within a metadata document: Prefer: odata-vocabularies="*" Do not include any vocabularies or documentation elements: Prefer: odata-vocabularies="" Include only documentation elements: Prefer: odata-vocabularies="Edm.Documentation" Include all vocabularies, but exclude documentation elements within a metadata document: Prefer: odata-vocabularies="*,-Edm.Documentation" Include only vocabularies defined directly under the odata namespace: Prefer: odata-vocabularies="odata" Include only vocabularies defined anywhere within the odata namespace: Prefer: odata-vocabularies="odata.*" Accepted: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/47355/latest/odata_meeting-14_on-20121101-minutes.html
    • Resolution:
      Show
      Applied: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/48472/odata-core-v4.0-wd01-part1-protocol-current-2013-3-6-MP.docx . Accepted: https://www.oasis-open.org/committees/download.php/49055/odata-meeting-35_on-20130502-minutes.html#odata-34

      Description

      Metadata documents may contain Documentation, ValueAnnotation and TypeAnnotation elements that quite increase the size of the document.

      It is desirable for (especially mobile) clients to control the size of the response and include e.g. only annotations of vocabularies the client can understand.

      This may be done via headers (Prefer, Accept?), system query options, or by exposing $metadata as an OData service itself, see ODATA-126:

      GET ~/$metadata/EntityTypes('Model.Person')?$expand=Annotations

      Ideally combined with filtering on expanded entities, see ODATA-32.

        Attachments

          Activity

            People

            • Assignee:
              mikep Michael Pizzo
              Reporter:
              handl Ralf Handl
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: