Table of Contents

Class S201AtonRules

Namespace
EncDotNet.S100.Datasets.S201.Validation
Assembly
EncDotNet.S100.Datasets.S201.dll

The default ValidationRuleSet<TModel> of normative rules for an S-201 S201AtonInventory. Rule identifiers follow the convention S201-R-{clause}, where {clause} traces to the relevant section of the S-201 specification (Edition 2.0.0 — Aids to Navigation Information) or to the S-100 framework (Part 10b §6.2 / §6.4 for coordinate and identifier encoding).

public static class S201AtonRules
Inheritance
S201AtonRules
Inherited Members

Remarks

The pilot rule set focuses on Tier-1 (schema-shape) and Tier-2 (spec-semantic) rules that can be evaluated against a single S201AtonInventory in isolation. Tier-3 cross-dataset rules (e.g. cross-referencing an AtoN's charted position against an S-101 chart) are out of scope here — they would reach sibling datasets via Services.

Audience-driven design. S-201 is the IALA AtoN-authority exchange product, not an ECDIS portrayal product. Rules emphasise integrity of the inventory chain (xlink resolution, equipment ↔ host-structure subordination, aggregation membership, AIS MMSI conformance) over mariner-display concerns.

Deviation from S-125. Projection-time issues surfaced by From(S201Dataset, out IReadOnlyList<ProjectionDiagnostic>) (unresolved xlinks, attribute parse failures, duplicate ids) are reported through a ProjectionDiagnostic out-parameter rather than carried on the typed model, so the rule pack performs its own checks where useful (see AggregationMembersResolved).

Properties

AggregationHasMembers

S201-R-6.1 — Every AtonAggregation / AtonAssociation must reference at least two AtoNs.

public static IValidationRule<S201AtonInventory> AggregationHasMembers { get; }

Property Value

IValidationRule<S201AtonInventory>

Remarks

Spec reference: S-201 Edition 2.0.0 Annex C — §AtonAggregation and §AtonAssociation. These features are geometry-less containers whose entire purpose is to group two or more AtoNs by xlink (e.g. a leading line of two beacons). An aggregation with fewer than two resolved peers has no semantic content.

AggregationMembersResolved

S201-R-6.2 — Every peer xlink:href on an AtonAggregation or AtonAssociation must resolve to an AtoN in the inventory.

public static IValidationRule<S201AtonInventory> AggregationMembersResolved { get; }

Property Value

IValidationRule<S201AtonInventory>

Remarks

Spec reference: S-100 Part 10b §6.4 — xlink:href references at the dataset level must resolve. The typed projection captures the resolved peers in Peers; comparing the resolved count to the number of peer-role references on the source feature surfaces dropped references that would otherwise hide behind the typed model's already-resolved view.

The rule fires at Error — an unresolved aggregation member is a structural defect in the AtoN inventory.

ChangeTypesInEnumeration

S201-R-3.1 — When an AtonStatusInformation carries a ChangeTypes code it must fall within the closed enumeration declared by the Feature Catalogue.

public static IValidationRule<S201AtonInventory> ChangeTypesInEnumeration { get; }

Property Value

IValidationRule<S201AtonInventory>

Remarks

Spec reference: S-201 Edition 2.0.0 Annex C2 — ChangeTypes codelist (1 Advance Notice of Change, 2 Discrepancy, 3 Proposed Change, 4 Permanent Change). Note S-201 has only four codelist values where S-125 has five — the spec does not include "Temporary Change" as a distinct code under S-201.

CoordinatesInWgs84Range

S201-R-1.1 — Every coordinate of every AtoN geometry must fall within the WGS-84 ranges: latitude in [-90, +90] and longitude in [-180, +180].

public static IValidationRule<S201AtonInventory> CoordinatesInWgs84Range { get; }

Property Value

IValidationRule<S201AtonInventory>

Remarks

Spec reference: S-100 Part 10b §6.2 — geographic coordinates for EPSG:4326 are bounded. AtoNs without geometry (geometry-less container features such as AtonAggregation) are ignored by this rule.

DateRangeOrdered

S201-R-4.1 — When an AtoN's fixedDateRange or periodicDateRange carries both a start and an end, the start must not be after the end.

public static IValidationRule<S201AtonInventory> DateRangeOrdered { get; }

Property Value

IValidationRule<S201AtonInventory>

Remarks

Spec reference: S-201 Edition 2.0.0 Annex C — §fixedDateRange and §periodicDateRange. The complex attribute is composed of dateStart / dateEnd; the spec is silent on degenerate ranges but a deployment whose validity begins after it ends is non-actionable.

Default

The canonical default rule set for S-201 AtoN inventories.

public static ValidationRuleSet<S201AtonInventory> Default { get; }

Property Value

ValidationRuleSet<S201AtonInventory>

EquipmentHasHostStructure

S201-R-5.1 — Every Equipment instance (including concrete GenericLight subclasses) should resolve to a host StructureObject.

public static IValidationRule<S201AtonInventory> EquipmentHasHostStructure { get; }

Property Value

IValidationRule<S201AtonInventory>

Remarks

Spec reference: S-201 Edition 2.0.0 Annex C — StructureEquipment association. The subordination chain is back-resolved by the typed projection via theParentFeature / parent xlinks; an equipment instance whose HostStructure is null is either free-standing (rare but spec-permissible in the operational fleet) or carries an unresolved xlink:href.

The rule fires at Warning rather than Error because the FC does not strictly require the association — the warning flags the case for downstream authority review.

GmlIdsUnique

S201-R-1.2 — Every AtoN, aggregation, association, and information-type instance must carry a dataset-unique gml:id.

public static IValidationRule<S201AtonInventory> GmlIdsUnique { get; }

Property Value

IValidationRule<S201AtonInventory>

Remarks

Spec reference: S-100 Part 10b §6.4 — every GML object exposed at the dataset level must carry a unique gml:id so that xlink:href references resolve deterministically. Duplicate identifiers also break the typed projection's back-resolved parent / aggregation lookups.

NavigableAtoNHasGeometry

S201-R-1.3 — Every navigable AtoN (concrete StructureObject, Equipment, or non-virtual ElectronicAton) must carry at least one coordinate.

public static IValidationRule<S201AtonInventory> NavigableAtoNHasGeometry { get; }

Property Value

IValidationRule<S201AtonInventory>

Remarks

Spec reference: S-201 Edition 2.0.0 Annex C — the FC requires a point geometry for concrete physical AtoNs. Aggregation containers (handled separately as S201AtonAggregation / S201AtonAssociation) and non-physical feature kinds (lines, areas, dataset metadata, represented in the typed model as S201GenericAtonObject) are exempt.

Virtual AIS AtoNs (Virtual) describe a notional aid broadcast over AIS and may legitimately appear without a transmitter position when the encoder elides it; the rule fires at Warning on non-virtual AtoNs only.

PhysicalAisHasMmsi

S201-R-2.1 — Every Physical or Synthetic AIS aid to navigation must carry an mMSICode of exactly nine decimal digits.

public static IValidationRule<S201AtonInventory> PhysicalAisHasMmsi { get; }

Property Value

IValidationRule<S201AtonInventory>

Remarks

Spec reference: S-201 Edition 2.0.0 Annex C — §PhysicalAISAidToNavigation and §SyntheticAISAidToNavigation declare mMSICode (Maritime Mobile Service Identity) as a required attribute. The MMSI is the nine-digit identifier broadcast in the AIS message (ITU-R M.585).

VirtualAisMmsiFormat

S201-R-2.2 — When a Virtual AIS aid to navigation carries an mMSICode, the value must be exactly nine decimal digits.

public static IValidationRule<S201AtonInventory> VirtualAisMmsiFormat { get; }

Property Value

IValidationRule<S201AtonInventory>

Remarks

Spec reference: S-201 Edition 2.0.0 Annex C — §VirtualAISAidToNavigation. The FC permits a virtual AIS AtoN to be authored without an MMSI (a virtual mark may be dropped without provisioning a dedicated identity), but when one is supplied it must still conform to the ITU MMSI nine-digit shape. The rule fires at Warning rather than Error because the missing-value case is permitted.

Methods

Validate(S201AtonInventory, ValidationContext?)

Convenience wrapper around Run(TModel, ValidationContext?) using the Default rule set.

public static ValidationReport Validate(S201AtonInventory inventory, ValidationContext? context = null)

Parameters

inventory S201AtonInventory

The S-201 AtoN inventory to validate.

context ValidationContext

Optional validation context; defaults to Default.

Returns

ValidationReport

The validation report for inventory.