Table of Contents

Class S131HarbourInfrastructureRules

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

The default ValidationRuleSet<TModel> of normative rules for an S-131 S131HarbourInfrastructureDataset. Rule identifiers follow the convention S131-R-{clause}, where {clause} traces to the relevant section of the S-131 Product Specification (Edition 2.0.0 feature and portrayal catalogues) or the S-100 framework (Part 10b §6.2 for coordinate encoding).

public static class S131HarbourInfrastructureRules
Inheritance
S131HarbourInfrastructureRules
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 S131HarbourInfrastructureDataset in isolation. Tier-3 cross-dataset rules (e.g. cross-checking Berth depths against a loaded S-102 bathymetric surface) are out of scope here — they would reach sibling datasets via Services.

S-131 has a few characteristics worth flagging up-front:

  • Container-style information types (e.g. Authority) never carry geometry — these are modelled as IS131InformationType and are excluded from geometry-presence rules by construction.
  • A handful of HarbourPhysicalInfrastructure features (e.g. HarbourFacility) are container-style in practice — they aggregate child features through xlinks and may legitimately have no geometry. These kinds are exempted from HarbourInfrastructureGeometryPresent.

Properties

AvailableBerthingLengthNonNegative

S131-R-2.1 — When the availableBerthingLength attribute is present on a feature, its value must be a valid non-negative number expressed in metres.

public static IValidationRule<S131HarbourInfrastructureDataset> AvailableBerthingLengthNonNegative { get; }

Property Value

IValidationRule<S131HarbourInfrastructureDataset>

Remarks

Spec reference: S-131 FC Edition 2.0.0 — the availableBerthingLength simple attribute is bound to Berth, BerthPosition, and related layout features; the FC declares the quantity specification as length with the SI base unit (metres), so negative or non-numeric values are nonsensical.

CoordinatesInWgs84Range

S131-R-3.1 — Every coordinate on every feature geometry (point, curve, exterior ring, interior ring) must lie within the valid WGS-84 ranges: latitude in [-90, +90] and longitude in [-180, +180].

public static IValidationRule<S131HarbourInfrastructureDataset> CoordinatesInWgs84Range { get; }

Property Value

IValidationRule<S131HarbourInfrastructureDataset>

Remarks

Spec reference: S-100 Part 10b §6.2 — geographic coordinates for EPSG:4326 are bounded. S-131 uses the S-100 GML 5.0 profile with lat/lon ordering for gml:pos and gml:posList.

Default

The canonical default rule set for S-131 harbour-infrastructure datasets.

public static ValidationRuleSet<S131HarbourInfrastructureDataset> Default { get; }

Property Value

ValidationRuleSet<S131HarbourInfrastructureDataset>

FeatureCodeRecognised

S131-R-6.1 — Every feature and information type in the dataset must use a code declared in the S-131 Feature Catalogue (Edition 2.0.0). Unknown codes — i.e. projections that surface as S131OtherFeature or S131OtherInformationType — are surfaced as Warnings.

public static IValidationRule<S131HarbourInfrastructureDataset> FeatureCodeRecognised { get; }

Property Value

IValidationRule<S131HarbourInfrastructureDataset>

Remarks

Spec reference: S-131 FC Edition 2.0.0 §B.1, §B.2 — the FC closes over the legal feature- and information-type code lists. A warning (rather than an error) is used so that forward-compat extensions in future FC editions remain consumable while still flagging unrecognised codes for follow-up.

HarbourInfrastructureGeometryPresent

S131-R-1.1 — Every non-container HarbourPhysicalInfrastructure feature must carry a non-empty geometry.

public static IValidationRule<S131HarbourInfrastructureDataset> HarbourInfrastructureGeometryPresent { get; }

Property Value

IValidationRule<S131HarbourInfrastructureDataset>

Remarks

Spec reference: S-131 FC Edition 2.0.0 §B.2 — features such as Bollard, Dolphin, DryDock, MooringBuoy, LockBasin, etc. describe fixed physical installations and require a spatial anchor. Container-style kinds (currently only HarbourFacility) are exempted because they aggregate constituent features by xlink and may have no geometry of their own.

LayoutFeatureGeometryPresent

S131-R-1.2 — Every Layout feature (berths, terminals, anchorage areas, harbour basins, etc.) must carry a non-empty geometry.

public static IValidationRule<S131HarbourInfrastructureDataset> LayoutFeatureGeometryPresent { get; }

Property Value

IValidationRule<S131HarbourInfrastructureDataset>

Remarks

Spec reference: S-131 FC Edition 2.0.0 §B.2 — every Layout-derived feature is intrinsically spatial; a berth without coordinates cannot be drawn or routed to. Unlike the HarbourPhysicalInfrastructure branch there are no container exceptions among layout features.

ResolvedReferencesNotNull

S131-R-5.1 — Every xlink:href reference recorded in ResolvedReferences or ResolvedReferences must resolve to a typed peer in the same dataset.

public static IValidationRule<S131HarbourInfrastructureDataset> ResolvedReferencesNotNull { get; }

Property Value

IValidationRule<S131HarbourInfrastructureDataset>

Remarks

Spec reference: S-131 FC Edition 2.0.0 §B.3 — feature/info-type associations are encoded as xlink:href attributes on role-bearing child elements; the target must exist within the dataset's id space.

Deviation from S-421 R-7.x: S-421 only carries feature-to-feature xlinks (waypoints, legs, action points) which can be reasoned about purely from the typed S421RoutePlan graph. S-131 also carries information-type bindings (e.g. Authority → ContactDetails) that are surfaced through ResolvedReferences, so this rule checks both axes.

SurfaceRingsClosed

S131-R-3.2 — Every surface feature's exterior and interior rings must be closed (first vertex equals last) and contain at least four vertices.

public static IValidationRule<S131HarbourInfrastructureDataset> SurfaceRingsClosed { get; }

Property Value

IValidationRule<S131HarbourInfrastructureDataset>

Remarks

Spec reference: S-100 Part 10b (GML profile) — surface rings are encoded as gml:LinearRing, which by the OGC GML 3.2 rules must be closed and contain at least four positions (three distinct vertices plus the closing repeat).

UniqueFeatureIds

S131-R-4.1 — No two features (and no two information types) in a dataset may share the same gml:id.

public static IValidationRule<S131HarbourInfrastructureDataset> UniqueFeatureIds { get; }

Property Value

IValidationRule<S131HarbourInfrastructureDataset>

Remarks

Spec reference: S-100 Part 10b §7 (GML identifier model) — gml:id values must be unique within the document. The typed-projection layer also emits an s131.id.duplicate diagnostic for this condition; the rule re-surfaces it as an addressable Error finding in the validation report.

Methods

Validate(S131HarbourInfrastructureDataset, ValidationContext?)

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

public static ValidationReport Validate(S131HarbourInfrastructureDataset dataset, ValidationContext? context = null)

Parameters

dataset S131HarbourInfrastructureDataset
context ValidationContext

Returns

ValidationReport