Skip to content

Wells Classification #25

Description

@prayaslashkari

Summary

The Well Source filter right now shows only two choices, Illinois (ISGS) and Maine (MGS). This issue explains how that works today and suggests two ways we could classify wells.

Important background: there are two separate well datasets

Inventory wells Sampled wells
What they are Full well registries from state geological surveys. They tell us where wells exist. Wells where someone took a contaminant sample. They tell us where contamination was measured.
Endpoint hydrologykg sawgraph
Size 379k (IL) plus 153k (ME), about 532k total about 5,330
States Illinois and Maine only about 10 states (ME, MN, AZ, MA, AL, IN, IL, NH, KS, SC)
Classified by IL: il_isgs:wellPurpose. ME: me_mgs:ofWellType coso:ofFeatureType (shared vocabulary)
In the current dropdown? Yes No

The current dropdown filters the inventory dataset. Full inventories only exist for Illinois and Maine, so the two choices are correct for that data. Wells from other states only show up in the small sampled dataset.

1. Current behavior

What we show: a multi select called Well Source with two fixed choices, Illinois Wells (ISGS) and Maine Wells (MGS). There is no live query and no counts. Picking a source limits the query to that state's well class. If nothing is picked, both are used.

How it works:

  • The options are a fixed list in code (WELL_TYPE_OPTIONS).
  • Each option maps to a class, il_isgs:ISGS-Well or me_mgs:MGS-Well.
  • A WELL_TO_STATE map (ISGS to FIPS 17, MGS to FIPS 23) shows a warning when the chosen state does not match the chosen source.
  • The chosen types become UNION clauses in the well query, which runs against the hydrologykg endpoint.

SPARQL (from buildWellsByIri in src/engine/templates/hydrate.ts):

# well type filter. If nothing is picked, both states are used.
{ ?well rdf:type il_isgs:ISGS-Well } UNION { ?well rdf:type me_mgs:MGS-Well }

SELECT DISTINCT ?well ?wellWKT ?wellName ?s2cell
  ?meUse ?meWellType ?meDepth ?meOverburden
  ?ilOwner ?ilDepth ?ilPurpose ?ilYield
WHERE {
  VALUES ?well { ... }
  ?s2cell spatial:connectedTo ?well ;
          rdf:type kwg-ont:S2Cell_Level13 .
  { ?well rdf:type il_isgs:ISGS-Well } UNION { ?well rdf:type me_mgs:MGS-Well }
  ?well geo:hasGeometry/geo:asWKT ?wellWKT .
  OPTIONAL { ?well rdfs:label ?wellName . }
  # Maine (MGS) attributes
  OPTIONAL { ?well me_mgs:hasUse ?meUse . }
  OPTIONAL { ?well me_mgs:ofWellType ?meWellType . }
  OPTIONAL { ?well me_mgs:wellDepth/qudt:numericValue ?meDepth . }
  OPTIONAL { ?well me_mgs:wellOverburden/qudt:numericValue ?meOverburden . }
  # Illinois (ISGS) attributes
  OPTIONAL { ?well il_isgs:hasOwner ?ilOwner . }
  OPTIONAL { ?well il_isgs:wellDepth/qudt:numericValue ?ilDepth . }
  OPTIONAL { ?well il_isgs:wellPurpose ?ilPurpose . }
  OPTIONAL { ?well il_isgs:wellYield/qudt:numericValue ?ilYield . }
}

Relevant files:

  • src/components/QueryEditor/WellFilters.tsx holds the fixed options, the state map, and the warning.
  • src/engine/templates/hydrate.ts (buildWellsByIri) has the well query and the type filter.
  • src/engine/templates/fusedQueries.ts (buildWellTypeFilterSuffixed) has the same type filter for fused queries.
  • src/engine/planner.ts sends wells blocks to the hydrologykg endpoint.
  • src/constants/prefixes.ts defines the il_isgs and me_mgs prefixes.
  • src/types/query.ts defines WellFilters.wellTypes.

2. Proposed classification

Approach A: one scheme for every state

Classify by coso:ofFeatureType, which uses the same words in every region. It applies to the roughly 5,330 sampled wells across about 10 states.

Bucket Count Codes
Water Supply about 3,053 PWSW, PUWSW, IWSW, DWS, MUW
Generic Well 1,285 Well
Monitoring 953 MW
Extraction or Agricultural 37 AW, EW

Good points: it is the same everywhere, it works across regions by design, and it needs no per state logic.

Weak points: it only covers the roughly 5,330 sampled wells, which is about 1 percent of the inventory. Maine makes up about 76 percent of it. It is also a different dataset and endpoint (sawgraph) than the current dropdown (hydrologykg).

Approach B: each state uses its own scheme

Classify each state's inventory by that state's own field.

Illinois (ISGS), by il_isgs:wellPurpose (about 379,496 wells) Count
Water supply 297,955
Engineering 52,016
Monitoring 5,802
Water test 5,553
Stratigraphic 4,547
Mineral 4,159
plus 27 more codes
Maine (MGS), by me_mgs:ofWellType (about 153,275 wells) Count
Bedrock 145,408
Gravel 2,884
Overburden 1,205
Other 161
Spring 127
GravelPacked 62
Observation 23
Dug 20

Other states have no inventory data, so they have no native scheme. Only Approach A applies to them.

Good points: it covers all of the roughly 532k inventory wells and gives the richest detail per state.

Weak points: the two schemes do not line up. Illinois classifies by purpose (what the well is for). Maine classifies by construction and geology (what it is drilled into). Water and Bedrock describe different things, so they cannot sit on one shared axis. Also only Illinois and Maine have any scheme.

Trade off

There is no option that is both full coverage and the same across states, because the graph has no shared classification over the inventory data. The choice depends on which set of wells the filter should target, the sampled wells or the full inventory.

Open question

Confirm which set of wells the Well Source filter is meant to serve, the map layer of inventory wells or the contaminant sample queries, before we pick Approach A or Approach B.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions