Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Using OpenRefine
Using OpenRefine

Using OpenRefine: With this book on OpenRefine, managing and cleaning your large datasets suddenly got a lot easier! With a cookbook approach and free datasheets included, you'll quickly and painlessly improve your data managing capabilities.

eBook
$20.69 $22.99
Paperback
$38.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Using OpenRefine

Chapter 2. Analyzing and Fixing Data

In this chapter, we will go deeper into OpenRefine and review most of its basic functionalities intended for data fixing and analysis. We will cover the following topics, spread over six recipes:

  • Recipe 1 – sorting data

  • Recipe 2 – faceting data

  • Recipe 3 – detecting duplicates

  • Recipe 4 – applying a text filter

  • Recipe 5 – using simple cell transformations

  • Recipe 6 – removing matching rows

Even more so than in Chapter 1, Diving Into OpenRefine, the recipes are designed to allow readers to jump from one recipe to another in any way you like, depending on your needs and interests. Flowing reading of the chapter is also possible of course, but not mandatory at all.

Be warned that recipes are unequal in length; some are quite short and to the point, but others could not be constricted to one or two pages. Recipe 2 – faceting data, for instance, which covers the broad topic of faceting, runs over many pages and is divided into subrecipes.

Note

To follow the examples used...

Recipe 1 – sorting data


In this recipe, you will learn how to sort data as a visual aid and how to reorder rows permanently as a prerequisite for more advanced operations.

Because sorted values are easier to explore and manipulate, sorting data is certainly something you will want to do at some point when working with OpenRefine; you can either use the sorted values as a visual aid or reorder your records permanently. In order to sort your data by their Record ID, for instance, choose Sort... in the column menu to access the following window:

Cell values can be sorted according to their type: text (case-sensitive or not), numbers, dates, or Boolean values. For each type, we are offered two possible sorting orders:

  • Text: alphabetical (a to z) or reversed alphabetical (z to a)

  • Numbers: smallest first or largest first

  • Dates: earliest first or latest first

  • Booleans: false then true or true then false

Moreover, we can select where errors and blanks will be stored in relation to the valid values by dragging...

Recipe 2 – faceting data


One of the functionalities of OpenRefine that you will use most often is faceting. Facets do not affect the values of your data, but they allow you to get useful insights of your dataset; you can think of facets as various ways to look at your data, just like the facets of a gemstone that still have to be refined. Facets also allow you to apply a transformation to a subset of your data, as they allow you to display only rows corresponding to a given criterion.

In this recipe, we will explore the various ways of faceting data depending on their values and on your needs: text facets for strings, numeric facets for numbers and dates, a few predefined customized facets, and finally how to use stars and flags. Most of the power of OpenRefine lies in the ability to combine these different types of facets.

Text facets

If your dataset has a column containing cities or country names, for instance, you will want to see at a glance what the different values are for that field...

Recipe 3 – detecting duplicates


In this recipe, you will learn what duplicates are, how to spot them, and why it matters.

The only type of customized facet that we left out in the previous recipe is the duplicates facet. Duplicates are annoying records that happen to appear twice (or more) in a dataset. Keeping identical records is a waste of space and can generate ambiguity, so we will want to remove these duplicates. This facet is an easy way to detect them, but it has a downside; it only works on text strings, at least straightforwardly (to learn how to tweak it to work on integers as well, have a look at Appendix, Regular Expressions and GREL).

Too bad then; we cannot use a duplicate facet on the Record ID column. The next best thing is to run it on the registration numbers, which are an internal classification of objects in the collection, though they are not as reliable as the IDs, since they have an extrinsic meaning for collection managers. Anyway, let's give it a try by navigating...

Recipe 4 – applying a text filter


In this recipe, you will learn about filters that allow you to search for values displaying some patterns.

When you want to find rows matching a certain string, it is easier to rely on a simple text filter than on cumbersome facets. Let's start with a simple example. Suppose you want to filter all titles relating to the United States. Navigate to Object Title | Text filter and watch the filter box open on the left, in the same tab where facets appear. Now type in USA. OpenRefine tells you that there are 1,866 matching rows. Select the case sensitive checkbox to eliminate happenstance matches, such as karakusa and Jerusalem, and we are down to 1,737 rows:

Still, we cannot be sure that there is no noise left in these matches; there could be occurrences of JERUSALEM in capital letters for instance. To get around this problem, we could try to add spaces to either side of USA, but at the risk of losing cases, such as [USA] or /USA, along with occurrences of the...

Recipe 5 – using simple cell transformations


In this recipe, you will learn how to use OpenRefine's built-in transformations to modify subsets of your data.

When playing with facets and filters, we have essentially displayed the data in various ways, but we have not really affected them. Now comes the time to modify your data at last, and this means entering the powerful Edit cells menu. While we already used Blank down in order to detect duplicates, other transformations, such as splitting and joining multi-valued cells or clustering and editing values, are more advanced, so we will delay their discussion until the next chapter. Other transforms are easier to grasp; however, we will focus now on those available through the Common transforms submenu pictured in the following screenshot:

Trimming whitespace at the beginning and end of a string is a good first step to improve the quality of your data. It will ensure that their identical values will not differ by leading and trailing whitespace...

Recipe 6 – removing matching rows


In this recipe, you will learn how to suppress problematic rows that have been previously singled out through the use of facets and filters.

Detecting duplicates or flagging redundant rows is fine, but it is only part of the job. At some point, you will want to cross the mark between data profiling (or analysis) and data cleaning. In practice, this means that rows that have been identified as inappropriate during the diagnosis phase (and probably flagged as such) will need to be removed from the dataset, since they are detrimental to its quality.

To remove rows, be sure to have a facet or filter in place first, otherwise you will remove all rows in the dataset. Let's start from the clean project again (import it for a second time or toggle the Undo / Redo tab and select 0. Create project to cancel all modifications) and see what we can do to clean up this dataset. Also, check that OpenRefine shows your data as rows, not records.

We will first remove the rows...

Summary


During the course of this chapter, we have learned how to master the basics of OpenRefine in order to analyze and fix datasets, essential components of data profiling and cleaning.

Analyzing data involved sorting and the use of various facets, but also the application of text filters and the detection of duplicates.

Fixing data was accomplished through reordering, cell transformations, and deletion.

In the next chapter, we will bring our understanding of the inner workings of OpenRefine to another level by venturing into advanced data operations.

Left arrow icon Right arrow icon

Key benefits

  • Create links between your dataset and others in an instant
  • Effectively transform data with regular expressions and the General Refine Expression Language
  • Spot issues in your dataset and take effective action with just a few clicks

Description

Data today is like gold - but how can you manage your most valuable assets? Managing large datasets used to be a task for specialists, but the game has changed - data analysis is an open playing field. Messy data is now in your hands! With OpenRefine the task is a little easier, as it provides you with the necessary tools for cleaning and presenting even the most complex data. Once it's clean, that's when you can start finding value. Using OpenRefine takes you on a practical and actionable through this popular data transformation tool. Packed with cookbook style recipes that will help you properly get to grips with data, this book is an accessible tutorial for anyone that wants to maximize the value of their data. This book will teach you all the necessary skills to handle any large dataset and to turn it into high-quality data for the Web. After you learn how to analyze data and spot issues, we'll see how we can solve them to obtain a clean dataset. Messy and inconsistent data is recovered through advanced techniques such as automated clustering. We'll then show extract links from keyword and full-text fields using reconciliation and named-entity extraction. Using OpenRefine is more than a manual: it's a guide stuffed with tips and tricks to get the best out of your data.

Who is this book for?

This book is targeted at anyone who works on or handles a large amount of data. No prior knowledge is required, as we start from the very beginning and gradually reveal more advanced features. You don't even need your own dataset, as we provide example data to try out the book's recipes.

What you will learn

  • Import data in various formats
  • Explore datasets in a matter of seconds
  • Apply basic and advanced cell transformations
  • Deal with cells that contain multiple values
  • Create instantaneous links between datasets
  • Filter and partition your data easily with regular expressions
  • Use named-entity extraction on full-text fields to automatically identify topics
  • Perform advanced data operations with the General Refine Expression Language

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 10, 2013
Length: 114 pages
Edition : 1st
Language : English
ISBN-13 : 9781783289097
Vendor :
Google
Category :
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Sep 10, 2013
Length: 114 pages
Edition : 1st
Language : English
ISBN-13 : 9781783289097
Vendor :
Google
Category :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 148.97
Building Machine Learning Systems with Python
$54.99
Using OpenRefine
$38.99
Practical Data Analysis
$54.99
Total $ 148.97 Stars icon

Table of Contents

4 Chapters
Diving Into OpenRefine Chevron down icon Chevron up icon
Analyzing and Fixing Data Chevron down icon Chevron up icon
Advanced Data Operations Chevron down icon Chevron up icon
Linking Datasets Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(5 Ratings)
5 star 20%
4 star 60%
3 star 20%
2 star 0%
1 star 0%
David Branch Oct 22, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A really excellent book - very clear and well written and provided me with a very good base level of knowledge of this product. There are a couple of minor mistakes in the book, but these do not detract from its value. In my view, this is the best book available to get you going with OpenRefine.
Amazon Verified review Amazon
M. Heller Nov 19, 2013
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Disclosure: the publisher of this book provided me with a free copy in exchange for a review. The opinions expressed in the review are my own.While OpenRefine is an extremely useful "power tool for messy data", its power can be difficult to master without a great deal of trial and error on the part of the user. Part of this stems from the evolving nature of the tool. It began life as Freebase Gridworks, with the purpose of cleaning up data in order to run it against linked data in Freebase. When the Freebase parent organization was acquired by Google, they rebranded the tool as Google Refine, but as Google's priorities shifted, they stopped working on the tool and it became the open source OpenRefine. This legacy means that the tool has many pieces created by different people for different purposes. While there is quite a lot of good documentation out there on the OpenRefine site and elsewhere, this book puts it together in a easy to follow format. Like a lot of OpenRefine documentation, it is a series of "recipes" that explain how to do one specific task, but is written with the cover to cover reader in mind as well. The Google produced tutorial videos have similar coverage, but the book is more in depth, and has the advantage for readers coming from the cultural institution side of using a museum data set for examples. Another advantage is that the authors of the book have a particular interest in named entity recognition (part of the book covers the tool that one of them produced), which is particularly helpful for more abstract data sets with cultural data.Using OpenRefine is useful for beginner or intermediate users of OpenRefine. As someone who has used OpenRefine for awhile and written about its use in libraries, this was more helpful than I expected initially, since there were pieces of functionality I'd not yet encountered in experimentation or documentation so far. My one criticism is that much of the book promises a complete explanation in the appendix of regular expressions and the Google Refine Expression Language that powers the software, but I found that the GREL documentation was less useful than I hoped, though I still learned from it. I would have preferred if that section had been earlier in the book. That aside, I would recommend this book to anyone who has been using OpenRefine or thinking about using it, and additionally for library and museum professional development collections.
Amazon Verified review Amazon
Liath Appleton Oct 31, 2013
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Finally! A much needed introduction to OpenRefine. In my line of work I clean and organize data nearly every day. I use OpenRefine for the bulk of this work, and find myself training new students on a regular basis. This book and its tutorials have freed up my time, allowing students to learn the basics on their own. I am then able to focus more advanced training on the specifics of our particular data.This book assumes no prior knowledge of OpenRefine, but even as an advanced user I learned a few tricks I hadn't previously discovered. OpenRefine itself is an essential tool for anyone who works with large amounts of data, and anyone who needs to learn or teach OpenRefine will find this book to be a valuable addition to their library.
Amazon Verified review Amazon
Xavi Gimenez Nov 18, 2013
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Good book about OpenRefine, readable as well and technically accurate. The provided dataset is also useful and it serves as a good example of what one can find in the real world.For non-technical users and those not used to work with data, the book helps with the steep learning curve that one can face with OpenRefine. For users that already work with data in his daily work, is a good chance to introduce OpenRefine to their data processing pipeline.The book and all its recipes covers all the basic (and not so basic) topics of OpenRefine, so gives to the user a good knowledge of what can be accomplished with the software. After covering all the essential topics, also offers a detailed introduction to the Regular Expressions and GREL, which improves exponentially the user's hability to work with data.Good complement to the existing OpenRefine resources that already exist on the net.
Amazon Verified review Amazon
Gwen E. Garrison Jul 04, 2016
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
For the money I expected more tips especially when handling various lengths of text such as addresses
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.

Modal Close icon
Modal Close icon