No description
  • JavaScript 87.2%
  • HTML 8.3%
  • CSS 3.1%
  • PHP 1.4%
Find a file
BERJAYA Magnus Manske 114f4ce40e V2: render start/end qualifiers next to spouses in Personal Relations
V1 surfaced marriage / partnership date ranges inline; V2 was dropping
the qualifier data when building buckets.  Add it back without changing
the bucket shape (so the existing equality-based bucket tests stay
stable):

util/person-relations.js
  - export SYMMETRIC_PROPS — predicates whose reciprocal claim lives
    under the same predicate on the other item (P26, P451, P3373,
    P1038, P3342).  Asymmetric predicates (P22 / P25 / P3448 / P40)
    need a different reciprocal.
  - findClaim(item, prop, targetQid): pure helper that returns the
    full claim object (with qualifiers) when the mainsnak target
    matches, else null.
  - extractTimeQualifiers(claim): returns a {P580, P582, P585} map
    containing only the present, well-formed time qualifiers
    (novalue / somevalue / missing-time snaks are dropped).

components/person-relations.js
  - relationshipDates(prop, qid): try the forward claim on main first
    (main.prop = qid), then fall back to the reciprocal claim on the
    other item — same predicate for symmetric kinship, P40 for parent
    rows, P22/P25/P3448 for child rows.
  - formatRelationshipDates: compact display:
      "1991-11-25–2001-05-11"  both start and end
      "since 1991"             only start
      "until 2001"             only end
      "1995"                   only a point in time
      ""                       no time qualifiers
    Template renders the result inline next to each linked person,
    wrapped so it doesn't break mid-range.

Tests: 14 new assertions for findClaim (target match, no match,
missing prop/item, malformed mainsnak) and extractTimeQualifiers
(each qualifier in isolation, both, P585 point in time, ignoring
non-time qualifiers, empty / null inputs, novalue / missing-time
snaks dropped, first-of-multiple selected).  The bucket-shape tests
were left untouched because the bucket return value is unchanged —
qualifier rendering is purely a presentation-layer concern.
2026-05-11 11:19:50 +01:00
public_html V2: render start/end qualifiers next to spouses in Personal Relations 2026-05-11 11:19:50 +01:00
tests/v2 V2: render start/end qualifiers next to spouses in Personal Relations 2026-05-11 11:19:50 +01:00
.gitignore Ignore audits/ folder (local-only working notes) 2026-05-08 16:24:56 +01:00
CLAUDE.md misc 2026-05-08 15:10:30 +01:00
composer.json misc 2026-03-18 13:10:20 +00:00
COPYING add COPYING 2019-08-18 10:26:24 +00:00
LICENSE Routine check-in 2013-06-24 19:38:50 +00:00
package.json V2: honour V1 ?find=, ?date=, ?lang= URL contract; add stub search & date views 2026-05-08 16:25:10 +01:00