Class S128CatalogueRules
- Namespace
- EncDotNet.S100.Datasets.S128.Validation
- Assembly
- EncDotNet.S100.Datasets.S128.dll
The default ValidationRuleSet<TModel> of normative rules
for an S-128 S128ProductCatalogue. Rule identifiers follow
the convention S128-R-{clause}, where {clause} traces to
the relevant section of the S-128 (Edition 2.0.0) specification.
public static class S128CatalogueRules
- Inheritance
-
S128CatalogueRules
- 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
S128ProductCatalogue in isolation. Tier-3 cross-dataset
rules (e.g. comparing a catalogue's product references against actually
loaded S-1xx datasets) will be added in a follow-up once the MCP
validate_all surface is wired up — they need access to sibling
datasets via Services.
Properties
CoordinatesInWgs84Range
S128-R-12.3 — Every coordinate on every catalogue entry must
lie within the WGS-84 ranges: latitude in [-90, +90] and longitude
in [-180, +180].
public static IValidationRule<S128ProductCatalogue> CoordinatesInWgs84Range { get; }
Property Value
Remarks
Spec reference: S-100 Part 10b §6.2 — geographic coordinates for
EPSG:4326 are bounded. S-128 catalogue entries carry
coverage geometry as a point, curve, or surface exterior ring.
Default
The canonical default rule set for S-128 catalogues.
public static ValidationRuleSet<S128ProductCatalogue> Default { get; }
Property Value
EditionNumberPositive
S128-R-12.1 — When present, every catalogue entry's
editionNumber must be ≥ 1.
public static IValidationRule<S128ProductCatalogue> EditionNumberPositive { get; }
Property Value
Remarks
Spec reference: S-128 § 12 — editionNumber is the
author-assigned edition counter shared across
ElectronicProduct, PhysicalProduct, and
S100Service. The S-100 lifecycle treats edition 1 as the
first publishable edition; values of 0 or below are not meaningful.
IssueDateBeforeUpdateDate
S128-R-12.2 — When both an issueDate and an
updateDate are present on a catalogue entry, the issue date
must not be later than the update date.
public static IValidationRule<S128ProductCatalogue> IssueDateBeforeUpdateDate { get; }
Property Value
Remarks
Spec reference: S-128 § 12 — issueDate records the original
release date of an edition; updateDate (falling back to
editionDate) records the most recent revision date for that
edition. An update cannot precede its own issue.
OnlineResourceLinkageWellFormed
S128-R-12.6 — When an onlineResource/linkage is
supplied on a catalogue entry, it must parse as an absolute URI.
public static IValidationRule<S128ProductCatalogue> OnlineResourceLinkageWellFormed { get; }
Property Value
Remarks
Spec reference: S-128 § 12 onlineResource complex attribute
— linkage carries the URL at which the product may be
downloaded or accessed. A relative or malformed value cannot be
dereferenced by clients.
ProducerOrDistributorPresent
S128-R-12.7 — A catalogue dataset should carry at least one
producer or distributor metadata record.
public static IValidationRule<S128ProductCatalogue> ProducerOrDistributorPresent { get; }
Property Value
Remarks
Spec reference: S-128 § 12 — a Catalogue of Nautical Products is
always published by an agency, and the encoded catalogue is
expected to identify either the producing agency
(ProducerInformation) or at least one distributor
(DistributorInformation). A catalogue with neither cannot
be attributed and is treated as a soft warning rather than a
hard error so legacy / partial fixtures still parse.
SurfaceRingClosed
S128-R-12.4 — When a catalogue entry carries a
Surface geometry, its exterior ring
must contain at least four vertices and its first and last vertex
must coincide (closed ring).
public static IValidationRule<S128ProductCatalogue> SurfaceRingClosed { get; }
Property Value
Remarks
Spec reference: S-100 Part 10b §6 (surface primitives) — a GML
polygon's exterior ring is a closed LinearRing. The minimum
of four positions follows from "three distinct corners + repeat the
first to close". Coincidence is tested with a tight tolerance
(1e-9 degrees, about 0.1 mm at the equator) so that ordinary
floating-point round-trip does not trigger the rule.
UniqueProductIds
S128-R-12.5 — Every catalogue product must have a unique
Id.
public static IValidationRule<S128ProductCatalogue> UniqueProductIds { get; }
Property Value
Remarks
Spec reference: S-100 Part 10b §10 (GML identity) and S-128 § 12 —
the gml:id on a feature instance is the primary key used by
xlinks (e.g. theReference supersedes pointers) to address
catalogue entries. Duplicate identifiers break xlink resolution and
supersedes navigation.
Methods
Validate(S128ProductCatalogue, ValidationContext?)
Convenience wrapper around Run(TModel, ValidationContext?) using the Default rule set.
public static ValidationReport Validate(S128ProductCatalogue catalogue, ValidationContext? context = null)
Parameters
catalogueS128ProductCataloguecontextValidationContext