Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation: Library Carpentry OpenRefine Episode 10 #165

Open
joelnitta opened this issue Aug 5, 2021 · 0 comments
Open

Translation: Library Carpentry OpenRefine Episode 10 #165

joelnitta opened this issue Aug 5, 2021 · 0 comments

Comments

@joelnitta
Copy link
Member

Translation: Library Carpentry OpenRefine Episode 10

Original lesson: https://librarycarpentry.org/lc-open-refine/10-data-transformation/index.html


  • PO fileの編集についてはREADMEをご参照ください
  • あなたが翻訳し始めたと分かるように、翻訳を始める前にこのイシューを自分に割り振って(assign)、あるいはコメントを書いて下さい。
  • 翻訳が終わったら、プルリクエストを開いて、このイシューを参照・リンクして下さい。

i18n/po/lc-open-refine.ja.po

Lines 1566 to 1658 in bb59a56

#: lc-open-refine/_episodes/10-data-transformation.md:1
# Front Matter
msgid "---\n"
"title: \"Transforming Strings, Numbers, Dates and Booleans\"\n"
"teaching: 5\n"
"exercises: 15\n"
"questions:\n"
"- \"How do I use transformations to programmatically edit my data?\"\n"
"- \"How do I transform the various data types?\"\n"
"objectives:\n"
"- \"Name and describe 4 types of data - String, Number, Date and Boolean\"\n"
"- \"Transform dates for further analysis\"\n"
"- \"Use Boolean to identify information recorded in a different format\"\n"
"- \"Create and run transformations based on Boolean Values\"\n"
"keypoints:\n"
"- \"You can alter data in OpenRefine based on specific instructions\"\n"
"- \"You can expand the data editing functions that are built-in into OpenRefine by building your own\"\n"
"---"
msgstr ""
#: lc-open-refine/_episodes/10-data-transformation.md:18
# header
msgid "## Data types"
msgstr ""
#: lc-open-refine/_episodes/10-data-transformation.md:19
msgid "Understanding data types and regular expressions will help you write more complex transformations using GREL."
msgstr ""
#: lc-open-refine/_episodes/10-data-transformation.md:21
msgid ">## Data types in OpenRefine\n"
">Every piece of data in OpenRefine has a 'type'. The most common 'type' is a 'string' - that is a piece of text. However there are other data types available and transformations let you convert data from one type to another where appropriate. The data types supported are:\n"
">\n"
">* String\n"
">* Number\n"
">* Date\n"
">* Boolean\n"
">* Array (covered in the next lesson)"
msgstr ""
#: lc-open-refine/_episodes/10-data-transformation.md:31
# header
msgid "### Dates and Numbers"
msgstr ""
#: lc-open-refine/_episodes/10-data-transformation.md:32
msgid "So far we've been looking only at 'String' type data. Much of the time it is possible to treat numbers and dates as strings. For example in the Date column we have the date of publication represented as a String. However, some operations and transformations only work on 'number' or 'date' type operations. The simplest example is sorting values in numeric or date order. To carry out these functions we need to convert the values to a date or number first."
msgstr ""
#: lc-open-refine/_episodes/10-data-transformation.md:34
msgid ">## Reformat the Date\n"
">1. Make sure you remove all Facets and Filters\n"
">2. On the Date column use the dropdown menu to select ```Edit cells -> Transform```\n"
">2. In the 'Expression' box type the GREL expression ```value.toDate(\"dd/MM/yyyy\")``` and press OK.\n"
">3. Note how the values are now displayed in green and follow a standard convention for their display format (ISO 8601) - this indicates they are now stored as date data types in OpenRefine. We can now carry out functions that are specific to Dates\n"
">4. On the Date column dropdown select ```Edit column->Add column based on this column```. Using this function you can create a new column, while preserving the old column\n"
">5. In the 'New column name' type \"Formatted-Date\"\n"
">6. In the 'Expression' box type the GREL expression ```value.toString(\"dd MMMM yyyy\")```"
msgstr ""
#: lc-open-refine/_episodes/10-data-transformation.md:44
# header
msgid "### Booleans"
msgstr ""
#: lc-open-refine/_episodes/10-data-transformation.md:45
msgid "A 'Boolean' is a binary value that can either be 'true' or 'false'. Boolean values can be used directly in OpenRefine cell, but is more often used in transformations as part of a GREL expression. For example the GREL expression\n"
"```\n"
"value.contains(\"test\")\n"
"```\n"
"generates a boolean value of either 'true' or 'false' depending on whether the current value in the cell contains the text 'test' anywhere."
msgstr ""
#: lc-open-refine/_episodes/10-data-transformation.md:51
msgid "Such tests can be combined with other GREL expressions to create more complex transformations. For example, to carry out a further transformation only if a test is successful. The GREL transformation ```if(value.contains(\"test\"),\"Test data\",value)``` replaces a cell value with the words \"Test data\" only *if* the value in the cell contains the string \"test\" anywhere."
msgstr ""
#: lc-open-refine/_episodes/10-data-transformation.md:53
msgid ">## Find Reversed Author Names\n"
">In this exercise we are going to use the Boolean data type.\n"
">If you look at the Authors column, you can see that most of the author names are written in the natural order. However, a few have been reversed to put the family name first.\n"
">\n"
">We can do a crude test for reversed author names by looking for those that contain a comma:\n"
">\n"
">1. Make sure you have already split the author names into individual cells using ```Edit cells->Split multi-valued cells``` (you should have done this in exercise 5)\n"
">2. On the Authors column, use the dropdown menu and select ```Facet->Custom text facet...```\n"
">3. The Custom text facet function allows you to write GREL functions to create a facet\n"
">4. In the Expression box type ```value.contains(\",\").toString()```\n"
">* Click ```OK```\n"
">* Since the 'contains' function outputs a Boolean value, you should see a facet that contains 'false' and 'true'. These represent the outcome of the expression, i.e. true = values containing a comma; false = values not containing a comma\n"
">* In order to change the names to natural order, see the Arrays lesson."
msgstr ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant