Validation¶
Introduction¶
Britain is on the verge of a transport revolution and the Department has recently delivered the Future of Mobility, Urban Strategy as part of the Future of Mobility Grand Challenge. The Strategy priorities providing a regulatory framework that evolves with transport technology and advocates data sharing to improve operation of the transport system. Traffic Regulation Orders (TROs) are the legal orders made under the Road Traffic Regulation Act 1984 which define the rules of the road network. They currently provide Traffic Regulation Authorities with powers to place permanent, temporary, or experimental restrictions on traffic for the purposes of safety or traffic management. Orders therefore provide a vital mechanism for enforcement on the road network. Digitization of these orders and providing them as standardized data would provide many benefits, including :
improving existing services (e.g., satNav routing);
providing new services;
reducing enforcement and processing costs to highway authorities;
reducing congestion;
provision of the digital infrastructure for connected and automated vehicles.
The Automated Vehicles Act 2024 (section 93) provides the capability for the Secretary of State, through regulation, to require Traffic Regulation Authorities (TRAs) to provide information on a defined set of Traffic Regulation Measures, in a specified manner and form, to be provided in accordance with a specified model, standard or set of specifications. These will be the D-TRO Data Specification including the D-TRO Data Model, and are expected to be specified under secondary legislation. This document specifies the semantic validation rules that submitted D-TRO records will be executed against before acceptance into the central storage system.
Terms and abbreviations¶
Terms/Abbreviation |
Definitions |
|---|---|
D-TRO |
Digital Traffic Regulation Order |
DfT |
Department for Transport |
DSP |
Digital Solution Provider |
TRA |
Traffic Regulation Authority |
ICD |
Interface Control Document |
SWA |
Street Works Act (SWA) codes |
Target audience¶
- The target audiences of this document include :
Traffic Regulation Authorities (TRAs) and any Digital Solution Providers that currently manage IT contracts within the authority.
The D-TRO Service Owner who will be responsible for long-term support, maintenance, and continual improvement of the Service.
Validation approach¶
Schema validation¶
Schema validation ensures that submitted D-TROs align with the data model. Schema validation is executed at the time of submission. The current version of the schema can be found within the D-TRO Beta GitHub repository: https://github.com/department-for-transport-public/D-TRO. The purpose of schema validation is to validate that a submitted payload conforms to all the rules outlined within the schema. This includes, but is not limited to, the following:
All submitted property names match the naming convention
Required properties are present
Additional submitted properties not outlined in the schema are forbidden
Data types are correct
Values are one of a fixed enumeration, where required
Numeric values are within a given range
Strings are of a minimum/maximum length
Arrays have a minimum/maximum number of items
Values match expected formats/patterns, e.g. date formats, datetime formats
Conditional logic, e.g. when a property has a certain value, this property must/must not exist
Schema validation is implemented with Newtonsoft (https://www.newtonsoft.com/json). Newtonsoft provides a useful online schema validation tool, providing the ability to interactively validate payloads against a schema. This can be found here: https://www.jsonschemavalidator.net/.
Rule ID |
Applicable Data Field |
Secondary data field(s) |
Rule Definition |
Introduced in Version |
Error name |
Error message |
Error rule |
|---|---|---|---|---|---|---|---|
1 |
source.actionType |
Each instance shall be unique and one of these values: ‘new’,’amendment’,’noChange’,’errorFix’ |
3.2.1 |
Invalid ‘actionType’ |
Indicates the nature of update between D-TRO records or their constituent parts |
Source ‘actionType’ must contain one of the following accepted values: ‘new’, ‘amendment’, ‘noChange’, ‘errorFix’ |
|
2 |
source.reference |
This must be a non-null string |
3.2.0 |
Invalid ‘reference’ |
Indicates a reference to the relevant part or section of the TRO |
Source ‘reference’ must be of type ‘string’ and be non-null |
|
3 |
source.section |
This must be a non-null string |
3.2.0 |
Invalid ‘section’ |
Reference to the section of the D-TRO |
Source ‘section’ must be of type ‘string’ and be non-null. |
|
4 |
source.troName |
This must be a non-null string with a descriptor name for the TRO. |
3.2.0 |
Invalid ‘troName’ |
Traffic regulation order published title |
Source ‘troName’ must be of type ‘string’ and be non-null. ‘troName’ need to be meaningful (i.e. in the form given in the legal order) |
|
5 |
provision.actionType |
This must be of type ‘string’ and these values have been modified: ‘new’, ‘amendment’, ‘fullRevoke’, ‘partialRevoke’, ‘fullAmendment’, ‘partialAmendment’, ‘noChange’, ‘errorFix’ |
3.3.0 |
Invalid ‘actionType’ |
Indicates the nature of update of a Provision |
Provision ‘actionType’ must contain one of the following accepted values: ‘new’, ‘partialAmendment’, ‘fullAmendment’, ‘partialRevoke’, ‘fullRevoke’, ‘noChange’ ,’errorFix’ |
|
6 |
provision.orderReportingPoint |
Shall be one of:’experimentalAmendment”, ‘experimentalMakingPermanent”, ‘experimentalNoticeOfMaking”, ‘experimentalRevocation”, ‘permanentAmendment”, ‘permanentNoticeOfMaking”, ‘permanentNoticeOfProposal’, ‘permanentRevocation’, ‘specialEventOrderNoticeOfMaking ,’ttroTtmoByNotice’,’ttroTtmoExtension’,’ttroTtmoNoticeAfterMaking’,’ttroTtmoNoticeOfIntention’,’ttroTtmoRevocation’,’variationNotice’, ‘troOnRoadActiveStatus’ |
3.3.0 |
Invalid order reporting point |
Attribute identifying the lifecycle point and nature of a Provision |
‘orderReportingPoint’ must be one of ‘experimentalAmendment,experimentalMakingPermanent,experimentalNoticeOfMaking,experimentalRevocation,permanentAmendment,permanentNoticeOfMaking,permanentNoticeOfProposal,permanentRevocation,specialEventOrderNoticeOfMaking,ttroTtmoByNotice,ttroTtmoExtension,ttroTtmoNoticeAfterMaking,ttroTtmoNoticeOfIntention,ttroTtmoRevocation,variationByNotice,troOnRoadActiveStatus’ |
|
7 |
provision.provisionDescription |
This must be a non-null string. |
3.2.0 |
Invalid description |
Free text description of the referenced provision |
Provision ‘provisionDescription’ must be of type ‘System.String’ and be non-null. |
|
8 |
provision.reference |
This must be a non-null string. |
3.2.0 |
Invalid reference |
Indicates a system reference to the relevant Provision of the TRO |
Each provision ‘reference’ must be unique and of type ‘System.String’ and be non-null. |
|
9 |
regulatedPlace.description |
This must be a non-null string. |
3.2.0 |
Invalid regulated place description |
Free text description of the regulated place |
Provision ‘description’ must be of type ‘System.String’ and be non-null. |
|
10 |
regulatedPlace.type |
This must be of type ‘string” and one of these values:’regulationLocation”,’diversionRoute” |
3.3.0 |
Regulate place type |
Regulated place type missing or incorrect. |
One of ‘regulationLocation,diversionRoute’ type(s) must be present. |
|
11 |
geometry.version |
This must be an integer with the version number of the selected geometry. |
3.2.0 |
Invalid geometry version |
Version of geometry linked to a concrete instance of geometry |
Version number must be an integer and cannot be ‘0’ |
|
12 |
if geometry is pointGeometry |
Use of pointGeometry |
Value and usage must be consistent with WKT standards with one pair of coordinates. |
3.2.3 |
Invalid coordinates |
Geometry coordinates linked to ‘PointGeometry’ |
Coordinates ‘…’ are incorrect or not within Great Britain |
13 |
pointGeometry.representation |
This must be a string and one of the values: ‘centreLinePoint”,’trafficSignLocation”,’other” |
3.3.1 |
Invalid representation |
Indicates the nature of the point location for a point representation of a regulated place. |
‘representation’ must be one of ‘centreLinePoint,trafficSignLocation,other’ |
|
14 |
if geometry is linearGeometry |
Use of linearGeometry |
Value and usage must be consistent with WKT standards with at least two pairs of coordinates. |
3.2.3 |
Invalid geometry coordinates |
Geometry grid linked to ‘DirectedLinear’ |
Coordinates ‘…’ are incorrect or not within Great Britain |
15 |
linearGeometry.direction |
This must be a string and one of the values: ‘bidirectional”,’startToEnd”,’endToStart” |
3.3.1 |
Invalid direction |
Indicates the direction of the applicability of the referenced regulation. |
‘direction’ must be one of ‘bidirectional,startToEnd,endToStart’ |
|
16 |
linearGeometry.lateralPosition |
This must be a string and one of the values: ‘centreline”,’near”,’onKerb”,’far” |
3.3.1 |
Invalid lateral position |
Indicates the lateral position across a road of the linear representation of a regulated place. |
‘lateralPosition’ value must be one of ‘centreline,near,onKerb,far’ |
|
17 |
linearGeometry.representation |
This must be a string and one of the values: ‘linear”,’representingZone” |
3.3.1 |
Invalid representation |
Indicates the nature of the point location for a linear representation of a regulated place. |
‘representation’’ value must be one of ‘linear,representingZone’ |
|
18 |
if geometry is polygon |
Use of polygon |
Value and usage must be consistent with WKT standards with at least four pairs of coordinates. |
3.2.3 |
Invalid coordinates |
Indicates that the given coordinates are broadly appropriate |
Coordinates ‘…’ are incorrect or not within Great Britain |
19 |
if geometry is directedLinear |
Use of directed Linear |
Value and usage must be consistent with WKT standards with at least two pairs of coordinates. |
3.2.3 |
Invalid coordinates |
Indicates that the given coordinates are broadly appropriate |
Coordinates ‘…’ are incorrect or not within Great Britain |
20 |
Coordinate reference system (use of British National Grid Reference) |
Use of any geometries |
Needs to include prefix of ‘SRID=27700;…” to indicate use of the OSGB36 coordinate referencing system. |
3.2.3 |
Invalid geometry grid |
Geometry grid linked to ‘PointGeometry’, ‘LinearGeometry’, ‘Polygon’ or ‘DirectedLinear’ |
The WKT string must start with ‘SRID=27700 |
21 |
regulation.isDynamic |
This must be a boolean (true or false) |
3.3.1 |
Invalid ‘isDynamic’ |
Indicates if the regulation is dynamic in nature. |
Regulation ‘isDynamic’ must be present and has to be ‘true’ or ‘false’. |
|
22 |
regulation.timeZone |
This must be a non-null string and in IANA format (e.g. Europe/London) |
3.3.0 |
Regulation ‘timeZone’ |
IANA time-zone (see http://www.iana.org/time-zones). |
Regulation ‘timeZone’ must be of type ‘string’ and be non-null. Expected to default to “Europe/London” |
|
23 |
speedLimitValueBased.mphValue |
Must be one of defined values (e.g. 10, 20, 30, 40, 50, 60, 70) |
3.3.0 |
Invalid ‘mphValue’ |
Speed limit value in miles per hour |
‘mphValue’ must be an integer and one of these values: 10, 20, 30, 40, 50, 60, 70 |
|
24 |
speedLimitValueBased.speedLimitValueType |
This must be a string and one of the followings: ‘maximumSpeedLimit”,’minimumSpeedLimit”,’nationalSpeedLimitWellLitStreetDefault” |
3.3.0 |
Invalid ‘type’ |
Speed limit value type value indicated |
‘type’ must be one of ‘maximumSpeedLimit,minimumSpeedLimit,nationalSpeedLimitWellLitStreetDefault’ |
|
25 |
speedLimitProfileBased.type |
3.3.1 |
Invalid ‘type’ |
Speed limit based value indicated |
‘type’ must be one of ‘nationalSpeedLimitDualCarriageway,nationalSpeedLimitSingleCarriageway,nationalSpeedLimitMotorway’ |
||
26 |
generalRegulation.regulationType |
This must be a string and one of these values: “bannedMovementNoEntry”,”bannedMovementNoLeftTurn”,”bannedMovementNoRightTurn”, “bannedMovementNoUTurn”,”dimensionMaximumHeightStructural”,”dimensionMaximumHeightWithTRO”,”dimensionMaximumLength”,”dimensionMaximumWeightEnvironmental”,”dimensionMaximumWeightStructural”,”dimensionMaximumWidth”,”kerbsideControlledParkingZone”,”kerbsideDisabledBadgeHoldersOnly”,”kerbsideDoubleRedLines”,”kerbsideFootwayParking”,”kerbsideFootwayParkingProhibited”,”kerbsideLimitedWaiting”,”kerbsideLoadingBay”,”kerbsideLoadingBayPassengerSetDownPermitted”,”kerbsideLoadingBayPassengerSetDownProhibited”,”kerbsideLoadingPlace”,”kerbsideLoadingPlacePassengerSetDownPermitted”,”kerbsideLoadingPlacePassengerSetDownProhibited”,”kerbsideNoLoadingPassengerSetDownPermitted”,”kerbsideNoLoadingPassengerSetDownProhibited”,”kerbsideMotorcycleParkingPlace”,”kerbsideNoLoading”,”kerbsideNoStopping”,”kerbsideNoWaiting”,”kerbsideOtherYellowZigZagMandatory”,”kerbsideParkingPlace”,”kerbsidePaymentParkingPlace”,”kerbsidePermitParkingArea”,”kerbsidePermitParkingPlace”,”kerbsideRedRouteClearway”,”kerbsideRestrictedParkingZone”,”kerbsideRedRouteBusStopClearway”,”kerbsideRuralClearway”,”kerbsideSchoolKeepClearYellowZigZagMandatory”,”kerbsideSingleRedLines”,”kerbsideTaxiRank”,”kerbsideUrbanClearway”,”mandatoryDirectionAheadOnly”,”mandatoryDirectionLeftTurnOnly”,”mandatoryDirectionOneWay”,”mandatoryDirectionRightTurnOnly”,”miscBaySuspension”,”miscBusGate”,”miscBusLaneWithTrafficFlow”,”miscBusOnlyStreet”,”miscCongestionLowEmissionZone”,”miscContraflow”,”miscContraflowBusLane”,”miscCycleHireParking”,”miscCycleLane”,”miscCycleLaneClosure”,”miscCycleParking”,’miscFootpathClosure””miscFootwayClosure”,”miscLaneClosure”,”miscPROWClosure”,”miscPedestrianZone”,”miscRoadClosure”,”miscRoadClosureCrossingPoint”,”miscSuspensionOfBusway”,”miscSuspensionOfOneWay”,”miscSuspensionOfParkingRestriction”,”miscSuspensionOfWeightRestriction”,”miscTemporaryParkingBay”,”miscTemporaryParkingRestriction”,”movementOrderNoOvertaking”,”movementOrderPriorityOverOncomingTraffic”,”movementOrderProhibitedAccess”,”nonOrderKerbsideBusStop”,”nonOrderKerbsidePedestrianCrossing”,”nonOrderMovementBoxJunction” |
3.3.1 |
Invalid ‘type’ |
Object indicating a specific regulation (other than speed limit or user-defined off-list regulation) |
‘type’ must be one of ‘dimensionMaximumHeightStructural,dimensionMaximumHeightWithTRO,dimensionMaximumLength,dimensionMaximumWeightEnvironmental,dimensionMaximumWeightStructural,dimensionMaximumWidth,bannedMovementNoEntry,bannedMovementNoLeftTurn,bannedMovementNoRightTurn,bannedMovementNoUTurn,mandatoryDirectionAheadOnly,mandatoryDirectionLeftTurnOnly,mandatoryDirectionOneWay,mandatoryDirectionRightTurnOnly,movementOrderNoOvertaking,movementOrderPriorityOverOncomingTraffic,movementOrderProhibitedAccess,kerbsideDisabledBadgeHoldersOnly,kerbsideRuralClearway,kerbsideLimitedWaiting,kerbsideLoadingPlace,kerbsideMotorcycleParkingPlace,kerbsideNoLoading,kerbsideNoStopping,kerbsideNoWaiting,kerbsideTaxiRank,kerbsideSchoolKeepClearYellowZigZagMandatory,kerbsideLoadingBay,kerbsideOtherYellowZigZagMandatory,kerbsidePermitParkingArea,kerbsideParkingPlace,kerbsideUrbanClearway,kerbsideRedRouteClearway,kerbsidePaymentParkingPlace,kerbsidePermitParkingPlace,kerbsideFootwayParking,kerbsideControlledParkingZone,kerbsideRestrictedParkingZone,kerbsideDoubleRedLines,kerbsideSingleRedLines,nonOrderMovementBoxJunction,nonOrderKerbsideBusStop,nonOrderKerbsidePedestrianCrossing,miscBusGate,miscBusLaneWithTrafficFlow,miscBusOnlyStreet,miscContraflowBusLane,miscCongestionLowEmissionZone,miscCycleLane,miscPedestrianZone,miscRoadClosure,miscLaneClosure,miscContraflow,miscFootwayClosure,miscCycleLaneClosure,miscTemporaryParkingRestriction,miscSuspensionOfOneWay,miscSuspensionOfParkingRestriction,miscSuspensionOfWeightRestriction,miscSuspensionOfBusway,miscTemporarySpeedLimit,miscRoadClosureCrossingPoint,miscBaySuspension,miscTemporaryParkingBay,miscPROWClosure’ |
|
27 |
offListRegulation.regulationFullText |
This must be a string |
3.3.1 |
Invalid ‘regulationFull Text’ |
User-defined text name for referenced regulation |
‘regulationFullText’ must be of type ‘string’ and be non-null. |
|
28 |
offListRegulation.regulationShortName |
This must be a string |
3.3.1 |
Invalid ‘regulationShortText’ |
User-defined short name for other type of regulation |
‘regulationShortText’ must be of type ‘string’ and cannot be-null. |
|
29 |
one of speedLimitValueBased, speedLimitProfileBased, generalRegulation or offListRegulation must be present. |
Condition –must be one and one only of the regulation sub types (4-way condition) |
3.1.2 |
Invalid number and type of regulations |
Object indicating the characteristics of a regulation |
One and one only of the regulation sub types (SpeedLimitValueBased, SpeedLimitProfileBased, GeneralRegulation or OffListRegulation) must be present. |
|
30 |
rateTable.additionalInformation |
If present, this must be a string and of URI format |
3.3.1 |
Additional information |
URI locator for supplementary additional information concerning use of the rate table. |
If present, additional information must be formatted as URI |
|
31 |
rateTable.type |
If present this must be a string and one of the values: ‘daily”,’hourly” |
3.3.1 |
Rate type |
Defines the type of rate in use. |
Rate type must be one of ‘daily, hourly’ |
|
32 |
rateLineCollection.applicableCurrency |
If present, this must be a string and one of the values: ‘GBP”,’EUR” |
3.3.1 |
Applicable currency |
The monetary currency that rates are specified in this rate line collection. |
applicableCurrency must be one of ‘EUR, GBP’ |
|
33 |
rateLineCollection.endValidUsagePeriod |
If present, this must be a string and of date-time format |
3.3.1 |
End usage valid period |
The end time for the validity of this rate line collection. |
If present ‘endValidUsagePeriod’ must be of type date-time YYYY-MM-DDTHH:MM:SS. |
|
34 |
rateLineCollection.maxTime |
If present, this must be an ISO 8601-compliant duration |
3.3.1 |
Max time |
A maximum session duration to be applied to this rate line collection, specified in integer minutes. |
If present ‘maxTime’ must be of type duration. |
|
35 |
rateLineCollection.maxValueCollection |
If present, this must be a decimal |
3.3.1 |
Max Value Collection |
The maximum monetary amount to be applied in conjunction with use of this rate line collection. Defined in applicable currency with 2 decimal places. |
If present ‘maxValueCollection’ must be of type decimal and not 0.0 or negative |
|
36 |
rateLineCollection.minTime |
If present, this must be an ISO 8601-compliant duration |
3.3.1 |
Min time |
A minimum session duration to be applied to this rate line collection, specified in integer minutes. |
If present ‘minTime’ must be of type duration and not 0. |
|
37 |
rateLineCollection.minValueCollection |
If present, this must be a decimal |
3.3.1 |
Min Value Collection |
The minimum monetary amount to be applied in conjunction with use of this rate line collection. Defined in applicable currency with 2 decimal places. |
If present ‘minValueCollection’ must be of type decimal and not 0.0 or negative |
|
38 |
rateLineCollection.resetTime |
If present, this must be a string and of time format |
3.3.1 |
Reset Time |
Time that rate resets. |
If present ‘resetTime’ must be between ‘00:00:00’ and ‘23:59:59’” |
|
39 |
rateLineCollection.sequence |
Values must be sequential for all rateLineCollection instances in rateTable |
3.1.2 |
Sequence |
An indicator giving the place in sequence of this rate line collection. |
‘sequence’ must be of type integer and not a negative number |
|
40 |
rateLineCollection.startValidUsagePeriod |
This must be a string and of date-time format |
3.3.1 |
Start usage valid period |
The start time for the validity of this rate line collection. |
‘startValidUsagePeriod’ must be of type date-time YYYY-MM-DDTHH:MM:SS. |
|
41 |
rateLine.description |
If present, this must be a string |
3.3.1 |
Invalid ‘Description’ |
Free-text description associated with this rate line. |
If present, description must not be empty |
|
43 |
rateLine.durationEnd |
If present, this must be an integer, representing minutes |
3.3.1 |
Invalid ‘Duration end’ |
If used, indicates the end time for the applicability of the specific rate line, generally with respect to the start of the parking or other mobility session. |
If present, durationEnd must be of type ‘integer’ and greater than 0 |
|
44 |
rateLine.durationStart |
If present, this must be an integer, representing minutes |
3.3.1 |
Invalid ‘Duration start’ |
Indicates the start time for the applicability of the specific rate line. |
If present, durationStart must be of type ‘integer’ and greater than 0 |
|
45 |
rateLine.incrementPeriod |
If present, this must be an integer representing minutes |
3.3.1 |
Increment period |
The time period for incrementing the rate line charge. If set to the same as the duration of the period between the ‘durationStart’ and ‘durationEnd’ the increment will occur once per period. |
If present, incrementPeriod must be in integer. |
|
46 |
rateLine.maxValue |
must be equal to or greater than zero |
3.3.1 |
Invalid ‘Max value’ |
The maximum monetary amount to be applied in conjunction with use of this rate line collection, regardless of the actual calculated value of the rate line. Defined in applicable currency with 2 decimal places |
If present, maxValue must be defined in applicable currency with 2 decimal places and not 0.0 |
|
47 |
rateLine.minValue |
rateLine.maxValue |
max must be greater than min |
3.3.1 |
Invalid ‘Min value’ |
The minimum monetary amount to be applied in conjunction with use of this rate line collection, regardless of the actual calculated value of the rate line. Defined in applicable currency with 2 decimal places |
If present, minValue must be defined in applicable currency with 2 decimal places and not 0.0 |
48 |
rateLine.value |
must be equal to or greater than zero |
3.3.1 |
value |
The value of the fee to be charged in respect of this rate line. |
‘value’ must be defined in applicable currency with 2 decimal places. |
|
49 |
rateLine.sequence |
Values must be sequential for all rateLine instances in rateLineCollection |
3.3.0 |
Sequence |
An indicator giving the place in sequence of this rate line collection. |
‘sequence’ must be of type integer and not a negative number |
|
50 |
rateLine.type |
This must be a string and one of the values: ‘flatRate”,’incrementingRate”,’flatRateTier”,’perUnit” |
3.3.1 |
Invalid ‘Rate line type’ |
Indicates the nature of the rate line |
‘type’ must be one of ‘flatRate,incrementingRate,flatRateTier,perUnit’ |
|
51 |
rateLine.usageCondition |
This must be a string and one of the values: ‘fixedDuration,”’fixedNumber”,’once”,’unlimited” |
3.3.1 |
Invalid ‘Rate usage condition type’ |
Indicates conditions on the use of this rate line. |
‘usageCondition’ must be one of ‘fixedDuration,fixedNumber,once,unlimited’ |
|
52 |
dayWeekMonth.applicableDay |
Each instance within dayWeekMonth shall be unique |
3.2.3 |
This rule is not currently operational |
|||
53 |
dayWeekMonth.applicableMonth |
dayWeekMonth shall be unique |
3.2.3 |
This rule is not currently operational |
|||
54 |
calendarWeekInMonth.weekInMonth |
each instance within calendarWeekInMonth shall be unique |
3.1.2 |
This rule is not currently operational |
|||
55 |
weekInMonth.applicableWeek |
each instance within weekInMonth shall be unique |
3.1.2 |
This rule is not currently operational |
|||
56 |
instanceOfDayWithinMonth |
each instance within instanceOfDayWithinMonth shall be unique |
3.1.2 |
This rule is not currently operational |
Semantic validation¶
Semantic validation ensures that submitted D-TROs contain quality and representational data beyond alignment with the schema. Semantic validation is executed at the time of submission. Semantic validation is defined through two approaches. The first is to use JSON native validation where possible to validate ranges or types, through the use of schema validation (see above section). The second is to define more complex, dependent rules using code-side validation.
Rule ID |
Applicable Data Field |
Secondary data field(s) |
Rule Definition |
Introduced in Version |
Error Message “name” |
Error Message “message” |
Error Message “rule” |
|---|---|---|---|---|---|---|---|
1 |
source.currentTraOwner |
This must be an integer and numeric value of the integer must match an entry in the D-TRO user code list |
3.2.2 |
Invalid ‘Current Traffic regulation authority current owner’ |
Current Traffic regulation authority maintaining this D-TRO (SWA-like code) |
Current TRA must be a valid SWA-like code and known to the D-TRO Service; the TRA code must correspond with the appropriate App-ID |
|
2 |
source.traAffected |
This must be an array of integers, comma separated, and numeric value(s) must match an entry in the D-TRO user code list |
3.2.3 |
Invalid ‘traAffected’ |
Traffic regulation authorities who roads are affected by this D-TRO |
TRA affected must be a valid SWA-like code and known to the D-TRO Service; the TRA |
|
3 |
source.traCreator |
This must be an integer, and numeric value must match an entry in the D-TRO user code list |
3.2.2 |
Invalid ‘traCreator’ |
Traffic regulation authority originally creating this D-TRO (SWA-like code) |
TRA creator must be a valid SWA-like code and known to the D-TRO Service; the TRA |
|
4 |
externalReference.lastUpdateDate |
This must be a date in the past |
3.5.1 |
Invalid last update date |
Indicates the date the USRN reference was last updated,lastUpdateDate’ must be of type ‘System.DateTime’, and shall not be in the future |
||
5 |
uniqueStreetReferenceNumber.usrn |
This must be an integer representing the ID of the Unique Street Reference Number that appears in the National Street Gazetteer |
3.5.1 |
Invalid USRN |
One or more ‘usrn’ are invalid |
usrn’ value should be between 0 and 99999999 and specified as an integer (no leading zeros). This shall correspond to a value found in the National Street Gazetteer |
|
6 |
maximumWidthCharacteristic.vehicleWidth |
Where provided it must be >0 <=6m |
3.5.1 |
||||
7 |
maximumHeightCharacteristic.vehicleHeight |
Where provided it must be >0 <=6m |
3.5.1 |
||||
8 |
maximumLengthCharacteristic.vehicleLength |
Where provided it must be >0 <=40m |
3.5.1 |
||||
9 |
maximumGrossWeightCharacteristic.grossVehicleWeight |
Where provided it must be >0 <=50t |
3.5.1 |
||||
10 |
heaviestAxleWeightCharacteristic.heaviestAxleWeight |
Where provided it must be >0 <=50t |
3.5.1 |
||||
11 |
vehicleCharacteristics.yearOfFirstRegistration |
shall be >1900 and less than or equal to current year value |
3.5.1 |
||||
12 |
timeValidity.start |
timeValidity.end |
end must be later than start if present |
3.5.1 |
|||
13 |
timePeriodOfDay.startTimeOfPeriod |
timePeriodOfDay.endTi meOfPeriod |
End must be later than start |
3.5.1 |
|||
14 |
consultation.startOfConsultation |
consultation.endOfConsultation |
End date must be later than or equal to start date |
3.5.1 |
Invalid ‘startOfConsultation’ |
Time and date of the end of the consultation period. |
startOfConsultation’ cannot be after ‘endOfConsultation’ |
Validation strategy for supporting multiple versions¶
When a D-TRO is submitted the request body must include a version of the data schema that the D-TRO is to be validated against. There is a relationship between the schema version number and a semantic rules version number document. As semantic validation rules are defined in table 8, they are assigned an introduced in version number showing which version they are applied to, therefore any D-TRO submitted with the corresponding schema version will be validated against that versions ruleset and any lower versions ruleset. If a D-TRO is submitted against one version of the schema and semantic rules, future updates can be made against the version of the schema it was originally submitted against. Updates can also be submitted against a higher version of the schema and rules and will be accepted against the higher version if validation is successful.
Assumptions, Constraints, Risks and Dependencies¶
ID |
Scenario |
Impact |
|---|---|---|
01 |
D-TRO maintains the D-TRO user code list which is synchronised with the SWA code list where the user exists in the SWA code list. The SWA code list used is maintained externally by GeoPlace (link https://www.geoplace.co.uk/) so may change without notice |
A change to the SWA code list may render previously accepted records or D-TRO user codes invalid if an update is attempted if the code changes. |
02 |
DfT may not be aware of the association between a TRA and a DSP |
Records may be rejected if a system is not in place for TRAs to nominate DSPs to provide their data. |