Search notes:

OData-Service-Root/$metadata

service/$metadata returns a CDSL XML document that describes the services offered by a particular OData installation. The document might also reference other CDSL documents.
The returned XML document is a an EDMX document.
The root element of this EDMX document is an <edmx:Edmx> element.
The root element contains zero or more <edmx:Reference> or <edmx:Annotationsreference> subelements in any order.
The root element contains exactly one <edmx:DataServices> element which must appear after any <edmx:Reference> or <edmx:Annotationsreference> element.
The <edxm:DataServices> element contains zero or more <Schema> elements. These <Schema>` elements specify Entity Data Model conceptual Schemas. (See MC-CSDL: Conceptual Schema Definition File Format)
An <edmx:Reference> element allows to reference other EDMX documents or Entity Data Model (EDM) conceptual schemas:
  <edmx:Reference Uri="http://vocabularies.odata.org/OData.Community.Keys.V1.xml">
    <edmx:Include Namespace="OData.Community.Keys.V1" Alias="Keys" />
    <edmx:IncludeAnnotations TermNamespace="OData.Community.Keys.V1" />
  </edmx:Reference>

  <edmx:Reference Url="http://www.tq84.xy/a-model.edmx"       />

 < edmx:Reference Url="http://www.tq84.xy/another-model.csdl" />
An <edmx:AnnotationsReference> element allows to reference annotations which are specified in another EDMX document or another Entity Data Model (EDM) conceptual schema.
A <Schema> element roughly follows the following structure:
<Schema>
   <Using/>
   <Using/>
   <Annotations />
   <ValueTerm />
 
   <EntityType/>
   <EntityType/>
   <ComplexType/>
 
   <Association/>
   <Association/>
   <Function/>
   <Function/>
   <EntityContainer>
      <EntitySet/>
      <EntitySet/>
 
      <AssociationSet/>
      <AssociationSet/>
 
      <FunctionImport/>
      <FunctionImport/>
   </EntityContainer>
   <EntityContainer/>
</Schema>
<?xml version="1.o" encoding="utf-8"?>
<edmx:Edmx
  Version="4.0"
  xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">

  <edmx:DataServices>

    <Schema Namespace="Microsoft.Dynamics.CRM" Alias="mscrm" xmlns="http://docs.oasis-open.org/odata/ns/edm">

      <EntityType Name="ParentTable">
  
         <Key>
           <PropertyRef Name="id">
         </Key>
  
         <Property
            Name = "id"
            Type = "Edm.Guid"
         >
            <Annotation Term="Org.OData.Core.V1.Description" String="Unique id for parent table"/>
         </Property>

         <Property
            Name     = "value_one"
            Type     = "Edm.String"
            Nullable = "True"
         >
         </Property>
  
         <NavigationProperty
           Name    = "parent_child"
           Type    = "Collection(ChildTable)
           Partner = "nav_Partner"/>
  
  
      </EntityType>
  
      <EntityType Name="ChildTable">
  
         <Key>
           <PropertyRef Name="id">
         </Key>
  
         <Property
            Name = "id"
            Type = "Edm.Guid">
            <Annotation Term="Org.OData.Core.V1.Description" String="Unique id for child table"/>
         </Property>
  
         <Property
            Name = "parent_id"
            Type = "Edm.Guid">
  
         </Propert>
  
         <NavigationProperty
           Name     = "nav_Partner"
           Type     = "ParentTable"
           Nullable = "false"
           Partner  = "parent_child">
  
           <ReferentialConstraint
             Property           = "parent_id"
             ReferencedProperty = "id"
           />
  
         </NavigationProperty>
      </EntityType>
    </Schema>

  </edmx:DataServices>
</edmx:Edmx>

See also

OData Web API

Index