MSLNZ / equipment-register-schema

XML Schema Definition (XSD) for an Equipment Register
https://mslnz.github.io/equipment-register-schema/
0 stars 0 forks source link

attribute type of an equipment element #2

Closed jborbely closed 3 months ago

jborbely commented 1 year ago

Currently, <equipment> may have an optional @category attribute. The @category type is a string enumeration.

Maintaining values of the enum may become difficult to manage. We will need to have a lot of already predefined values for different category combinations, for example, a device may measure temperature, humidity or both, or it may be an environmental control chamber. We would then need to define, for example, Thermometer, Hygrometer, Thermometer Hygrometer as enum values if someone wanted to properly encompass the category of the equipment.

We could use a list of enumeration, and possibly consider renaming the attribute to @categories or @keywords or something similar, e.g.,

    <xsd:simpleType name="categoryEnumList">
        <xsd:list>
            <xsd:simpleType>
                <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="DigitalMultiMeter"/>
                    <xsd:enumeration value="Thermometer"/>
                    <xsd:enumeration value="Hygrometer"/>
                    <xsd:enumeration value="DC"/>
                    <xsd:enumeration value="AC"/>
                    <xsd:enumeration value="Voltage"/>
                    <xsd:enumeration value="Current"/>
                    <xsd:enumeration value="Source"/>
                    <xsd:enumeration value="Sense"/>
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:list>
    </xsd:simpleType>

This would achieve the same result that we currently have, but is scalable.

I don't have a good recommendation of what enum values to implement, I suggest that we add them as we need them. An enum value cannot contain whitespace because whitespace is how an XSD list works (a space-separated sequence of literals of the atomic datatype).

Some examples with the proposed change

I still think that this should be an optional attribute of <equipment>, not a required child element of <equipment>.

rebeccahawke commented 4 months ago

Recording this sort of equipment type information would definitely be useful, if the name/description of the equipment isn't sufficient to identify the type. There are many, many options for categories though - e.g. scales, balances, and comparators all measure the quantity 'mass' - so if it is possible to search for equipment by measurand then it may not be necessary to restrict the category to specific enum values.

jborbely commented 3 months ago

Resolved in ce3d5954fc762269885da04391c9137f75ab2da0