energystar-gov/energy-star-certified-commercial-coffee-brewers-6xa2-5c2t
Loading...

Query the Data Delivery Network

Query the DDN

The easiest way to query any data on Splitgraph is via the "Data Delivery Network" (DDN). The DDN is a single endpoint that speaks the PostgreSQL wire protocol. Any Splitgraph user can connect to it at data.splitgraph.com:5432 and query any version of over 40,000 datasets that are hosted or proxied by Splitgraph.

For example, you can query the energy_star_certified_commercial_coffee_brewers table in this repository, by referencing it like:

"energystar-gov/energy-star-certified-commercial-coffee-brewers-6xa2-5c2t:latest"."energy_star_certified_commercial_coffee_brewers"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "preheat_time_min", -- The time required for the commercial coffee brewer to achieve a ready-to-use state.
    "markets", -- Includes products sold in the U.S. and/or Canada and other ENERGY STAR partner countries.
    "date_qualified", -- The date on which the product was confirmed to meet the ENERGY STAR specification.
    "date_available_on_market", -- The date that the model is available for purchase.
    "preheat_energy_wh", -- The energy required for the commercial coffee brewer to reach ready-to-brew state. 
    "normalized_energy_save_mode_idle_energy_rate_watts_gal", -- The average rate of the coffee brewer energy consumption, after the energy save mode has been activated.
    "energy_star_model_identifier", -- A unique string of characters assigned by certification bodies (CBs) to identify a model or set of models with the same performance characteristics. This identifier should remain the same for a model even if it is recertified to a new version of an ENERGY STAR specification. This string of characters is determined by CBs and is not the ENERGY STAR Unique ID assigned by EPA.
    "pd_id", -- The ENERGY STAR Unique ID (ESUID) is a string of seven numbers EPA assigns to an ENERGY STAR model or set of models with unique performance characteristics. This ESUID is unique to both the model and product specification version and is assigned by EPA upon receipt of certification information from the certification body. Each row within the product list will have a unique ESUID. Developers may wish to use this ESUID to track information on certified models in their information systems.
    "production_capacity_gal_hr", -- The volume of brewed coffee per brew event. May also be referred to as brew capacity.
    "tank_capacity_ounces", -- Volume of water the internal water reservoir (tank) can accommodate in ready-to-brew mode in ounces.  
    "tank_capacity_gal", -- Volume of water the internal water reservoir (tank) can accommodate in ready-to-brew mode in gallons.
    "upc", -- UPC codes provided by partners for ENERGY STAR certified products. The brand, model name and model number continue to serve as the identifiers used to establish certification. The UPC code data below is intended to aid in identification of ENERGY STAR models. UPC code data is not provided for all certified models.
    "additional_model_information",
    "product_type", -- Designates the type of commercial coffee brewer, according to the following options:  1) Small Batch Type II (24oz. - 128 oz.)  2) Medium Batch Type II (>128 oz. - 256 oz.)  3) Large Batch Type II (>256oz. - 384oz.)  Refer to the specification in Section 1.K.a-c.
    "model_number", -- A distinguishing identifier, usually alphanumeric, assigned to a product by the manufacturer or private labeler.
    "model_name", -- An identifier assigned by the manufacturer or private labeler to a product or family/series of products for sales and marketing purposes.
    "brand_name", -- An identifier assigned by the manufacturer or private labeler to a product or family/series of products for sales and marketing purposes.
    "energy_star_partner", -- ENERGY STAR partner who certified the product.
    "energy_save_mode_feature", -- An optional low power mode that is designed to reduce energy consumption during periods of non-use. 
    "maximum_serving_temperature_f", -- Maximum serving temperature during heavy-use brew test (°F)
    "normalized_heavy_use_brew_energy_rate_watts_gal", -- The average rate of the coffee brewer energy consumption during a brew cycle, calculated across brew volumes for comparison.  Also referred to as normalized brew energy rate.  Calculated value using the equation in Section 3.B.
    "measured_average_tank_temperature_in_ready_to_brew_idle",
    "normalized_ready_to_brew_idle_energy_rate_watts_gal" -- The average rate of the coffee brewer energy consumption while it is maintaining or holding at a stabilized ready-to-brew operating temperature. Also referred to as normalized idle energy rate.  Calculated value using the equation in Section 3.B.
FROM
    "energystar-gov/energy-star-certified-commercial-coffee-brewers-6xa2-5c2t:latest"."energy_star_certified_commercial_coffee_brewers"
LIMIT 100;

Connecting to the DDN is easy. All you need is an existing SQL client that can connect to Postgres. As long as you have a SQL client ready, you'll be able to query energystar-gov/energy-star-certified-commercial-coffee-brewers-6xa2-5c2t with SQL in under 60 seconds.

Query Your Local Engine

Install Splitgraph Locally
bash -c "$(curl -sL https://github.com/splitgraph/splitgraph/releases/latest/download/install.sh)"
 

Read the installation docs.

Splitgraph Cloud is built around Splitgraph Core (GitHub), which includes a local Splitgraph Engine packaged as a Docker image. Splitgraph Cloud is basically a scaled-up version of that local Engine. When you query the Data Delivery Network or the REST API, we mount the relevant datasets in an Engine on our servers and execute your query on it.

It's possible to run this engine locally. You'll need a Mac, Windows or Linux system to install sgr, and a Docker installation to run the engine. You don't need to know how to actually use Docker; sgrcan manage the image, container and volume for you.

There are a few ways to ingest data into the local engine.

For external repositories, the Splitgraph Engine can "mount" upstream data sources by using sgr mount. This feature is built around Postgres Foreign Data Wrappers (FDW). You can write custom "mount handlers" for any upstream data source. For an example, we blogged about making a custom mount handler for HackerNews stories.

For hosted datasets (like this repository), where the author has pushed Splitgraph Images to the repository, you can "clone" and/or "checkout" the data using sgr cloneand sgr checkout.

Cloning Data

Because energystar-gov/energy-star-certified-commercial-coffee-brewers-6xa2-5c2t:latest is a Splitgraph Image, you can clone the data from Spltgraph Cloud to your local engine, where you can query it like any other Postgres database, using any of your existing tools.

First, install Splitgraph if you haven't already.

Clone the metadata with sgr clone

This will be quick, and does not download the actual data.

sgr clone energystar-gov/energy-star-certified-commercial-coffee-brewers-6xa2-5c2t

Checkout the data

Once you've cloned the data, you need to "checkout" the tag that you want. For example, to checkout the latest tag:

sgr checkout energystar-gov/energy-star-certified-commercial-coffee-brewers-6xa2-5c2t:latest

This will download all the objects for the latest tag of energystar-gov/energy-star-certified-commercial-coffee-brewers-6xa2-5c2t and load them into the Splitgraph Engine. Depending on your connection speed and the size of the data, you will need to wait for the checkout to complete. Once it's complete, you will be able to query the data like you would any other Postgres database.

Alternatively, use "layered checkout" to avoid downloading all the data

The data in energystar-gov/energy-star-certified-commercial-coffee-brewers-6xa2-5c2t:latest is 0 bytes. If this is too big to download all at once, or perhaps you only need to query a subset of it, you can use a layered checkout.:

sgr checkout --layered energystar-gov/energy-star-certified-commercial-coffee-brewers-6xa2-5c2t:latest

This will not download all the data, but it will create a schema comprised of foreign tables, that you can query as you would any other data. Splitgraph will lazily download the required objects as you query the data. In some cases, this might be faster or more efficient than a regular checkout.

Read the layered querying documentation to learn about when and why you might want to use layered queries.

Query the data with your existing tools

Once you've loaded the data into your local Splitgraph Engine, you can query it with any of your existing tools. As far as they're concerned, energystar-gov/energy-star-certified-commercial-coffee-brewers-6xa2-5c2t is just another Postgres schema.

Related Documentation:

Loading...