Skip to content

Commit

Permalink
Add v2 node API doc (datacommonsorg#337)
Browse files Browse the repository at this point in the history
* Add v2 node API doc

* Revert lock file

* resolve comments
  • Loading branch information
shifucun authored Sep 3, 2023
1 parent 7395de3 commit fb8d2ec
Show file tree
Hide file tree
Showing 9 changed files with 391 additions and 23 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ _site/
vendor/
.bundle/
.vscode/
.jekyll-cache
.jekyll-cache
.jekyll-metadata
6 changes: 0 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,8 @@ GEM
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.14.3-arm64-darwin)
racc (~> 1.4)
nokogiri (1.14.3-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.13.3-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.13.3-x86_64-darwin)
racc (~> 1.4)
octokit (4.21.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
Expand Down
7 changes: 4 additions & 3 deletions api/pandas/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
layout: default
title: Pandas
nav_order: 3
nav_order: 4
parent: API
has_children: true
---

# Data Commons Pandas API

The **Data Commons Pandas API** is a superset of the Data Commons Python API:
Expand All @@ -21,8 +22,8 @@ Before proceeding, make sure you have followed the setup instructions below.

To get started using the Pandas API:

* Install the API using `pip`.
* Begin developing with the Pandas API
- Install the API using `pip`.
- Begin developing with the Pandas API

### Installing the Pandas API

Expand Down
7 changes: 4 additions & 3 deletions api/python/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
layout: default
title: Python
nav_order: 2
nav_order: 3
parent: API
has_children: true
---

# Data Commons Python API

The **Data Commons Python API** is a Python library that enables developers to
Expand All @@ -19,8 +20,8 @@ Before proceeding, make sure you have followed the setup instructions below.

To get started using the Python API:

* Install the API using `pip`.
* Begin developing with the Python API
- Install the API using `pip`.
- Begin developing with the Python API

### Installing the Python API

Expand Down
4 changes: 2 additions & 2 deletions api/rest/index.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
layout: default
title: REST (v0)
nav_order: 1
nav_order: 2
parent: API
has_children: true
---

# Data Commons REST API

The **Data Commons REST API** is a REST library that enables developers to
programmatically access nodes in the Data Commons knowledge graph. This package
allows users to explore the structure of the graph, integrate statistics from
the graph into data analysis applications and much more. Please see the
[overview](/api) for more details on the design and structure of the API.

14 changes: 7 additions & 7 deletions api/rest/v1/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: default
title: REST (v1)
nav_order: 0
nav_order: 1
parent: API
has_children: true
published: true
Expand Down Expand Up @@ -46,7 +46,7 @@ Methods for exploring the graph around a set of nodes.
| Property Values | [/v1/property/values/](/api/rest/v1/property/values) | Get the value for a property of a specific node |
| Property Values (linked) | [/v1/property/values/in/linked](/api/rest/v1/property/values/in/linked) | Get all places of a specific type contained in an ancestor place |
| | | |
| <bulk-tag>bulk</bulk-tag> Triples | [/v1/bulk/triples](/api/rest/v1/bulk/triples) | Get neighboring nodes and edge labels for multiple nodes |
| <bulk-tag>bulk</bulk-tag> Triples | [/v1/bulk/triples](/api/rest/v1/bulk/triples) | Get neighboring nodes and edge labels for multiple nodes |
| <bulk-tag>bulk</bulk-tag> Properties | [/v1/bulk/properties](/api/rest/v1/bulk/properties) | Get all properties for multiple nodes. |
| <bulk-tag>bulk</bulk-tag> Property values | [/v1/bulk/property/values](/api/rest/v1/bulk/property/values) | Get property values for multiple properties and multiple nodes |
| <bulk-tag>bulk</bulk-tag> Property Values (linked) | [/v1/bulk/property/values/in/linked](/api/rest/v1/bulk/property/values/in/linked) | Get all places of a specific type for mulitple ancestor places |
Expand All @@ -57,14 +57,14 @@ Methods for retrieving information of certain types of nodes.

| API | URI | Description |
| --------------------------------------------- | --------------------------------------------------------------------- | ---------------------------------------------- |
| Find Entities | [/v1/find/entities](/api/rest/v1/find/entities) | Find the DCID of an entity |
| Find Entities | [/v1/find/entities](/api/rest/v1/find/entities) | Find the DCID of an entity |
| Place Info | [/v1/info/place](/api/rest/v1/info/place) | Get information about a place |
| Variable Info | [/v1/info/variable](/api/rest/v1/info/variable) | Get information about a variable |
| Variable Group Info | [/v1/info/variable-group](/api/rest/v1/info/variable-group) | Get information about a variable group |
| | | |
| <bulk-tag>bulk</bulk-tag> Find Entities | [/v1/bulk/find/entities](/api/rest/v1/bulk/find/entities) | Find the DCID of an entity |
| <bulk-tag>bulk</bulk-tag> Place Info | [/v1/bulk/info/place](/api/rest/v1/bulk/info/place) | Get information about multiple places |
| <bulk-tag>bulk</bulk-tag> Variable Info | [/v1/bulk/info/variable](/api/rest/v1/bulk/info/variable) | Get information about multiple variables |
| <bulk-tag>bulk</bulk-tag> Find Entities | [/v1/bulk/find/entities](/api/rest/v1/bulk/find/entities) | Find the DCID of an entity |
| <bulk-tag>bulk</bulk-tag> Place Info | [/v1/bulk/info/place](/api/rest/v1/bulk/info/place) | Get information about multiple places |
| <bulk-tag>bulk</bulk-tag> Variable Info | [/v1/bulk/info/variable](/api/rest/v1/bulk/info/variable) | Get information about multiple variables |
| <bulk-tag>bulk</bulk-tag> Variable Group Info | [/v1/bulk/info/variable-group](/api/rest/v1/bulk/info/variable-group) | Get information about multiple variable groups |

### Statistical Observations
Expand All @@ -79,7 +79,7 @@ entities.
| | | |
| <bulk-tag>bulk</bulk-tag> Observation (single value) | [/v1/bulk/observations/point](/api/rest/v1/bulk/observations/point) | Get a single value from variables for multiple entities |
| <bulk-tag>bulk</bulk-tag> Observation (single value, linked) | [/v1/bulk/observations/point/linked](/api/rest/v1/bulk/observations/point/linked) | Get a single value from variables for all places in an ancestor place |
| <bulk-tag>bulk</bulk-tag> Observation (series) | [/v1/bulk/observations/series](/api/rest/v1/bulk/observations/series) | Get all values from variables for multiple entities |
| <bulk-tag>bulk</bulk-tag> Observation (series) | [/v1/bulk/observations/series](/api/rest/v1/bulk/observations/series) | Get all values from variables for multiple entities |
| <bulk-tag>bulk</bulk-tag> Observation (series, linked) | [/v1/bulk/observations/series/linked](/api/rest/v1/bulk/observations/series/linked) | Get all values from a variable for all places in an ancestor place |

### Statistical Variable
Expand Down
32 changes: 32 additions & 0 deletions api/rest/v2/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
layout: default
title: REST (v2)
nav_order: 0
parent: API
has_children: true
published: false
permalink: /api/rest/v2
---

# Data Commons REST API

The Data Commons REST API is a
[REST](https://en.wikipedia.org/wiki/Representational_state_transfer) library
that enables developers to programmatically access data in the Data Commons
knowledge graph. This package allows users to explore the structure of the
graph, integrate statistics from the graph into data analysis applications and
much more.

## Getting Started

[//]: <> (TODO: update this section for v2)
First time using the Data Commons API, or just need a refresher? Take a look at
our [Getting Started Guide](/api/rest/v1/getting_started).

## Service Endpoints

The base URL for all endpoints below is:

```bash
https://api.datacommons.org/v2
```
Loading

0 comments on commit fb8d2ec

Please sign in to comment.