2020-12-16

2020-12-15T0509Z 頃から気象庁防災情報XML pull型提供 Atomフィードの 要素値が UUID から HTTP URI に変更されています

すみません。ウェブでお知らせが出ていないらしいので、とりあえずメモしておきます。

従来型で出た最後のフィードの冒頭

 <?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
<title>高頻度(定時)</title>
<subtitle>JMAXML publishing feed</subtitle>
<updated>2020-12-15T13:51:02+09:00</updated>
<id>urn:uuid:4e2e12c8-4601-3c0f-8c8a-75cc83dcf6ac</id>
<link rel="related" href="http://www.jma.go.jp/" />
<link rel="self" href="http://www.data.jma.go.jp/developer/xml/feed/regular.xml" />
<rights type="html"><![CDATA[
<a href="http://www.jma.go.jp/jma/kishou/info/coment.html">利用規約</a>,
<a href="http://www.jma.go.jp/jma/en/copyright.html">Terms of Use</a>
]]></rights>
<entry>
<title>大雨危険度通知</title>
<id>urn:uuid:e3707979-75e7-3d9c-a465-39ccbade49dd</id>
<updated>2020-12-15T04:50:15Z</updated>
<author><name>気象庁</name></author>
<link type="application/xml" href="http://www.data.jma.go.jp/developer/xml/data/e3707979-75e7-3d9c-a465-39ccbade49dd.xml" />
<content type="text">【大雨危険度通知】</content>
</entry>

新しい形で出たフィードの冒頭部

 <?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" lang="ja">
  <title>高頻度(定時)</title>
  <subtitle>JMAXML publishing feed</subtitle>
  <updated>2020-12-15T14:02:06+09:00</updated>
  <id>http://www.data.jma.go.jp/developer/xml/feed/regular.xml#short_1608008526</id>
  <link rel="related" href="http://www.jma.go.jp/"/>
  <link rel="self" href="http://www.data.jma.go.jp/developer/xml/feed/regular.xml"/>
  <link rel="hub" href="http://alert-hub.appspot.com/"/>
  <rights type="html"><![CDATA[
<a href="http://www.jma.go.jp/jma/kishou/info/coment.html">利用規約</a>,
<a href="http://www.jma.go.jp/jma/en/copyright.html">Terms of Use</a>
]]></rights>
  <entry>
    <title>警報級の可能性(明日まで)</title>
    <id>http://www.data.jma.go.jp/developer/xml/data/20201215050006_0_VPFD60_100000.xml</id>
    <updated>2020-12-15T05:00:00Z</updated>
    <author>
      <name>前橋地方気象台</name>
    </author>
    <link type="application/xml" href="http://www.data.jma.go.jp/developer/xml/data/20201215050006_0_VPFD60_100000.xml"/>
    <content type="text">【群馬県警報級の可能性(明日まで)】</content>
  </entry>

まあ、理屈をいえば、id値は RFC 4287 §4.2.6 に規定する構文に従ってユニークに実現されておりさえすればよく、気象庁としてはその値について何らのお約束をしておらないところ、この変更を必ずしも積極的に周知する必要まではないと言って言えないことはないけれど、実際問題として、id値から保存ファイル名を導出したりしていると、これまでになかったスラッシュ文字が入ることによって、受信処理が障害したりするだろうと思います。僕が個人的にやっているのがそうはまりました。

0 件のコメント:

コメントを投稿