Skip to content
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

ODATA-1218 - Enhance hierarchy processing #121

Merged
merged 12 commits into from
Jan 13, 2022
16 changes: 2 additions & 14 deletions vocabularies/Org.OData.Aggregation.V1.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@
"$Kind": "Term",
"$Type": "Aggregation.RecursiveHierarchyType",
"$AppliesTo": [
"EntityType",
"ComplexType"
"EntityType"
],
"@Core.Description": "Defines a recursive hierarchy."
},
Expand All @@ -203,18 +202,7 @@
},
"ParentNavigationProperty": {
"$Type": "Edm.NavigationPropertyPath",
"@Core.Description": "Property for navigating to the parent node"
},
"DistanceFromRootProperty": {
"$Type": "Edm.PropertyPath",
"$Nullable": true,
"@Core.Description": "Property holding the number of edges between the node and the root node"
},
"IsLeafProperty": {
"$Type": "Edm.PropertyPath",
"$Nullable": true,
"@Core.RequiresType": "Edm.Boolean",
"@Core.Description": "Property indicating whether the node is a leaf of the hierarchy"
"@Core.Description": "Property for navigating to the parent node. Its type MUST be the entity type annotated with this term, and it MUST be nullable."
}
},
"isroot": [
Expand Down
64 changes: 31 additions & 33 deletions vocabularies/Org.OData.Aggregation.V1.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,69 +16,69 @@ Term|Type|Description
[ContextDefiningProperties](./Org.OData.Aggregation.V1.xml#L184:~:text=<Term%20Name="-,ContextDefiningProperties,-")|\[PropertyPath\]|<a name="ContextDefiningProperties"></a>The annotated property or custom aggregate is only well-defined in the context of these properties<br>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.
[LeveledHierarchy](./Org.OData.Aggregation.V1.xml#L191:~:text=<Term%20Name="-,LeveledHierarchy,-")|\[PropertyPath\]|<a name="LeveledHierarchy"></a>Defines a leveled hierarchy by defining an ordered list of properties in the hierarchy
[RecursiveHierarchy](./Org.OData.Aggregation.V1.xml#L195:~:text=<Term%20Name="-,RecursiveHierarchy,-")|[RecursiveHierarchyType](#RecursiveHierarchyType)|<a name="RecursiveHierarchy"></a>Defines a recursive hierarchy.
[AvailableOnAggregates](./Org.OData.Aggregation.V1.xml#L255:~:text=<Term%20Name="-,AvailableOnAggregates,-")|[AvailableOnAggregatesType](#AvailableOnAggregatesType)|<a name="AvailableOnAggregates"></a>This action or function is available on aggregated entities if the `RequiredProperties` are still defined
[AvailableOnAggregates](./Org.OData.Aggregation.V1.xml#L248:~:text=<Term%20Name="-,AvailableOnAggregates,-")|[AvailableOnAggregatesType](#AvailableOnAggregatesType)|<a name="AvailableOnAggregates"></a>This action or function is available on aggregated entities if the `RequiredProperties` are still defined


## Functions

### <a name="isroot"></a>[isroot](./Org.OData.Aggregation.V1.xml#L215:~:text=<Function%20Name="-,isroot,-")
### <a name="isroot"></a>[isroot](./Org.OData.Aggregation.V1.xml#L208:~:text=<Function%20Name="-,isroot,-")

Returns true, if and only if the value of the node property of the specified hierarchy is the root of the hierarchy

Parameter|Type|Description
:--------|:---|:----------
**[Entity](./Org.OData.Aggregation.V1.xml#L217:~:text=<Function%20Name="-,isroot,-")**|EntityType|**Binding parameter**
[Hierarchy](./Org.OData.Aggregation.V1.xml#L218:~:text=<Function%20Name="-,isroot,-")|String|
[&rarr;](./Org.OData.Aggregation.V1.xml#L219:~:text=<Function%20Name="-,isroot,-")|Boolean|
**[Entity](./Org.OData.Aggregation.V1.xml#L210:~:text=<Function%20Name="-,isroot,-")**|EntityType|**Binding parameter**
[Hierarchy](./Org.OData.Aggregation.V1.xml#L211:~:text=<Function%20Name="-,isroot,-")|String|
[&rarr;](./Org.OData.Aggregation.V1.xml#L212:~:text=<Function%20Name="-,isroot,-")|Boolean|


### <a name="isdescendant"></a>[isdescendant](./Org.OData.Aggregation.V1.xml#L222:~:text=<Function%20Name="-,isdescendant,-")
### <a name="isdescendant"></a>[isdescendant](./Org.OData.Aggregation.V1.xml#L215:~:text=<Function%20Name="-,isdescendant,-")

Returns true, if and only if the value of the node property of the specified hierarchy is a descendant of the given parent node with a distance of less than or equal to the optionally specified maximum distance

Parameter|Type|Description
:--------|:---|:----------
**[Entity](./Org.OData.Aggregation.V1.xml#L224:~:text=<Function%20Name="-,isdescendant,-")**|EntityType|**Binding parameter**
[Hierarchy](./Org.OData.Aggregation.V1.xml#L225:~:text=<Function%20Name="-,isdescendant,-")|String|
[Node](./Org.OData.Aggregation.V1.xml#L226:~:text=<Function%20Name="-,isdescendant,-")|PrimitiveType|
[MaxDistance](./Org.OData.Aggregation.V1.xml#L227:~:text=<Function%20Name="-,isdescendant,-")|Int16?|
[&rarr;](./Org.OData.Aggregation.V1.xml#L228:~:text=<Function%20Name="-,isdescendant,-")|Boolean|
**[Entity](./Org.OData.Aggregation.V1.xml#L217:~:text=<Function%20Name="-,isdescendant,-")**|EntityType|**Binding parameter**
[Hierarchy](./Org.OData.Aggregation.V1.xml#L218:~:text=<Function%20Name="-,isdescendant,-")|String|
[Node](./Org.OData.Aggregation.V1.xml#L219:~:text=<Function%20Name="-,isdescendant,-")|PrimitiveType|
[MaxDistance](./Org.OData.Aggregation.V1.xml#L220:~:text=<Function%20Name="-,isdescendant,-")|Int16?|
[&rarr;](./Org.OData.Aggregation.V1.xml#L221:~:text=<Function%20Name="-,isdescendant,-")|Boolean|


### <a name="isancestor"></a>[isancestor](./Org.OData.Aggregation.V1.xml#L231:~:text=<Function%20Name="-,isancestor,-")
### <a name="isancestor"></a>[isancestor](./Org.OData.Aggregation.V1.xml#L224:~:text=<Function%20Name="-,isancestor,-")

Returns true, if and only if the value of the node property of the specified hierarchy is an ancestor of the given child node with a distance of less than or equal to the optionally specified maximum distance

Parameter|Type|Description
:--------|:---|:----------
**[Entity](./Org.OData.Aggregation.V1.xml#L233:~:text=<Function%20Name="-,isancestor,-")**|EntityType|**Binding parameter**
[Hierarchy](./Org.OData.Aggregation.V1.xml#L234:~:text=<Function%20Name="-,isancestor,-")|String|
[Node](./Org.OData.Aggregation.V1.xml#L235:~:text=<Function%20Name="-,isancestor,-")|PrimitiveType|
[MaxDistance](./Org.OData.Aggregation.V1.xml#L236:~:text=<Function%20Name="-,isancestor,-")|Int16?|
[&rarr;](./Org.OData.Aggregation.V1.xml#L237:~:text=<Function%20Name="-,isancestor,-")|Boolean|
**[Entity](./Org.OData.Aggregation.V1.xml#L226:~:text=<Function%20Name="-,isancestor,-")**|EntityType|**Binding parameter**
[Hierarchy](./Org.OData.Aggregation.V1.xml#L227:~:text=<Function%20Name="-,isancestor,-")|String|
[Node](./Org.OData.Aggregation.V1.xml#L228:~:text=<Function%20Name="-,isancestor,-")|PrimitiveType|
[MaxDistance](./Org.OData.Aggregation.V1.xml#L229:~:text=<Function%20Name="-,isancestor,-")|Int16?|
[&rarr;](./Org.OData.Aggregation.V1.xml#L230:~:text=<Function%20Name="-,isancestor,-")|Boolean|


### <a name="issibling"></a>[issibling](./Org.OData.Aggregation.V1.xml#L240:~:text=<Function%20Name="-,issibling,-")
### <a name="issibling"></a>[issibling](./Org.OData.Aggregation.V1.xml#L233:~:text=<Function%20Name="-,issibling,-")

Returns true, if and only if the value of the node property of the specified hierarchy has the same parent node as the specified node

Parameter|Type|Description
:--------|:---|:----------
**[Entity](./Org.OData.Aggregation.V1.xml#L242:~:text=<Function%20Name="-,issibling,-")**|EntityType|**Binding parameter**
[Hierarchy](./Org.OData.Aggregation.V1.xml#L243:~:text=<Function%20Name="-,issibling,-")|String|
[Node](./Org.OData.Aggregation.V1.xml#L244:~:text=<Function%20Name="-,issibling,-")|PrimitiveType|
[&rarr;](./Org.OData.Aggregation.V1.xml#L245:~:text=<Function%20Name="-,issibling,-")|Boolean|
**[Entity](./Org.OData.Aggregation.V1.xml#L235:~:text=<Function%20Name="-,issibling,-")**|EntityType|**Binding parameter**
[Hierarchy](./Org.OData.Aggregation.V1.xml#L236:~:text=<Function%20Name="-,issibling,-")|String|
[Node](./Org.OData.Aggregation.V1.xml#L237:~:text=<Function%20Name="-,issibling,-")|PrimitiveType|
[&rarr;](./Org.OData.Aggregation.V1.xml#L238:~:text=<Function%20Name="-,issibling,-")|Boolean|


### <a name="isleaf"></a>[isleaf](./Org.OData.Aggregation.V1.xml#L248:~:text=<Function%20Name="-,isleaf,-")
### <a name="isleaf"></a>[isleaf](./Org.OData.Aggregation.V1.xml#L241:~:text=<Function%20Name="-,isleaf,-")

Returns true, if and only if the value of the node property of the specified hierarchy has no descendants

Parameter|Type|Description
:--------|:---|:----------
**[Entity](./Org.OData.Aggregation.V1.xml#L250:~:text=<Function%20Name="-,isleaf,-")**|EntityType|**Binding parameter**
[Hierarchy](./Org.OData.Aggregation.V1.xml#L251:~:text=<Function%20Name="-,isleaf,-")|String|
[&rarr;](./Org.OData.Aggregation.V1.xml#L252:~:text=<Function%20Name="-,isleaf,-")|Boolean|
**[Entity](./Org.OData.Aggregation.V1.xml#L243:~:text=<Function%20Name="-,isleaf,-")**|EntityType|**Binding parameter**
[Hierarchy](./Org.OData.Aggregation.V1.xml#L244:~:text=<Function%20Name="-,isleaf,-")|String|
[&rarr;](./Org.OData.Aggregation.V1.xml#L245:~:text=<Function%20Name="-,isleaf,-")|Boolean|


## <a name="ApplySupportedBase"></a>[ApplySupportedBase](./Org.OData.Aggregation.V1.xml#L92:~:text=<ComplexType%20Name="-,ApplySupportedBase,-")
Expand Down Expand Up @@ -129,19 +129,17 @@ Member|Value|Description
Property|Type|Description
:-------|:---|:----------
[NodeProperty](./Org.OData.Aggregation.V1.xml#L200:~:text=<ComplexType%20Name="-,RecursiveHierarchyType,-")|PropertyPath|Property holding the hierarchy node value
[ParentNavigationProperty](./Org.OData.Aggregation.V1.xml#L203:~:text=<ComplexType%20Name="-,RecursiveHierarchyType,-")|NavigationPropertyPath|Property for navigating to the parent node
[DistanceFromRootProperty](./Org.OData.Aggregation.V1.xml#L206:~:text=<ComplexType%20Name="-,RecursiveHierarchyType,-")|PropertyPath?|Property holding the number of edges between the node and the root node
[IsLeafProperty](./Org.OData.Aggregation.V1.xml#L209:~:text=<ComplexType%20Name="-,RecursiveHierarchyType,-")|PropertyPath?|Property indicating whether the node is a leaf of the hierarchy
[ParentNavigationProperty](./Org.OData.Aggregation.V1.xml#L203:~:text=<ComplexType%20Name="-,RecursiveHierarchyType,-")|NavigationPropertyPath|Property for navigating to the parent node. Its type MUST be the entity type annotated with this term, and it MUST be nullable.

## <a name="AvailableOnAggregatesType"></a>[AvailableOnAggregatesType](./Org.OData.Aggregation.V1.xml#L258:~:text=<ComplexType%20Name="-,AvailableOnAggregatesType,-")
## <a name="AvailableOnAggregatesType"></a>[AvailableOnAggregatesType](./Org.OData.Aggregation.V1.xml#L251:~:text=<ComplexType%20Name="-,AvailableOnAggregatesType,-")


Property|Type|Description
:-------|:---|:----------
[RequiredProperties](./Org.OData.Aggregation.V1.xml#L259:~:text=<ComplexType%20Name="-,AvailableOnAggregatesType,-")|\[PropertyPath\]|Properties required to apply this action or function
[RequiredProperties](./Org.OData.Aggregation.V1.xml#L252:~:text=<ComplexType%20Name="-,AvailableOnAggregatesType,-")|\[PropertyPath\]|Properties required to apply this action or function

## <a name="NavigationPropertyAggregationCapabilities"></a>[NavigationPropertyAggregationCapabilities](./Org.OData.Aggregation.V1.xml#L264:~:text=<ComplexType%20Name="-,NavigationPropertyAggregationCapabilities,-"): [NavigationPropertyRestriction](Org.OData.Capabilities.V1.md#NavigationPropertyRestriction) *(Deprecated)*
## <a name="NavigationPropertyAggregationCapabilities"></a>[NavigationPropertyAggregationCapabilities](./Org.OData.Aggregation.V1.xml#L257:~:text=<ComplexType%20Name="-,NavigationPropertyAggregationCapabilities,-"): [NavigationPropertyRestriction](Org.OData.Capabilities.V1.md#NavigationPropertyRestriction) *(Deprecated)*
[`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)

## <a name="CustomAggregateType"></a>[CustomAggregateType](./Org.OData.Aggregation.V1.xml#L282:~:text=<ComplexType%20Name="-,CustomAggregateType,-") *(Deprecated)*
## <a name="CustomAggregateType"></a>[CustomAggregateType](./Org.OData.Aggregation.V1.xml#L275:~:text=<ComplexType%20Name="-,CustomAggregateType,-") *(Deprecated)*
Deprecated since [`NavigationPropertyAggregationCapabilities`](#NavigationPropertyAggregationCapabilities) is also deprecated
11 changes: 2 additions & 9 deletions vocabularies/Org.OData.Aggregation.V1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
<Annotation Term="Core.Description" String="Defines a leveled hierarchy by defining an ordered list of properties in the hierarchy" />
</Term>

<Term Name="RecursiveHierarchy" Type="Aggregation.RecursiveHierarchyType" Nullable="false" AppliesTo="EntityType ComplexType">
<Term Name="RecursiveHierarchy" Type="Aggregation.RecursiveHierarchyType" Nullable="false" AppliesTo="EntityType">
<Annotation Term="Core.Description" String="Defines a recursive hierarchy." />
</Term>

Expand All @@ -201,14 +201,7 @@
<Annotation Term="Core.Description" String="Property holding the hierarchy node value" />
</Property>
<Property Name="ParentNavigationProperty" Type="Edm.NavigationPropertyPath" Nullable="false">
<Annotation Term="Core.Description" String="Property for navigating to the parent node" />
</Property>
<Property Name="DistanceFromRootProperty" Type="Edm.PropertyPath" Nullable="true">
<Annotation Term="Core.Description" String="Property holding the number of edges between the node and the root node" />
</Property>
<Property Name="IsLeafProperty" Type="Edm.PropertyPath" Nullable="true">
<Annotation Term="Core.RequiresType" String="Edm.Boolean" />
<Annotation Term="Core.Description" String="Property indicating whether the node is a leaf of the hierarchy" />
<Annotation Term="Core.Description" String="Property for navigating to the parent node. Its type MUST be the entity type annotated with this term, and it MUST be single-valued and nullable." />
</Property>
</ComplexType>

Expand Down