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

Dimension in thing-description-1.0.0.xsd #4156

Closed
jlaur opened this issue Mar 18, 2024 · 2 comments · Fixed by #4217
Closed

Dimension in thing-description-1.0.0.xsd #4156

jlaur opened this issue Mar 18, 2024 · 2 comments · Fixed by #4217
Labels
bug An unexpected problem or unintended behavior of the Core

Comments

@jlaur
Copy link
Contributor

jlaur commented Mar 18, 2024

I randomly noticed that there is a list of dimensions in thing-description-1.0.0.xsd:

<xs:simpleType name="dimension">
<xs:restriction base="xs:string">
<xs:enumeration value="Intensity" />
<xs:enumeration value="Acceleration" />
<xs:enumeration value="AmountOfSubstance" />
<xs:enumeration value="Angle" />
<xs:enumeration value="AngularAcceleration" />
<xs:enumeration value="AngularVelocity" />
<xs:enumeration value="Area" />
<xs:enumeration value="CatalyticActivity" />
<xs:enumeration value="DataAmount" />
<xs:enumeration value="DataRate" />
<xs:enumeration value="Dimensionless" />
<xs:enumeration value="Duration" />
<xs:enumeration value="DynamicViscosity" />
<xs:enumeration value="ElectricCapacitance" />
<xs:enumeration value="ElectricCharge" />
<xs:enumeration value="ElectricConductance" />
<xs:enumeration value="ElectricCurrent" />
<xs:enumeration value="ElectricInductance" />
<xs:enumeration value="ElectricPotential" />
<xs:enumeration value="ElectricResistance" />
<xs:enumeration value="Energy" />
<xs:enumeration value="Force" />
<xs:enumeration value="Frequency" />
<xs:enumeration value="Illuminance" />
<xs:enumeration value="KinematicViscosity" />
<xs:enumeration value="Length" />
<xs:enumeration value="LuminousFlux" />
<xs:enumeration value="LuminousIntensity" />
<xs:enumeration value="MagneticFlux" />
<xs:enumeration value="MagneticFluxDensity" />
<xs:enumeration value="Mass" />
<xs:enumeration value="MassFlowRate" />
<xs:enumeration value="Power" />
<xs:enumeration value="Pressure" />
<xs:enumeration value="RadiationDoseAbsorbed" />
<xs:enumeration value="RadiationDoseEffective" />
<xs:enumeration value="RadioactiveActivity" />
<xs:enumeration value="SolidAngle" />
<xs:enumeration value="Speed" />
<xs:enumeration value="Temperature" />
<xs:enumeration value="Torque" />
<xs:enumeration value="Velocity" />
<xs:enumeration value="Time" />
<xs:enumeration value="Volume" />
<xs:enumeration value="VolumetricDensity" />
<xs:enumeration value="VolumetricFlowRate" />
</xs:restriction>
</xs:simpleType>

This list hasn't been updated for a while, for example the following are missing:

and probably others as well.

But then I validated a thing type definition containing one of those, and it passed. Apparently dimension is not used at all, since item-type is defined as xs:string:

<xs:element name="item-type" type="xs:string" minOccurs="0"/>

So I'm wondering: Should it even be in the file? Is it a left-over, or deliberately kept for some sort of legacy backwards compatibility?

Expected Behavior

I would expect dimension to be either maintained and used, or not in the XSD at all.

Current Behavior

The XSD contains a definition for dimension, but apparently it is not used.

Possible Solution

Remove it from the XSD, if this is feasible without breaking compatibility and/or requiring a new version, which might complicate things.

@jlaur jlaur added the bug An unexpected problem or unintended behavior of the Core label Mar 18, 2024
@andrewfg
Copy link
Contributor

Given openhab/openhab-webui#2485 I would say to remove it. And as it seems never to have been used anyway, there would seem to be little risk of breaking anything..

@J-N-K
Copy link
Member

J-N-K commented Apr 28, 2024

In my opinion the <xs:element name="item-type" type="xs:string" minOccurs="0"/>should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants