Symbols and abbreviated terms XML use conventions Introduction Abbreviation for units of measure Measure data type

OpenGIS © Recommendation Paper — Units of Measure Use and Definition Recommendations 1 Scope This OpenGIS © Recommendation Paper provides recommendations for use and definition of the units of measure used for numerical quantities. These recommendations are more widespread than OpenGIS only, and are being proposed at other organizations, including POSC, W3C, CSIRO, PIDX, and OASIS. These recommendations are given as best practices, and are not intended to be rigidly followed. However, it is recommended that variations from these practices be considered for their negative effects on interoperability. The recommendations are stated for a single, measure value. However, many of the same structures apply to arrays and tuples of values. XML Schema and documents that capture arrays of values, and tuples of values, should consider the patterns of these recommendations, and follow them where appropriate. Many of these recommendations are stated using XML and XML Schema. These recommendations should be followed even when XML is not being used. 2 Conventions

2.1 Symbols and abbreviated terms

ISO International Organization for Standardization OGC Open GIS Consortium UOM Unit of Measure W3C World Wide Web Consortium XML eXtended Markup Language

2.2 XML use conventions

This document uses a set of conventions for use of XML and XML Schema, that currently include: a Use of xsd prefixes to indicate the XML schema elements, as defined in the W3C proposed recommendation dated 30 March 2001. b Snippets of XML being used as examples forgo any use of namespaces. © OGC 2002 – All rights reserved 7 3 Using a unit of measure

3.1 Introduction

This clause provides recommendations for using a unit of measure. The use of a unit of measure is meant to encompass the means by which a measured value is tied explicitly to its unit of measure.

3.2 Abbreviation for units of measure

Recommendation 1: When an abbreviation for units of measure is to be used in an element or attribute name, the abbreviation should be uom or UOM. Comment: The other obvious choice is “unit.” Since “unit” can have other meanings, it was felt that “uom” was a better choice than “unit.” The important point is to select one, and use it exclusively. Comment: This recommendation is for abbreviations only. It is still permissible to use the full name, “UnitOfMeasure,” where appropriate.

3.3 Measure data type

Recommendation 2: A QuantityType data type should be defined in XML Schema as follows: xsd:complexType name=”QuantityType xsd:simpleContent xsd:extension base=xsd:double xsd:attribute name=uom type=xsd:anyURI use=optional xsd:extension xsd:simpleContent xsd:complexType The type for the uom attribute may also be IDREF or string, with the understanding that it will be a keyref to a value that is contained within the file. Comment: The type xsd:double is used for the value since it is the most general format available in the XML Schema data types. It is not intended to imply any semantics on the data value, or to imply any special computer representation of the value. Comment: It is intended that the uom attribute be a reference to a unit defintion instance within the same file. Thus, alternative formulations of the QuantityType would allow the uom to be of type xsd:IDREF, or of type xsd:string, where string is declared to be a keyref to a locally defined key. The particular implementation of the MeasrueType is left to the using application. Note that xsd:IDREF is being deprecated by W3C, and its use is discouraged. Comment: The use of xsd:anyURI for a local reference implies that a “” is included. Applications should be able to handle a reference with or without the “” symbol. Below is a XML example of a QuantityType with uom of type xsd:anyURI and one of xsd:string: 8 © OGC 2002 – All rights reserved length uom=”ft”26.62length width uom=”ft”18.3width Comment: This Recommendation uses the term, “QuantityType.” This is not mandatory. The name of the complexType is local, and is under control of the schema developer. However, the structure of the complexType should be maintained. Comment: The Recommendation is that the uom attribute be optional. This is not mandatory. The schema developer may make it required. The optionality is given because many users felt that a unit of measure can be defined within a context, and should not be given with every, individual value. Comment: The string value of the uom attribute does not contain any semantic meaning. It is strictly defined as a key reference to another instance within the document. The use of “ft” in the above example does not necessarily imply that the unit of measure is a foot. However, in practice, it would probably be useful to have a meaningful value. See also Recommendation 4a.

3.4 Unit of measure reference type