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

Merge TypeAnnotation and ValueAnnotation into Annotation

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_WD01
    • Fix Version/s: V4.0_WD01
    • Component/s: CSDL XML
    • Labels:
      None
    • Environment:

      [Proposed]

      Description

      Currently we can annotate anything using a ValueAnnotation, and ValueTerms can be of any type except EntityType and Collection(EntityType). We can in addition annotate entity types and complex types with a TypeAnnotation, and these can be of complex type or entity type.

      So for complex-type annotations we have to choose between a ValueAnnotation using a ValueTerm of that complex type, or a TypeAnnotation using the complex type directly.

      From the expressiveness there's no difference. The value annotation will look like

      <ValueAnnotation Term="MyComplexTerm">
      <Record>
      <PropertyValue Name="FirstProperty" String="Constant value" />
      <PropertyValue Name="SecondProperty" Path="SomePropertyInTheAnnotatedType" />
      </Record>
      </ValueAnnotation>

      The type annotation will look like

      <TypeAnnotation Term="MyComplexTerm">
      <PropertyValue Name="FirstProperty" String="Constant value" />
      <PropertyValue Name="SecondProperty" Path="SomePropertyInTheAnnotatedType" />
      </TypeAnnotation>

      The similarity is striking: just strike the <Record> and replace the prefix "Value" with "Type".

      If the annotation on an instance basis deviates from the metadata "default", the representation in Atom and JSON is already identical for both cases.

      The only difference is that with a type annotation the server expresses the opinion that the original instance can be "cast" to the annotation's type, while with a value annotation the original instance can be "projected" to the annotation's type.

      From a data perspective there's no difference between the two, and the "cast" versus "project" choice is anyway ultimately left to the client. So this difference in opinion can be expressed as an annotation on the term definition.

        Attachments

          Activity

          ralfhandl Ralf Handl created issue -
          mikep Michael Pizzo (Inactive) made changes -
          Field Original Value New Value
          Environment [Proposed]
          ralfhandl Ralf Handl made changes -
          Proposal Merge ValueAnnotation and TypeAnnotation into Annotation.
          Rename ValueTerm to Term and allow it to have any type.
          Make <Record> wrapper unnecessary for terms of complex and entity type (eye candy).
          Optionally allow marking a Term as "I'd like you to treat this as a type cast".
          - Remove TypeAnnotation
          - Rename ValueAnnotation to Annotation
          - Rename ValueTerm to Term and allow it to have any type.

          - Optionally add a term to the Core vocabulary that allows marking a Term as "I'd like you to treat this as a type cast".
          mikep Michael Pizzo (Inactive) made changes -
          Proposal - Remove TypeAnnotation
          - Rename ValueAnnotation to Annotation
          - Rename ValueTerm to Term and allow it to have any type.

          - Optionally add a term to the Core vocabulary that allows marking a Term as "I'd like you to treat this as a type cast".
          - Remove TypeAnnotation
          - Rename ValueAnnotation to Annotation
          - Rename ValueTerm to Term and allow it to have any type.
          - Add an optional "AppliesTo" attribute to the <Term> element whose value is a common separated list of model elements to which the annotation may be applied, including "Property", "EntityType", "EntitySet", "ComplexType", or "Term".
          - Optionally add a term to the Core vocabulary that allows marking a Term as "I'd like you to treat this as a type cast".
          mikep Michael Pizzo (Inactive) made changes -
          Environment [Proposed]
          ralfhandl Ralf Handl made changes -
          Proposal - Remove TypeAnnotation
          - Rename ValueAnnotation to Annotation
          - Rename ValueTerm to Term and allow it to have any type.
          - Add an optional "AppliesTo" attribute to the <Term> element whose value is a common separated list of model elements to which the annotation may be applied, including "Property", "EntityType", "EntitySet", "ComplexType", or "Term".
          - Optionally add a term to the Core vocabulary that allows marking a Term as "I'd like you to treat this as a type cast".
          - Remove TypeAnnotation
          - Rename ValueAnnotation to Annotation
          - Rename ValueTerm to Term and allow it to have any type.
          - Add an optional "AppliesTo" attribute to the <Term> element whose value is a comma-separated list of model elements to which the annotation may be applied, including "Property", "EntityType", "EntitySet", "ComplexType", or "Term".
          - Optionally add a term to the Core vocabulary that allows marking a Term as "I'd like you to treat this as a type cast".
          ralfhandl Ralf Handl made changes -
          Proposal - Remove TypeAnnotation
          - Rename ValueAnnotation to Annotation
          - Rename ValueTerm to Term and allow it to have any type.
          - Add an optional "AppliesTo" attribute to the <Term> element whose value is a comma-separated list of model elements to which the annotation may be applied, including "Property", "EntityType", "EntitySet", "ComplexType", or "Term".
          - Optionally add a term to the Core vocabulary that allows marking a Term as "I'd like you to treat this as a type cast".
          - Remove TypeAnnotation
          - Rename ValueAnnotation to Annotation
          - Rename ValueTerm to Term and allow it to have any type.
          - Add an optional "AppliesTo" attribute to the <Term> element whose value is a comma-separated list of model elements to which the annotation may be applied, including "Property", "EntityType", "EntitySet", "ComplexType", or "Term".
          - Add a term to the Core vocabulary that allows marking a Term as "I'd like you to treat this as a type cast".
          ralfhandl Ralf Handl made changes -
          Status New [ 10000 ] Open [ 1 ]
          ralfhandl Ralf Handl made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          ralfhandl Ralf Handl made changes -
          Proposal - Remove TypeAnnotation
          - Rename ValueAnnotation to Annotation
          - Rename ValueTerm to Term and allow it to have any type.
          - Add an optional "AppliesTo" attribute to the <Term> element whose value is a comma-separated list of model elements to which the annotation may be applied, including "Property", "EntityType", "EntitySet", "ComplexType", or "Term".
          - Add a term to the Core vocabulary that allows marking a Term as "I'd like you to treat this as a type cast".
          - Remove TypeAnnotation
          - Rename ValueAnnotation to Annotation
          - Rename ValueTerm to Term and allow it to have any type.
          - Add an optional "AppliesTo" attribute to the <Term> element whose value is a comma-separated list of model elements to which the annotation may be applied, including "Property", "EntityType", "EntitySet", "ComplexType", or "Term".
          - Add a term to the Core vocabulary that allows marking a Term as "I'd like you to treat this as a type cast".

          Accepted: https://www.oasis-open.org/committees/download.php/48097/odata-meeting-23_on-20130130_31-F2F-minutes.html#odata-205

          Status Resolved [ 5 ] Applied [ 10002 ]
          ralfhandl Ralf Handl made changes -
          Status Applied [ 10002 ] Resolved [ 5 ]
          ralfhandl Ralf Handl made changes -
          Proposal - Remove TypeAnnotation
          - Rename ValueAnnotation to Annotation
          - Rename ValueTerm to Term and allow it to have any type.
          - Add an optional "AppliesTo" attribute to the <Term> element whose value is a comma-separated list of model elements to which the annotation may be applied, including "Property", "EntityType", "EntitySet", "ComplexType", or "Term".
          - Add a term to the Core vocabulary that allows marking a Term as "I'd like you to treat this as a type cast".

          Accepted: https://www.oasis-open.org/committees/download.php/48097/odata-meeting-23_on-20130130_31-F2F-minutes.html#odata-205

          - Remove TypeAnnotation
          - Rename ValueAnnotation to Annotation
          - Rename ValueTerm to Term and allow it to have any type.
          - Add an optional "AppliesTo" attribute to the <Term> element whose value is a whitespace-separated list of model elements to which the annotation may be applied, including "Property", "EntityType", "EntitySet", "ComplexType", or "Term".
          - Add a term to the Core vocabulary that allows marking a Term as "I'd like you to treat this as a type cast".

          Accepted: https://www.oasis-open.org/committees/download.php/48097/odata-meeting-23_on-20130130_31-F2F-minutes.html#odata-205
          ralfhandl Ralf Handl made changes -
          Assignee Ralf Handl [ ralfhandl ]
          handl Ralf Handl made changes -
          Reporter Ralf Handl [ ralfhandl ] Ralf Handl [ handl ]
          handl Ralf Handl made changes -
          Assignee Ralf Handl [ ralfhandl ] Ralf Handl [ handl ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: