170 likes | 285 Views
XML Implementations for Multilingual Descriptions in the WMO Core Metadata Profile. Jürgen Seib Deutscher Wetterdienst e-mail: juergen.seib@dwd.de. Introduction. WMO has six official languages multilingual metadata is important for WMO
E N D
XML Implementations for Multilingual Descriptions in the WMO Core Metadata Profile Jürgen Seib Deutscher Wetterdienst e-mail: juergen.seib@dwd.de
Introduction • WMO has six official languages • multilingual metadata is important for WMO • WMO Core Metadata Profile V0.2 does not support multilingual metadata descriptions • ISO-19115 and ISO-19139 propose extensions for handling multi-languages support in text elements • <language> and <characterSet> are default values for the language and the character encoding used in text elements Thursday, 14 August 2014 - 2 -
The xml:lang attribute • a special attribute for all XML tags • specifies the language used in the tag content • has to be declared for XML validation • standard XSD type is xsd:language • the values are language identifiers as defined by [IETF RFC 1766] • [IETF RFC 1766] tags are two-letter language codes (ISO 639) with optional two-letter country codes (ISO 3166) Thursday, 14 August 2014 - 3 -
The xml:lang attribute - cont. • Examples: • <keyword xml:lang="en">air temperature</keyword> • <keyword xml:lang="en-GB">colour</keyword> • <keyword xml:lang="en-US">colour</keyword> • Drawbacks: • attribute must be declared in XML schema • if a metadata element could not occur multiple times, then xml:lang is insufficient for the specification of multilingual alternatives (e.g. <abstract> ) Thursday, 14 August 2014 - 4 -
The rdf:Alt container • RDF = Resource Description Framework • RDF is a family of specifications for a metadata model • An RDF container is a resource that contains things. • RDF defines three types of containers: <rdf:Bag>, <rdf:Seq> and <rdf:Alt> Thursday, 14 August 2014 - 5 -
The rdf:Alt container - cont. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> <dc:creator>Ernest Hemmingway</dc:creator> <dc:title> <rdf:Alt> <rdf:li xml:lang="en">Old man in the Sea</rdf:li> <rdf:li xml:lang=”de">Der alte Mann und das Meer</rdf:li> <rdf:li xml:lang=”fr">Le vieil homme et la mer</rdf:li> </rdf:Alt> </dc:title> </rdf:RDF> Thursday, 14 August 2014 - 6 -
The proposal in annex J of ISO 19115 Thursday, 14 August 2014 - 7 -
Implementation of annex J Thursday, 14 August 2014 - 8 -
Implementation of annex J <xs:complexType name="PT_Group_PropertyType"> <xs:sequence> <xs:element ref="gmd:PT_Group" minOccurs="0"/> </xs:sequence> <xs:attributeGroup ref="gco:ObjectReference"/> </xs:complexType> <xs:element name="PT_Group" type="gmd:PT_Group_Type"/> <xs:complexType name="PT_Group_Type"> <xs:complexContent> <xs:extension base="gco:AbstractObject_Type"> <xs:sequence> <xs:element name="plainText" type="xs:string"/> <xs:element name="languageCode" type="gmd:LanguageCode_PropertyType"/> <xs:element name="country" type="gmd:Country_PropertyType" minOccurs="0"/> <xs:element name="characterEncoding" type="gmd:MD_CharacterSetCode_PropertyType"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> Thursday, 14 August 2014 - 9 -
Proposal of ISO 19139 Thursday, 14 August 2014 - 10 -
Implementation <xs:complexType name=”PT_Locale_Type"> <xs:complexContent> <xs:extension base="gco:AbstractObject_Type"> <xs:sequence> <xs:element name="languageCode" type="gmd:LanguageCode_PropertyType"/> <xs:element name="country" type="gmd:Country_PropertyType" minOccurs="0"/> <xs:element name="characterEncoding” type="gmd:MD_CharacterSetCode_PropertyType"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> Thursday, 14 August 2014 - 11 -
Implementation <xs:complexType name="LocalisedCharacterString_PropertyType"> <xs:complexContent> <xs:extension base="gco:ObjectReference_PropertyType"> <xs:sequence minOccurs="0"> <xs:element ref="gmd:LocalisedCharacterString"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:element name="LocalisedCharacterString" type="gmd:LocalisedCharacterString_Type" substitutionGroup="gco:CharacterString"/> <xs:complexType name="LocalisedCharacterString_Type"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="id" type="xs:ID" use="optional"/> <xs:attribute name="locale" type="xs:anyURI" use="optional"/> </xs:extension> </xs:simpleContent> </xs:complexType> Thursday, 14 August 2014 - 12 -
Implementation <xs:complexType name="PT_FreeText_PropertyType"> <xs:complexContent> <xs:extension base="gco:CharacterString_PropertyType"> <xs:sequence minOccurs="0"> <xs:element ref="gmd:PT_FreeText"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> Thursday, 14 August 2014 - 13 -
Implementation <xs:element name="PT_FreeText" type="gmd:PT_FreeText_Type"/> <xs:complexType name="PT_FreeText_Type"> <xs:complexContent> <xs:extension base="gco:AbstractObject_Type"> <xs:sequence> <xs:element name="textGroup” type="gmd:LocalisedCharacterString_PropertyType" maxOccurs="unbounded"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> Thursday, 14 August 2014 - 14 -
Proposal for WMO Metadata Profile First requirement: • explicit definition of language and character encoding for all text fields • implemented by LocalisedCharacterString Example: <keyword> <LocalisedCharacterString locale=“de”> Lufttemperatur</LocalisedCharacterString> </keyword> Thursday, 14 August 2014 - 15 -
Proposal for WMO Metadata Profile • possibility to specify translations of a text field into another language • implemented by PT_FreeText Second requirement: Thursday, 14 August 2014 - 16 -
Metadata Example <keyword> <wmo:WMO_keyword>agriculture</wmo:WMO_keyword> <PT_FreeText> <textGroup> <LocalisedCharacterString locale="fr">agriculture</LocalisedCharacterString> </textGroup> <textGroup> <LocalisedCharacterString locale="es">agricultura</LocalisedCharacterString> </textGroup> <textGroup> <LocalisedCharacterString locale="de">Landwirtschaft</LocalisedCharacterString> </textGroup> </PT_FreeText> </keyword> Thursday, 14 August 2014 - 17 -