un-sanctions

The UN Security Council Consolidated List for Hot. It downloads the free XML file and parses it into Listing records.

This package only fetches and parses. It doesn't screen names, and it stores nothing: no cache, no ::hot::store, no state between calls. Storing the data, matching names against it and reviewing any match are your job. List data alone is not a clearance decision. A name missing from this list clears no one, because it covers one list as of one publication. A name on it still needs a person to confirm it is the same party.

Install

Add it to your project's deps in hot.hot:

hot.project.my-app.deps {
  "hot.dev/un-sanctions": "0.1.0"
}

The list needs no account or key, and the package has no settings.

Quick start

out ::un::sanctions/fetch()
out.version              // the first 16 hex digits of the body's SHA-256
length(out.entries)      // about 1,000
first(out.entries).name

Skip the parse when nothing changed

The server answers GET only, so there is no cheap version check. fetch always downloads the 2 MB file. When its hash equals the version you pass, it skips the parse. Keeping that version between runs is up to you.

out ::un::sanctions/fetch(held-version)
out.unchanged            // true: not parsed, entries is null

List and format

ListFile usedSizeVersion
UN Security Council Consolidated List, about 1,000consolidated.xml (English)2 MBSHA-256 of the body

https://scsanctions.un.org/resources/xml/en/consolidated.xml redirects to a signed Azure Blob URL.

Listing

FieldMeaning
id, data-idThe REFERENCE_NUMBER (such as "IQi.004") and DATAID
kind"individual" or "entity"
name, aliasesFIRST_NAME to FOURTH_NAME joined, then every ALIAS_NAME and NAME_ORIGINAL_SCRIPT
dobsDates of birth as YYYY-MM-DD, YYYY, or a range YYYY/YYYY
nationalitiesAs published
list-typesThe UN_LIST_TYPE values
addressesOne line per address
commentsThe COMMENTS1 text
listed-onThe LISTED_ON date, as published
urlThe list file

Functions

NamespaceFunctions
::un::sanctionsfetch, parse, parse-record, iso-date; types Listing, ListingKind
::un::sanctions::httprequest, get-text, http-error, body-text; type HttpError
::un::sanctions::xmlrecords, blocks, block, texts, text, start-tags, attr, decode

Errors

  • fetch returns an Err when a download fails, and when the file parses to no records, so a changed file format can't pass for an empty list.
  • Download failures are HttpError (status, url, message).
  • Nothing is retried inside a run. Use the schedule's retry policy (see the retries docs).

Notes and limits

  • The list is a public publication, free, with no sandbox or keys.
  • The XML is read with regexes over record strings, which is nearly twice as fast in Hot as walking a parsed tree. It relies on the file's format: record elements do not nest inside themselves, and there are no CDATA sections or comments inside records.

License

Apache-2.0 - see LICENSE