Invalid resource identifier for QuakeML produced by SC3

Hello,

The attached QuakeML file has been produced by SeisComP3.

It is correctly read by read_events(), but when trying to write it back to disk, I get the following error:

ValueError: The id ‘smi:org.gfz-potsdam.de/geofon/RMHP(60)>>ITAPER(3)>>BW(4,5,15)’ is not a valid QuakeML resource identifier.

This is related to the presence of the sign “>” which is encoded in the original xml file as ">” but gets decoded as “>”.

This symbol is part of the SeisComP3 filter grammar: https://www.seiscomp3.org/doc/jakarta/2015.040/base/filter-grammar.html

I think that, as long as this symbol is not decoded from its HTML representation, it should be acceptable.
So my impression is that this is an ObsPy bug.

What do you think?
Let me know if you want me to open an issue on GitHub.

Claudio

ipgp2016afqtcu.xml (20.6 KB)

Hey Claudio,

I think ObsPy is right here. And its not ObsPy but lxml:

from lxml import etree
� etree.parse(“./ipgp2016afqtcu.xml”).getroot().getchildren()[0].getchildren()[0].getchildren()[6].getchildren()[-1].text

‘smi:org.gfz-potsdam.de/geofon/RMHP(60)>>ITAPER(3)>>BW(4,5,15)’

XML has five special chars that have to be encoded, and > is among them:

Thus lxml correctly decodes it to its string representation. What is actually in the XML are the decoded > which are not valid according to the QuakeML specification. The spec/schema are of course evaluated for the decoded XML. Concluding I think ObsPy is correct in complaining here as it indeed is not a valid resource identifier. jing thinks the same and complains about the example file when validating against the quakeml relaxng schema: /Users/lion/Desktop/ipgp2016afqtcu.xml:61:127: error: value of attribute “publicID” is invalid; must be a URI � (repeated a couple of times)

Cheers!

Lion

Ignore what I said about jing - it does complain but about some other resource identifiers. I still think my reasoning is sound but let me know if you disagree. Also it might be a good idea to move the discussion to github as it might become very technical.

Hi,

please use the latest version if SeisComP3 to get the issue correct.

Regards

Dirk

Hi Dirk,

is there a changelog or a discussion somewhere regarding what changed in
seiscomp? We are currently discussing if this is valid QuakeML or not
and would be great to get some more input.

https://github.com/obspy/obspy/issues/2090

https://github.com/obspy/obspy/pull/2093

All the best,

Lion

Hi Dirk,
thanks for your reply.

Could you please explain how this issue was fixed? (and possibly provide a link to the commit on GitHub?)

Also, starting from which version the issue is fixed?

Thanks,
Claudio


Hi Lion,

  please start the discussion on the SeisComP3 forum [1] as this is community software.

Perfect! This brings together the SeisComP3 with the ObsPy community.

Best regards

Dirk

[1] https://forum.seiscomp3.org

Hi Claudio,

  please post your SeisComP3-related questions on the forum webpage of SeisComP3.

Regards

Dirk

[1] https://forum.seiscomp3.org

Could you please explain how this issue was fixed? (and possibly provide a link to the commit on GitHub?)

Also, starting from which version the issue is fixed?

2017.334

See also: seiscomp3/CHANGELOG.md at master · SeisComP3/seiscomp3 · GitHub

Regards,
Andres.