OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] (ODATA-696) Support "interfaces" for casting entities to multiple different types


     [ https://issues.oasis-open.org/browse/ODATA-696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Pizzo updated ODATA-696:
--------------------------------

    Proposal: 
Services MAY support casting any entity type, complex type, primitive type, or type definition to a type outside of the type hierarchy, following standard cast semantics including path constructs in URLs. If an instance of the type doesn't support the cast, a null is returned.

The target type of the cast may have some or no properties in common with the source type, and properties with the same name may have different values and even different types. 

If casting to an entity type, the entity type may have an entity key which may or may not match the entity key of the type that implements it.

A new term is added to the Core vocabulary to advertise the set of types outside of the type hierarchy that a type may be cast to:

<Term Name="MayImplement" Type="String">
  <Annotation Term="Core.Description" 
              String="A space-delimited list of types that this type can be cast to."/>
</Term>

Services MUST support casting instances of the annotated type to the target type(s) using existing cast segments and semantics. If an instance of the type doesn't support the cast, the cast results in a null value.

Open a new issue to consider structural casting.

  was:
Services MAY support casting any entity type, complex type, primitive type, or type definition to a type outside of the type hierarchy, following standard cast semantics including path constructs in URLs. If an instance of the type doesn't support the cast, a null is returned.

The target type of the cast may have some or no properties in common with the source type, and properties with the same name may have different values and even different types. 

If casting to an entity type, the entity type may have an entity key which may or may not match the entity key of the type that implements it.

A new term is added to the Core vocabulary to advertise the set of types outside of the type hierarchy that a type may be cast to:

<Term Name="MayImplement" Type="String">
  <Annotation Term="Core.Description" 
              String="A space-delimited list of types that this type can be cast to."/>
</Term>

Services MUST support casting instances of the annotated type to the target type(s) using existing cast segments and semantics. If an instance of the type doesn't support the cast, the cast results in a null value.


> Support "interfaces" for casting entities to multiple different types
> ---------------------------------------------------------------------
>
>                 Key: ODATA-696
>                 URL: https://issues.oasis-open.org/browse/ODATA-696
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Bug
>          Components: OData CSDL, OData URL Conventions, Vocabularies
>    Affects Versions: V4.0_OS
>         Environment: Interfaces
>            Reporter: Michael Pizzo
>            Assignee: Michael Pizzo
>            Priority: Minor
>              Labels: Extension, GoodIdea
>             Fix For: V4.01_WD01
>
>
> OData's single-inheritance type model works well for many types of ontologies where new types are specializations of existing types, and maps well to class definitions in popular programming languages. However, single inheritance does not describe the fact that an instance of a type can play multiple different roles.
> Vocabularies were introduced to OData in order to enable the definition of common schemas that could be shared across a particular industry or enterprise. Vocabularies allow the ability to share semantic information, such as the fact that a particular instance represents some generic concept.
> Entity models can use these shared schema in defining a data model, for example through derivation, or can map properties of a defined entity to properties of an entity from a shared model. However, we don't have a common way for a service to specify that an entity can be treated (i.e., cast) to another entity outside of the single-inheritance hierarchy, and requiring inheritance to model ontologies is overly restrictive in many cases. Also, some ontologies (like schema.org) make use of multiple inheritance, making it difficult for an entity to derive, for example, from both an individual and an organization.
> Odata defines clear semantics for casting entities of one type to a different type in requests urls, filters, etc. Services can support casting instances to any type, but can currently only advertise the ability to cast to a single (derived) type.
> Adding a new "implements" annotation term to the Core vocabulary allows a service to advertise the fact that one type can be cast to one or more other types using existing cast rules. This rule is entirely backward compatible; it doesn't introduce any incompatible behavior and is entirely safe for a client to ignore.



--
This message was sent by Atlassian JIRA
(v6.2.2#6258)


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]