Data preparation pipeline
Watchman prepares list records and search queries the same way so a query like nicolas maduro can match a list name stored as MADURO MOROS, Nicolas. This page is that preparation. Scoring is Similarity methodology. Candidate indexes are Indexing.
There are two layers:
- List ingest — extra steps some sources run when a file is loaded. OFAC is the main one.
Normalize()— runs on every list entity after ingest and on every search query.
List ingest
When Watchman loads lists (like the OFAC SDN) it organizes the names and values into a common ordering.
Name reordering (people only, SDNType=individual):
MADURO MOROS, Nicolas→Nicolas MADURO MOROS
Company suffix stripping (companies):
SAI ADVISORS INC.→SAI ADVISORS- Suffixes include
INC.,LLC,LTD.,GMBH,CO., and similar.
A query is not reordered or suffix-stripped. You can search Nicolas Maduro or MADURO, Nicolas; after Normalize() both become comparable to the OFAC person name that was already reordered at ingest.
Normalize (every list record and every query)
Entity.Normalize() fills PreparedFields used by scoring and indexes.
Names
- Drop a leading trade-document role marker (
SHIPPER:,BENEFICIARY:,ORDERING CUSTOMER:,MESSRS.,FIELD 59:). - Treat former-name markers as
HistoricalInfoand drop them from the primary name:(ex-Cape Diamond),(f.k.a. …),(formerly …),(formerly known as …), inlinef.k.a./f/k/a/formerly, and anextoken with a separator (Kalliopi Dawn ex Orion Tanager). Chained(ex A, ex B)becomes two former names. A trailing year on the former name (, 2020oruntil 2019) is dropped.(example)stays on the primary name. A leadingEX-with nothing before it (EX-35011,EX-CLE SOLUCIONES BIOMETRICAS C.A.) stays on the primary name. - Trim, lowercase, turn
.,-and other punctuation/symbols into spaces. A token-final's(including curly quotes) is dropped onto the previous token (GINO'S/McDonald's→ginos/mcdonalds). If that token already ends ins, the possessive is dropped (Jones's/James's→jones/james). Other apostrophes become spaces (O'Brien→o brien). - Unicode NFD → strip combining marks → NFC, so
Raúlandraulmatch. - For vessels, drop a trailing port or place (
MV SIAM ORCHID 7, Bangkok→MV SIAM ORCHID 7; a final(Laem Chabang)is dropped), then drop leading ship-type markers (MV,M/V,M/T,SS,N/M,T/B, and the same after punctuation becomes spaces).MV Solenne HarbourandSolenne Harbourcompare as the same prepared name. - For businesses and organizations, rewrite English legal-form phrases to the short token (
incorporated→inc,limited→ltd,limited liability company→llc,public limited company→plc,corporation→corp,company→co).Harrowfield Bearings LimitedandHARROWFIELD BEARINGS LTD.compare as the same prepared name. Jurisdiction-specific forms (GmbH,Sdn. Bhd.) are left as they are. - Split on whitespace into tokens.
- Drop stopwords (
of,the,and, and the same idea in other languages). Language is guessed from the name. Numeric tokens (11420) are kept. SetKEEP_STOPWORDS=trueto skip this step.
The same steps run on the primary name, aliases, and former names (HistoricalInfo of type Former Name).
Example: BANK OF AMERICA → tokens bank, america.
Phones and fax
Digits are kept and, when possible, normalized with a country guess (+1 (555) 010-0100 and 555-010-0100 can compare).
Websites
website= values and listed websites are reduced to a host for indexing and scoring. Scheme (http://, https://), userinfo, path, query, fragment, default ports (:80, :443), a trailing dot, and a leading www. are dropped. https://www.gicdf.org/about and listed www.gicdf.org compare as gicdf.org. The original string stays on contact.websites in the JSON.
Domains
domain= values, listed websites, and email hosts are walked from the FQDN down to eTLD+1 using the Public Suffix List. mail.suex.io and listed suex.io share suex.io. Public suffixes (co.uk, ru) are not indexed or queried. Email hosts at consumer providers (gmail, yahoo, mail.ru, icloud, …) are skipped so those providers are not treated as an entity domain. website= still scores the prepared host exactly; listed websites also feed the domain index, so a subdomain on either website= or domain= can match a listed eTLD+1.
SWIFT/BIC
swift= and bic= are aliases for ISO 9362 codes. Letters are uppercased, spaces, hyphens, and periods are stripped, and an XXX branch suffix is dropped so the 8-character head-office form is stored. 8- and 11-character forms match on the first eight characters. OFAC SDN remarks (SWIFT/BIC HNRBBY2X, alt. SWIFT/BIC VVBKRU2Y) and US CSL IDs (SWIFT/BIC, RUDVRUMM and CKLBCNBJ, SWIFT/BIC) are extracted into swiftBICs. Ingest YAML can map swift and bic columns the same way. The original query string stays on swiftBICs in the JSON; prepared values are canonical.
Addresses
- Free-text
address=on the query is parsed into line, city, state, postal code, country. Default Docker images and Linux/macOS GitHub releases use libpostal. The slim image uses usaddress (deepparse if you enable it). Windows.exeandgo runuse usaddress unless built with-tags libpostal. Any build can enable deepparse. See Addresses. - Parsed fields are lowercased. Commas are stripped from street lines. Country codes (
US,USA) fold to a common name (United States). - Street, city, and similar fields are split into tokens for scoring.
Gender (query parameter)
gender= is mapped to male, female, or unknown (m / male / f / female, and a few synonyms).
Government IDs
Query IDs are gov_<type>=COUNTRY:IDENTIFIER (for example gov_passport=IR:Y53914915). Country on the ID is normalized the same way as address country when scoring.
What this means for searches
- Case, accents, and punctuation do not need to match the list file:
Joséandjosecompare as the same letters. - Common words can be omitted:
Bank of AmericaandBank America. - For OFAC people, list names in
SURNAME, Givenorder are stored asGiven SURNAME, so a natural-order query works. - For OFAC companies,
Inc./LLCon the list name is stripped at ingest. A query ofAcme Incstill hasincas a token unless you omit it; it is a weak token, not a blocker. English legal-form expansions on the query (Incorporated,Limited) are rewritten to the same short tokens asInc./Ltd.duringNormalize(). - Send IDs and dates when you have them. Preparation does not invent them.
Debugging
debug=true (or debug=0.80) on /v2/search returns a typed breakdown on details and a human-readable trail on debug:
details.nameis the name score, the query vs list names (original, prepared, tokens), greedy token pairs, and the name-score steps with deltas (token-pairs, historical, close-enough). Namestepson each side start with display-name prefix transforms (party labels, former names). When an AKA or former name won, acomparedstep follows, then Normalize of that scored name.comparedis also a field on the name side. When short tokens are concatenated (for example JSC ARGUMENT vs JSCARGUMENT),combinedlists the tokens the pairs actually align. Pairscoreis the raw token similarity; thetoken-pairsstep is a length-weighted average of those pairs, then reduced for unmatched index tokens.details.stepsis the final-score trail (base, name-only, exact-override, ID conflict, numeral conflict).details.piecesare the field-level scores (name, identifiers, dates, addresses).details.rankedByissimilarityorembeddings. When embeddings ranked the hit,debugleads with the cosine ranking score and labels the rest as a similarity diagnostic.
Prefer details for machines. debug is the same information as text, for example:
match 0.8122
name 0.9500 historical query=historical index=primary
query Ocean Pioneer (ex-Cape Diamond)
former-names Ocean Pioneer
extracted Cape Diamond
compared Cape Diamond
normalize cape diamond
tokens [cape diamond]
index Cape Diamond
normalize cape diamond
tokens [cape diamond]
pairs
cape ↔ cape 1.000
diamond ↔ diamond 1.000
name steps
token-pairs 1.0000 length-weighted average of pair scores; unmatched index tokens lower the aggregate
historical 0.9500 -0.0500 former-name penalty 0.95
score steps
base 0.9500
min-required-fields 0.8550 -0.0950 fewer than 2 required fields compared
name-only 0.8122 -0.0428 no matched unique ID or address
If a name does not match, check type (person vs business), whether you sent the same fields as the list record, and the prepared tokens on details.name.