[Groonga-commit] groonga/groonga [master] doc tutorial: update data (4.3).

Back to archive index

null+****@clear***** null+****@clear*****
2012年 3月 26日 (月) 13:27:41 JST


Susumu Yata	2012-03-26 13:27:41 +0900 (Mon, 26 Mar 2012)

  New Revision: 00ab9f8436252dd5710d242932a39b09614e435b

  Log:
    doc tutorial: update data (4.3).

  Added files:
    doc/source/example/tutorial/data-4.log
    doc/source/example/tutorial/data-5.log
    doc/source/example/tutorial/data-6.log
    doc/source/example/tutorial/data-7.log
    doc/source/example/tutorial/data-8.log
  Modified files:
    doc/locale/ja/LC_MESSAGES/tutorial.po
    doc/source/example/tutorial/data-1.log
    doc/source/example/tutorial/data-2.log
    doc/source/example/tutorial/data-3.log
    doc/source/tutorial/data.txt

  Modified: doc/locale/ja/LC_MESSAGES/tutorial.po (+254 -75)
===================================================================
--- doc/locale/ja/LC_MESSAGES/tutorial.po    2012-03-23 17:27:42 +0900 (420de8c)
+++ doc/locale/ja/LC_MESSAGES/tutorial.po    2012-03-26 13:27:41 +0900 (41df62d)
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: 1.2.1\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-03-23 16:54\n"
+"POT-Creation-Date: 2012-03-26 13:19\n"
 "PO-Revision-Date: 2011-11-27 22:36+0900\n"
 "Last-Translator: Kouhei Sutou <kou****@clear*****>\n"
 "Language-Team: Japanese\n"
@@ -20,6 +20,11 @@ msgstr ""
 #: ../../../source/example/tutorial/data-1.log:1
 #: ../../../source/example/tutorial/data-2.log:1
 #: ../../../source/example/tutorial/data-3.log:1
+#: ../../../source/example/tutorial/data-4.log:1
+#: ../../../source/example/tutorial/data-5.log:1
+#: ../../../source/example/tutorial/data-6.log:1
+#: ../../../source/example/tutorial/data-7.log:1
+#: ../../../source/example/tutorial/data-8.log:1
 #: ../../../source/example/tutorial/drilldown-1.log:1
 #: ../../../source/example/tutorial/drilldown-2.log:1
 #: ../../../source/example/tutorial/drilldown-3.log:1
@@ -92,116 +97,289 @@ msgstr "チュートリアル"
 
 # fa721fedb4f64992b485a0cd289bce93
 #: ../../../source/tutorial/data.txt:11
-msgid "いろいろなデータの保存"
-msgstr ""
+msgid "Various data types"
+msgstr "いろいろなデータの保存"
 
-# 61e24387a15b477a9ab68de9b8cff016
+# 19e12e7217a54c47a4cbc3ab8081e1a7
 #: ../../../source/tutorial/data.txt:13
 msgid ""
-"groongaは全文検索エンジンですが、文字列だけでなく、日時や経緯度など、いろいろ"
-"なデータを保存することができます。"
+"Groonga is a full text search engine but also serves as a column-oriented "
+"data store. Groonga supports various data types, such as numeric types, "
+"string types, date and time type, longitude and latitude types, etc. This "
+"tutorial shows a list of data types and explains how to use them."
 msgstr ""
+"groongaは全文検索エンジンを起源として独自のカラムストアを持つに至るわけです"
+"が、索引語や文書を保存するだけでなく、数値や文字列、日時や経緯度など、いろい"
+"ろなデータを保存することができます。本チュートリアルでは、groongaで保存できる"
+"データの種類、およびに保存の方法を説明します。"
 
+# c9e13b292e424a658a2db5a95d21a417
 #: ../../../source/tutorial/data.txt:16
-msgid "データ型"
-msgstr ""
+msgid "Overview"
+msgstr "データの種類"
 
-# d1442c49be824f7ea3209e8fcd74a505
+# 19e12e7217a54c47a4cbc3ab8081e1a7
 #: ../../../source/tutorial/data.txt:18
 msgid ""
-"groongaでは、数値(整数・浮動小数点数)と文字列に加えて、日時や経緯度を格納す"
-"ることができます。"
+"The basic data types of groonga are roughly divided into 5 groups --- "
+"boolean type, numeric types, string types, date/time type and longitude/"
+"latitude types. The numeric types are further divided according to whether "
+"integer or floating point number, signed or unsigned and the number of bits "
+"allocated to each integer. The string types are further divided according to "
+"the maximum length. The longitude/latitude types are further divided "
+"according to the geographic coordinate system. For more details, see :doc:`/"
+"type`."
+msgstr ""
+"groongaにおいて利用できる基本型は、真偽値、数値、文字列、日時、経緯度の5種類"
+"に大別できます。基本型において、数値は整数・浮動小数点数の違い、符号の有無と"
+"割り当てるビット数によって細分化できるほか、文字列は長さの上限によって細分化"
+"できます。また、経緯度には測地系による分類があります。詳しくは :doc:`/type` "
+"を参照してください。"
+
+# 3ec01c2c1fbd42978e3a85da79958686
+#: ../../../source/tutorial/data.txt:20
+msgid ""
+"In addition, groonga supports reference types and vector types. Reference "
+"types are designed for accessing other tables. Vector types are designed for "
+"storing a variable number of values in one element."
 msgstr ""
+"拡張型としては、別テーブルを参照するための情報であるテーブル参照を保存するこ"
+"とができます。また、基本型もしくはテーブル参照を複数まとめて保存できるよう"
+"に、ベクターカラムをサポートしています。"
 
-# 11cf117bd13d4449917d3c3dec6b9ff2
-#: ../../../source/tutorial/data.txt:20
+# 9e6e98a709f14215910f8e5673e2ef46
+#: ../../../source/tutorial/data.txt:22
+msgid "First, let's create a table for this tutorial."
+msgstr "それでは、本チュートリアルで使用するテーブルを作成しておきましょう。"
+
+# 53d9f39eca8145b4a66147fda15bf49b
+#: ../../../source/tutorial/data.txt:29
+msgid "Boolean type"
+msgstr "真偽値"
+
+# 12f45b0a19194e02b1523b9f3645f175
+#: ../../../source/tutorial/data.txt:31
 msgid ""
-"例として、整数を格納するカラムnumber、浮動小数点数を格納するカラムfloat、文字"
-"列を格納するカラムstring、日時を格納するカラムtimeにより構成されるテーブル"
-"Typeを作成する手順を以下に示します。以下の例では、テーブルを作成した後でデー"
-"タを格納し、さらに内容の確認をおこなっています。"
+"The boolean type is used to store true or false. To create a boolean type "
+"column, specify Bool to the `type` parameter of :doc:`/commands/"
+"column_create` command. The default value of the boolean type is false."
 msgstr ""
+"ブール型は真偽値(true/false)を表現するための型です。"
+"ブール型のカラムを作成するには、 :doc:`/commands/column_create` コマンドの `type` 引数に Bool を指定します。"
+"ブール型のデフォルト値はfalseです。"
 
-# 43ad899b5de04e11b8fca6b40399b366
+# b0efb64bd2724bcc88a28ff9460b8fa0
 #: ../../../source/tutorial/data.txt:33
 msgid ""
-"テーブルの作成手順は、 :doc:`/commands/table_create` コマンドを使って空のテー"
-"ブルを作成した後、 :doc:`/commands/column_create` コマンドによりカラムを一つ"
-"ずつ作成するだけです。型の指定には--typeオプションを使います。整数の型として"
-"Int32、浮動小数点数の型としてFloat、文字列の型としてShortText、日時の型として"
-"Timeを使っていますが、整数と文字列については他にも型が存在します。利用可能な"
-"データ型の一覧については、 :doc:`/type` を参照してください。経緯度について"
-"は、後のチュートリアルで詳しく紹介します。"
+"The following example creates a boolean type column and adds three records. "
+"Note that the third record has the default value because no value is "
+"specified."
+msgstr ""
+"以下の例では、ブール型のカラムを作成し、3つのレコードを追加します。3番目のレ"
+"コードについては、値を省略しているため、デフォルト値が格納されます。"
+
+# 5beba7b848dd4414b24dd6957c7beda2
+#: ../../../source/tutorial/data.txt:47
+msgid "Numeric types"
+msgstr "数値"
+
+# 14cc63c41f094d08aac73106b134640b
+#: ../../../source/tutorial/data.txt:49
+msgid ""
+"The numeric types are divided into integer types and a floating point number "
+"type. The integer types are further divided into the signed integer types "
+"and unsigned integer types. In addition, you can choose the number of bits "
+"allocated to each integer. For more details, see :doc:`/type`. The default "
+"value of the numeric types is 0."
 msgstr ""
+"数値型は、整数と浮動小数点数に分けることができます。整数は、符号付き整数と符"
+"号なし整数に分けることができるだけでなく、割り当てるビット数によっても分ける"
+"ことができます。割り当てるビット数を大きくすると、カラムのサイズは大きくなっ"
+"てしまいますが、表現できる整数の範囲を大きくすることができます。詳しくは :"
+"doc:`/type` を参照してください。数値型のデフォルト値はいずれも0です。"
+
+# 92862bee04a048cf97411a6649be1a0f
+#: ../../../source/tutorial/data.txt:51
+msgid ""
+"The following example creates an Int8 column and a Float column, and then "
+"updates existing records. The :doc:`/commands/load` command updates the "
+"weight column as expected. On the other hand, the price column values are "
+"different from the specified values because 15.9 is not an integer and 200 "
+"is too large. 15.9 is converted to 15 by removing the fractional part. 200 "
+"causes an overflow and the result becomes -56. Note that the result of an "
+"overflow/underflow is undefined."
+msgstr ""
+"以下の例では、Int8型のカラムとFloat型のカラムを作成し、既存のレコードを更新し"
+"ます。weightカラムについては、指定した値が問題なく格納されています。一方、"
+"priceカラムに指定した小数については、小数点以下を切り捨てた値が格納されていま"
+"す。また、表現できる範囲を超える値を格納しようとした2番目のレコードについて"
+"は、指定した値とは異なる値が格納されています。このように、表現できる範囲を超"
+"える値を指定すると、操作後の値は未定義になるので注意してください。"
+
+# ac9727f7f978484497a9972a67ad950a
+#: ../../../source/tutorial/data.txt:66
+msgid "String types"
+msgstr "文字列"
+
+# 6f9b195b9b494b518887da51ea243c5b
+#: ../../../source/tutorial/data.txt:68
+msgid ""
+"The string types are divided according to the maximum length. For more "
+"details, see :doc:`/type`. The default value is the zero-length string."
+msgstr ""
+"文字列型は、長さの上限によって分けることができます。詳しくは :doc:`/type` を"
+"参照してください。文字列型のデフォルト値は長さ0の文字列です。"
+
+# b0efb64bd2724bcc88a28ff9460b8fa0
+#: ../../../source/tutorial/data.txt:70
+msgid ""
+"The following example creates an ShortText column and updates existing "
+"records. The third record has the default value because not updated."
+msgstr ""
+"以下の例では、ShortText型のカラムを作成し、IDが1と2のレコードを更新します。更"
+"新しないレコードについては、デフォルト値のままとなります。"
+
+# 7d03964b5a874744bfe1e3a6551e4e51
+#: ../../../source/tutorial/data.txt:83
+msgid "Date and time type"
+msgstr "日時"
+
+# d3765644e96044df8c541833e8989c51
+#: ../../../source/tutorial/data.txt:85
+msgid ""
+"The date and time type of groonga is Time. Actually, a Time column stores a "
+"date and time as the number of microseconds since the Epoch, 1970-01-01 "
+"00:00:00. A Time value can represent a date and time before the Epoch "
+"because the actual data type is a signed integer. Note that :doc:`/commands/"
+"load` and :doc:`/commands/select commands use a decimal number to represent "
+"a data and time in seconds. The default value is 0.0, which means the Epoch."
+msgstr ""
+"日時を表現するための型はTimeです。内部では1970年1月1日0時0分0秒を基準とする経"
+"過時間をマイクロ秒単位で表現します。符号付きの整数を用いるため、1970年以前の"
+"日時も表現することができます。内部表現はマイクロ秒単位の整数ですが、 :doc:`/"
+"commands/load` コマンドおよび :doc:`/commands/select` コマンドでは、経過秒数"
+"による指定・表示となります。デフォルト値は1970年1月1日0時0分0秒のことを表す"
+"0.0です。"
+
+# b0efb64bd2724bcc88a28ff9460b8fa0
+#: ../../../source/tutorial/data.txt:87
+msgid ""
+"The following example creates a Time column and updates existing records. "
+"The first record has the default value because not updated."
+msgstr ""
+"以下の例では、Time型のカラムを作成し、IDが2と3のレコードを更新します。更新し"
+"ないレコードについては、デフォルト値のままとなります。"
+
+# 07daa91307514527811f3676dc10f746
+#: ../../../source/tutorial/data.txt:100
+msgid "Longitude and latitude types"
+msgstr "経緯度"
+
+# 6f9b195b9b494b518887da51ea243c5b
+#: ../../../source/tutorial/data.txt:102
+msgid ""
+"The longitude and latitude types are divided according to the geographic "
+"coordinate system. For more details, see :doc:`/type`. To represent a "
+"longitude and latitude, groonga uses a string formatted as follows:"
+msgstr ""
+"経緯度を表現するための型は、測地系によって分けることができます。詳しくは :"
+"doc:`/type` を参照してください。経緯度の指定・表示には、以下に示す形式の文字"
+"列を使います。"
+
+# bc2afac58e83444099f6a2e282104d04
+#: ../../../source/tutorial/data.txt:104
+msgid ""
+"\"longitude x latitude\" in milliseconds (e.g.: \"128452975x503157902\")"
+msgstr "\"経度のミリ秒表記x緯度のミリ秒表記\" (例: \"128452975x503157902\")"
+
+# e1f3ea2983484088b1ba1af18ef828ef
+#: ../../../source/tutorial/data.txt:105
+msgid "\"longitude x latitude\" in degrees (e.g.: \"35.6813819x139.7660839\")"
+msgstr "\"経度の度数表記x緯度の度数表記\" (例: \"35.6813819x139.7660839\")"
+
+# 88eb9be1200c4811a3a98f1905145535
+#: ../../../source/tutorial/data.txt:107
+msgid ""
+"A number with/without a decimal point represents a longitude or latitude in "
+"milliseconds/degrees respectively. Note that a combination of a number with "
+"a decimal point and a number without a decimal point (e.g. 35.1x139) must "
+"not be used. A comma (',') is also available as a delimiter. The default "
+"value is \"0x0\"."
+msgstr ""
+"小数点を含んでいなければミリ秒表記、小数点を含んでいれば度数表記として扱われ"
+"ます。ミリ秒表記と度数表記を混ぜるたときの動作は未定義なので注意してくださ"
+"い。経度と緯度の区切りとしては、'x' のほかに ',' を使うことができます。経緯度"
+"のデフォルト値は \"0x0\" です。"
 
-# e2ef8f5736eb4934b641fe8a0590c0f2
-#: ../../../source/tutorial/data.txt:35
+# 4d10a27a69284c1ba1699fcb8ead8cfe
+#: ../../../source/tutorial/data.txt:109
 msgid ""
-":doc:`/commands/load` コマンドで新しいレコードを作成するとき、省略したカラム"
-"には、データ型のデフォルト値が格納されます。デフォルト値については、 :doc:`/"
-"type` を参照してください。"
+"The following example creates a WGS84GeoPoint column and updates existing "
+"records. The second record has the default value because not updated."
 msgstr ""
+"以下の例では、世界測地系を用いるWGS84GeoPoint型のカラムを作成し、IDが1と3のレ"
+"コードを更新します。更新しないレコードについては、デフォルト値のままとなりま"
+"す。"
 
 # 5ddabb8ff97a4f54ac6b61a035092980
-#: ../../../source/tutorial/data.txt:38
-msgid "テーブル参照"
-msgstr ""
+#: ../../../source/tutorial/data.txt:122
+msgid "Reference types"
+msgstr "テーブル参照"
 
 # 90397f1e19db4ea98ea05026ba0a5e2a
-#: ../../../source/tutorial/data.txt:40
+#: ../../../source/tutorial/data.txt:124
 msgid ""
-"groongaでは、別テーブルを参照するカラムを作成できます。より正確には、別テーブ"
-"ルのレコードIDを格納しておくことにより、別テーブルのレコードを参照できるよう"
-"にします。以降、別テーブルを参照するカラムに格納される値のことをテーブル参照"
-"と呼びます。"
+"groongaでは、テーブル参照のカラム、すなわち別テーブルを参照するカラムを作成で"
+"きます。より正確には、別テーブルのレコードIDを格納しておくことにより、別テー"
+"ブルのレコードを参照できるようにします。"
 msgstr ""
 
 # 8d1a529de14948efa4b7ec87c5f3617a
-#: ../../../source/tutorial/data.txt:42
+#: ../../../source/tutorial/data.txt:126
 msgid ""
-"テーブル参照のカラムがあるときは、--output_columnsオプションに「参照元カラム"
-"名.参照先カラム名」と指定することにより、参照先カラムの値を取り出すことができ"
-"ます。参照元カラム名のみを指定したときは、「参照元カラム名._key」と同様の扱い"
-"となり、参照先レコードの主キー(_key)が取り出されます。また、テーブル参照が"
-"有効なレコードを指していないときは、参照先カラムのデフォルト値が取り出される"
-"ようになっています。"
+"テーブル参照のカラムがあるときは、 `output_columns` 引数に \"参照元カラム.参"
+"照先カラム\" と指定することにより、参照先カラムの値を取り出すことができます。"
+"参照元カラムのみを指定したときは、 \"参照元カラム名._key\" と同様の扱いとな"
+"り、参照先レコードの主キーが取り出されます。テーブル参照が有効なレコードを指"
+"していないときは、参照先カラムのデフォルト値が取り出されるようになっていま"
+"す。"
 msgstr ""
 
 # c3a7a7cea377485d81cd4ec552c15694
-#: ../../../source/tutorial/data.txt:44
+#: ../../../source/tutorial/data.txt:128
 msgid ""
 "ここでは、先のチュートリアルで作成したSiteテーブルにlinkという新たなカラムを"
 "作成し、サイト間のリンク関係を保存できるようにしてみましょう。"
 msgstr ""
 
 # b7536412e9e5480f853a888f3e1cbf99
-#: ../../../source/tutorial/data.txt:53
+#: ../../../source/tutorial/data.txt:137
 msgid ""
-"テーブル参照のカラムを作成するときは、--typeオプションに参照先テーブルの名前"
-"を指定します。この例では、同じテーブルに含まれる別のレコードを参照させたいの"
-"で、Siteを指定することになります。次に、\"http://example.org/\"から\"http://"
-"example.net/\"へのリンクを作成しています。テーブル参照を作成するときは、IDで"
-"はなく主キー(_key)を指定することに注意してください。最後に、リンクの内容を"
-"確認しています。\"link._key\"と\"link.title\"を--output_columnsに指定すること"
-"により、参照先の主キー(_key)とタイトル(title)を表示できています。"
+"テーブル参照のカラムを作成するときは、 `type` 引数に参照先テーブルを指定しま"
+"す。この例では、同じテーブルに含まれる別のレコードを参照させたいので、Siteを"
+"指定することになります。次に、 \"http://example.org/\" から \"http://example."
+"net/\" へのリンクを登録しています。テーブル参照を作成するときは、IDではなく主"
+"キーを指定することに注意してください。最後に、リンクの内容を確認しています。"
+"この例では、  `output_columns` 引数に link._key と link.title を指定している"
+"ので、参照先の主キーとタイトルが表示されています。"
 msgstr ""
 
-#: ../../../source/tutorial/data.txt:56
-msgid "ベクターカラム"
-msgstr ""
+#: ../../../source/tutorial/data.txt:140
+msgid "Vector types"
+msgstr "ベクターカラム"
 
 # 2a92c171b54e4efca37e0e72e454c7bb
-#: ../../../source/tutorial/data.txt:58
+#: ../../../source/tutorial/data.txt:142
 msgid ""
-":doc:`/commands/column_create` コマンドでカラムを作成するとき、--flagsオプ"
-"ションにCOLUMN_VECTORフラグを指定すると、--typeに指定した型の配列を格納するカ"
-"ラムになります。以下、このようなカラムをベクターカラムと呼びます。ベクターカ"
-"ラムは、各レコードに複数の値を格納できるため、一対多の参照関係を表すのに便利"
-"です。"
+":doc:`/commands/column_create` コマンドでカラムを作成するとき、 `flags` 引数"
+"にCOLUMN_VECTORフラグを指定すると、 `type` 引数に指定した型の配列を格納するカ"
+"ラムになります。このようなカラムのことは、ベクターカラムと呼びます。ベクター"
+"カラムは、各レコードに複数の値を格納できるため、一対多の参照関係を表すのに便"
+"利です。"
 msgstr ""
 
 # 11d030f09d2f467baa42c4a27ff06b7e
-#: ../../../source/tutorial/data.txt:60
+#: ../../../source/tutorial/data.txt:144
 msgid ""
 "さきほどテーブル参照の例として作成したカラムでは、各サイトに一つのリンクしか"
 "保存できませんでした。通常は一つのサイトから多くのサイトにリンクが張られてい"
@@ -210,16 +388,16 @@ msgid ""
 msgstr ""
 
 # 106bb3631f6b4aa7930e0491a6d4d2fd
-#: ../../../source/tutorial/data.txt:71
+#: ../../../source/tutorial/data.txt:155
 msgid ""
-"新たなカラムにはSiteテーブルに対する参照の配列を格納するので、--typeオプショ"
-"ンにSiteを指定するとともに、--flagsオプションにCOLUMN_VECTORフラグを指定して"
-"います。次に、 :doc:`/commands/load` による更新では、\"http://example.org/"
-"\"を主キー(_key)とするレコードに対し、3つのサイトをリンク先として格納してい"
-"ます。そして、最後にリンクの内容を確認しています。この例では、--"
-"output_columnsオプションに\"links._key\"と\"links.title\"を指定することによ"
-"り、参照先の主キー(_key)とタイトル(title)をそれぞれ配列にしたものが表示さ"
-"れています。"
+"新たなカラムにはSiteテーブルに対する参照の配列を格納するので、 `type` 引数に"
+"Siteを指定するとともに、 `flags` 引数にCOLUMN_VECTORフラグを指定しています。"
+"次に、 :doc:`/commands/load` による更新では、 \"http://example.org/\" から "
+"\"http://example.net/\" へのリンクに加えて、 \"http://example.org/\" と "
+"\"http://example.com/\" へのリンクも登録しています。そして、最後にリンクの内"
+"容を確認しています。この例では、 `output_columns` 引数に links._key と links."
+"title を指定しているので、参照先の主キーとタイトルをそれぞれ配列にしたものが"
+"表示されています。"
 msgstr ""
 
 #: ../../../source/tutorial/drilldown.txt:11
@@ -1732,8 +1910,9 @@ msgid ""
 "request. The format is \"?NAME_1=VALUE_1&NAME_2=VALUE_2&...\"."
 msgstr ""
 "groongaがHTTPサーバとして起動されているときは、/d/COMMAND_NAME というURLにア"
-"クセスすることにより、コマンドを実行することができます。コマンドの引数"
-"は、HTTPのGETパラメータとして渡します。引数の書式は \"?NAME_1=VALUE_1&NAME_2=VALUE_2&...\" となります。"
+"クセスすることにより、コマンドを実行することができます。コマンドの引数は、"
+"HTTPのGETパラメータとして渡します。引数の書式は \"?"
+"NAME_1=VALUE_1&NAME_2=VALUE_2&...\" となります。"
 
 # f8c8c0a35b004171b80f3188d5ba7ee1
 #: ../../../source/tutorial/network.txt:122

  Modified: doc/source/example/tutorial/data-1.log (+2 -15)
===================================================================
--- doc/source/example/tutorial/data-1.log    2012-03-23 17:27:42 +0900 (18325aa)
+++ doc/source/example/tutorial/data-1.log    2012-03-26 13:27:41 +0900 (6ef3cda)
@@ -1,18 +1,5 @@
 Execution example::
 
-  > table_create --name Type --flags TABLE_HASH_KEY --key_type ShortText
-  [[0,1322616293.7274,0.012551106],true]
-  > column_create --table Type --name number --type Int32
-  [[0,1322616293.94115,0.008619605],true]
-  > column_create --table Type --name float --type Float
-  [[0,1322616294.15095,0.004959989],true]
-  > column_create --table Type --name string --type ShortText
-  [[0,1322616294.35693,0.005551818],true]
-  > column_create --table Type --name time --type Time
-  [[0,1322616294.56333,0.006356953],true]
-  > load --table Type
-  > [{"_key":"sample","number":12345,"float":42.195,"string":"GROONGA","time":1234567890.12}]
-  [[0,1322616294.77086,0.202357708],1]
-  > select --table Type
-  [[0,1322616295.1744,0.000340057],[[[1],[["_id","UInt32"],["_key","ShortText"],["float","Float"],["number","Int32"],["string","ShortText"],["time","Time"]],[1,"sample",42.195,12345,"GROONGA",1234567890.12]]]]
+  > table_create --name ToyBox --flags TABLE_HASH_KEY --key_type ShortText
+  [[0,1332498286.03578,0.00542259216308594],true]
   
\ No newline at end of file

  Modified: doc/source/example/tutorial/data-2.log (+11 -7)
===================================================================
--- doc/source/example/tutorial/data-2.log    2012-03-23 17:27:42 +0900 (c08d61b)
+++ doc/source/example/tutorial/data-2.log    2012-03-26 13:27:41 +0900 (89cd091)
@@ -1,10 +1,14 @@
 Execution example::
 
-  > column_create --table Site --name link --type Site
-  [[0,1322616295.37864,0.005674045],true]
-  > load --table Site
-  > [{"_key":"http://example.org/","link":"http://example.net/"}]
-  [[0,1322616295.5854,0.200879317],1]
-  > select --table Site --output_columns _key,title,link._key,link.title --query title:@this
-  [[0,1322616295.98732,0.000872177],[[[1],[["_key","ShortText"],["title","ShortText"],["link._key","ShortText"],["link.title","ShortText"]],["http://example.org/","This is test record 1!","http://example.net/","test record 2."]]]]
+  > column_create --table ToyBox --name is_animal --type Bool
+  [[0,1332498286.2427,0.00578594207763672],true]
+  > load --table ToyBox
+  > [
+  > {"_key":"Monkey","is_animal":true}
+  > {"_key":"Flower","is_animal":false}
+  > {"_key":"Block"}
+  > ]
+  [[0,1332498286.44978,1.00197458267212],3]
+  > select --table ToyBox --output_columns _key,is_animal
+  [[0,1332498287.65257,0.000472545623779297],[[[3],[["_key","ShortText"],["is_animal","Bool"]],["Monkey",true],["Flower",false],["Block",false]]]]
   
\ No newline at end of file

  Modified: doc/source/example/tutorial/data-3.log (+13 -7)
===================================================================
--- doc/source/example/tutorial/data-3.log    2012-03-23 17:27:42 +0900 (27def94)
+++ doc/source/example/tutorial/data-3.log    2012-03-26 13:27:41 +0900 (3356f9c)
@@ -1,10 +1,16 @@
 Execution example::
 
-  > column_create --table Site --name links --flags COLUMN_VECTOR --type Site
-  [[0,1322616296.19238,0.007598942],true]
-  > load --table Site
-  > [{"_key":"http://example.org/","links":["http://example.net/","http://example.org/","http://example.com/"]}]
-  [[0,1322616296.40092,0.201036234],1]
-  > select --table Site --output_columns _key,title,links._key,links.title --query title:@this
-  [[0,1322616296.80305,0.000899975],[[[1],[["_key","ShortText"],["title","ShortText"],["links._key","ShortText"],["links.title","ShortText"]],["http://example.org/","This is test record 1!",["http://example.net/","http://example.org/","http://example.com/"],["test record 2.","This is test record 1!","test test record three."]]]]]
+  > column_create --table ToyBox --name price --type Int8
+  [[0,1332498287.85609,0.00574946403503418],true]
+  > column_create --table ToyBox --name weight --type Float
+  [[0,1332498288.06304,0.00493621826171875],true]
+  > load --table ToyBox
+  > [
+  > {"_key":"Monkey","price":15.9}
+  > {"_key":"Flower","price":200,"weight":0.13}
+  > {"_key":"Block","weight":25.7}
+  > ]
+  [[0,1332498288.26924,1.00213837623596],3]
+  > select --table ToyBox --output_columns _key,price,weight
+  [[0,1332498289.47254,0.000308036804199219],[[[3],[["_key","ShortText"],["price","Int8"],["weight","Float"]],["Monkey",15,0.0],["Flower",-56,0.13],["Block",0,25.7]]]]
   
\ No newline at end of file

  Added: doc/source/example/tutorial/data-4.log (+13 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/tutorial/data-4.log    2012-03-26 13:27:41 +0900 (c251644)
@@ -0,0 +1,13 @@
+Execution example::
+
+  > column_create --table ToyBox --name name --type ShortText
+  [[0,1332498289.67627,0.00676369667053223],true]
+  > load --table ToyBox
+  > [
+  > {"_key":"Monkey","name":"Grease"}
+  > {"_key":"Flower","name":"Rose"}
+  > ]
+  [[0,1332498289.88434,0.801783800125122],2]
+  > select --table ToyBox --output_columns _key,name
+  [[0,1332498290.88724,0.000265598297119141],[[[3],[["_key","ShortText"],["name","ShortText"]],["Monkey","Grease"],["Flower","Rose"],["Block",""]]]]
+  
\ No newline at end of file

  Added: doc/source/example/tutorial/data-5.log (+13 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/tutorial/data-5.log    2012-03-26 13:27:41 +0900 (23864bd)
@@ -0,0 +1,13 @@
+Execution example::
+
+  > column_create --table ToyBox --name time --type Time
+  [[0,1332498291.0906,0.00631809234619141],true]
+  > load --table ToyBox
+  > [
+  > {"_key":"Flower","time":1234567890.1234569999}
+  > {"_key":"Block","time":-1234567890}
+  > ]
+  [[0,1332498291.29814,0.801807641983032],2]
+  > select --table ToyBox --output_columns _key,time
+  [[0,1332498292.30117,0.000299692153930664],[[[3],[["_key","ShortText"],["time","Time"]],["Monkey",0.0],["Flower",1234567890.12346],["Block",-1234567890.0]]]]
+  
\ No newline at end of file

  Added: doc/source/example/tutorial/data-6.log (+13 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/tutorial/data-6.log    2012-03-26 13:27:41 +0900 (e00c75b)
@@ -0,0 +1,13 @@
+Execution example::
+
+  > column_create --table ToyBox --name location --type WGS84GeoPoint
+  [[0,1332498292.50467,0.0079643726348877],true]
+  > load --table ToyBox
+  > [
+  > {"_key":"Monkey","location":"128452975x503157902"}
+  > {"_key":"Block","location":"35.6813819x139.7660839"}
+  > ]
+  [[0,1332498292.71385,0.801813840866089],2]
+  > select --table ToyBox --output_columns _key,location
+  [[0,1332498293.71678,0.000298976898193359],[[[3],[["_key","ShortText"],["location","WGS84GeoPoint"]],["Monkey","128452975x503157902"],["Flower","0x0"],["Block","128452975x503157902"]]]]
+  
\ No newline at end of file

  Added: doc/source/example/tutorial/data-7.log (+10 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/tutorial/data-7.log    2012-03-26 13:27:41 +0900 (961353d)
@@ -0,0 +1,10 @@
+Execution example::
+
+  > column_create --table Site --name link --type Site
+  [[0,1332498293.92066,0.00589966773986816],true]
+  > load --table Site
+  > [{"_key":"http://example.org/","link":"http://example.net/"}]
+  [[0,1332498294.1274,0.201014280319214],1]
+  > select --table Site --output_columns _key,title,link._key,link.title --query title:@this
+  [[0,1332498294.52959,0.00171041488647461],[[[1],[["_key","ShortText"],["title","ShortText"],["link._key","ShortText"],["link.title","ShortText"]],["http://example.org/","This is test record 1!","http://example.net/","test record 2."]]]]
+  
\ No newline at end of file

  Added: doc/source/example/tutorial/data-8.log (+10 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/tutorial/data-8.log    2012-03-26 13:27:41 +0900 (542f2d4)
@@ -0,0 +1,10 @@
+Execution example::
+
+  > column_create --table Site --name links --flags COLUMN_VECTOR --type Site
+  [[0,1332498294.7353,0.00729537010192871],true]
+  > load --table Site
+  > [{"_key":"http://example.org/","links":["http://example.net/","http://example.org/","http://example.com/"]}]
+  [[0,1332498294.94353,0.200709581375122],1]
+  > select --table Site --output_columns _key,title,links._key,links.title --query title:@this
+  [[0,1332498295.34514,0.00077366828918457],[[[1],[["_key","ShortText"],["title","ShortText"],["links._key","ShortText"],["links.title","ShortText"]],["http://example.org/","This is test record 1!",["http://example.net/","http://example.org/","http://example.com/"],["test record 2.","This is test record 1!","test test record three."]]]]]
+  
\ No newline at end of file

  Modified: doc/source/tutorial/data.txt (+110 -26)
===================================================================
--- doc/source/tutorial/data.txt    2012-03-23 17:27:42 +0900 (b4a1c85)
+++ doc/source/tutorial/data.txt    2012-03-26 13:27:41 +0900 (646dee6)
@@ -7,65 +7,149 @@
 .. groonga-command
 .. database: tutorial
 
-いろいろなデータの保存
-======================
+Various data types
+==================
 
-groongaは全文検索エンジンですが、文字列だけでなく、日時や経緯度など、いろいろなデータを保存することができます。
+Groonga is a full text search engine but also serves as a column-oriented data store. Groonga supports various data types, such as numeric types, string types, date and time type, longitude and latitude types, etc. This tutorial shows a list of data types and explains how to use them.
 
-データ型
+Overview
 --------
 
-groongaでは、数値(整数・浮動小数点数)と文字列に加えて、日時や経緯度を格納することができます。
+The basic data types of groonga are roughly divided into 5 groups --- boolean type, numeric types, string types, date/time type and longitude/latitude types. The numeric types are further divided according to whether integer or floating point number, signed or unsigned and the number of bits allocated to each integer. The string types are further divided according to the maximum length. The longitude/latitude types are further divided according to the geographic coordinate system. For more details, see :doc:`/type`.
 
-例として、整数を格納するカラムnumber、浮動小数点数を格納するカラムfloat、文字列を格納するカラムstring、日時を格納するカラムtimeにより構成されるテーブルTypeを作成する手順を以下に示します。以下の例では、テーブルを作成した後でデータを格納し、さらに内容の確認をおこなっています。
+In addition, groonga supports reference types and vector types. Reference types are designed for accessing other tables. Vector types are designed for storing a variable number of values in one element.
+
+First, let's create a table for this tutorial.
 
 .. groonga-command
 .. include:: ../example/tutorial/data-1.log
-.. table_create --name Type --flags TABLE_HASH_KEY --key_type ShortText
-.. column_create --table Type --name number --type Int32
-.. column_create --table Type --name float --type Float
-.. column_create --table Type --name string --type ShortText
-.. column_create --table Type --name time --type Time
-.. load --table Type
-.. [{"_key":"sample","number":12345,"float":42.195,"string":"GROONGA","time":1234567890.12}]
-.. select --table Type
+.. table_create --name ToyBox --flags TABLE_HASH_KEY --key_type ShortText
+
+Boolean type
+------------
+
+The boolean type is used to store true or false. To create a boolean type column, specify Bool to the `type` parameter of :doc:`/commands/column_create` command. The default value of the boolean type is false.
+
+The following example creates a boolean type column and adds three records. Note that the third record has the default value because no value is specified.
+
+.. groonga-command
+.. include:: ../example/tutorial/data-2.log
+.. column_create --table ToyBox --name is_animal --type Bool
+.. load --table ToyBox
+.. [
+.. {"_key":"Monkey","is_animal":true}
+.. {"_key":"Flower","is_animal":false}
+.. {"_key":"Block"}
+.. ]
+.. select --table ToyBox --output_columns _key,is_animal
 
-テーブルの作成手順は、 :doc:`/commands/table_create` コマンドを使って空のテーブルを作成した後、 :doc:`/commands/column_create` コマンドによりカラムを一つずつ作成するだけです。型の指定には--typeオプションを使います。整数の型としてInt32、浮動小数点数の型としてFloat、文字列の型としてShortText、日時の型としてTimeを使っていますが、整数と文字列については他にも型が存在します。利用可能なデータ型の一覧については、 :doc:`/type` を参照してください。経緯度については、後のチュートリアルで詳しく紹介します。
+Numeric types
+-------------
 
-:doc:`/commands/load` コマンドで新しいレコードを作成するとき、省略したカラムには、データ型のデフォルト値が格納されます。デフォルト値については、 :doc:`/type` を参照してください。
+The numeric types are divided into integer types and a floating point number type. The integer types are further divided into the signed integer types and unsigned integer types. In addition, you can choose the number of bits allocated to each integer. For more details, see :doc:`/type`. The default value of the numeric types is 0.
 
-テーブル参照
+The following example creates an Int8 column and a Float column, and then updates existing records. The :doc:`/commands/load` command updates the weight column as expected. On the other hand, the price column values are different from the specified values because 15.9 is not an integer and 200 is too large. 15.9 is converted to 15 by removing the fractional part. 200 causes an overflow and the result becomes -56. Note that the result of an overflow/underflow is undefined.
+
+.. groonga-command
+.. include:: ../example/tutorial/data-3.log
+.. column_create --table ToyBox --name price --type Int8
+.. column_create --table ToyBox --name weight --type Float
+.. load --table ToyBox
+.. [
+.. {"_key":"Monkey","price":15.9}
+.. {"_key":"Flower","price":200,"weight":0.13}
+.. {"_key":"Block","weight":25.7}
+.. ]
+.. select --table ToyBox --output_columns _key,price,weight
+
+String types
 ------------
 
-groongaでは、別テーブルを参照するカラムを作成できます。より正確には、別テーブルのレコードIDを格納しておくことにより、別テーブルのレコードを参照できるようにします。以降、別テーブルを参照するカラムに格納される値のことをテーブル参照と呼びます。
+The string types are divided according to the maximum length. For more details, see :doc:`/type`. The default value is the zero-length string.
+
+The following example creates an ShortText column and updates existing records. The third record has the default value because not updated.
+
+.. groonga-command
+.. include:: ../example/tutorial/data-4.log
+.. column_create --table ToyBox --name name --type ShortText
+.. load --table ToyBox
+.. [
+.. {"_key":"Monkey","name":"Grease"}
+.. {"_key":"Flower","name":"Rose"}
+.. ]
+.. select --table ToyBox --output_columns _key,name
+
+Date and time type
+------------------
+
+The date and time type of groonga is Time. Actually, a Time column stores a date and time as the number of microseconds since the Epoch, 1970-01-01 00:00:00. A Time value can represent a date and time before the Epoch because the actual data type is a signed integer. Note that :doc:`/commands/load` and :doc:`/commands/select commands use a decimal number to represent a data and time in seconds. The default value is 0.0, which means the Epoch.
 
-テーブル参照のカラムがあるときは、--output_columnsオプションに「参照元カラム名.参照先カラム名」と指定することにより、参照先カラムの値を取り出すことができます。参照元カラム名のみを指定したときは、「参照元カラム名._key」と同様の扱いとなり、参照先レコードの主キー(_key)が取り出されます。また、テーブル参照が有効なレコードを指していないときは、参照先カラムのデフォルト値が取り出されるようになっています。
+The following example creates a Time column and updates existing records. The first record has the default value because not updated.
+
+.. groonga-command
+.. include:: ../example/tutorial/data-5.log
+.. column_create --table ToyBox --name time --type Time
+.. load --table ToyBox
+.. [
+.. {"_key":"Flower","time":1234567890.1234569999}
+.. {"_key":"Block","time":-1234567890}
+.. ]
+.. select --table ToyBox --output_columns _key,time
+
+Longitude and latitude types
+----------------------------
+
+The longitude and latitude types are divided according to the geographic coordinate system. For more details, see :doc:`/type`. To represent a longitude and latitude, groonga uses a string formatted as follows:
+
+* "longitude x latitude" in milliseconds (e.g.: "128452975x503157902")
+* "longitude x latitude" in degrees (e.g.: "35.6813819x139.7660839")
+
+A number with/without a decimal point represents a longitude or latitude in milliseconds/degrees respectively. Note that a combination of a number with a decimal point and a number without a decimal point (e.g. 35.1x139) must not be used. A comma (',') is also available as a delimiter. The default value is "0x0".
+
+The following example creates a WGS84GeoPoint column and updates existing records. The second record has the default value because not updated.
+
+.. groonga-command
+.. include:: ../example/tutorial/data-6.log
+.. column_create --table ToyBox --name location --type WGS84GeoPoint
+.. load --table ToyBox
+.. [
+.. {"_key":"Monkey","location":"128452975x503157902"}
+.. {"_key":"Block","location":"35.6813819x139.7660839"}
+.. ]
+.. select --table ToyBox --output_columns _key,location
+
+Reference types
+---------------
+
+groongaでは、テーブル参照のカラム、すなわち別テーブルを参照するカラムを作成できます。より正確には、別テーブルのレコードIDを格納しておくことにより、別テーブルのレコードを参照できるようにします。
+
+テーブル参照のカラムがあるときは、 `output_columns` 引数に "参照元カラム.参照先カラム" と指定することにより、参照先カラムの値を取り出すことができます。参照元カラムのみを指定したときは、 "参照元カラム名._key" と同様の扱いとなり、参照先レコードの主キーが取り出されます。テーブル参照が有効なレコードを指していないときは、参照先カラムのデフォルト値が取り出されるようになっています。
 
 ここでは、先のチュートリアルで作成したSiteテーブルにlinkという新たなカラムを作成し、サイト間のリンク関係を保存できるようにしてみましょう。
 
 .. groonga-command
-.. include:: ../example/tutorial/data-2.log
+.. include:: ../example/tutorial/data-7.log
 .. column_create --table Site --name link --type Site
 .. load --table Site
 .. [{"_key":"http://example.org/","link":"http://example.net/"}]
 .. select --table Site --output_columns _key,title,link._key,link.title --query title:@this
 
-テーブル参照のカラムを作成するときは、--typeオプションに参照先テーブルの名前を指定します。この例では、同じテーブルに含まれる別のレコードを参照させたいので、Siteを指定することになります。次に、"http://example.org/"から"http://example.net/"へのリンクを作成しています。テーブル参照を作成するときは、IDではなく主キー(_key)を指定することに注意してください。最後に、リンクの内容を確認しています。"link._key"と"link.title"を--output_columnsに指定することにより、参照先の主キー(_key)とタイトル(title)を表示できています。
+テーブル参照のカラムを作成するときは、 `type` 引数に参照先テーブルを指定します。この例では、同じテーブルに含まれる別のレコードを参照させたいので、Siteを指定することになります。次に、 "http://example.org/" から "http://example.net/" へのリンクを登録しています。テーブル参照を作成するときは、IDではなく主キーを指定することに注意してください。最後に、リンクの内容を確認しています。この例では、  `output_columns` 引数に link._key と link.title を指定しているので、参照先の主キーとタイトルが表示されています。
 
-ベクターカラム
---------------
+Vector types
+------------
 
-:doc:`/commands/column_create` コマンドでカラムを作成するとき、--flagsオプションにCOLUMN_VECTORフラグを指定すると、--typeに指定した型の配列を格納するカラムになります。以下、このようなカラムをベクターカラムと呼びます。ベクターカラムは、各レコードに複数の値を格納できるため、一対多の参照関係を表すのに便利です。
+:doc:`/commands/column_create` コマンドでカラムを作成するとき、 `flags` 引数にCOLUMN_VECTORフラグを指定すると、 `type` 引数に指定した型の配列を格納するカラムになります。このようなカラムのことは、ベクターカラムと呼びます。ベクターカラムは、各レコードに複数の値を格納できるため、一対多の参照関係を表すのに便利です。
 
 さきほどテーブル参照の例として作成したカラムでは、各サイトに一つのリンクしか保存できませんでした。通常は一つのサイトから多くのサイトにリンクが張られているので、これでは残念な仕様になってしまいます。そこで、ベクターカラムを使って、複数のリンクを保存できるようにしてみましょう。
 
 .. FIXME: _idの配列ではダメなのかどうか。検証する。
 
 .. groonga-command
-.. include:: ../example/tutorial/data-3.log
+.. include:: ../example/tutorial/data-8.log
 .. column_create --table Site --name links --flags COLUMN_VECTOR --type Site
 .. load --table Site
 .. [{"_key":"http://example.org/","links":["http://example.net/","http://example.org/","http://example.com/"]}]
 .. select --table Site --output_columns _key,title,links._key,links.title --query title:@this
 
-新たなカラムにはSiteテーブルに対する参照の配列を格納するので、--typeオプションにSiteを指定するとともに、--flagsオプションにCOLUMN_VECTORフラグを指定しています。次に、 :doc:`/commands/load` による更新では、"http://example.org/"を主キー(_key)とするレコードに対し、3つのサイトをリンク先として格納しています。そして、最後にリンクの内容を確認しています。この例では、--output_columnsオプションに"links._key"と"links.title"を指定することにより、参照先の主キー(_key)とタイトル(title)をそれぞれ配列にしたものが表示されています。
+新たなカラムにはSiteテーブルに対する参照の配列を格納するので、 `type` 引数にSiteを指定するとともに、 `flags` 引数にCOLUMN_VECTORフラグを指定しています。次に、 :doc:`/commands/load` による更新では、 "http://example.org/" から "http://example.net/" へのリンクに加えて、 "http://example.org/" と "http://example.com/" へのリンクも登録しています。そして、最後にリンクの内容を確認しています。この例では、 `output_columns` 引数に links._key と links.title を指定しているので、参照先の主キーとタイトルをそれぞれ配列にしたものが表示されています。




Groonga-commit メーリングリストの案内
Back to archive index