Ontology Synchronization Counts

The /settingsontologysynchronization Blazor page displays synchronization statistics for each entity element in the selected ontology.

Synchronized Count

The synchronized count includes distinct Entity nodes aggregated by communities defined by the selected Ontology when the entity carries the ontology element label.

Source Count

Source mappings are represented by EntityOntology-[:HAS_SOURCE]->OntologySource. Each mapped OntologySource.name identifies a source node label. The page displays the number of non-Thalabus source nodes carrying each mapped label, while SourceTotal counts distinct source ontologies using the first two dot-separated name parts (for example, all kg.Innovator.* mappings count as one source ontology). Source nodes are counted only when they are in scope of a package or diagram selected through Ontology-[:SYNCHRONIZE_SOURCE]->(Package|Diagram): descendants of a selected package (owner*1..), elements occurring on a selected diagram (diagram_occurrences), or the selected node itself.

The counts are loaded in one batched call through IOntologyService.GetOntologyElementSynchronizationCounts when an ontology is selected.

Innovator Package & Diagram Tree Counts

The source-configuration page (/settingskg/{ontologyId}/sourcesconfiguration) shows a single unified tree — "Packages & Diagrams Selection" — where both structural packages (is_structure = true) and diagrams (is_diagram = true) appear as selectable nodes, distinguished by a folder or diagram icon. Diagram identity is determined solely by the is_diagram boolean property; diagram stereotype labels are not reliable classifiers. Each node displays a count badge using the following format:

NN + MM [+ SS] [+ KK]

For example, 3 + 12 + 8 means that the node has 3 direct elements, its descendants have 12 elements in total, and 8 selected elements are mapped. 3 + 12 means the same direct and descendant counts, with no selected mapped elements. 3 + 12 + 8 + 2 means that 8 selected elements are mapped and 2 additional selected elements have no matching source mapping. Those 2 elements will not be synchronized until a mapping is added. Hovering over the badge displays the same definitions in the localized tooltip.

Computing KK

KK is derived the same way as the total selected count, but starting from an "unmapped" element count instead of the total element count:

  1. For each package node, IOntologyService.GetInnovatorPackageUnmappedElementCounts(ontologyId, packageNodeIdentifiers) counts the package's direct non-structure elements (via owner) whose label set does not satisfy sourceParts[1] IN labels(element) AND sourceParts[2] IN labels(element) for any kg.-prefixed source name mapped to an EntityOntology or RelationshipOntology definition of the ontology. For each diagram node, IOntologyService.GetInnovatorDiagramUnmappedElementCounts(ontologyId, diagramNodeIdentifiers) computes the analogous count over elements linked via diagram_occurrences.
  2. The Blazor page aggregates these per-node "unmapped direct" counts up the tree into an "unmapped descendant" count, mirroring how DirectElementCount/DescendantElementCount produce NN/MM.
  3. KK for a given node is then computed with the same selection-propagation rule used for the total selected count (GetFullySelectedElementCount): if the node (or an ancestor) is selected for synchronization, KK equals the node's unmapped direct + unmapped descendant counts; otherwise it is the sum of KK over its children. The displayed SS is GetFullySelectedElementCount - KK and is clamped at zero.