Skip to content

Add CSV downloads for collection resources and fix un-types properties

Steve CAPELL requested to merge csv-downloads into main

CSV downloads, a Properties index, and correctly-typed properties

Bundles the CSV-download feature (issue #15 (closed)) with a pass that fixes the ranges of mis-typed BSP properties and maps generic code-carriers onto authoritative external lists.

CSV downloads (issue #15 (closed))

  • Every resource now offers Turtle, JSON-LD and CSV representations with per-format icons and a "click to view, right-click to download" hint.
  • CSV is generated for collection resources (class, code list, collection, domain) and the aggregate indexes; not for leaf nodes (individual property, code value).
  • Downloads are named after the resource (Consignment.ttl, not index.ttl) via Content-Disposition, emulated locally in serve-vocab.py and in production by the CloudFront viewer-response function.
  • CI: a dedicated S3 sync pass publishes *.csv with the correct content type.

Properties index

  • New Properties page in the resolvable vocabulary (nav: Home, Classes, Properties, Code lists), grouped by kind, with a "Used by" count of the classes that use each property.

Property retyping (BSP clean-up)

Fixes properties that carried xsd:string but are clearly typed by their name:

  • *Code (unmapped) to any-code, *DateTime to xsd:dateTime, *Numeric/*Percent/*Rate to xsd:decimal, *Date to xsd:date, *Country to the country code list.
  • *Number left as string (they are identifiers, not quantities).
  • *Id categorised: scheme identifiers range on unece:Identifier, dangerous-goods codes on any-code, URIs on xsd:anyURI, and paymentMeansId / tradeSettlementPaymentMeansId on the unece:PaymentMeans class.

External authoritative code lists

  • Adds six external-reference code lists (shared scope, no local members) that point at well-established lists the vocabulary does not hold locally, via rdfs:seeAlso to the owner's authoritative page: hs-commodity (WCO HS), isic (UN Statistics), un-locode (UNECE), iso-3166-2 (ISO), itu-calling-code (ITU E.164), un-dangerous-goods-number (UN Model Regs).
  • Re-points the matching properties off any-code onto these schemes (and the two hazard-class properties onto the local dangerous-goods-class-code-list).
  • Because they use rdfs:seeAlso rather than dcterms:source, they are exempt from the ledger-drift gate.
  • The docs Code Lists page gains an External codes table linking each scheme to its authoritative source.

Validation

  • All 9 CI gates pass (87 classes, 740 properties).
  • Regenerated diagrams, per-domain docs, the code-lists page, dist/ and the Nextra export.

Merge request reports

Loading