URN Mapper Configuration#

Configuration#

System configuration is changed via the provided values.yaml file. The dataGateways section defines URN mapping rules for each external data gateway the system can connect to. By default no rules are active except the first defaultGateway providing the rules for basic shapes provided as part of the installation.

Note

The default defaultGateway rule cannot be disabled (even if removed from configuration) and is only part of the configuration as an example:

# Set the URN mapping rules per data gateway. See the integration documentation for
# motivation and concepts behind data gateways and URN mappings.
#
# For templates, $(n) is the n-th value in the URN separated after urn:namespace:specifier:xxx
# e.g.: urn:x-i3d:shape:sphere ($(1) == sphere)
#
dataGateways:
  defaultGateway:
    - namespace: x-i3d
      specifier: shape
      urlContentType: [ x3d-xml ]
      urlTemplate: http://i3dhub-entrygw:8080/repo/shapes/$(1).x3d

To define a new rule we can remove the defaultGateway and add a new custom entry:

dataGateways:
  customerGateway1:
    - namespace: customer
      specifier: document-uuid
      urlContentType: [ openjt ]
      urlTemplate: https://download.example.com/documents/$(1).jt

This will create a new URN in the form of urn:customer:document-uuid:12345 which will then internally resolve to https://download.example.com/documents/12345.jt.

Mapping Logic#

The mapper itself applies very simple logic to resolve a URN to a URL:

  1. urn:NAMESPACE:SPECIFIER: is matched to an incoming URI in order to find the correct mapping rule (if any) to apply.

  2. Splitting any arguments (separated by :) following the matched prefix and assigning to $(1), $(2), $(3)

  3. Replacing any $(x) values in the given urlTemplate by their values parsed from the URN.