wikidata_position_history 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52e5490ed1d01167632b8adc9cb5d9a37912a5accad858b5d2ada5aaa43522ff
4
- data.tar.gz: ab39a9aed506e9c77834ed7a7fdc6a9a06006eaee84f14ee9fb0c71eb069c5a8
3
+ metadata.gz: '08b127d4fefeb6c622042af063ab7574afb3b54f0c1c6dc3cb5329304b6b7c84'
4
+ data.tar.gz: 72f0be64974066b3b8988f23ac5dde2e5897b8aaa611ff379997053f890b3011
5
5
  SHA512:
6
- metadata.gz: e7aae1fb45f43c0ba961d878de171e4150194514dc406e0059a8c9bc2544ce2e9549d4e9e07c5da6b7ccfe8a6aec534735c1f645fb026a5eb04512b4cee7f9cb
7
- data.tar.gz: 797ab543a4a0ee636ed833a1f200c266ebed7b60872084b6f9b0156b11920dc619c15d4bc19b8326ca747c9f5585df4a81be7b23c5fbdd07a177e3ded1f3f702
6
+ metadata.gz: c914cfaa9abc6412f04e0482b91facf33d52db8f4b49adea721bbdb5cb7dcd31c9e404f87bd58a09e7843ee8d985f2c2cd30f89953fdeffb54dc3b2749e11e85
7
+ data.tar.gz: 131ef009d921f4fa974411295f913b8b9df0800f326caf9125e7524d60e627e29e3bf8f7d7303e1a4b258dca4a679568ea3f17944795bd4d68e408c4f8c023c0
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ # [2.1.0] 2020-09-16
4
+
5
+ * When displaying a list of members for a constituency, also include
6
+ a 'parliamentary group' (P4100) column, and if there's a
7
+ 'parliamentary term' (P2937) qualifier, use it for the ordinal.
8
+
3
9
  # [2.0.0] 2020-09-16
4
10
 
5
11
  ## Interface change
@@ -32,7 +32,7 @@ module WikidataPositionHistory
32
32
  <<~SPARQL
33
33
  # constituency-mandates
34
34
 
35
- SELECT DISTINCT ?ordinal ?item ?start_date ?start_precision ?end_date ?end_precision ?prev ?next ?nature
35
+ SELECT DISTINCT ?ordinal ?item ?start_date ?start_precision ?end_date ?end_precision ?party ?prev ?next ?term
36
36
  WHERE {
37
37
  ?item wdt:P31 wd:Q5 ; p:P39 ?posn .
38
38
  ?posn pq:P768 wd:%s .
@@ -40,10 +40,13 @@ module WikidataPositionHistory
40
40
 
41
41
  OPTIONAL { ?posn pqv:P580 [ wikibase:timeValue ?start_date; wikibase:timePrecision ?start_precision ] }
42
42
  OPTIONAL { ?posn pqv:P582 [ wikibase:timeValue ?end_date; wikibase:timePrecision ?end_precision ] }
43
- OPTIONAL { ?posn pq:P1365|pq:P155 ?prev }
44
- OPTIONAL { ?posn pq:P1366|pq:P156 ?next }
45
- OPTIONAL { ?posn pq:P1545 ?ordinal }
46
- OPTIONAL { ?posn pq:P5102 ?nature }
43
+ OPTIONAL { ?posn pq:P1365 ?prev }
44
+ OPTIONAL { ?posn pq:P1366 ?next }
45
+ OPTIONAL { ?posn pq:P4100 ?party }
46
+ OPTIONAL {
47
+ ?posn pq:P2937 ?term .
48
+ OPTIONAL { ?term p:P31/pq:P1545 ?ordinal }
49
+ }
47
50
  }
48
51
  ORDER BY DESC(?start_date) ?item
49
52
  SPARQL
@@ -61,6 +64,10 @@ module WikidataPositionHistory
61
64
  item_from(:item)
62
65
  end
63
66
 
67
+ def party
68
+ item_from(:party)
69
+ end
70
+
64
71
  # TODO: switch to item_from
65
72
  def prev
66
73
  QueryService::WikidataItem.new(row.dig(:prev, :value)).qlink
@@ -22,6 +22,10 @@ module WikidataPositionHistory
22
22
  "#{ordinal}."
23
23
  end
24
24
 
25
+ def party
26
+ current.party
27
+ end
28
+
25
29
  def officeholder
26
30
  current.officeholder
27
31
  end
@@ -50,6 +50,9 @@ module WikidataPositionHistory
50
50
  | style="padding:0.5em 2em" | <%= mandate.ordinal_string %>
51
51
  | style="padding:0.5em 2em" | <%= bio.map(&:image_link).first %>
52
52
  | style="padding:0.5em 2em" | <span style="font-size: <%= mandate.acting? ? '1.25em; font-style: italic;' : '1.5em' %>; display: block;"><%= mandate.officeholder.qlink %></span> <%= mandate.dates %>
53
+ <% if metadata.constituency? -%>
54
+ | style="padding:0.5em 1em" | <% if mandate.party %><%= mandate.party.qlink %><% end %>
55
+ <% end -%>
53
56
  | style="padding:0.5em 2em 0.5em 1em; border: none; background: #fff; text-align: left;" | \
54
57
  <% mandate.warnings.each do |warning| -%>
55
58
  <span style="display: block">[[File:Pictogram voting comment.svg|15px|link=]]&nbsp;<span style="color: #d33; font-weight: bold; vertical-align: middle;"><%= warning.headline %></span>&nbsp;<ref><%= warning.explanation %></ref></span>\
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WikidataPositionHistory
4
- VERSION = '2.0.0'
4
+ VERSION = '2.1.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wikidata_position_history
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Bowden