Address Lookup Using Link Table

This section explains how the HRA address lookup process utilizes the link table to return consolidated address records across multiple sources.

The lookup first attempts to match against the pre-built link table, if no match is found, performs an online linkage to dynamically resolve and store new links.

The address lookup process involves two main API calls:

  1. similar-addresses

    • Accepts an input address and searches across multiple sources.

    • Uses the link table to group and consolidate matching candidates.

    • Returns a list of consolidated address candidates, each with a unique linked ID.

  2. address-by-id

    • Takes a linked ID (from the previous step) and returns the full, resolved address record.

    • Ensures consistent retrieval of unified address data across systems.

Prerequisites:

Before using the link table in address lookup, you must first generate the link table using the Batch Link Table Build Tool.

Batch Link Table Buildchevron-right

After the link table has been created, you will need to obtain the access.dat.key file from Loqate Support.

Once you have both the link table and the key, place the link table in the default directory located at $HARMONY_HOME/ROAD/LINK_TABLE. If you have overridden the default location, make sure to update the harmony.hello.linktable.location property in the hello.properties file, which is located under $HARMONY_HOME/config. By default, this property points to $HARMONY_HOME/ROAD/LINK_TABLE.

Configuration Properties

These properties can be set in the hello.properties file located at: $HARMONY_HOME/config/hello.properties

Property
Description
Default Value

harmony.hello.linktable.location

Link table directory path

$HARMONY_HOME/ROAD/LINK_TABLE

harmony.hello.linktable.update.linktable

Enable writing to link table if online linkage is found

true

harmony.hello.linktable.online.linkage

Enable online linkage

true

harmony.hello.linktable.transitive.linkage

Enable transitive lookup (e.g., A→B, B→C → A→C)

true

harmony.hello.linktable.update.interval

Interval for link table updates

5 minutes

Standardization Terms

A new configuration file has been added at: $HARMONY_HOME/config/sub/link_table.properties This file lists interchangeable terms used to standardize address lines across sources.

similar-addresses

When multiple sources are used in a search and a linkTableName is provided (this refers to the folder name of your link table under the LINK_TABLE directory), the system groups results by sourceName , then attempts to identify and consolidate related records based on link table entries. If linked records are found, they are merged into a single result with a combined ID and marked as coming from the LINKTABLE source.

Behavior Changes in This Version

  • Previously, sourceName was only populated when the source was CUSTOM.

  • Now, if sourceName is empty, it will default to the value of source (e.g., NZPAF, CNAR, NZAD).

Linking Logic

  1. Group Results by Source: Results are grouped based on sourceName.

  2. Link Table Matching: For each group, the system checks the link table for matching link pairs.

    • If matches are found, it combines all linked IDs and source names into a single id field.

    • The addressLine is taken from the base record, and the source is set to LINKTABLE.

    • Example ID:

  3. Fallback Matching: If no direct link is found, the system attempts to match address lines across groups.

    • If successful, it creates a new link and writes it to the link table for future use.

Resource

The port number is configurable, with the default ports being:

  • Tomcat: 8080

chevron-rightPOST http://localhost:8080/HRAWeb/hra/rest/au/address/similar-addressesarrow-up-righthashtag

Usage Notes

The following options have been introduced to enhance the flexibility and control of address consolidation using the link table:

Option
Type
Description
Default

linkTableName

string

Required when consolidating records from multiple sources using a link table. The value should match the folder name of your link table (i.e., the hello index folder name under LINK_TABLE).

N/A

linkTableTypeFilters

list of strings

Filters the types of linkages used from the link table. To include specific link types, list them directly (e.g., ["EXACT", "MPP"]). To exclude, prefix with - (e.g., ["-TBC"]). Applicable types: EXACT, MPP, STREET_RANGE, TBC.

[] (empty list)

transliteration

integer (0 or 1)

Enables transliteration of accented characters to ASCII equivalents in single-line HRA address searches. 0 = disabled, 1 = enabled (e.g., Ā → A, ē → e).

0

Sample Request and Response

chevron-rightRequest 1: POST- Lookup for addresses from CUSTOM/TUI, NZAD and CNAR with transliteration onhashtag
chevron-rightResponse 1: POST- Lookup for addresses from CUSTOM/TUI, NZAD and CNAR with transliteration onhashtag
chevron-rightRequest 2: POST- Lookup for addresses with All link typeshashtag
chevron-rightResponse 2: POST- Lookup for addresses with All link typeshashtag

195 VICTORIA STREET, TE ARO, WELLINGTON 6011 (CNAR:9670085cdd8ec2232794ba1820289f66e31ee420) is also linked with UNIT 1 195 VICTORIA STREET, TE ARO, WELLINGTON 6011 by link type as MPP (matched to primary point)

chevron-rightRequest 3: POST- Lookup for addresses with linkTableTypeFilters Option (INCLUDE)hashtag
chevron-rightResponse 3: POST- Lookup for addresses with linkTableTypeFilters Option (INCLUDE)hashtag

Include only the link type as EXACT, 195 VICTORIA STREET, TE ARO, WELLINGTON 6011 (CNAR:9670085cdd8ec2232794ba1820289f66e31ee420) is not linked with UNIT 1 195 VICTORIA STREET, TE ARO, WELLINGTON 6011

chevron-rightRequest 4: POST- Lookup for addresses with linkTableTypeFilters Option (EXCLUDE)hashtag
chevron-rightResponse 4: POST- Lookup for addresses with linkTableTypeFilters Option (EXCLUDE)hashtag

Exclude link type of "MPP", 195 VICTORIA STREET, TE ARO, WELLINGTON 6011 (CNAR:9670085cdd8ec2232794ba1820289f66e31ee420) is not linked with UNIT 1 195 VICTORIA STREET, TE ARO, WELLINGTON 6011

address-by-id

The address-by-id API retrieves full address details using an ID. This ID can be either a single-source ID or a consolidated ID in the format of source:id. Consolidated IDs may include one or more source-ID pairs, depending on how the data was linked or structured.

Usage Notes

  • When using a concatenated ID (e.g., "NZAD:1294125" or "NZAD:1294125;CNAR:abc123"), the source in the option field must be set to "LINKTABLE". This tells the system to interpret the ID as a linked or structured identifier, even if it only contains one source.

  • For single-source IDs, set the source to the corresponding source name (e.g., "CNAR", "NZPAF"). In the request payload, you can provide the identifier in one of two ways: using the id field (which accepts either a standard id or a hash_id), or using the dpid field if applicable. The API will use the provided identifier to retrieve the corresponding address record from the specified source.

Resource

The port number is configurable, with the default ports being:

  • Tomcat: 8080

chevron-rightPOST http://localhost:8080/HRAWeb/hra/rest/au/address/address-by-idhashtag

Sample Request and Response

chevron-rightRequest 1: POST- Retrieve Address by concatenated idhashtag
chevron-rightResponse 1: POST- Retrieve Address by concatenated idhashtag
chevron-rightRequest 2: POST- Retrieve Address by single-source idhashtag
chevron-rightResponse 2: POST- Retrieve Address by single-source idhashtag
chevron-rightRequest 3: POST- Retrieve Address by custom-source idhashtag
chevron-rightResponse 3: POST- Retrieve Address by custom-source idhashtag
chevron-rightRequest 4: POST- Retrieve Address by single-source dpidhashtag
chevron-rightResponse 4: POST- Retrieve Address by single-source dpidhashtag

Last updated