<?xml version="1.0" encoding="utf-8"?>
<!--

  Technical Committee:
  OASIS Open Data Protocol (OData) TC
  https://www.oasis-open.org/committees/odata

  Chairs:
  - Ralf Handl (ralf.handl@sap.com), SAP SE
  - Michael Pizzo (mikep@microsoft.com), Microsoft

  Editors:
  - Ralf Handl (ralf.handl@sap.com), SAP SE
  - Hubert Heijkers (hubert.heijkers@nl.ibm.com), IBM
  - Gerald Krause (gerald.krause@sap.com), SAP SE
  - Michael Pizzo (mikep@microsoft.com), Microsoft
  - Heiko Theißen (heiko.theissen@sap.com), SAP SE
  - Martin Zurmuehl (martin.zurmuehl@sap.com), SAP SE

  Additional artifacts:
  This vocabulary is one component of a Work Product that also includes the following vocabulary components:
  - OData Core Vocabulary. Latest version: https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml.
  - OData Measures Vocabulary. Latest version: https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Measures.V1.xml.
  - OData Capabilities Vocabulary. Latest version: https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Capabilities.V1.xml.
  - OData Validation Vocabulary. Latest version: https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Validation.V1.xml.
  - OData Aggregation Vocabulary. Latest version: https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Aggregation.V1.xml.
  - OData Authorization Vocabulary. Latest version: https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Authorization.V1.xml.

  Related work:
  This vocabulary replaces or supersedes:
  - OData Extension for Data Aggregation Version 4.0 Aggregation Vocabulary.
  This vocabulary is related to:
  - OData Version 4.01 Part 1: Protocol. Latest version: http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html.
  - OData Version 4.01 Part 2: URL Conventions. Latest version: http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html.
  - OData Common Schema Definition Language (CSDL) JSON Representation Version 4.01. Latest version: http://docs.oasis-open.org/odata/odata-csdl-json/v4.01/odata-csdl-json-v4.01.html.
  - OData Common Schema Definition Language (CSDL) XML Representation Version 4.01. Latest version: http://docs.oasis-open.org/odata/odata-csdl-xml/v4.01/odata-csdl-xml-v4.01.html.
  - OData JSON Format Version 4.01. Latest version: http://docs.oasis-open.org/odata/odata-json-format/v4.01/odata-json-format-v4.01.html.
  - OData Extension for Data Aggregation Version 4.0. Latest version: http://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/odata-data-aggregation-ext-v4.0.html.

  Abstract:
  This vocabulary defines terms to describe which data in a given entity model can be aggregated, and how.

-->
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.01">
  <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml">
    <edmx:Include Namespace="Org.OData.Core.V1" Alias="Core" />
  </edmx:Reference>
  <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Validation.V1.xml">
    <edmx:Include Namespace="Org.OData.Validation.V1" Alias="Validation" />
  </edmx:Reference>
  <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Capabilities.V1.xml">
    <edmx:Include Namespace="Org.OData.Capabilities.V1" Alias="Capabilities" />
  </edmx:Reference>
  <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Validation.V1.xml">
    <edmx:Include Namespace="Org.OData.Validation.V1" Alias="Validation" />
  </edmx:Reference>
  <edmx:DataServices>
    <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Org.OData.Aggregation.V1" Alias="Aggregation">
      <Annotation Term="Core.Description">
        <String>Terms to describe which data in a given entity model can be aggregated, and how.</String>
      </Annotation>
      <Annotation Term="Core.LongDescription">
        <String>Related to the specification document [OData-Data-Agg-v4.0](http://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/odata-data-aggregation-ext-v4.0.html).</String>
      </Annotation>
      <Annotation Term="Core.Links">
        <Collection>
          <Record>
            <PropertyValue Property="rel" String="latest-version" />
            <PropertyValue Property="href" String="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Aggregation.V1.xml" />
          </Record>
          <Record>
            <PropertyValue Property="rel" String="alternate" />
            <PropertyValue Property="href" String="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Aggregation.V1.json" />
          </Record>
          <Record>
            <PropertyValue Property="rel" String="describedby" />
            <PropertyValue Property="href" String="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Aggregation.V1.md" />
          </Record>
        </Collection>
      </Annotation>

      <Term Name="ApplySupported" Type="Aggregation.ApplySupportedType" Nullable="false" AppliesTo="EntitySet Collection EntityType">
        <Annotation Term="Core.AppliesViaContainer" />
        <Annotation Term="Core.Description">
          <String>This entity set or collection supports the `$apply` system query option</String>
        </Annotation>
      </Term>
      <Term Name="ApplySupportedDefaults" Type="Aggregation.ApplySupportedBase" Nullable="false" AppliesTo="EntityContainer">
        <Annotation Term="Core.Description">
          <String>Default support of the `$apply` system query option for all collection-valued resources in the container</String>
        </Annotation>
        <Annotation Term="Core.LongDescription">
          <String>Annotating term [`ApplySupported`](#ApplySupported) for a specific collection-valued resource overrides the default support with the specified properties using PATCH semantics:
- Primitive or collection-valued properties specified in `ApplySupported` replace the corresponding properties specified in `ApplySupportedDefaults`
- Complex-valued properties specified in `ApplySupported` override the corresponding properties specified in `ApplySupportedDefaults` using PATCH semantics recursively
- Properties specified neither in `ApplySupported` nor in `ApplySupportedDefaults` have their default value</String>
        </Annotation>
      </Term>
      <ComplexType Name="ApplySupportedBase">
        <Annotation Term="Core.LongDescription">
          <String>Services that do not fully implement a certain aggregation-related functionality may document
          this by annotating the [`ApplySupported`](#ApplySupported) or [`ApplySupportedDefaults`](#ApplySupportedDefaults)
          annotation with a description.</String>
        </Annotation>
        <Property Name="Transformations" Type="Collection(Aggregation.Transformation)" Nullable="false">
          <Annotation Term="Core.Description" String="Transformations that can be used in `$apply`" />
        </Property>
        <Property Name="CustomAggregationMethods" Type="Collection(Edm.String)" Nullable="false">
          <Annotation Term="Core.Description" String="Qualified names of custom aggregation methods that can be used in `aggregate(...with...)`" />
        </Property>
        <Property Name="Rollup" Nullable="false" DefaultValue="None" Type="Aggregation.RollupType">
          <Annotation Term="Core.Description" String="The service supports rollup hierarchies in a `groupby` transformation" />
        </Property>
        <Property Name="From" Nullable="false" DefaultValue="false" Type="Edm.Boolean">
          <Annotation Term="Core.Description" String="The service supports the `from` keyword in an `aggregate` transformation" />
        </Property>
      </ComplexType>
      <ComplexType Name="ApplySupportedType" BaseType="Aggregation.ApplySupportedBase">
        <Property Name="PropertyRestrictions" Nullable="false" DefaultValue="false" Type="Edm.Boolean">
          <Annotation Term="Core.Revisions">
            <Collection>
              <Record>
                <PropertyValue Property="Kind" EnumMember="Core.RevisionKind/Deprecated" />
                <PropertyValue Property="Description" String="Deprecated since [`Groupable`](#Groupable) and [`Aggregatable`](#Aggregatable) are deprecated" />
              </Record>
            </Collection>
          </Annotation>
          <Annotation Term="Core.Description" String="Only properties marked as `Groupable` can be used in the `groupby` transformation, and only those marked as `Aggregatable` can be used in the  `aggregate` transformation" />
        </Property>
        <Property Name="GroupableProperties" Type="Collection(Edm.AnyPropertyPath)" Nullable="false">
          <Annotation Term="Core.Description" String="A non-empty collection indicates that only the listed properties of the annotated target are supported by the `groupby` transformation" />
        </Property>
        <Property Name="AggregatableProperties" Type="Collection(Aggregation.AggregatablePropertyType)" Nullable="false">
          <Annotation Term="Core.Description" String="A non-empty collection indicates that only the listed properties of the annotated target can be used in the `aggregate` transformation, optionally restricted to the specified aggregation methods" />
        </Property>
      </ComplexType>
      <ComplexType Name="AggregatablePropertyType">
        <Property Name="Property" Type="Edm.PropertyPath" Nullable="false">
          <Annotation Term="Core.Description">
            <String>Aggregatable property</String>
          </Annotation>
        </Property>
        <Property Name="SupportedAggregationMethods" Type="Collection(Aggregation.AggregationMethod)" Nullable="false">
          <Annotation Term="Core.Description">
            <String>Standard and custom aggregation methods that can be applied to the property. If omitted, all aggregation methods can be applied</String>
          </Annotation>
        </Property>
        <Property Name="RecommendedAggregationMethod" Type="Aggregation.AggregationMethod">
          <Annotation Term="Core.Description">
            <String>Recommended method for aggregating values of the property</String>
          </Annotation>
        </Property>
      </ComplexType>

      <TypeDefinition Name="Transformation" UnderlyingType="Edm.String">
        <Annotation Term="Core.Description" String="A transformation that can be used in `$apply`" />
        <Annotation Term="Validation.AllowedValues">
          <Collection>
            <Record>
              <PropertyValue Property="Value" String="aggregate" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.2.1" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="groupby" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.2.3" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="concat" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.2.2" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="identity" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.4.1" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="filter" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.3.2" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="search" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.3.4" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="nest" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.5.2" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="addnested" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.4.3" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="join" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.5.1" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="outerjoin" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.5.1" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="compute" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.4.2" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="bottomcount" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.3.1.1" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="bottomsum" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.3.1.3" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="bottompercent" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.3.1.2" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="topcount" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.3.1.1" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="topsum" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.3.1.3" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="toppercent" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.3.1.2" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="orderby" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.3.3" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="top" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.3.6" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="skip" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 3.3.5" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="ancestors" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 6.2.1" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="descendants" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 6.2.1" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="traverse" />
              <Annotation Term="Core.Description" String="OData-Data-Agg-v4.0, section 6.2.2" />
            </Record>
          </Collection>
        </Annotation>
      </TypeDefinition>

      <TypeDefinition Name="AggregationMethod" UnderlyingType="Edm.String">
        <Annotation Term="Core.Description">
          <String>Standard or custom aggregation method</String>
        </Annotation>
        <Annotation Term="Core.LongDescription">
          <String>Custom aggregation methods MUST use a namespace-qualified name, that is contain at least one dot. </String>
        </Annotation>
        <Annotation Term="Validation.AllowedValues">
          <Collection>
            <Record>
              <PropertyValue Property="Value" String="sum" />
              <Annotation Term="Core.Description" String="Can be applied to numeric values to return the sum of the non-null values, or null if there are no non-null values or the input set is empty" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="min" />
              <Annotation Term="Core.Description" String="Can be applied to values with a totally ordered domain to return the smallest of the non-null values, or null if there are no non-null values or the input set is empty" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="max" />
              <Annotation Term="Core.Description" String="Can be applied to values with a totally ordered domain to return the largest of the non-null values, or null if there are no non-null values or the input set is empty" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="average" />
              <Annotation Term="Core.Description" String="Can be applied to numeric values to return the sum of the non-null values divided by the count of the non-null values, or null if there are no non-null values or the input set is empty" />
            </Record>
            <Record>
              <PropertyValue Property="Value" String="countdistinct" />
              <Annotation Term="Core.Description" String="Counts the distinct values, omitting any null values" />
              <Annotation Term="Core.LongDescription">
                <String>For navigation properties, it counts the distinct entities in the union of all entities related to entities in the input set. 
                  For collection-valued primitive properties, it counts the distinct items in the union of all collection values in the input set.</String>
              </Annotation>
            </Record>
          </Collection>
        </Annotation>
      </TypeDefinition>

      <EnumType Name="RollupType">
        <Annotation Term="Core.Description" String="The number of `rollup` or `rolluprecursive` operators allowed in a `groupby` transformation" />
        <Member Name="None">
          <Annotation Term="Core.Description" String="No support for `rollup` or `rolluprecursive`" />
        </Member>
        <Member Name="SingleHierarchy">
          <Annotation Term="Core.Description" String="Only one `rollup` or `rolluprecursive` operator per `groupby`" />
        </Member>
        <Member Name="MultipleHierarchies">
          <Annotation Term="Core.Description" String="Full support for `rollup` and `rolluprecursive`" />
        </Member>
      </EnumType>

      <Term Name="Groupable" Type="Core.Tag" Nullable="false" DefaultValue="true" AppliesTo="Property NavigationProperty">
        <Annotation Term="Core.Revisions">
          <Collection>
            <Record>
              <PropertyValue Property="Kind" EnumMember="Core.RevisionKind/Deprecated" />
              <PropertyValue Property="Description" String="Deprecated in favor of [`ApplySupported/GroupableProperties`](#ApplySupported)" />
            </Record>
          </Collection>
        </Annotation>
        <Annotation Term="Core.Description" String="This property can be used in the `groupby` transformation" />
      </Term>

      <Term Name="Aggregatable" Type="Core.Tag" Nullable="false" DefaultValue="true" AppliesTo="Property NavigationProperty">
        <Annotation Term="Core.Revisions">
          <Collection>
            <Record>
              <PropertyValue Property="Kind" EnumMember="Core.RevisionKind/Deprecated" />
              <PropertyValue Property="Description" String="Deprecated in favor of [`ApplySupported/AggregatableProperties`](#ApplySupported)" />
            </Record>
          </Collection>
        </Annotation>
        <Annotation Term="Core.Description" String="This property can be used in the `aggregate` transformation" />
      </Term>

      <Term Name="CustomAggregate" Type="Edm.String" Nullable="false" AppliesTo="EntitySet Collection EntityContainer EntityType">
        <Annotation Term="Core.AppliesViaContainer" />
        <Annotation Term="Core.Description" String="Dynamic property that can be used in the `aggregate` transformation" />
        <Annotation Term="Core.LongDescription" String="This term MUST be applied with a Qualifier, the Qualifier value is the name of the dynamic property. The value of the annotation MUST be the qualified name of a primitive type. The aggregated value will be of that type." />
      </Term>

      <Term Name="ContextDefiningProperties" Type="Collection(Edm.PropertyPath)" Nullable="false" AppliesTo="Property Annotation">
        <Annotation Term="Core.Description" String="The annotated property or custom aggregate is only well-defined in the context of these properties" />
        <Annotation Term="Core.LongDescription">
          <String>The context-defining properties need either be part of the result entities, or be restricted to a single value by a pre-filter operation. Examples are postal codes within a country, or monetary amounts whose context is the unit of currency.</String>
        </Annotation>
      </Term>

      <Term Name="LeveledHierarchy" Type="Collection(Edm.PropertyPath)" Nullable="false" AppliesTo="EntityType ComplexType">
        <Annotation Term="Core.Description" String="Defines a leveled hierarchy (OData-Data-Agg-v4.0, section 5.5.1)" />
      </Term>

      <Term Name="RecursiveHierarchy" Type="Aggregation.RecursiveHierarchyType" Nullable="false" AppliesTo="EntityType">
        <Annotation Term="Core.Description" String="Defines a recursive hierarchy (OData-Data-Agg-v4.0, section 5.5.2)" />
      </Term>

      <ComplexType Name="RecursiveHierarchyType">
        <Property Name="NodeProperty" Type="Edm.PropertyPath" Nullable="false">
          <Annotation Term="Core.Description" String="Primitive property holding the node identifier" />
        </Property>
        <Property Name="ParentNavigationProperty" Type="Edm.NavigationPropertyPath" Nullable="false">
          <Annotation Term="Core.Description" String="Property for navigating to the parent node(s). Its type MUST be the entity type annotated with this term, and it MUST be collection-valued or nullable single-valued." />
        </Property>
      </ComplexType>

      <TypeDefinition Name="HierarchyQualifier" UnderlyingType="Edm.String">
        <Annotation Term="Core.Description" String="Qualifier of a [`RecursiveHierarchy`](#RecursiveHierarchy) annotation" />
        <Annotation Term="Core.LongDescription">
          <String>Every recursive hierarchy function defined in this vocabulary has
- a parameter `HierarchyQualifier` of this type and
- a parameter `HierarchyNodes` that is a collection of entities of a common type without multiple occurrences of the same entity.

`HierarchyQualifier` is the qualifier of a `RecursiveHierarchy` annotation on the entity type of the collection
given by the `HierarchyNodes` parameter. This specifies a recursive hierarchy that is evaluated by the function.</String>
        </Annotation>
      </TypeDefinition>

      <Function Name="isnode">
        <Annotation Term="Core.Description" String="Is the entity a node of the hierarchy specified by the [parameter pair](#HierarchyQualifier) (`HierarchyNodes`, `HierarchyQualifier`)? (See OData-Data-Agg-v4.0, section 5.5.2.1)" />
        <Annotation Term="Core.LongDescription" String="If a node identifier passed to the function is null, the function returns null." />
        <Parameter Name="HierarchyNodes" Type="Collection(Edm.EntityType)" Nullable="false">
          <Annotation Term="Core.Description" String="A collection, given through a `$root` expression" />
        </Parameter>
        <Parameter Name="HierarchyQualifier" Type="Aggregation.HierarchyQualifier" Nullable="false" />
        <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="true">
          <Annotation Term="Core.Description" String="Node identifier of the putative node" />
        </Parameter>
        <ReturnType Type="Edm.Boolean" Nullable="true" />
      </Function>

      <Function Name="isroot">
        <Annotation Term="Core.Description" String="Is the entity a root node of the hierarchy specified by the [parameter pair](#HierarchyQualifier) (`HierarchyNodes`, `HierarchyQualifier`)?" />
        <Annotation Term="Core.LongDescription" String="If a node identifier passed to the function is null, the function returns null." />
        <Parameter Name="HierarchyNodes" Type="Collection(Edm.EntityType)" Nullable="false">
          <Annotation Term="Core.Description" String="A collection, given through a `$root` expression" />
        </Parameter>
        <Parameter Name="HierarchyQualifier" Type="Aggregation.HierarchyQualifier" Nullable="false" />
        <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="true">
          <Annotation Term="Core.Description" String="Node identifier of the putative root" />
        </Parameter>
        <ReturnType Type="Edm.Boolean" Nullable="true" />
      </Function>

      <Function Name="isdescendant">
        <Annotation Term="Core.Description" String="Is the entity a descendant node of the ancestor node in the hierarchy specified by the [parameter pair](#HierarchyQualifier) (`HierarchyNodes`, `HierarchyQualifier`) with at most the specified distance? (See OData-Data-Agg-v4.0, section 5.5.2.1)" />
        <Annotation Term="Core.LongDescription" String="If a node identifier passed to the function is null, the function returns null." />
        <Parameter Name="HierarchyNodes" Type="Collection(Edm.EntityType)" Nullable="false">
          <Annotation Term="Core.Description" String="A collection, given through a `$root` expression" />
        </Parameter>
        <Parameter Name="HierarchyQualifier" Type="Aggregation.HierarchyQualifier" Nullable="false" />
        <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="true">
          <Annotation Term="Core.Description" String="Node identifier of the putative descendant" />
        </Parameter>
        <Parameter Name="Ancestor" Type="Edm.PrimitiveType" Nullable="true">
          <Annotation Term="Core.Description" String="Node identifier of the ancestor node" />
        </Parameter>
        <Parameter Name="MaxDistance" Type="Edm.Int16" Nullable="false">
          <Annotation Term="Core.OptionalParameter">
            <Record>
              <PropertyValue Property="DefaultValue" String="32767" />
            </Record>
          </Annotation>
          <Annotation Term="Validation.Minimum" Int="1" />
        </Parameter>
        <Parameter Name="IncludeSelf" Type="Edm.Boolean" Nullable="false">
          <Annotation Term="Core.Description" String="Whether to include the node itself in the result" />
          <Annotation Term="Core.OptionalParameter">
            <Record>
              <PropertyValue Property="DefaultValue" String="false" />
            </Record>
          </Annotation>
        </Parameter>
        <ReturnType Type="Edm.Boolean" Nullable="true" />
      </Function>

      <Function Name="isancestor">
        <Annotation Term="Core.Description" String="Is the entity an ancestor node of the descendant node in the hierarchy specified by the [parameter pair](#HierarchyQualifier) (`HierarchyNodes`, `HierarchyQualifier`) with at most the specified distance? (See OData-Data-Agg-v4.0, section 5.5.2.1)" />
        <Annotation Term="Core.LongDescription" String="If a node identifier passed to the function is null, the function returns null." />
        <Parameter Name="HierarchyNodes" Type="Collection(Edm.EntityType)" Nullable="false">
          <Annotation Term="Core.Description" String="A collection, given through a `$root` expression" />
        </Parameter>
        <Parameter Name="HierarchyQualifier" Type="Aggregation.HierarchyQualifier" Nullable="false" />
        <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="true">
          <Annotation Term="Core.Description" String="Node identifier of the putative ancestor" />
        </Parameter>
        <Parameter Name="Descendant" Type="Edm.PrimitiveType" Nullable="true">
          <Annotation Term="Core.Description" String="Node identifier of the descendant node" />
        </Parameter>
        <Parameter Name="MaxDistance" Type="Edm.Int16" Nullable="false">
          <Annotation Term="Core.OptionalParameter">
            <Record>
              <PropertyValue Property="DefaultValue" String="32767" />
            </Record>
          </Annotation>
          <Annotation Term="Validation.Minimum" Int="1" />
        </Parameter>
        <Parameter Name="IncludeSelf" Type="Edm.Boolean" Nullable="false">
          <Annotation Term="Core.Description" String="Whether to include the node itself in the result" />
          <Annotation Term="Core.OptionalParameter">
            <Record>
              <PropertyValue Property="DefaultValue" String="false" />
            </Record>
          </Annotation>
        </Parameter>
        <ReturnType Type="Edm.Boolean" Nullable="true" />
      </Function>

      <Function Name="issibling">
        <Annotation Term="Core.Description" String="Is the entity a sibling node of the other node in the hierarchy specified by the [parameter pair](#HierarchyQualifier) (`HierarchyNodes`, `HierarchyQualifier`)? (See OData-Data-Agg-v4.0, section 5.5.2.1)" />
        <Annotation Term="Core.LongDescription" String="A node is not a sibling of itself. If a node identifier passed to the function is null, the function returns null." />
        <Parameter Name="HierarchyNodes" Type="Collection(Edm.EntityType)" Nullable="false">
          <Annotation Term="Core.Description" String="A collection, given through a `$root` expression" />
        </Parameter>
        <Parameter Name="HierarchyQualifier" Type="Aggregation.HierarchyQualifier" Nullable="false" />
        <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="true">
          <Annotation Term="Core.Description" String="Node identifier of the putative sibling" />
        </Parameter>
        <Parameter Name="Other" Type="Edm.PrimitiveType" Nullable="true">
          <Annotation Term="Core.Description" String="Node identifier of the other node" />
        </Parameter>
        <ReturnType Type="Edm.Boolean" Nullable="true" />
      </Function>

      <Function Name="isleaf">
        <Annotation Term="Core.Description" String="Is the entity a leaf node in the hierarchy specified by the [parameter pair](#HierarchyQualifier) (`HierarchyNodes`, `HierarchyQualifier`)? (See OData-Data-Agg-v4.0, section 5.5.2.1)" />
        <Annotation Term="Core.LongDescription" String="If a node identifier passed to the function is null, the function returns null." />
        <Parameter Name="HierarchyNodes" Type="Collection(Edm.EntityType)" Nullable="false">
          <Annotation Term="Core.Description" String="A collection, given through a `$root` expression" />
        </Parameter>
        <Parameter Name="HierarchyQualifier" Type="Aggregation.HierarchyQualifier" Nullable="false" />
        <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="true">
          <Annotation Term="Core.Description" String="Node identifier of the putative leaf" />
        </Parameter>
        <ReturnType Type="Edm.Boolean" Nullable="true" />
      </Function>

      <Function Name="rollupnode">
        <Annotation Term="Core.Description" String="During `rolluprecursive` for a hierarchy node, this function returns the node" />
        <Annotation Term="Core.LongDescription">
          <String>This function may only occur in the second parameter of a `groupby` transformation whose first parameter
contains `rolluprecursive(...)`. It is evaluated as part of the transformation `R(x)` in the "`rolluprecursive` algorithm"
(OData-Data-Agg-v4.0, section 6.3). Its behavior is undefined outside of this algorithm.
```
Sales?$apply=groupby((rolluprecursive(...)), filter(SalesOrganization eq Aggregation.rollupnode())/aggregate(...))
```
constructs a rollup that contains aggregates per hierarchy node while excluding descendants from the aggregation.</String>
        </Annotation>
        <Parameter Name="Position" Type="Edm.Int16" Nullable="false">
          <Annotation Term="Core.Description" String="Position N among the `rolluprecursive` operators in the first argument of `groupby`" />
          <Annotation Term="Core.LongDescription">
            <String>Every instance in the output set of a `groupby` transformation with M `rolluprecursive` operators
            has M relationships to M nodes in M recursive hierarchies. This function returns the node x with path r to the root
            in relationship number N.
            If several such `groupby` transformations are nested, this function refers to the innermost one.</String>
          </Annotation>
          <Annotation Term="Core.OptionalParameter">
            <Record>
              <PropertyValue Property="DefaultValue" String="1" />
            </Record>
          </Annotation>
          <Annotation Term="Validation.Minimum" Int="1" />
        </Parameter>
        <ReturnType Type="Edm.EntityType" Nullable="false" />
      </Function>

      <Term Name="UpPath" Type="Collection(Edm.String)" Nullable="false" AppliesTo="EntityType">
        <Annotation Term="Core.Description" String="The string values of the node identifiers in a path from the annotated node to a start node in a traversal of a recursive hierarchy" />
        <Annotation Term="Core.LongDescription">
          <String>This instance annotation occurs in the result set after a `traverse` transformation (OData-Data-Agg-v4.0, section 6.2.2.2).
          A use case for this is traversal with multiple parents, when this annotation takes
          as value one parent node identifier followed by one grandparent node identifier and so on.</String>
        </Annotation>
      </Term>

      <Term Name="AvailableOnAggregates" Type="Aggregation.AvailableOnAggregatesType" Nullable="false" AppliesTo="Function">
        <Annotation Term="Core.Description" String="This function is available on aggregated entities if the `RequiredProperties` are still defined" />
      </Term>
      <ComplexType Name="AvailableOnAggregatesType">
        <Property Name="RequiredProperties" Type="Collection(Edm.PropertyPath)" Nullable="false">
          <Annotation Term="Core.Description" String="Properties required to apply this function" />
        </Property>
      </ComplexType>

      <ComplexType Name="NavigationPropertyAggregationCapabilities" BaseType="Capabilities.NavigationPropertyRestriction">
        <Annotation Term="Core.Revisions">
          <Collection>
            <Record>
              <PropertyValue Property="Kind" EnumMember="Core.RevisionKind/Deprecated" />
              <PropertyValue Property="Description" String="[`Capabilities.NavigationRestrictions`](Org.OData.Capabilities.V1.md#NavigationRestrictions) that make use of the additional properties in this subtype are deprecated in favor of [`ApplySupported`](#ApplySupported) and [`CustomAggregate`](#CustomAggregate)" />
            </Record>
          </Collection>
        </Annotation>
        <Annotation Term="Core.Description" String="Aggregation capabilities on a navigation path" />
        <Property Name="ApplySupported" Type="Aggregation.ApplySupportedType">
          <Annotation Term="Core.Description" String="Support for `$apply`" />
        </Property>
        <Property Name="CustomAggregates" Type="Collection(Aggregation.CustomAggregateType)" Nullable="false">
          <Annotation Term="Core.Description" String="Supported custom aggregates" />
        </Property>
      </ComplexType>

      <ComplexType Name="CustomAggregateType">
        <Annotation Term="Core.Revisions">
          <Collection>
            <Record>
              <PropertyValue Property="Kind" EnumMember="Core.RevisionKind/Deprecated" />
              <PropertyValue Property="Description" String="Deprecated since [`NavigationPropertyAggregationCapabilities`](#NavigationPropertyAggregationCapabilities) is also deprecated" />
            </Record>
          </Collection>
        </Annotation>
        <Property Name="Name" Type="Edm.String" Nullable="false">
          <Annotation Term="Core.Description" String="Name of the dynamic property that can be used in the `aggregate` transformation" />
        </Property>
        <Property Name="Type" Type="Edm.String" Nullable="false">
          <Annotation Term="Core.Description" String="Qualified name of a primitive type. The aggregated value will be of that type" />
        </Property>
      </ComplexType>

    </Schema>
  </edmx:DataServices>
</edmx:Edmx>
