Oihana PHP System

HasTreeMetrics

Provides non-SKOS structural metrics about a concept's position in its tree.

These are house properties — they are deliberately NOT part of W3C SKOS, which models the hierarchy relationally (through narrower/broader), not with counts. They are extracted into a dedicated trait so the pure-SKOS Concept stays free of structural metadata, and are composed only by the hierarchical, project-specific terms (e.g. ProductCategoryTerm) — mirroring HasColor.

Like the SKOS relations, they are traversal/projection-only : computed at query time (e.g. an ArangoDB edge-count projection), never persisted nor harvested, populated only on selected API responses (typically a full skin).

The companion property name constant lives in TreeMetricsTrait.

Tags
author

Marc Alcaraz (ekameleon)

since
1.2.1

Table of Contents

Properties

$childrenCount  : int|null
The number of direct children — the count of `narrower` concepts.

Properties

$childrenCount

The number of direct children — the count of `narrower` concepts.

public int|null $childrenCount

A value of 0 means the concept is a leaf ; null means the metric was not loaded. It lets a UI decide whether to show an "expand" affordance without loading the children. The derived isLeaf is simply childrenCount === 0.

Example:

$term->childrenCount = 8 ;
On this page

Search results