Validation Rules Reference
This page documents every validation rule used by the BS 5930 Soil Description Checker and the AGS Quality Checker.
Rules are grouped by category. Each rule has a code (e.g. GEOL_003), a severity level, and a BS 5930 reference where applicable. Results are advisory - engineering judgment should always take priority.
Severity Levels
| Severity | Meaning |
|---|---|
| Error | Must be fixed - indicates invalid or impossible data |
| Warning | Should be reviewed - may indicate a problem |
| Info | Best practice suggestion |
BS 5930 Description Rules
These rules validate geological descriptions against BS 5930:2015+A1:2020.
Tier 1: Critical Errors
GEOL_003: Invalid Soil Combination
Severity: Error | BS 5930: S33.4.4.4
Flags two types of invalid soil combinations:
1. Self-referencing modifiers - a soil cannot be modified by a term derived from itself.
| Modifier | Main Soil | Example | Result |
|---|---|---|---|
| clayey | CLAY | "clayey CLAY" | Error |
| silty | SILT | "silty SILT" | Error |
| sandy | SAND | "sandy SAND" | Error |
| gravelly | GRAVEL | "gravelly GRAVEL" | Error |
2. Inappropriate fine-on-fine subdivisions - when the main soil is fine (CLAY or SILT) and the modifier is also fine, using "slightly" or "very" qualifiers is not appropriate per BS 5930.
| Example | Result |
|---|---|
| "silty CLAY" | Valid |
| "slightly silty CLAY" | Error - subdivision not appropriate |
| "very silty CLAY" | Error - subdivision not appropriate |
| "slightly sandy CLAY" | Valid - coarse-on-fine subdivision is OK |
GEOL_005: Invalid Density/Consistency
Severity: Error | BS 5930: Tables 8, 10
Wrong strength term type for the soil classification.
- Fine soils (CLAY, SILT) use consistency terms: very soft, soft, firm, stiff, very stiff
- Coarse soils (SAND, GRAVEL) use density terms: very loose, loose, medium dense, dense, very dense
| Description | Result |
|---|---|
| "Firm brown CLAY" | Valid |
| "Dense brown CLAY" | Error - density on fine soil |
| "Dense brown SAND" | Valid |
| "Stiff brown SAND" | Error - consistency on coarse soil |
GEOL_013: Fractions Exceed 100%
Severity: Error | BS 5930: S33.4.4.5 NOTE 2
Flags descriptions where implied proportions are mathematically impossible.
| Combination | Calculation | Result |
|---|---|---|
| very sandy + very gravelly | >65% + >65% = >130% | Error |
| gravelly + very sandy | 35-65% + >65% = >100% | Error |
| slightly sandy + gravelly | <35% + 35-65% = <100% | Valid |
| slightly sandy + slightly gravelly | <35% + <35% = <70% | Valid |
GEOL_020: Missing Primary Material Type
Severity: Error | BS 5930: S33.4.4.1
Every geological description must include a primary material in CAPITALS.
Valid primary materials include: CLAY, SILT, SAND, GRAVEL, COBBLES, BOULDERS (soils); SANDSTONE, LIMESTONE, CHALK, MUDSTONE, GRANITE etc. (rocks); CONCRETE, TARMAC, BRICK, MADE GROUND (anthropogenic); PEAT, TOPSOIL (organic).
| Description | Result |
|---|---|
| "Brown CLAY" | Valid |
| "Brown clay" | Error - no CAPS material |
| "Brown silty sandy" | Error - no primary material |
Tier 2: Warnings
GEOL_001: Legend Code Mismatch
Severity: Warning (wrong primary material) / Info (more specific code available) | BS 5930: S33.5
Validates that the geological description matches the assigned legend code using AGS dictionary mappings. The result depends on what differs:
- Wrong primary material (e.g. a CLAY code on a SAND or SILT description) is a warning - the material itself is misrepresented.
- Correct primary but different secondary modifiers (e.g. a plain CLAY code on a "silty CLAY") is info only - the code is right for the material, just less specific than it could be. The message suggests a more specific code rather than flagging an error.
| Legend Code | Expected | Actual Description | Result |
|---|---|---|---|
| 201 | CLAY | "Brown CLAY" | Valid |
| 201 | CLAY | "Very stiff grey silty CLAY" | Info - consider 202 (Silty CLAY) |
| 201 | CLAY | "Brown clayey SILT" | Warning - mismatch (material is SILT) |
| 201 | CLAY | "Brown SAND" | Warning - mismatch |
Note: Only applies to AGS data with legend codes. Not checked in single description mode.
GEOL_002: Incorrect Modifier Order
Severity: Warning | BS 5930: S33.4.4.5
Secondary fractions should be ordered with coarse modifiers before fine modifiers.
Correct order: sandy/gravelly/cobble/boulder then silty/clayey
| Description | Result |
|---|---|
| "sandy silty CLAY" | Valid |
| "silty sandy CLAY" | Warning - wrong order |
| "gravelly clayey SAND" | Valid |
| "clayey gravelly SAND" | Warning - wrong order |
GEOL_004: Invalid Test for Soil Type
Severity: Warning | BS 5930: Table 33
Pocket penetrometer and hand vane tests are only valid for fine soils.
| Test Type | Soil Type | Result |
|---|---|---|
| Hand penetrometer | CLAY | Valid |
| Hand penetrometer | SAND | Warning - invalid test |
| Vane | SILT | Valid |
| Vane | GRAVEL | Warning - invalid test |
Only applies to AGS data with IPEN/IVAN tables.
GEOL_007: Consistency on Coarse Soil
Severity: Warning | BS 5930: Tables 8, 10
Consistency terms (soft, firm, stiff) used on SAND or GRAVEL.
GEOL_008: Density on Fine Soil
Severity: Warning | BS 5930: Tables 8, 10
Density terms (loose, dense) used on CLAY or SILT.
GEOL_009: Invalid Consistency Term
Severity: Warning | BS 5930: Table 8
Detects non-standard consistency terms on fine soils.
Valid terms: very soft, soft, firm, stiff, very stiff
| Term | Result |
|---|---|
| "Firm CLAY" | Valid |
| "Hard CLAY" | Warning - use "very stiff" |
| "Medium CLAY" | Warning - use "firm" |
GEOL_010: Invalid Density Term
Severity: Warning | BS 5930: Table 10
Detects non-standard density terms on coarse soils.
Valid terms: very loose, loose, medium dense, dense, very dense
| Term | Result |
|---|---|
| "Dense SAND" | Valid |
| "Compact SAND" | Warning - use "dense" |
GEOL_011: Invalid Coarse Secondary Term
Severity: Warning | BS 5930: Table 16
Cross-references description terms against PSD lab data for coarse soils. Checks whether the quantifier (slightly/unqualified/very) matches the measured proportion.
| Term | Expected % |
|---|---|
| slightly sandy/gravelly | <5% |
| sandy/gravelly | 5-20% |
| very sandy/gravelly | >20% |
Only applies to AGS data with GRAG/GRAT lab data.
GEOL_012: Invalid Fine Secondary Term
Severity: Warning | BS 5930: Table 17
Same as GEOL_011 but for fine modifiers (clayey, silty) on coarse soils. Uses total fines content (clay% + silt%) to validate the quantifier.
Only applies to AGS data with GRAG/GRAT lab data.
GEOL_014: Invalid Angularity Term
Severity: Warning | BS 5930: S33.4.3, Figure 7
Valid terms: very angular, angular, subangular, subrounded, rounded, well rounded
GEOL_017: Invalid Discontinuity Spacing
Severity: Warning | BS 5930: Table 7
Cross-references spacing terms with FRAC table measurements.
| Term | Spacing Range |
|---|---|
| extremely closely | <20mm |
| very closely | 20-60mm |
| closely | 60-200mm |
| medium | 200-600mm |
| widely | 600-2000mm |
| very widely | >2000mm |
Only applies to AGS data with FRAC table.
GEOL_022: Invalid Organic Term
Severity: Warning | BS 5930: Table 22
Valid terms: slightly organic, organic, very organic
GEOL_023: Invalid Carbonate Term
Severity: Warning | BS 5930: S33.4.4.6
Valid terms: slightly calcareous, calcareous, highly calcareous
GEOL_024: Invalid Rock Strength Term
Severity: Warning | BS 5930: Table 25
Valid terms: extremely weak, very weak, weak, moderately weak, medium strong, strong, very strong, extremely strong
GEOL_025: Strength/UCS Mismatch
Severity: Warning | BS 5930: Table 25
Cross-references strength terms with UCS lab data.
| Term | UCS Range (MPa) |
|---|---|
| Extremely weak | 0.6-1.0 |
| Very weak | 1-5 |
| Weak | 5-12.5 |
| Moderately weak | 12.5-25 |
| Medium strong | 25-50 |
| Strong | 50-100 |
| Very strong | 100-250 |
| Extremely strong | >250 |
Only applies to AGS data with RUCS table.
GEOL_028: Invalid Boulder/Cobble Term
Severity: Warning | BS 5930: Tables 12-15
Valid proportion terms: with occasional (<5%), with some (5-20%), with many (20-50%), with low/medium/high content
GEOL_029: Invalid Weathering Grade
Severity: Warning | BS 5930: Figure 9
Valid terms: fresh, slightly weathered, moderately weathered, highly weathered, completely weathered, residual soil
GEOL_031: Made Ground Indicators
Severity: Warning | BS 5930: S33.7
Flags descriptions containing anthropogenic materials (brick, concrete, tarmac, glass, metal, slag, ash, etc.) when the legend code does not indicate made ground.
Tier 3: Info (Best Practice)
GEOL_006: Missing Angularity
Severity: Info | BS 5930: S33.4.3
GRAVEL, COBBLES, or BOULDERS described without an angularity term.
GEOL_015: Angularity on Fine Soil
Severity: Info | BS 5930: S33.4.3
Angularity terms used on CLAY or SILT (only applicable to gravel and coarser).
GEOL_018: Invalid Colour Hue
Severity: Info | BS 5930: Table 7
Valid hues: red, pink, orange, yellow, cream, brown, green, blue, white, grey, black. Valid prefixes: light, dark, reddish, yellowish, brownish, etc.
GEOL_019: Missing Colour
Severity: Info
Description does not contain any colour term.
GEOL_021: Multiple Primary Types
Severity: Info | BS 5930: S33.4.4.1
Flags two or more non-adjacent primary soil types in CAPITALS that would usually be better written as one principal soil with the others as modifiers (e.g. "CLAY and GRAVEL" -> "gravelly CLAY").
Acceptable composites of adjacent size fractions are not flagged - "SAND and GRAVEL", "GRAVEL, COBBLES and BOULDERS", "CLAY/SILT" are all valid. The rule also ignores soil words that are not the primary: recovered rock fragments ("MUDSTONE excavated as GRAVEL and COBBLES of mudstone") and subordinate inclusions ("SAND with occasional pockets of CLAY", "very gravelly SAND with BOULDERS").
| Description | Result |
|---|---|
| "Loose brown SAND and GRAVEL" | Valid - adjacent composite |
| "GRAVEL, COBBLES and BOULDERS of concrete" | Valid - adjacent composite |
| "MUDSTONE excavated as GRAVEL and COBBLES" | Valid - recovered rock fragments |
| "SAND with pockets of CLAY" | Valid - CLAY is a subordinate inclusion |
| "Firm brown CLAY and GRAVEL" | Info - non-adjacent, consider "gravelly CLAY" |
GEOL_027: Invalid Structure for Rock
Severity: Info | BS 5930: Table 27
Bedding terms used on igneous or metamorphic rocks (GRANITE, BASALT, GNEISS, etc.) which do not have bedding.
GEOL_030: Test on Layer Boundary
Severity: Info
Pocket penetrometer or vane test recorded exactly at a geological boundary, making it ambiguous which layer is being tested.
Depth Validation Rules
These rules check for issues with depth values in geotechnical data. Only applies to AGS data.
DEPTH_001: Overlapping Geology Depths
Severity: Error
Two geology records at the same location have depth ranges that overlap.
| Range 1 | Range 2 | Result |
|---|---|---|
| 0.00-2.50m | 2.20-5.00m | Error - 2.20 < 2.50 |
| 0.00-2.00m | 2.00-4.00m | Valid - adjacent |
DEPTH_002: Depth Top Greater Than Base
Severity: Error
A record's top depth is greater than or equal to its base depth.
DEPTH_003: Record Exceeds Final Depth
Severity: Error
A depth-based record extends deeper than the location's recorded final depth (LOCA_FDEP).
DEPTH_004: Backfill Does Not Match Final Depth
Severity: Warning
Deepest backfill record doesn't reach the location's final depth (potential void). Tolerance: 10cm.
DEPTH_005: Geology Does Not Reach Final Depth
Severity: Warning
Geology descriptions don't extend to the location's final depth (missing stratigraphy). Tolerance: 10cm.
DEPTH_006: Gaps in Geology
Severity: Warning
Missing depth ranges between consecutive geology records within a location.
| Record 1 | Record 2 | Result |
|---|---|---|
| 0.00-2.00m | 2.00-4.00m | Valid - adjacent |
| 0.00-2.00m | 2.50-4.00m | Warning - 0.50m gap |
DEPTH_007: SPT Penetration Exceeds Final Depth
Severity: Error
SPT test depth plus penetration (ISPT_TOP + ISPT_NPEN/1000) exceeds the location's final depth.
Spatial Validation Rules
These rules check for issues with location coordinates. Only applies to AGS data.
SPATIAL_001: Missing Coordinates
Severity: Warning
Location has no coordinate data (no easting/northing or latitude/longitude).
SPATIAL_002: Duplicate Location Coordinates
Severity: Warning
Multiple locations share the same coordinates (within 10cm precision). Usually indicates a data entry or copy/paste error.
Date Validation Rules
These rules check for issues with date values. Only applies to AGS data.
DATE_001: End Date Before Start Date
Severity: Error
Location's end date (LOCA_ENDD) is earlier than its start date (LOCA_STAR). Compared by calendar day, so a hole started and finished on the same day is valid.
DATE_002: Future Dates
Severity: Warning
Start or end date is in the future, which usually indicates a data entry error.
Data Quality Rules
These rules check for data consistency issues. Only applies to AGS data.
DATA_001: Suspicious Values
Severity: Warning
Values that appear to be placeholders or errors: null island coordinates (0,0), zero easting/northing, placeholder depths (9999, -999), or unusually deep values (>500m).
DATA_002: Inconsistent Units
Severity: Warning
Depth values that appear to be in millimetres where metres were expected. Detected when average depth > 100 and maximum > 1000.
DATA_003: Spelling Errors
Severity: Warning
Text fields contain possible spelling mistakes. Uses a British English dictionary augmented with 200+ geological and geotechnical terms.
Completeness Rules
COMPLETE_001: Missing Required Fields
Severity: Error
Required fields (AGS KEY fields) have empty values. Only applies to AGS data.
Relationship Rules
KEY_001: Duplicate Key Fields
Severity: Error
Multiple records in the same table have identical key field values within a single location. Usually indicates duplicate data entry or copy/paste errors. Records whose key fields are entirely empty are not counted here - that is a completeness issue (see COMPLETE_001), not a duplicate.
Rules are based on BS 5930:2015+A1:2020 and maintained by the Diggy engineering team. Results are advisory - engineering judgment should always take priority.
Spotted an error? Let us know.