Skip to content
Sign in

Analyze

SQL over open product data, run by DuckDB in your browser. Pick releases, query the published Parquet files directly, or sync them to this browser for repeat and offline analysis.

Your access to this dataset changed

Publish as a public recipe

Recipes are public: they carry this SQL and the pinned datasets below, never local data or imports. Readers see both and run them themselves.

Datasets, pinned

  • datasets/electric-motors @ 3
-- Which motors claim a rated power between 1 and 2.5 kW, and where do their classes disagree?
-- EF009903 is the rated power in kW that the transform derives from the supplier's power[W].
WITH power AS (
  SELECT entity_id, TRY_CAST(value AS DOUBLE) AS kw
  FROM assertions
  WHERE property = 'EF009903' AND unit = 'kW'
), classes AS (
  SELECT entity_id,
         string_agg(scheme || ': ' || CASE WHEN code <> '' THEN code ELSE '(' || loss || coalesce(': ' || nullif(candidates, ''), '') || ')' END,
                    ' | ' ORDER BY scheme, code) AS classes,
         bool_or(loss IN ('ambiguous', 'missing', 'incompatible')) AS unresolved
  FROM classifications
  GROUP BY entity_id
)
SELECT e.entity_id, e.name, p.kw AS rated_power_kw, c.classes,
       CASE WHEN c.unresolved THEN 'disagree' ELSE 'consistent' END AS class_status
FROM entities e
JOIN power p USING (entity_id)
LEFT JOIN classes c USING (entity_id)
WHERE p.kw BETWEEN 1 AND 2.5
ORDER BY class_status DESC, p.kw;
Engine: starting…electric_motors: remote · 3Remote read: up to 10.7 KB