odata.net icon indicating copy to clipboard operation
odata.net copied to clipboard

Enable Base term for IEdmTerm

Open xuzhg opened this issue 4 years ago • 3 comments

Issues

This pull request fixes issue #1955. & #1816

Description

*14.1.1 Specialized Term

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

When applying a term with a base 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

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

This PR is to enable the base term.

Checklist (Uncheck if it is not completed)

  • [x] Test cases added
  • [x] Build and test with one-click build and test script passed

Additional work necessary

If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.

xuzhg avatar Dec 17 '20 19:12 xuzhg

What are the ramifications of introducing a base Term? Do consumers of the API need to do anything different?

i.e., for structured types, a base type implies that all of the properties of the base type are available on the derived type. a client that looks only at the declared properties of the derived type will miss the properties inherited from the base type.

Are there similar ramifications for consumers of a derived term?

mikepizzo avatar Dec 17 '20 21:12 mikepizzo

public interface IEdmTerm : IEdmSchemaElement

Need to update public api


Refers to: src/Microsoft.OData.Edm/Vocabularies/Annotations/IEdmTerm.cs:12 in 22945d8. [](commit_id = 22945d8514b5d8ab3b0ae247b7f3a4a4655a7ef6, deletion_comment = False)

mikepizzo avatar Dec 17 '20 21:12 mikepizzo

Quick answer is that" It's the same usage of "Base type" and "Base Term".

When we create the annotation, we can create the PropertyValue for the "Property" defined in the base term. However, OData.Edm lib doesn't have the process to verify that "PropertyName" of the Record is defined or not. Let me add a test case to cover it.


In reply to: 747701313 [](ancestors = 747701313)

xuzhg avatar Dec 17 '20 21:12 xuzhg