-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formally define OData Metamodel #288
Comments
A <EntityType Name="Employee">
<Key>
<PropertyRef Name="Name"/>
</Key>
<Property Name="Name" Type="Edm.String" Nullable="false"/>
</EntityType>
<EntityType Name="ReportingLine">
<Key>
<PropertyRef Name="ReportsTo/Name" Alias="Manager"/>
<PropertyRef Name="DirectReport/Name" Alias="Subordinate"/>
</Key>
<NavigationProperty Name="ReportsTo" Type="self.Employee"/>
<NavigationProperty Name="DirectReport" Type="self.Employee"/>
</EntityType> A $Version: '4.0'
Org.OData.Core.V1:
Description: &Core.Description
$Kind: Term
$Annotations:
- term: *Core.Description
value: A brief description of a model element
example.StructuralProperty:
Employee: &Employee
$Kind: EntityType
Name: &Name
$Key:
- finalSegmentStructuralProperty: *Name
ReportingLine: &ReportingLine
$Kind: EntityType
ReportsTo: &ReportsTo
$Kind: NavigationProperty
$Type: *Employee
DirectReport: &DirectReport
$Kind: NavigationProperty
$Type: *Employee
$Key:
- nonFinalSegments: [*ReportsTo]
finalSegmentStructuralProperty: *Name
alias: Manager
- nonFinalSegments: [*DirectReport]
finalSegmentStructuralProperty: *Name
alias: Subordinate
container: &container
$Kind: EntityContainer
Employees: &Employees
$Collection: true
$Type: *Employee
$NavigationPropertyBinding:
- finalSegmentNavigationProperty: *ReportsTo
target: *Employees
- finalSegmentNavigationProperty: *DirectReport
target: *Employees
$Annotations:
- target: [*Employee]
term: *Core.Description
value: Party to a contractual agreement regarding employment
$EntityContainer: *container Or they can be expressed in CSDL XML through additional ID attributes, see oasis-tcs/odata-openapi#291. |
About the comment from March 22. the standard says : "The value of Name is a path expression leading to a primitive property. The names of the properties in the path are joined together by forward slashes." the meta model would specify that it is a path starting with the containing EntityType followed by a sequence of Properties or NavigationProperties (connected via their referenced types) and ending in a PrimitiveType. In pseudo PGQL: the paths are visualized in the graph visualization through colored graph-paths |
About the comment from March 22. the standard says : "The value of Name is a path expression leading to a primitive property. The names of the properties in the path are joined together by forward slashes." the meta model would specify that it is a path starting with the containing EntityType followed by a sequence of Properties or NavigationProperties (via their types) and ending in a PrimitiveType. In pseudo PGQL: the paths are visualized in the graph visualization through colored graph-paths |
Various aspects of OData seem unclear or redundant. A formal UML model for the OData metamodel can be used to clarify and simplify OData.
The existing metamodel defined by 'MetadataService.xml' contains much of what is needed, but has some issues, such as:
The included proposal started from scratch out of a need to understand several concepts, including the semantics of Singletons and EntitySets. It needs to be rationalized with the existing 'MetadataService.xml' . It is preliminary and needs review and refinement. It is expressed in CSDL XML. (See https://www.oasis-open.org/apps/org/workgroup/odata/download.php/60420/OdataMetamodel.xml.) UML diagrams are provided that illustrate this proposal. (See: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/60421/OdataMetamodel.pdf)
An advantage of the UML model is that it expresses the Odata metamodel in precise terms. Constraints and requirements on the various elements of the model are expressed normatively using the UML model together with UML Object Constraing Language (OCL) statements. An added Term supports this.
The various schema definition languages CSDL XML, CSDL JSON, and others should conform to the OData metamodel.
Imported from ODATA-1062
The text was updated successfully, but these errors were encountered: