Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISO19139 / Use PT_FreeText element for default language. #2032

Conversation

fxprunayre
Copy link
Member

Currently multilingual metadata records in ISO19139, encode translation using the following form (a):

<gmd:title xsi:type="gmd:PT_FreeText_PropertyType">
  <gco:CharacterString>Carte indicative des dangers eaux</gco:CharacterString>
  <gmd:PT_FreeText>
    <gmd:textGroup>
      <gmd:LocalisedCharacterString locale="#EN">Water risk information map</gmd:LocalisedCharacterString>
    </gmd:textGroup>

Another XSD valid encoding (b) would be to use only PT_FreeText:

<gmd:title xsi:type="gmd:PT_FreeText_PropertyType">
  <gmd:PT_FreeText>
     <gmd:textGroup>
      <gmd:LocalisedCharacterString locale="#FR">Carte indicative des dangers eaux</gmd:LocalisedCharacterString>
    </gmd:textGroup>
    <gmd:textGroup>
      <gmd:LocalisedCharacterString locale="#EN">Water risk information map</gmd:LocalisedCharacterString>
    </gmd:textGroup>

For compatibility with validation rules (and external validator like INSPIRE one), the following encoding (c) is proposed:

<gmd:title xsi:type="gmd:PT_FreeText_PropertyType">
  <gco:CharacterString>Carte indicative des dangers eaux</gco:CharacterString>
  <gmd:PT_FreeText>
     <gmd:textGroup>
      <gmd:LocalisedCharacterString locale="#FR">Carte indicative des dangers eaux</gmd:LocalisedCharacterString>
    </gmd:textGroup>
    <gmd:textGroup>
      <gmd:LocalisedCharacterString locale="#EN">Water risk information map</gmd:LocalisedCharacterString>
    </gmd:textGroup>

This change in encoding is made for the following reasons:

  • Subtemplates currently do not support multilingualism. In order to add that feature (future proposal coming), the use of only PT_FreeText is required (because subtemplate can not define the languages they are in).

  • INSPIRE validator does not handle records with only PT_FreeText even if it is valid from an XSD point of view. Validator report empty elements. To preserve compatibility with those system, the encoding (c) is used.

Changes:

  • For multilingual record, default language is added to list of locales (with an ID which is used in PT_FreeText)
  • For all multilingual element (using the editor config), create a gco:CharacterString and a PT_FreeText element containing the default language value
  • config-editor.xsd / Add missing elements in schema added for multilingual exclusion in (59bc2df)

Note:

  • In the editor / XML view, gco:CharacterString are displayed. We could warn user that in case of multilingual record, PT_FreeText elements take priority over gco:CharacterString for advanced user using the XML mode.

Previous implementation:

Related issue:

Currently multilingual metadata records in ISO19139, encode translation using the following form (a):

```
<gmd:title xsi:type="gmd:PT_FreeText_PropertyType">
  <gco:CharacterString>Carte indicative des dangers eaux</gco:CharacterString>
  <gmd:PT_FreeText>
    <gmd:textGroup>
      <gmd:LocalisedCharacterString locale="#EN">Water risk information map</gmd:LocalisedCharacterString>
    </gmd:textGroup>
```

Another XSD valid encoding (b) would be to use only PT_FreeText:
```
<gmd:title xsi:type="gmd:PT_FreeText_PropertyType">
  <gmd:PT_FreeText>
     <gmd:textGroup>
      <gmd:LocalisedCharacterString locale="#FR">Carte indicative des dangers eaux</gmd:LocalisedCharacterString>
    </gmd:textGroup>
    <gmd:textGroup>
      <gmd:LocalisedCharacterString locale="#EN">Water risk information map</gmd:LocalisedCharacterString>
    </gmd:textGroup>
```

For compatibility with validation rules (and external validator like INSPIRE one), the following encoding (c) is proposed:
```
<gmd:title xsi:type="gmd:PT_FreeText_PropertyType">
  <gco:CharacterString>Carte indicative des dangers eaux</gco:CharacterString>
  <gmd:PT_FreeText>
     <gmd:textGroup>
      <gmd:LocalisedCharacterString locale="#FR">Carte indicative des dangers eaux</gmd:LocalisedCharacterString>
    </gmd:textGroup>
    <gmd:textGroup>
      <gmd:LocalisedCharacterString locale="#EN">Water risk information map</gmd:LocalisedCharacterString>
    </gmd:textGroup>
```

This change in encoding is made for the following reasons:
* Subtemplates currently do not support multilingualism. In order to add that feature (future proposal coming), the use of only PT_FreeText is required (because subtemplate can not define the languages they are in).

* INSPIRE validator does not handle records with only PT_FreeText even if it is valid from an XSD point of view. Validator report empty elements. To preserve compatibility with those system, the encoding (c) is used.

Changes:
* For multilingual record, default language is added to list of locales (with an ID which is used in PT_FreeText)
* For all multilingual element (using the editor config), create a gco:CharacterString and a PT_FreeText element containing the default language value
* config-editor.xsd / Add missing elements in schema added for multilingual exclusion in (geonetwork@59bc2df)

Note:
* In the editor / XML view, gco:CharacterString are displayed. We could warn user that in case of multilingual record, PT_FreeText elements take priority over gco:CharacterString for advanced user using the XML mode.

Previous implementation:
* geocat.ch https://github.com/geoadmin/geocat/blob/geocat_develop/web/src/main/webapp/xsl/characterstring-to-localisedcharacterstring.xsl

Related issue:
* Fix geonetwork#1985
* ISO19139.che / Also implement this mechanism for che:PT_FreeURL
* ISO19115-3 / Plugin needs update for this
@fxprunayre fxprunayre added this to the 3.4.0 milestone Jun 20, 2017
@fxprunayre fxprunayre requested a review from fgravin June 20, 2017 13:55
@jodygarnett
Copy link
Contributor

This pull request has led a merry case for metadata101/iso19139.ca.HNAP#12 can I ask if the future proposal "Subtemplates currently do not support multilingualism" worked out?

  • Having text duplication is quite a price to pay, and is now identified as a gap in the validation for HNAP.
  • Can option (b) used to stage data for editing, and then transformed into option (a) for storing?

@fxprunayre
Copy link
Member Author

can I ask if the future proposal "Subtemplates currently do not support multilingualism" worked out?

geocat.ch is using multilingual subtemplates in up to 5 languages for contacts, extents and formats.

  • Can option (b) used to stage data for editing, and then transformed into option (a) for storing?

Maybe using @josegar74 inflate mechanism?

@jodygarnett
Copy link
Contributor

Thanks for feedback @fxprunayre; should this discussion move to issue tracker or mailing list :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants