OData (EDM) Components | Description |
Service | The simple OData Service which implements the Open Data Protocol (OData). |
Schema | The Schema(s) exposed by the OData service. The schema in XML language describes the service’s data in EDM terms. For example: <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm”> |
Namespace | The Namespace used by OData services when representing data in XML-based formats. The URI identifying the namespace is <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="services.odata.org.TripPin"> |
Version | The Version of the OData protocol required to consume the service. The supported OData protocol versions are 2.0 and 4.0. For example, <edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0"> |
EnumType | Enumeration Types (for example, PersonGender) represent a series of related values. Enumeration types expose the related values as members of the enumeration. The following example shows a simple enum for our sample TripPinService: <EnumType Name="PersonGender"> <Member Name="Male" Value="0"/> <Member Name="Female" Value="1"/> <Member Name="Unknown" Value="2"/> </EnumType> |
ComplexType | Complex Types are structured types (for example, City, Location, Airport Location and so on) consisting of a list of properties (for example, CountryRegion, Name, Address, and so on) but with no key, and thus can only exist as a property of a containing entity or as a temporary value. The following example shows a simple complex type for our sample TripPinService: <ComplexType Name="City"> <Property Name="CountryRegion" Type="Edm.String" Nullable="false"/> <Property Name="Name" Type="Edm.String" Nullable="false"/> <Property Name="Region" Type="Edm.String" Nullable="false"/> </ComplexType> |
EntityType | Entity Types (for example, Person, Airline and so on) are structured records consisting of named and typed properties and key properties whose values (for example, UserName, AirlineCode and so on) uniquely identify one instance from another. The following example shows a simple entity type for our sample TripPinService: <EntityType Name="Person" OpenType="true"> <Key> <PropertyRef Name="UserName"/> </Key> <Property Name="UserName" Type="Edm.String" Nullable="false"/> <Property Name="FirstName" Type="Edm.String" Nullable="false"/> <Property Name="LastName" Type="Edm.String" Nullable="false"/> <Property Name="Emails" Type="Collection (Edm.String)"/> </EntityType> |
Property | The Property element allows the construction of structural types from a single value or a collection of values. <Property Name="UserName" Type="Edm.String" Nullable="false"/> <Property Name="Emails" Type="Collection (Edm.String)"/> |
NavigationProperty | The Navigation Property allows navigation from an entity to related entities. In the following example, the Person entity type has the navigation properties, for example, Friends, Trips, and Photo: <EntityType Name="Person" OpenType="true"> ... <NavigationProperty Name="Friends" Type= "Collection(services.odata.org.TripPin.Person)"/> <NavigationProperty Name="Trips" Type= "Collection(services.odata.org.TripPin.Trip)" ContainsTarget="true"/> <NavigationProperty Name="Photo" Type= "services.odata.org.TripPin.Photo"/> </EntityType> |
EntityContainer | An Entity Container corresponds to a logical data store and contains zero or more entity sets and function imports. A full example of an entity container is as follows: <EntityContainer Name="DefaultContainer"> <EntitySet Name="Photos" EntityType="services.odata.org.TripPin.Photo"/> <EntitySet Name="People" EntityType="services.odata.org.TripPin.Person"/> <EntitySet Name="Airlines" EntityType="services.odata.org.TripPin.Airline"/> <FunctionImport Name="GetNearestAirport" Function="services.odata.org.TripPin.GetNearestAirport" <EntitySet="Airports" IncludeInServiceDocument="true"> </FunctionImport> </EntityContainer> |
EntitySet | An Entity Set element represents a single entity or a collection of entities of a specific entity type in the data model. For example, the entity set identified by the URI http://services.odata.org/V4/TripPinService/People('scottketchum')/Friends or the collection of entities identified by the "Friends" navigation property in http://services.odata.org/V4/TripPinService/People('scottketchum')/Friends('russellwhyte')/Trips identifies a feed of entries exposed by the OData service. |
Singleton | Singletons are single entities which are accessed as children of the entity container. A simple example of a singleton is as follows: <Singleton Name="Me" Type="services.odata. org.TripPin.Person"> <NavigationPropertyBinding Path="Friends" Target="People"/> <NavigationPropertyBinding Path="Photo" Target="Photos"/> </Singleton> |
FunctionImport | The Function Import element represents a Function in an entity model. A simple example of a Function Import is as follows: <FunctionImport Name="GetNearestAirport" Function="services.odata.org.TripPin.GetNearestAirport" EntitySet="Airports" IncludeInServiceDocument="true"> <Annotation Term="Org.OData.Core.V1.ResourcePath" String="services.odata.org.TripPin.GetNearestAirport"/> </FunctionImport> |
Function IsBound | The Function IsBound element denotes if the function is bound to a specific entity type in an entity model. A simple example of a Function IsBound is as follows: <Function Name="GetFavoriteAirline" IsBound="true" EntitySetPath="person/Trips/PlanItems/ Services.odata.org.TripPin.Flight/Airline" IsComposable="true"> <Parameter Name="person" Type="services.odata.org.TripPin.Person" Nullable="false"/> <ReturnType Type= "services.odata.org.TripPin.Airline" Nullable="false"/> </Function> |
Function Parameter | The Function Parameter element represents a parameter to the function. The following example demonstrates a Function that contains two parameters: <Function Name="GetNearestAirport" IsComposable="true"> <Parameter Name="lat" Type="Edm.Double" Nullable="false"/> <Parameter Name="lon" Type="Edm.Double" Nullable="false"/> <ReturnType Type="services.odata.org.TripPin.Airport" Nullable="false"/> </Function> |
ActionImport | The Action Import element represents an Action in an entity model. A simple example of an Action Import is as follows: <ActionImport Name="ResetDataSource" Action="services.odata.org.TripPin.ResetDataSource"/> |
Action IsBound | The Action IsBound element denotes if the action is bound to a specific entity type in an entity model. A simple example of an Action IsBound is as follows: <Action Name="ShareTrip" IsBound="true"> <Parameter Name="person" Type="services.odata.org.TripPin.Person" Nullable="false"/> <Parameter Name="userName" Type="Edm.String" Nullable="false"/> <Parameter Name="tripId" Type="Edm.Int32" Nullable="false"/> </Action> |
Note: | CentraSite supports OData versions 2.0 and 4.0. |
This EDM Component… | Is Referenced Using the OData Service Field… |
Service | OData Service The OData service is represented by an asset instance of the type OData Service in the CentraSite registry. |
Version | Version The OData version (for example, 2.0 or 4.0) is represented by the Version field in the OData API's Technical Details profile. |
EntityType | Entity Types The OData entity type (for example, Person) is represented by the Entity Types field in the Entity Sets. The Entity Types field is contained in the OData Resources profile. |
NavigationProperty | Navigation Properties The OData navigation property (for example, Friends, Trips, Photo) is represented as an OData Resource and denoted as OData Navigation Properties inside the OData Resources profile. |
EntityContainer | OData Service The OData entity container (for example, DefaultContainer) is represented by a collection of Attributes which hold data that is specific to the OData service. |
EntitySet | Entity Sets The OData entity set (for example, photos, people, airlines and so on) is represented as an OData Resource and denoted as OData Entity Sets inside the OData Resources profile. |
Singleton | Singletons The OData singleton (for example, Me) is represented as an OData Resource and denoted as OData Singletons inside the OData Resources profile. |
FunctionImport | Function Imports The OData function import (for example, GetNearestAirport) is represented as an OData Resource and denoted as OData Function Imports inside the OData Resources profile. |
Function Parameter | Resource Parameters The OData function parameter or action parameter (for example, person, trip) is represented as an OData Parameter and denoted as OData Parameter of the type Path inside the OData Resources profile. |
ActionImport | Action Imports The OData action import (for example, ResetDataSource) is represented as an OData Resource and denoted as OData Action Imports inside the OData Resources profile. |
OData Resource | Supported HTTP Methods |
Entity Sets Resource (collection) | GET POST |
Entity Sets Resource (single) | GET PUT PATCH DELETE |
Singletons Resource | GET PUT PATCH |
Function Imports Resource | GET |
Action Imports Resource | POST |
Navigation Properties Resource (collection) | GET POST |
Navigation Properties Resource (single) | GET PUT PATCH DELETE |