# Presentation: 661016

## Introduction to WQX XML Schema

- Doug Timms, enfoTech
- November 28, 2007

## Topics

- Getting Started
- Schema Structure
- Handling of Attachments
- Other things to look out for

- July 17, 2006

## Helpful Resources

- Data Exchange Template (WQX_DET_v1.0.xls)
- XML Schema (WQX_Schema_v1.0.zip)
- Flow Configuration Document (WQX_FCD_v1.0.zip)
- Domain Value Database (WQX_ODS_MS_Access.zip)
- 1,2,3 found at: _[http://www.exchangenetwork.net/exchanges/water/wqx.htm](http://www.exchangenetwork.net/exchanges/water/wqx.htm)_
- 4 found at: _[http://www.epa.gov/storet/wqx_downloads.html](http://www.epa.gov/storet/wqx_downloads.html)_

- July 17, 2006

## Data Exchange Template

- July 17, 2006

## WQX XML Schema File Structure

- July 17, 2006

## Simplified Data Structure

- July 17, 2006

## Monitoring Location

- Consists of Following Groups:
- _Monitoring Location Identity_
- _Monitoring Location Geospatial_
- _Attachments (i.e. Binary Object)_

- July 17, 2006

## Activity

- Consists of Following Groups:
- _Activity Description_
- _Activity Location_
- _Sample Description_
- _Attachments (i.e. Binary Object)_
- _Children Results_
- Used to report expanded list of Activity Types (Field Measurement, Quality Control Samples, Dups, Blanks, Vertical Profile, Data Logger, etc...)

- July 17, 2006

## Activity Group

- Used as a generic method to group related Activities:
- _Field Set:_ Used to group field activities
- _QC Sample:_ Used to group activities/samples with related quality control samples
- _Replicate:_ Used to group samples/measurements of the same type, medium, etc
- _Subsample:_ Used to group samples with subsamples
- Completely optional and up to data provider on what level of detail to provide

- July 17, 2006

## Domain Values

- For any fields that are marked as “Domain List = Yes”, you will need to either:
- use EPA/WQX’s values in your database
- Create a mapping table (or procedure) that converts your codes to EPA’s
- Special Case: ResultAnalyticalMethod
- Allows either using EPA’s domain values or your own
- AnalyticalMethodContext:
- If = EPA predefined value (NIOSH, USEPA, AOAC, etc)
- Otherwise set =- to your Organization ID
- Otherwise it will be rejected

- July 17, 2006

## Transaction Handling

- Submit data either as “Insert/Updates” or “Deletes”
- Insert/Update:
- Use WQX_WQX_v1.0.xsd
- Don’t need to specify insert or update: system will recognize this
- In order to update a result, must resupply all information for that activity
- Delete:
- Use WQX_WQX_Delete_v1.0.xsd
- Just need to supply Primary Key for the Project, Monitoring Location, Activity, or Activity Group you would like to delete
- When a component is deleted, all children information is deleted as well
- Your system should have some capability to understand which data has been updated since your last submission

- July 17, 2006

## Including Attachments

- Attachments can be tracked at:
- Project
- Monitoring Location
- Activity
- Result
- Store the attachment’s filename (including extension) in XML
- Therefore each attachment must have a unique filename
- Include attachments outside of XML, in ZIP file

- July 17, 2006

## Questions

- July 17, 2006