qudt / qudt-public-repo

QUDT -Quantities, Units, Dimensions and dataTypes - public repository
Other
106 stars 69 forks source link

qudt:Quantity vs qudt:QuantityValue #785

Open dr-shorthair opened 9 months ago

dr-shorthair commented 9 months ago

I have a feeling this has been answered before, but I can't find it.

At https://github.com/qudt/qudt-public-repo/wiki/User-Guide-for-QUDT#1-simple-use-case the basic pattern for a QUDT encoded Quantity instance is shown thus:

wiki-examples:MyThermostatSetting a qudt:Quantity ;
    qudt:unit unit:DEG_F ;
    qudt:value "72.0"^^xsd:float ;
.

However, looking at the OWL I see that a qudt:Quantity may have a qudt:quantityValue property whose range is expected to be a qudt:QuantityValue. (Note that qudt:unit and qudt:value are not mentioned in the OWL.)

Then the definition of qudt:QuantityValue is

A Quantity Value expresses the magnitude and kind of a quantity and is given by the product of a numerical value n and a unit of measure U. The number multiplying the unit is referred to as the numerical value of the quantity expressed in that unit. Refer to <a href=\"http://physics.nist.gov/Pubs/SP811/sec07.html\">NIST SP 811 section 7 for more on quantity values.

This seems to be the same as qudt:Quantity except without the QuantityKind reference. Is that correct?

This also seems to imply alternative serialisations:

wiki-examples:MyThermostatSetting a qudt:QuantityValue ;
    qudt:unit unit:DEG_F ;
    qudt:value "72.0"^^xsd:float ;
.

or

wiki-examples:MyThermostatSetting a qudt:Quantity ;
    qudt:quantityValue [ 
        a qudt:QuantityValue ;
        qudt:unit unit:DEG_F ;
        qudt:value "72.0"^^xsd:float ;
    ]
.

Which is recommended? Am I missing something here?

steveraysteveray commented 9 months ago

Just a bit lower in the wiki is this section. Does it answer your question?

dr-shorthair commented 9 months ago

Yes - it helps a bit. Quantity is the concept (and may/should have a quantityKind), QuantityValue is a specifically scaled value. But if the value for the Quantity is only available with one uom, then the Quantity/quantityValue/QuantityValue form can be shortened to just Quantity ??

Also: the example you refer to uses qudt:hasUnit. Is that preferred to qudt:unit ?

steveraysteveray commented 9 months ago

Yes, that is the intent. Just one uom, you can use qudt:value and qudt:hasUnit directly. With multiple uoms, use qudt:quantityValue.

Also, yes, we are migrating toward qudt:hasUnit instead of qudt:unit for consistency with qudt:hasQuantityKind, as of Release 2.1.28

(Now that you mention it, maybe we should also migrate qudt:value to qudt:hasValue...)