pub struct ShapeDef {
pub targets: &'static [Target],
pub props: &'static [&'static PropShape],
pub closed: Option<&'static ClosedShape>,
pub logic: &'static [Logic],
pub profiles: &'static [&'static str],
pub file: &'static str,
}Expand description
One sh:NodeShape.
Fields§
§targets: &'static [Target]§props: &'static [&'static PropShape]Borrowed rather than owned: NCP defines ~4,200 distinct property shapes
and references them ~14,800 times, because a shape like
IdentifiedObject.mRID-cardinality applies to hundreds of classes.
Sharing one definition per shape keeps the generated table a third of
the size it would otherwise be.
closed: Option<&'static ClosedShape>sh:closed — the allowed field keys. An element carrying any other key
is reported.
This is the constraint that only a property bag can answer: generated structs drop unknown properties at decode, leaving nothing to compare against. 823 NCP shapes use it.
logic: &'static [Logic]Node-level sh:and / sh:or / sh:xone.
profiles: &'static [&'static str]Every NC profile code whose manifest imports the file this shape came from. Plural because four shared constraint files are imported by 17 or 18 of the 18 manifests.
file: &'static strTTL base file name, for reports.