-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More fixes for Sheets tutorials (#497)
* troubleshooting API * Revert to gerund Though the style guide says to just use imperatives, "get started" just sounds weird. Also this is more consistent with "troubleshooting" * fixed egregiously out-of-date info and added mention of Sheets to the concepts doc * overhaul Sheets index page * fix few mis-wordings * restore mention of Workspace Marketplace * tweak procedure * Revert "tweak procedure" This reverts commit d35bc34. * tweak procedure again * rewording suggested by Julia * removed reference to video which I removed, and correct column number * rewrote sort step of sleep tutorial * updated data to 2020 * tweak images * small tweaks * redoing Covid tutorial * more corrections to tutorials * more tweaks
- Loading branch information
Showing
10 changed files
with
38 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
layout: default | ||
title: Google Sheets | ||
nav_order: 5 | ||
nav_order: 0 | ||
parent: API | ||
has_children: true | ||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
--- | ||
layout: default | ||
title: Sheets South American Latitudes | ||
nav_order: 4 | ||
title: Sheets South American latitudes | ||
parent: Tutorials | ||
parent_url: /api/sheets/tutorials | ||
grand_parent: Google Sheets | ||
grand_parent_url: /api/sheets | ||
show_in_nav: false | ||
--- | ||
|
||
# Obtaining latitude information for country capitals in South America | ||
# Obtain latitude information for country capitals in South America | ||
|
||
## Introduction | ||
The Data Commons API enables end users to obtain basic information about the entities in the graph by retrieving their properties. This tutorial walks you through the `DCPROPERTY` method in the Sheets API that enables this. | ||
The Data Commons Sheets add-on allows you to obtain basic information about the entities in the knowledge graph by retrieving their properties. This tutorial walks you through the `DCPROPERTY` function that enables this. | ||
|
||
## Step 1: Setup | ||
Pull up Google Sheets and create a new, blank spreadsheet. You can title it `Data Commons South American capitals’ latitude` or any other name of your choosing. | ||
|
||
![](/assets/images/sheets/tutorials/sheets_latitude_tutorial_1.png) | ||
|
||
To enable the Data Commons API in your spreadsheet, ensure that the Data Commons extension is installed and available under the Extensions tab in the main menu. Hover over the Data Commons menu item, then click on the Fill Place DCIDs option. | ||
To enable the Data Commons API in your spreadsheet, ensure that the Data Commons extension is installed and available under the **Extensions** menu. Hover over the **Data Commons** menu item, then click on the **Fill place DCIDs** option. | ||
|
||
![](/assets/images/sheets/tutorials/sheets_latitude_tutorial_2.png) | ||
|
||
## Step 2: Retrieving place names and DCIDs from Data Commons | ||
Double-click on A1 in the chart and enter [`southamerica`](https://datacommons.org/browser/southamerica) (the DCID for the continent of South America). | ||
## Step 2: Retrieve place names and DCIDs | ||
Double-click on the A1 cell and enter [`southamerica`](https://datacommons.org/browser/southamerica) (the DCID for the continent of South America). | ||
|
||
![](/assets/images/sheets/tutorials/sheets_latitude_tutorial_3.png) | ||
|
||
To obtain the DCIDs for all the countries, you can use the plugin function [`DCPLACESIN`](/api/sheets/places_in.html). Type `=DCPLACESIN(A1, "Country")` into cell B1. Sheets will provide pointers to help guide your function inputs. Your spreadsheet output should look like this: | ||
To obtain the DCIDs for all the countries, you can use the add-on function [`DCPLACESIN`](/api/sheets/places_in.html). In cell B1, type `=DCPLACESIN(A1, "Country")`. Sheets provides pointers to help guide your function inputs. Your spreadsheet output should look like this: | ||
|
||
![](/assets/images/sheets/tutorials/sheets_latitude_tutorial_4.png) | ||
|
||
Next, you’ll want to retrieve the country names and position them conveniently near these DCIDs. You can use the plugin function [`DCGETNAME`](/api/sheets/get_name.html) to access this information. Type `=dcgetname(B1:B)` in cell C1. Your final output will look like this: | ||
Next, you’ll want to retrieve the country names and position them conveniently near these DCIDs. You can use the addon-on function [`DCGETNAME`](/api/sheets/get_name.html) to access this information. In cell C1, type `=dcgetname(B1:B)`. Your final output will look like this: | ||
|
||
![](/assets/images/sheets/tutorials/sheets_latitude_tutorial_5.png) | ||
|
||
## Step 3: Populating the spreadsheet with capital and latitude information | ||
## Step 3: Populate the spreadsheet with capital and latitude information | ||
In this step, you will obtain all South American countries’ capitals and latitudes. To do this, you will need to get the value of the property names [`latitude`](https://datacommons.org/browser/latitude) and [`administrativeCapital`](https://datacommons.org/browser/administrativeCapital) for each country on the date specified. (As an aside, if you'd like to see what properties are available for any given entity, Data Commons provides a [Knowledge Graph](https://datacommons.org/browser) tool enabling you to look up any entity in the graph and view its associated properties.) You can use the [`DCPROPERTY`](/api/sheets/get_property.html) method to do this. | ||
|
||
Type `=DCPROPERTY(B1:B, "administrativeCapital")` into cell D1. Your output should look like this: | ||
In cell D1, `=DCPROPERTY(B1:B, "administrativeCapital")`. Your output should look like this: | ||
|
||
![](/assets/images/sheets/tutorials/sheets_latitude_tutorial_6.png) | ||
|
||
Now, to get the latitude of each capital, type `=DCPROPERTY(D1:D, "latitude")` into cell E1. | ||
Now, to get the latitude of each capital, in cell E1, type `=DCPROPERTY(D1:D, "latitude")`. | ||
|
||
![](/assets/images/sheets/tutorials/sheets_latitude_tutorial_7.png) | ||
|
||
If you’d like to experiment more with the data and methods from this tutorial, check out <https://docs.google.com/spreadsheets/d/1AYOD9yX59aKNNHoLLsmy00uihU72EKDFDZVo5KdX7H0/edit#gid=0>. You can clone the sheet by clicking on the File dropdown, then choosing the 'Make a copy' option. Note that you will need to enable the Sheets API as in Step 1 to retrieve the data for analysis. | ||
Finally, use the `DCGETNAME` function again, against column D, to get the names of the capitals. Try it yourself! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters