Agreement with the DIGGS validator¶
pyDIGGS is one implementation of DIGGS validation. The DIGGS project has its own: the DIGGSml XSLT validator, a set of XSLT 3.0 stylesheets that check structure, schema location, code lists, dictionaries, Schematron rules, geometry, coordinate reference systems, coordinates and deprecations. This page runs both on every file of the public conformance corpus and lists every file where their verdicts differ, with the reason.
A difference is not hidden and not waved through. Each one must be explained in
conformance/intended.toml,
and the explanation must cover every error that makes the difference. The check fails on
a difference nobody has explained, on an explanation that no longer applies, and on a
file that agrees again but is still listed.
How the comparison is run¶
- The same files. Every file of the corpus: the DIGGS project's own examples (DIGGS
2.5.a, 2.6 and 3.0) and the external files pinned by commit and SHA-256 in
conformance/corpus.toml. Files that pyDIGGS also checks under another profile (3.1-dev) are compared once, under their own: the validator reads the schema the file names and cannot be told otherwise. - The verdict. A file is valid for pyDIGGS when its report has no error
(
report.ok). It is valid for the validator when it ran to the end and wrote noERRORmessage. Warnings and information messages are counted but do not decide. - The validator, pinned. Its files are pinned by commit, size and SHA-256 in
conformance/xslt-validator.toml, run with SaxonC-HE 12.7, the Saxon release the validator's repository ships, and never committed here (that repository states no licence). - Offline, and independent of any service. Every URL the validator asks for is answered from a pinned local copy: the DIGGS schemas and dictionaries pyDIGGS bundles, at the addresses diggsml.org publishes them, and the validator's own files. Any other URL is unreachable during the run. That includes the units API the validator's dictionary step and Schematron rules call, so where they would need it they report that it could not be reached (a warning), and the job sends nothing anywhere. It also means the validator cannot download coordinate reference system definitions; the reasons below say which differences come from that.
- Recorded, then checked. The validator's outcome for every file is recorded in
conformance/xslt-expected.toml, as pyDIGGS's is inconformance/expected.toml. A CI job runs the validator again whenever either changes, fails when its outcome differs from the record, and fails on any difference that is not explained. The test suite checks the explanations against the records on every change, without the validator. This page is built from the same records.
The verdict is a coarse measure. Two implementations can both call a file invalid for different reasons, and that counts as agreement here; the error kinds at the end of the page show what the validator reports.
44 files, 8 with the same verdict, 36 with different verdicts, every one explained below.
| Validator | DIGGSml/validation at 68debbe |
| XSLT processor | SaxonC-HE 12.7 (saxonche 12.7.0, conformance/xslt-requirements.txt): the Saxon release DIGGSml/validation ships (lib/saxon-he-12.7.jar) |
| pyDIGGS | the outcomes recorded in conformance/expected.toml |
Where the verdicts differ¶
Reasons¶
CRS definitions are not fetched in the job¶
The validator's CRS step downloads the definition of every srsName from the OGC
register (www.opengis.net/def/crs/...) and reports an error when it cannot. The
agreement job runs offline, so that download fails and every EPSG srsName becomes an
error. pyDIGGS checks the same names against the EPSG subset it bundles and reports a
name it does not recognise as a warning (geometry.crs-unresolvable). This is a
difference of the job, not of the rules: run online, the validator would accept most of
these names.
The XSLT validator reports an error that pyDIGGS does not. Files: 10.
srsName forms the validator does not accept¶
The validator accepts an srsName only as a URL on its allow-list (opengis.net/def,
diggsml.org, epsg.org/api) or as #id for a reference system in the file, and
reports anything else as an error. The older DIGGS examples use DIGGS CRS URNs
(urn:diggs:def:crs:DIGGS:0.1:26911_5703) and name a linear reference system in the
file by its id without the # (srsName="B-001-0-12-lsr"). pyDIGGS recognises both, as
the DIGGS File Inspector does, and warns only about a name it cannot resolve
(geometry.crs-unresolvable).
The XSLT validator reports an error that pyDIGGS does not. Files: 22.
srsName points to an id that is not in the file¶
An srsName="#id" names a linear reference system that should be in the same file. When
no element has that gml:id, the validator reports an error; pyDIGGS reports a warning
(geometry.crs-unresolvable), because the file is schema-valid and the rest of it can
still be read.
The XSLT validator reports an error that pyDIGGS does not. Files: 13.
Code values without a DIGGS code list (codeType step)¶
For elements that have a DIGGS standard code list (rolePerformed, abundanceCode,
boreholeType, propertyClass ...), the validator's codeType step reports an error when
the value carries no codeSpace pointing at that list. pyDIGGS does not run this step
yet (the codeType step is reserved in diggs-findings): a value without a codeSpace
is valid by the schema, and pyDIGGS checks a codeSpace only where there is one
(the dictionary step).
The XSLT validator reports an error that pyDIGGS does not. Files: 26.
A posList with fewer than two positions¶
The validator's coordinate step requires a gml:posList to hold at least two positions
(2 × srsDimension values). Some older examples give a one-value posList on a
one-dimensional linear reference (a single depth). pyDIGGS has no coordinate step yet,
and the schema accepts the list.
The XSLT validator reports an error that pyDIGGS does not. Files: 6.
A geometry object without srsName and srsDimension¶
Both implement the same rule, from the validator's geometry module: a geometry object
needs srsName and srsDimension on itself or on an ancestor. When neither has them,
the validator reports an error and pyDIGGS a warning (geometry.srs-attributes), a
choice documented in Findings: the coordinates are still there, and the
reference system is often given once on the object's gml:pos or gml:posList.
The XSLT validator reports an error that pyDIGGS does not. Files: 10.
Every file¶
E, W, I: errors, warnings and information messages. The XSLT validator's error messages are listed by kind (its own text, with values left out).
| File | pyDIGGS | XSLT validator | Same verdict |
|---|---|---|---|
inspector/InspectorTestFile.xml |
invalid (15 E, 31 W) | invalid (121 E, 2210 W, 189 I) | yes |
inspector/SF_Project_Lith_Test.xml |
invalid (84 E, 96 W) | invalid (48 E, 241 W, 725 I) | yes |
inspector/SeismicConeExample.xml |
valid (0 E, 4 W) | invalid (3 E, 7 W, 6 I) | no |
official/2.5.a/AtterbergExample.xml |
valid (0 E, 7 W) | invalid (6 E, 10 W, 0 I) | no |
official/2.5.a/LithoGrading.xml |
valid (0 E, 16 W) | invalid (60 E, 147 W, 137 I) | no |
official/2.5.a/ODOT_600304_20180702.xml |
valid (0 E, 70 W) | invalid (284 E, 302 W, 284 I) | no |
official/2.5.a/ODOT_600339_20180702.xml |
valid (0 E, 113 W) | invalid (331 E, 412 W, 366 I) | no |
official/2.5.a/ODOT_Example_2_20180702.xml |
valid (0 E, 234 W) | invalid (657 E, 827 W, 752 I) | no |
official/2.5.a/PorePressureDissipation.xml |
valid (0 E, 1 W) | invalid (3 E, 4 W, 0 I) | no |
official/2.5.a/StrengthExample.xml |
valid (0 E, 12 W) | invalid (1 E, 15 W, 0 I) | no |
official/2.5.a/cptExample.xml |
valid (0 E, 1 W) | invalid (3 E, 10 W, 3 I) | no |
official/2.5.a/water_content.xml |
valid (0 E, 4 W) | invalid (3 E, 6 W, 0 I) | no |
official/2.6/Aeromag.xml |
valid (0 E, 2 W) | invalid (5 E, 2 W, 1 I) | no |
official/2.6/AtterbergExample-from25.xml |
invalid (2 E, 2 W) | invalid (6 E, 12 W, 0 I) | yes |
official/2.6/CPT_and_PorePressureDissipation.xml |
valid (0 E, 2 W) | invalid (6 E, 21 W, 0 I) | no |
official/2.6/CompactionGroutingExample.xml |
valid (0 E, 14 W) | invalid (18 E, 3 W, 3 I) | no |
official/2.6/DeepSoilMixingExample-Shortened.xml |
valid (0 E, 24 W) | invalid (5 E, 39 W, 0 I) | no |
official/2.6/DocumentationExample.xml |
valid (0 E, 38 W) | invalid (23 E, 68 W, 12 I) | no |
official/2.6/FieldSurveyExample.xml |
valid (0 E, 19 W) | invalid (16 E, 0 W, 0 I) | no |
official/2.6/JetGroutingExample.xml |
valid (0 E, 24 W) | invalid (2 E, 45 W, 0 I) | no |
official/2.6/LabCompaction.xml |
valid (0 E, 4 W) | invalid (2 E, 4 W, 0 I) | no |
official/2.6/LithoGrading-from25.xml |
valid (0 E, 16 W) | invalid (60 E, 147 W, 137 I) | no |
official/2.6/LugeonTestExample.xml |
valid (0 E, 3 W) | invalid (11 E, 3 W, 2 I) | no |
official/2.6/ODOT_600304_20180702-from25.xml |
valid (0 E, 70 W) | invalid (284 E, 302 W, 284 I) | no |
official/2.6/ODOT_600339_20180702-from25.xml |
valid (0 E, 113 W) | invalid (331 E, 412 W, 366 I) | no |
official/2.6/ODOT_Example_2_20180702-from25.xml |
valid (0 E, 234 W) | invalid (657 E, 827 W, 752 I) | no |
official/2.6/PermeationGroutingExample.xml |
valid (0 E, 40 W) | invalid (42 E, 12 W, 12 I) | no |
official/2.6/PorePressureDissipation.xml |
valid (0 E, 2 W) | invalid (6 E, 21 W, 0 I) | no |
official/2.6/PorePressureDissipationOnly.xml |
valid (0 E, 4 W) | invalid (3 E, 10 W, 0 I) | no |
official/2.6/RockGroutingExample.xml |
valid (0 E, 18 W) | invalid (16 E, 19 W, 2 I) | no |
official/2.6/StrengthExample-from25.xml |
valid (0 E, 12 W) | invalid (1 E, 15 W, 0 I) | no |
official/2.6/cptExample-from25.xml |
valid (0 E, 1 W) | invalid (3 E, 10 W, 3 I) | no |
official/2.6/water_content-from25.xml |
valid (0 E, 4 W) | invalid (3 E, 6 W, 0 I) | no |
official/3.0/Aeromag.xml |
valid (0 E, 1 W) | invalid (5 E, 2 W, 1 I) | no |
official/3.0/Borehole-CPT_Example_Annotated.xml |
valid (0 E, 1 W) | invalid (4 E, 185 W, 0 I) | no |
official/3.0/GeophysicalFieldSurveyExamples.xml |
valid (0 E, 20 W) | invalid (17 E, 0 W, 0 I) | no |
official/3.0/MWDExample.xml |
valid (0 E, 0 W) | invalid (2 E, 8 W, 0 I) | no |
official/3.0/Piezometer_Example.xml |
valid (0 E, 2 W) | invalid (7 E, 4 W, 0 I) | no |
official/3.0/PorePressureDissipation_Example.xml |
invalid (8 E, 8 W) | invalid (25 E, 30 W, 1 I) | yes |
official/3.0/TrenchWallExample.xml |
valid (0 E, 0 W) | invalid (4 E, 0 W, 0 I) | no |
official/LICENSE |
invalid (1 E, 0 W) | stopped | yes |
official/known_invalid/2.6_Temporal_Spatial_CRS_Example.xml |
invalid (1 E, 0 W) | invalid (1 E, 0 W, 0 I) | yes |
official/known_invalid/3.0_PileDrivingExample_schema-dev.xml |
invalid (6 E, 0 W) | invalid (7 E, 20 W, 3 I) | yes |
official/known_invalid/PlanarReference_3ns.xml |
invalid (4 E, 8 W) | invalid (11 E, 16 W, 0 I) | yes |
The XSLT validator's errors, by kind¶
| Kind | Messages | Files |
|---|---|---|
| CRS Validation: The srsName reference: "…" is either malformed or is not on the white list of approved URLs. If this is a reference to a linear reference system within the DIG… | 1218 | 24 |
| Coordinate Validation: The <posList> element contains # coordinate values but requires a minimum of # values (# × srsDimension of #) to define at least one complete coordinate tuple. | 788 | 6 |
| CodeType Validation: <abundanceCode> should reference a DIGGS Standard code list dictionary using the codeSpace attribute. Use one of these dictionaries to maximize interoperabilit… | 299 | 7 |
| CRS Validation: No element with id="…" found in the document. | 287 | 15 |
| CRS Validation: The resource at "…" could not be accessed. | 231 | 15 |
| CodeType Validation: <rolePerformed> should reference a DIGGS Standard code list dictionary using the codeSpace attribute. Use one of these dictionaries to maximize interoperabilit… | 112 | 26 |
| Geometry Validation: Geometry object <PointLocation> is missing required srsName and srsDimension attributes. Both attributes must be present together in the object itself, or in a… | 58 | 10 |
| CodeType Validation: <classificationCode> should reference a DIGGS Standard code list dictionary using the codeSpace attribute. Use one of these dictionaries to maximize interopera… | 50 | 2 |
| CodeType Validation: <propertyClass> should reference a DIGGS Standard code list dictionary using the codeSpace attribute. Use one of these dictionaries to maximize interoperabilit… | 20 | 2 |
| Dictionary Validation: Check 5: Code "…" is not found in the code list dictionary at "…". | 18 | 2 |
| CodeType Validation: <boreholeType> should reference a DIGGS Standard code list dictionary using the codeSpace attribute. Use one of these dictionaries to maximize interoperability… | 13 | 3 |
| CodeType Validation: <diggs_geo:propertyClass> should reference a DIGGS Standard code list dictionary using the codeSpace attribute. Use one of these dictionaries to maximize inter… | 3 | 3 |
| CodeType Validation: <boreholePurpose> should reference a DIGGS Standard code list dictionary using the codeSpace attribute. Use one of these dictionaries to maximize interoperabil… | 2 | 2 |
| CodeType Validation: <soundingPurpose> should reference a DIGGS Standard code list dictionary using the codeSpace attribute. Use one of these dictionaries to maximize interoperabil… | 1 | 1 |
| DIGGS Structure: File selected for validation is not a DIggs file. Expected Diggs as root element, found "…". Expected exactly # DocumentInformation element in the specific pat… | 1 | 1 |
| Dictionary Validation: Check 6: "…" is not a valid code for <rolePerformed> in this specific context. This element is not matched by any of these allowable xPaths: //diggs:samplingFe… | 1 | 1 |
| Geometry Validation: Geometry object <LinearExtent> is missing required srsName and srsDimension attributes. Both attributes must be present together in the object itself, or in a… | 1 | 1 |
Run it yourself¶
From a checkout of pyDIGGS, with uv:
$ python scripts/conformance.py fetch
$ python scripts/agreement.py fetch
$ uv venv --python 3.12 .cache/agreement/venv
$ uv pip sync --require-hashes --python .cache/agreement/venv conformance/xslt-requirements.txt
$ .cache/agreement/venv/bin/python scripts/agreement.py check --run
0 problem(s)
The first two commands download the external corpus files and the validator's files
(each checked against its recorded size and SHA-256). The next two install SaxonC-HE in
a throwaway environment, from wheels whose hashes are pinned, and the last runs the
comparison. SaxonC-HE is never a dependency of pyDIGGS. agreement.py record rewrites
conformance/xslt-expected.toml after a deliberate change, such as moving to a newer
validator commit; review its diff like any golden file.