[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [OASIS Issue Tracker] Commented: (ODATA-12) create a data type for property names
[ http://tools.oasis-open.org/issues/browse/ODATA-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=31059#action_31059 ] Michael Pizzo commented on ODATA-12: ------------------------------------ Random thoughts: The reason this is not straightforward is that annotations are defined using the same entity model, and using the same type system, as the schema of the service. So adding a more specific type to the type system for the model element would either make that same type available for all schema usages (i.e., a "Customer" could have a property of type "Property") or cause special rules depending on how a defined type was used. One way to address this would be to use the built-in extensibility of the type system (the ability to define complex types) to define a core vocabulary containing a type ("OData.Model.Property") that represents a property, and use that type in the vocabulary. For example: <Schema Namespace="OData.Model"> <ComplexType Name="Property"> <Property Name="PropertyName" Type="String" Nullable="False"/> </ComplexType> //... </Schema> Then we could use it in a definition as: <Schema Namespace="OData.Temporal"> <ComplexType Name="Period"> <Property Name="StartPeriod" Type="ODataModel.Property" Nullable="False"/> <Property Name="EndPeriod" Type="ODataModel.Property" Nullable="False"/> </ComplexType> <ValueTerm Name="ApplicationPeriod" Type="Temporal.Period"> //... </Schema> And apply it as: <TypeAnnotation Term="Temporal.ApplicationPeriod"> <Record Type="Temporal.Period"> <PropertyValue Name="StartPeriod"> <Record Type="OData.Model.Property"> <PropertyValue Name="PropertyName" String="bus_start" /> </Record> </PropertyValue> <PropertyValue Name="EndPeriod"> <Record Type="OData.Model.Property"> <PropertyValue Name="PropertyName" String="bus_end" /> </Record> </PropertyValue> </Record> </TypeAnnotation> It's obviously more verbose than just specifying a "ModelProperty" type, but it does convey the intention without convoluting the type system. Perhaps we could work on shortcuts for expressing the same semantics as above. > create a data type for property names > ------------------------------------- > > Key: ODATA-12 > URL: http://tools.oasis-open.org/issues/browse/ODATA-12 > Project: OASIS Open Data Protocol (OData) TC > Issue Type: Improvement > Components: OData CSDL v1.0 > Reporter: Andrew Eisenberg > Assignee: Michael Pizzo > Priority: Minor > > The Edm.String data type can be used to define a type annotation property when the property will hold the name of some other property. A more specific data type could be added to OData for this purpose. > In the OData Extension for Temporal Data we suggested this annotation: > <TypeAnnotation Term="Temporal.ApplicationPeriod"> > <PropertyValue Name="StartPeriod" String="bus_start" /> > <PropertyValue Name="EndPeriod" String="bus_end" /> > </TypeAnnotation> > Instead of declaring StartPeriod and EndPeriod to be of type String, we could declare them to be of type PropertyName. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]