NodeNova commited on
Commit
d2e485c
·
verified ·
1 Parent(s): 23d051f

Correct example query 1; ask users what they use the dataset for (GitHub b92b780)

Browse files
Files changed (3) hide show
  1. CHANGELOG.md +11 -0
  2. README.md +5 -0
  3. examples/queries.sql +22 -14
CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
  Each snapshot is a tag here and on the Hugging Face dataset, named `v<YYYY.MM>` after the
4
  month it was cut. Load a pinned snapshot with `revision="v2026.10"`.
5
 
 
 
 
 
 
 
 
 
 
 
 
6
  ## v2026.10
7
 
8
  First public snapshot.
 
3
  Each snapshot is a tag here and on the Hugging Face dataset, named `v<YYYY.MM>` after the
4
  month it was cut. Load a pinned snapshot with `revision="v2026.10"`.
5
 
6
+ ## Unreleased
7
+
8
+ - **`examples/queries.sql` query 1 corrected.** It had no column for weighted portal
9
+ placeholder slots (`template_slot`, e.g. *Custom Metric*), so on 19% of lots the price,
10
+ quality and social value columns summed to less than 100, and lots made only of such slots
11
+ were averaged in as 0% price. Authorities on that portal template read far too low — Cumbria
12
+ County Council 3.2% price where its classifiable lots average 40.0%. The query now adds an
13
+ `unnamed_pct` column, so the four sum to 100 per lot, and drops lots with nothing to
14
+ classify. The data is unchanged; only the example was wrong.
15
+ - The card asks users to say what they use the dataset for, in a discussion or an issue.
16
+
17
  ## v2026.10
18
 
19
  First public snapshot.
README.md CHANGED
@@ -66,6 +66,11 @@ Snapshot **v2026.10**, CC BY 4.0.
66
  - Hugging Face: <https://huggingface.co/datasets/NodeNovaOrg/bidlens-open-data>
67
  - GitHub (card, schema, examples): <https://github.com/nodenova/bidlens-open-data>
68
 
 
 
 
 
 
69
  ## Why another procurement dataset
70
 
71
  Raw procurement feeds are already open, and several good aggregations exist (the
 
66
  - Hugging Face: <https://huggingface.co/datasets/NodeNovaOrg/bidlens-open-data>
67
  - GitHub (card, schema, examples): <https://github.com/nodenova/bidlens-open-data>
68
 
69
+ **Using this dataset?** Tell us what for in a
70
+ [discussion](https://huggingface.co/datasets/NodeNovaOrg/bidlens-open-data/discussions) or a
71
+ [GitHub issue](https://github.com/nodenova/bidlens-open-data/issues/new/choose). It decides how
72
+ often the snapshot is refreshed and what gets added next.
73
+
74
  ## Why another procurement dataset
75
 
76
  Raw procurement feeds are already open, and several good aggregations exist (the
examples/queries.sql CHANGED
@@ -23,25 +23,33 @@ SELECT c.*,
23
  FROM criteria c LEFT JOIN criterion_roles r ON r.name = c.name;
24
 
25
  -- 1. Price / quality / social value split per UK authority, averaged over lots.
26
- -- UK-native feeds only. Lots whose scheme has a weighted non-competed or undisclosed line
27
- -- are dropped whole, and zero-weight non-scoring lines are ignored.
 
 
 
28
  WITH lots AS (
29
- SELECT notice_id, lot_id, buyer_name,
30
- sum(weight_pct) FILTER (WHERE role = 'price') AS price,
31
- sum(weight_pct) FILTER (WHERE role = 'quality') AS quality,
32
- sum(weight_pct) FILTER (WHERE role = 'social_value') AS social_value,
33
- bool_or(role IN ('not_competed', 'undisclosed', 'unsplit') AND weight_value > 0) AS no_contest
 
 
34
  FROM criteria_roled
35
- WHERE source IN ('fts_bulk_xml', 'fts_api') AND lot_id IS NOT NULL AND weight_pct IS NOT NULL
36
- GROUP BY ALL
 
 
 
37
  )
38
  SELECT b.canonical_name,
39
  count(*) AS lots,
40
- round(avg(coalesce(price, 0)), 1) AS price_pct,
41
- round(avg(coalesce(quality, 0)), 1) AS quality_pct,
42
- round(avg(coalesce(social_value, 0)), 1) AS social_value_pct
43
- FROM lots JOIN buyers b ON b.buyer_name = lots.buyer_name AND b.buyer_id IS NOT NULL
44
- WHERE NOT no_contest
45
  GROUP BY b.buyer_id, b.canonical_name
46
  HAVING count(*) >= 10
47
  ORDER BY lots DESC
 
23
  FROM criteria c LEFT JOIN criterion_roles r ON r.name = c.name;
24
 
25
  -- 1. Price / quality / social value split per UK authority, averaged over lots.
26
+ -- Metric: share of a lot's scored weight. The four columns sum to 100 per lot.
27
+ -- UK-native feeds only. A lot with a weighted non-competed, undisclosed or unsplit line is
28
+ -- dropped whole (there is no scheme to split). Weighted portal placeholder slots
29
+ -- (`template_slot`, e.g. "Custom Metric") and unclassified names go to `unnamed`, and a lot
30
+ -- made only of those is dropped: it has no split to report. Zero-weight lines change nothing.
31
  WITH lots AS (
32
+ SELECT source, notice_id, lot_id, min(buyer_name) AS buyer_name,
33
+ sum(CASE WHEN role = 'price' THEN weight_pct ELSE 0 END) AS price,
34
+ sum(CASE WHEN role = 'quality' THEN weight_pct ELSE 0 END) AS quality,
35
+ sum(CASE WHEN role = 'social_value' THEN weight_pct ELSE 0 END) AS social_value,
36
+ sum(CASE WHEN role = 'unknown' OR (role = 'template_slot' AND weight_pct > 0)
37
+ THEN weight_pct ELSE 0 END) AS unnamed,
38
+ bool_or(role IN ('not_competed', 'undisclosed', 'unsplit') AND weight_pct > 0) AS no_contest
39
  FROM criteria_roled
40
+ WHERE source IN ('fts_bulk_xml', 'fts_api', 'contracts_finder') AND weight_pct IS NOT NULL
41
+ GROUP BY source, notice_id, lot_id
42
+ ), scored AS (
43
+ SELECT *, price + quality + social_value + unnamed AS total
44
+ FROM lots WHERE NOT no_contest AND price + quality + social_value > 0
45
  )
46
  SELECT b.canonical_name,
47
  count(*) AS lots,
48
+ round(avg(100 * price / total), 1) AS price_pct,
49
+ round(avg(100 * quality / total), 1) AS quality_pct,
50
+ round(avg(100 * social_value / total), 1) AS social_value_pct,
51
+ round(avg(100 * unnamed / total), 1) AS unnamed_pct
52
+ FROM scored JOIN buyers b ON b.buyer_name = scored.buyer_name AND b.buyer_id IS NOT NULL
53
  GROUP BY b.buyer_id, b.canonical_name
54
  HAVING count(*) >= 10
55
  ORDER BY lots DESC