GeoNet / help

An issues repo for technical help questions.
6 stars 3 forks source link

QuakeML validation issues #2

Closed carolinelittle closed 8 years ago

carolinelittle commented 8 years ago

New issue from Chet at VUW:

I’ve just downloaded a few hundred QuakeML files from the GeoNet catalog (see attached XML) but they fail to validate against the QuakeML schema. The issue appears to be with the #s contained in the ‘publicID’ attribute.

A section of the output from xmllint validating the attached file against the QuakeML-1.2.xsd schema looks like this:

chet@chet-Dell-Precision-M3800:~/xml_validation$ xmllint --noout --valid --schema ~/xml_validation/QuakeML-1.2.xsd ~/xml_validation/2013p614135_orig.xml /home/chet/xml_validation/2013p614135_orig.xml:2: validity error : Validation failed: no DTD found ! ="http://quakeml.org/xmlns/quakeml/1.2" xmlns="http://quakeml.org/xmlns/bed/1.2" ^ /home/chet/xml_validation/2013p614135_orig.xml:25: element stationMagnitude: Schemas validity error : Element '{http://quakeml.org/xmlns/bed/1.2}stationMagnitude', attribute 'publicID': 'smi:scs/0.7/NLL.20130816054632.049483.46401#staMag.ML#NZ.AMCZ' is not a valid value of the atomic type '{http://quakeml.org/xmlns/bed/1.2}ResourceReference'. /home/chet/xml_validation/2013p614135_orig.xml:57: element stationMagnitude: Schemas validity error : Element '{http://quakeml.org/xmlns/bed/1.2}stationMagnitude', attribute 'publicID': 'smi:scs/0.7/NLL.20130816054632.049483.46401#staMag.MLv#NZ.AMCZ' is not a valid value of the atomic type '{http://quakeml.org/xmlns/bed/1.2}ResourceReference'. /home/chet/xml_validation/2013p614135_orig.xml:90: element stationMagnitude: Schemas validity error : Element '{http://quakeml.org/xmlns/bed/1.2}stationMagnitude', attribute 'publicID': 'smi:scs/0.7/NLL.20130816054632.049483.46401#staMag.ML#NZ.ANWZ' is not a valid value of the atomic type '{http://quakeml.org/xmlns/bed/1.2}ResourceReference'.

Removing all # s from the file results in validation using QuakeML-1.2.xsd.

A separate issue I’ve run into involves a lack of an ‘originID’ element within the ‘stationMagnitude’ element. Using the attached RelaxNG schema used by SeisHub (database structure built on Obspy), jing outputs the following errors:

chet@chet-Dell-Precision-M3800:~/xml_validation$ jing QuakeML-1.2-merged.rng 2013p614135_orig.xml /home/chet/xml_validation/2013p614135_orig.xml:25:98: error: value of attribute "publicID" is invalid; must be a URI /home/chet/xml_validation/2013p614135_orig.xml:37:26: error: element "stationMagnitude" incomplete; missing required element "originID" /home/chet/xml_validation/2013p614135_orig.xml:57:99: error: value of attribute "publicID" is invalid; must be a URI /home/chet/xml_validation/2013p614135_orig.xml:69:26: error: element "stationMagnitude" incomplete; missing required element "originID" /home/chet/xml_validation/2013p614135_orig.xml:90:98: error: value of attribute "publicID" is invalid; must be a URI /home/chet/xml_validation/2013p614135_orig.xml:102:26: error: element "stationMagnitude" incomplete; missing required element "originID" /home/chet/xml_validation/2013p614135_orig.xml:122:99: error: value of attribute "publicID" is invalid; must be a URI /home/chet/xml_validation/2013p614135_orig.xml:134:26: error: element "stationMagnitude" incomplete; missing required element "originID"

Does GeoNet validate these files against a different schema than the standard QuakeML-1.2.xsd, and if so what schema do you use? I’m hoping to make use of these event files using SeisHub as a database while processing data using Obspy tools but cannot do so if they don’t validate properly.