clarin-eric / VLO-mapping

Mapping definitions and vocabularies for the Virtual Language Observatory
3 stars 17 forks source link

Map `availability` to `licenseType` using value mapping #24

Open twagoo opened 6 years ago

twagoo commented 6 years ago

Currently, license type has a rather specific (post)processing logic: a rather limited set of concepts have their values mapped directly. If no value is mapped, the value of availability is adopted. This allows for explicit 'overrides' of the availability level (pub/aca/res). See LicenseTypePostNormalizer.java:

    public List<String> process(final String value, CMDIData cmdiData) {
        if (value != null) {
            final String normalizedVal = normalize(value);
            //Availability variants can be normalized with multiple values, in vocabulary they are separated with ;
            if (normalizedVal != null) {
                return Arrays.asList(normalizedVal.split(";"));
            }
        }
        //no (normalized) value - get from availability facet
        return transferValuesFromAvailability(cmdiData);
    }

To reduce the complexity of the new value mapping implementation (see https://github.com/clarin-eric/VLO/issues/93), we would like to get rid of the option to 'map if no match' (controlled by the doesProcessNoValue method of AbstractPostNormalizer)

With the new value mapping implementation, we can achieve the following with a cross-facet mapping from availability to licenseType with:

Implement this to see if this actually works.

twagoo commented 6 years ago

Also see the document describing the Potential for reimplementation of VLO post-processors as value mapping cases

twagoo commented 6 years ago

For an updated analysis, see https://github.com/clarin-eric/VLO/issues/191. We may want to close this issue.