fjuniorr / flowmapper

Mappings between elementary flows
MIT License
0 stars 1 forks source link

Move matches against synonyms to bottom of strategy list #68

Closed cmutel closed 6 months ago

cmutel commented 6 months ago

There are a few elements which have very generic synonyms, and these will lead to incorrect matches, such as:

  {
    "@id": "d16c8806-7701-4fbb-b68d-9b2d5d083d7a",
    "@unitId": "487df68b-4994-4027-8fdc-a4dc298257b7",
    "@formula": "MgCl2-KCl-6H2O",
    "@casNumber": "001318-27-0",
    "name": {
      "@xml:lang": "en",
      "#text": "Carnallite"
    },
    "unitName": {
      "@xml:lang": "en",
      "#text": "kg"
    },
    "compartment": {
      "@subcompartmentId": "30347aef-a90b-46ba-8746-b53741aa779d",
      "compartment": {
        "@xml:lang": "en",
        "#text": "natural resource"
      },
      "subcompartment": {
        "@xml:lang": "en",
        "#text": "in water"
      }
    },
    "synonym": [
      {
        "@xml:lang": "en",
        "#text": "trichloride"
      },
      {
        "@xml:lang": "en",
        "#text": "magnesium"
      },
      {
        "@xml:lang": "en",
        "#text": "potassium"
      },
      {
        "@xml:lang": "en",
        "#text": "hexahydrate"
      }
    ]
}

Using synonyms should be the last resort, unfortunately, until the input data is cleaner.