ダウンロードしたwikipediaのxml formatサンプル

ダウンロードしたwikipediaのxml formatサンプル。



wikipediaをダウンロードする場所


http://dumps.wikimedia.org/jawiki/


上記のページからlatestのjawiki-latest-pages-articles.xml.bz2を選べば最新版wikipediaがダウンロードできます。


wget http://dumps.wikimedia.org/jawiki/latest/jawiki-latest-pages-articles.xml.bz2


wikipediaの各記事のxml format


各記事のxml formatは以下のようになっています。


基本的には、pageタグで囲まれているようです。ただし、次に書くように例外もあります。


  <page>
    <title>アンパサンド</title>
    <ns>0</ns>
    <id>5</id>
    <revision>
      <id>46524710</id>
      <parentid>44911376</parentid>
      <timestamp>2013-03-06T22:31:33Z</timestamp>
      <contributor>
        <username>Addbot</username>
        <id>712937</id>
      </contributor>
      <minor />
      <comment>ボット: 言語間リンク 31 件を[[d:|ウィキデータ]]上の [[d:q11213]] に転記</comment>
      <text xml:space="preserve">{{記号文字|&amp;amp;}}
[[Image:Trebuchet MS ampersand.svg|right|thumb|100px|[[Trebuchet MS]] フォント]]
'''アンパサンド''' ({{lang|en|ampersand}}, '''&amp;amp;''') とは「…と…」を意味する[[記号]]である。[[英語]]の {{lang|en|&quot;and&quot;}} に相当する[[ラテン語]]の {{lang|la|&quot;e
t&quot;}} の[[合字]]で、{{lang|en|&quot;etc.&quot;}} (et cetera = and so forth)を {{lang|en|&quot;&amp;amp;c.&quot;}} と記述することがあるのはそのため。[[Trebuchet MS]]フォントで
は、[[ファイル:Trebuchet MS ampersand.svg|10px]]と表示され &quot;et&quot; の合字であることが容易にわかる。
__TOC__
{{Clear}}
== 歴史 ==
[[Image:Historical ampersand evolution.svg|thumb|right|390px|アンパサンドの進展]]
その使用は1世紀に遡ることができ (1)、5世紀中葉 (2,3) から現代 (4-6) に至るまでの変遷がわかる。
[[Z]] に続く[[ラテン文字]][[アルファベット]]の27字目とされた時期もある。

記号名の「アンパサンド」は、ラテン語の「&amp;amp; はそれ自身 &quot;and&quot; を表す」{{lang|la|(&amp;amp; per se and)}} からきている。
{{Clear}}
==手書き==
[[File:Ampersand-handwriting-1.png|right|thumb|80px|手書きのアンパサンド]][[Image:Ampersand-handwriting-2.svg|right|thumb|80px|手書きのアンパサンド(簡素化)]]
日常的な手書きの場合、欧米でアンパサンドは「'''ε'''」に縦線を引く単純化されたものが使われることがある。

また同様に、「'''t'''」または「'''+'''(プラス)」に輪を重ねたような、[[無声歯茎側面摩擦音]]を示す発音記号「'''{{IPA|ɬ}}'''」のようなものが使われることもある。

== プログラミング言語 ==
[[プログラミング言語]]では、[[C言語|C]] など多数の言語で AND [[演算子]]として用いられる。以下は C の例。
* &lt;code&gt;X = A '''&amp;amp;&amp;amp;''' B&lt;/code&gt; のように2個重ねたものは[[論理積|論理 AND]] を表す。この場合 A, B がともに真ならば X も真、それ以外は偽である。
* &lt;code&gt;0x12345678 '''&amp;amp;''' 0x0f0f0f0f&lt;/code&gt; のように1個であれば[[ビット演算#AND|ビット AND]] を表す。この場合の結果は &lt;code&gt;0x02040608&lt;/code&gt; である。

[[BASIC]] 系列の言語では[[文字列]]の連結演算子として使用される。&lt;code&gt;&quot;foo&quot; '''&amp;amp;''' &quot;bar&quot;&lt;/code&gt; は &lt;code&gt;&quot;foobar&quot;&lt;/code&gt; を返す。また、主に[[マイクロソフト]]系では整数の[[十六進法|十六進表記]]に '''&lt;code&gt;&amp;amp;h&lt;/code&gt;''' を用い、&lt;code&gt;&amp;amp;h0F&lt;/code&gt; (十進で15)のように表現する。

[[Standard Generalized Markup Language|SGML]]、[[Extensible Markup Language|XML]]、[[HyperText Markup Language|HTML]]では、アンパサンドを使って[[SGML実体]]を参照する。

== その他 ==
{{commons|Ampersand}}
* '''[[&amp;amp; (シングル)]]'''(アンド)は、[[浜崎あゆみ]]が[[2003年]]に発売した4曲入りマキシ[[シングル]]。
* '''[[&amp;amp; (一青窈のアルバム)]]'''(アンド)は、[[一青窈]]が[[2005年]]に発売した[[アルバム]]、及び同アルバムに収録された楽曲。
*'''[[&amp;amp; (漫画)]]'''(アンド)は、[[おかざき真里]]による[[漫画]]作品。
* '''アンパサンド'''は、[[日本]]の[[競走馬]]。⇒[[アンパサンド (競走馬)]]

== 符号位置 ==
{| class=&quot;wikitable&quot; style=&quot;text-align:center;&quot;
!記号!![[Unicode]]!![[JIS X 0213]]!![[文字参照]]!!名称
{{CharCode|38|0026|1-1-85|アンパサンド|amp}}
{{CharCode|65286|ff06|1-1-85|アンパサンド(全角)}}
|}

{{punctuation marks|&amp;amp;}}

{{DEFAULTSORT:あんはさんと}}
[[Category:約物]]
[[Category:ラテン語の語句]]</text>
      <sha1>4duebxtzaadjddpy3036cey6451d992</sha1>
      <model>wikitext</model>
      <format>text/x-wiki</format>
    </revision>
  </page>


pageタグに囲まれているけど記事ではない例


下記のような特殊なページはpageタグで囲まれていても普通の記事ではないようです。


ダウンロードしたxmlを扱う場合はこの点に注意が必要です。


このような特殊なページは、titleタグの中身の先頭に「Wikipedia:」と書いてあるかどうかでとりあえず見分けられるようです。


  <page>
    <title>Wikipedia:Sandbox</title>
    <ns>4</ns>
    <id>6</id>
    <redirect title="Wikipedia:サンドボックス" />
    <revision>
      <id>36654478</id>
      <parentid>36654304</parentid>
      <timestamp>2011-03-06T16:16:58Z</timestamp>
      <contributor>
        <username>Y-dash</username>
        <id>309126</id>
      </contributor>
      <comment>テストは[[Wikipedia:サンドボックス]]でお願いいたします。 / [[Special:Contributions/Kompek|Kompek]] ([[User talk:Kompek|会話]]) による ID:36654304 の版を[[H:RV|取り消し]]</comment>
      <text xml:space="preserve">#REDIRECT [[Wikipedia:サンドボックス]]</text>
      <sha1>8x10n6namf7oawlowe0whbs04o55b8d</sha1>
      <model>wikitext</model>
      <format>text/x-wiki</format>
    </revision>
  </page>

  <page>
    <title>Wikipedia:削除記録/過去ログ 2002年12月</title>
    <ns>4</ns>
    <id>2</id>
    <restrictions>sysop</restrictions>
    <revision>
      <id>2168856</id>
      <timestamp>2002-12-06T09:23:16Z</timestamp>
      <contributor>
        <username>Brion VIBBER</username>
        <id>1</id>
      </contributor>
      <comment>deleted &quot;Linux&quot;: goatse.cx</comment>
      <text xml:space="preserve">Below is a list of the most recent deletions.
All times shown are server (U.S. Pacific) time.
&lt;ul&gt;&lt;li&gt;09:23 2002年12月6日 [[User:Brion VIBBER|Brion VIBBER]] deleted &quot;Linux&quot; &lt;em&gt;(goatse.cx)&lt;/em&gt;&lt;/li&gt;

&lt;/ul&gt;</text>
      <sha1>gbhvqlwj7ga4v9ghhy0n88iqmlo19vz</sha1>
      <model>wikitext</model>
      <format>text/x-wiki</format>
    </revision>
  </page>


著者プロフィール
Webサイトをいくつか作っています。
著者プロフィール