relaton / relaton-itu

Relaton-ITU: retrieve ITU Standards for bibliographic use using the Relaton BibliographicItem model
https://www.relaton.org
MIT License
2 stars 1 forks source link

Unable to fetch "ITU-R Recommendation 592" #56

Closed skalee closed 3 years ago

skalee commented 3 years ago

Attempt to fetch ITU-R Recommendation 592 with Relaton results with an error. It is a regression — it was working without error on 18th March. (I'm not 100% sure if the return value was correct, but there was no error.)

Exact error:

`split': bad URI(is not URI?): "https://raw.githubusercontent.com/relaton/relaton-data-itu-r/master/data/RECOMMENDATION 592.yaml" (URI::InvalidURIError)

Stack trace:

    14: from (redacted)/gems/relaton-1.7.7/lib/relaton/db.rb:73:in `fetch'
    13: from (redacted)/gems/relaton-1.7.7/lib/relaton/db.rb:384:in `check_bibliocache'
    12: from (redacted)/gems/relaton-1.7.7/lib/relaton/db.rb:404:in `new_bib_entry'
    11: from (redacted)/gems/relaton-1.7.7/lib/relaton/db.rb:419:in `net_retry'
    10: from (redacted)/gems/relaton-itu-1.7.7/lib/relaton_itu/processor.rb:17:in `get'
     9: from (redacted)/gems/relaton-itu-1.7.7/lib/relaton_itu/itu_bibliography.rb:49:in `get'
     8: from (redacted)/gems/relaton-itu-1.7.7/lib/relaton_itu/itu_bibliography.rb:137:in `itubib_get1'
     7: from (redacted)/gems/relaton-itu-1.7.7/lib/relaton_itu/itu_bibliography.rb:91:in `search_filter'
     6: from (redacted)/gems/relaton-itu-1.7.7/lib/relaton_itu/itu_bibliography.rb:28:in `search'
     5: from (redacted)/gems/relaton-itu-1.7.7/lib/relaton_itu/itu_bibliography.rb:28:in `new'
     4: from (redacted)/gems/relaton-itu-1.7.7/lib/relaton_itu/hit_collection.rb:30:in `initialize'
     3: from (redacted)/lib/ruby/2.7.0/uri/common.rb:737:in `URI'
     2: from (redacted)/lib/ruby/2.7.0/uri/common.rb:234:in `parse'
     1: from (redacted)/lib/ruby/2.7.0/uri/rfc3986_parser.rb:73:in `parse'

Recorded Pry session:

[2] pry(main)> require "relaton"
=> true
[3] pry(main)> rec = "ITU-R Recommendation 592"
=> "ITU-R Recommendation 592"
[4] pry(main)> Relaton::Db.new("db1", nil).fetch(rec)
[relaton] Info: detecting backends:
[relaton] processor "relaton_gb" registered
[relaton] processor "relaton_iec" registered
[relaton] processor "relaton_ietf" registered
[relaton] processor "relaton_iso" registered
[relaton] processor "relaton_itu" registered
[relaton] processor "relaton_nist" registered
[relaton] processor "relaton_ogc" registered
[relaton] processor "relaton_calconnect" registered
[relaton] processor "relaton_omg" registered
[relaton] processor "relaton_un" registered
[relaton] processor "relaton_w3c" registered
[relaton] processor "relaton_ieee" registered
[relaton] processor "relaton_iho" registered
[relaton] processor "relaton_bipm" registered
[relaton] processor "relaton_ecma" registered
[relaton] processor "relaton_cie" registered
[relaton-itu] ("ITU-R Recommendation 592") fetching...
URI::InvalidURIError: bad URI(is not URI?): "https://raw.githubusercontent.com/relaton/relaton-data-itu-r/master/data/RECOMMENDATION 592.yaml"
from /Users/skale/.rbenv/versions/2.7.2/lib/ruby/2.7.0/uri/rfc3986_parser.rb:67:in `split'

ronaldtse commented 3 years ago

Thanks for reporting @skalee . @andrew2net can you help?

andrew2net commented 3 years ago

@ronaldtse I think the result was incorrect. We added ITU-R support in version 1.7.4 exact on 18th March. @skalee it seems you used one of the previous versions. The only document with number 592, that there is in the new ITU-R source, is "REC-F.592-4". To fetch the document It's necessary to use the reference "ITU-R REC-F.592-4".

skalee commented 3 years ago

Thanks for explanation. I'll better find out what refs should be passed instead of those. Closing.

skalee commented 3 years ago

Actually, this is a bug IMO.

If "ITU-R Recommendation 592" is not an existing ref, then:

but actual behaviour is:

cc @andrew2net

andrew2net commented 3 years ago

@skalee to store documents on disk we use https://github.com/relaton/relaton. It caches found and not found documents. The only issue that needs to be solved is catching an invalid URI error. I'll do it in the next release.

skalee commented 3 years ago

The only issue that needs to be solved is catching an invalid URI error.

That's right. Sorry for being unclear.