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

Fix Incomplete linkage between units and systems of units? #640

Open
fkleedorfer opened this issue Feb 3, 2023 · 33 comments
Open

Fix Incomplete linkage between units and systems of units? #640

fkleedorfer opened this issue Feb 3, 2023 · 33 comments

Comments

@fkleedorfer
Copy link
Collaborator

I want to be able to differentiate between systems of units, to allow for removing units from selection lists that do not make sense in an SI or Imperial context.

Looking at the vocabulary, there seems to have been the impetus to make these connections for units in general, but the actuall links from units to systems of units are quite sparse.

As I have access to all factor units (and scalings) for each unit, I can do the recursive calculation and determine if all basic factors are in the same system of units. Determining whether a unit can be linked to a system of units this way, I will call 'implicit'.

Some units are associated with systems of units using a qudt: property. I obtain them via this SPARQL snippet (because I don't want to use inference at this point):

optional {
        ?unit qudt:systemOfUnit|qudt:baseUnitOfSystem|qudt:derivedCoherentUnitOfSystem|qudt:derivedNonCoherentUnitOfSystem|qudt:derivedUnitOfSystem|qudt:coherentUnitOfSystem|qudt:definedUnitOfSystem|qudt:allowedUnitOfSystem ?systemOfUnits
    }

The links thus discovered I will call 'explicit'.

The attached file units-associated-with-sou-si.txt shows which units are explicitly and implicitly linked to sou:SI, and which ones are only implicitly linked and thus could be called 'missing links'.

Note that the file also contains the units I generate as factor units (see #638), which may not be of interest to this project. However, the amount of legitimate SI units not explicitly assocated with sou:SI suggests one of three decisions:

  1. remove all Unit -> SystemOfUnit links and just keep the base units
  2. add the missing links.
  3. leave it as it is (because nobody really has a problem with it, including myself)

For option 2., I can probably make a PR, but we'd have to talk about the concrete property to use in which case.
If option 1 is the better choice for this project, that's fine with me

@steveraysteveray
Copy link
Collaborator

steveraysteveray commented Feb 3, 2023

You are bringing up a topic that has long been on our list of things to clean up in QUDT. Thanks for this. Speaking personally, I would welcome at least a simple association (qudt:systemOfUnit) with the relevant system of units, for every unit that has such an association. Of course, some units are not referenced by any system of units at all, and thus would have no such relation.

I am a bit confused by your units-associated-with-sou-si.txt file, which has three sections:

  • implicitly assocated with sou:SI
  • explicitly assocated with sou:SI:
  • only implicitly assocated with sou:SI

Is the first category for units that are implicitly AND explicitly associated with SI? Regardless, I'm wondering why something like unit:A-HR fits?

So, again, from my personal perspective, I would suggest we proceed as follows:

  • agree on the criteria for inclusion, and make the definition of the relations clear
  • populate just qudt:unitOfSystem for SI (your option 2)

We can then decide whether to expand the relations to the other relations (qudt:baseUnitOfSystem, qudt:derivedUnitOfSystem, etc.) or to expand the range to other systems first. I do believe that the linkage to the system of units is a powerful, and possibly unique, feature of QUDT.

I would welcome input by others on this topic.

@jhodgesatmb
Copy link
Collaborator

jhodgesatmb commented Feb 3, 2023 via email

@fkleedorfer
Copy link
Collaborator Author

fkleedorfer commented Feb 3, 2023

Is the first category for units that are implicitly AND explicitly associated with SI? Regardless, I'm wondering why something like unit:A-HR fits?

Sorry for not having been entirely verbose about this. In short: implicitly OR explicitly associated with SI. The actual way to get there involves multiple preparation steps (determining factor units, scalingOf triples), then some additional triples are added that cannot be derived from the existing qudt data alone, like J consisting of factors N.m, or HR is a scaling of SEC (the latter is needed to determine that unit:A-HR is implicitly assocated with SI).

With that, the algorithm to check whether unit U is assocated with system S is as follows:
if U a qudt:baseUnit of S: true
if S qudt:systemOfUnit (or sub-property ) of U: true
if U qudt:isScalingOf U': run algorithm with U', return result
if U has factor units: return true if algorithm returns true for all factor units.
otherwise, return false

@steveraysteveray
Copy link
Collaborator

steveraysteveray commented Feb 3, 2023

Regarding identifying coherent units, I'd like to point out that not only does it depend on the system of units, but also on the context (in QUDT that means QuantityKind), as described in Wikipedia here:

"the same coherent SI unit may be a base unit in one context, but a coherent derived unit in another. For example, the ampere is a base unit when it is a unit of electric current, but a coherent derived unit when it is a unit of magnetomotive force.[1]: 140"

Thus, I suggest we stick with qudt:systemOfUnit qudt:unitOfSystem to start with, without trying to get more specific.

For your algorithm, I'm not confident about your steps 3 and 4, since we haven't nailed down exactly what is meant by qudt:isScalingOf.

@steveraysteveray
Copy link
Collaborator

Sorry, meant to say stick with qudt:unitOfSystem.

@fkleedorfer
Copy link
Collaborator Author

For your algorithm, I'm not confident about your steps 3 and 4, since we haven't nailed down exactly what is meant by qudt:isScalingOf.

I know. I am not sure we should open that can of worms again. I actually was expecting this property to drop out of QUDT.
(It turns out, there is an edge case in the algorithm because I use unit:GM as the base unit for mass - we've discussed that one ;-) )

@steveraysteveray
Copy link
Collaborator

Indeed, I'm on the verge of deprecating the qudt:isScalingOf relation. The last detail we are resolving is whether we need to create a "retirement home" for things we remove, and if so, whether it should contain just definitions, or also all the triples that contain a retired concept. So many questions...

@fkleedorfer
Copy link
Collaborator Author

With that caveat out of the way, and just looking at the result, not the algorithm, do you see any false positives or false negatives in (or missing from) the suggested 'implicit' list?

@steveraysteveray
Copy link
Collaborator

@fkleedorfer, in thinking about your notions of explicit and implicit associations with systems of units, it seems like these relations will not be very useful, since almost all units are related to SI units by a constant factor (qudt:conversionMultiplier). Therefore, all such units will be "associated" with sou:SI. Am I missing something?

By the way, in reviewing coherent and derived units because of this issue, I have found 7 errors, which I will be fixing very soon!

@fkleedorfer
Copy link
Collaborator Author

fkleedorfer commented Feb 6, 2023

@fkleedorfer, in thinking about your notions of explicit and implicit associations with systems of units, it seems like these relations will not be very useful, since almost all units are related to SI units by a constant factor (qudt:conversionMultiplier). Therefore, all such units will be "associated" with sou:SI. Am I missing something?

The conversion factor is not taken into account in the selection of the units implicitly associated with the SOU. Only those units are included whose factors are base units or have been determined to be implicitly associated already.

None of the imperial units, for example, are thus found for SI, and vice versa ( I belive, I haven't checked formally, but the printouts looked that way).

@steveraysteveray
Copy link
Collaborator

steveraysteveray commented Feb 6, 2023

OK. In the end, here's what I think makes sense. If the other Board members agree, then we can proceed:

  • Use qudt:isUnitOfSystem to relate every unit to every System of Units that it is "associated" with. There can be multiple such triples for units that are used in multiple systems, of course.
  • Create a sou:UNKNOWN for the weird units to refer to that are not part of any system.
  • We already have qudt:hasBaseUnit pointing from a system to its base units, so we don't need a property like qudt:isBaseUnitOfSystem since that is just ^qudt:hasBaseUnit.
  • We can continue to discuss what we should list as a qudt:derivedCoherentUnitOfSystem since the literature seems to talk about 22 such units for SI, but we already have 114 units that are declared as qudt:derivedCoherentUnitOfSystem and 308 units that have a conversionMultiplier of 1.0

@steveraysteveray
Copy link
Collaborator

@fkleedorfer, we discussed this topic at the Board today, and we want to proceed with the top three bullets in my previous comment above. One question that came up regarding false positives is how we consider the "minute" (unit:MIN) and other units for time other than unit:SEC. According the Wikipedia, "although not an SI unit, the minute is accepted for use with SI units.[2]." So the question is whether we state

unit:MIN qudt:isUnitOfSystem sou:SI?

I'm inclined to say no, since it is not an SI unit. But is that too strict? I'd be interested in your thoughts on this. Why did your algorithm decide unit:MIN is explicitly associated with SI?

Secondly, given the system-dependent and contextual nature of whether a unit is considered coherent and/or derived, we intend to remove all those triples and replace them with the top property qudt:isUnitOfSystem alone. Thoughts?

@fkleedorfer
Copy link
Collaborator Author

fkleedorfer commented Feb 18, 2023

The time inits are found because i explicitly add them as scalings of sec: https://github.com/qudtlib/qudtlib-java/blob/main/qudtlib-data-gen/src/main/resources/triples-to-add-to-units.ttl

For my use case, it's desirable to be able to determine units that are loosely permissible in an si or imperial context. I am not sure at this point if we need to include common time units like hour and minute in a construction industry context, but I think so. I added all time units for consistency. I'll ask the domain experts and get back to you.

@steveraysteveray
Copy link
Collaborator

@fkleedorfer, any updates on this? I'd like to have QUDT move forward with just the qudt:isUnitOfSystem predicate and remove the other ambiguous predicates, but I think your algorithms will do the best job of choosing the correct units.

@fkleedorfer
Copy link
Collaborator Author

Thanks for the nudge. The domain expert says, they would expect any scalings of second up to a week or maybe a month and year - although at that scale, obviously, it starts getting iffy because months have different lengths. I'd say there will probably have to be some edge case handling in any application using such time units, but having them available in an SI context would be a plus.

@fkleedorfer
Copy link
Collaborator Author

Is there anything else you need from my side for you to move forward with this?

@fkleedorfer
Copy link
Collaborator Author

... i.e, I could generate all the qudt:isUnitOfSystem triples using the algorithm described above - would that make sense?

@steveraysteveray
Copy link
Collaborator

That would be perfect! Yes please.

@fkleedorfer
Copy link
Collaborator Author

Ok here are 2949 triples: unit-sou.txt - actually a ttl file

@fkleedorfer
Copy link
Collaborator Author

fkleedorfer commented Mar 3, 2023

this is based on the 2.1.25 release, to which I add many triples, including these qudt:isScalingOf ones:

unit:TON_Metric qudt:isScalingOf unit:GM .
unit:TONNE qudt:isScalingOf unit:GM .
unit:MIN qudt:isScalingOf unit:SEC .
unit:HR qudt:isScalingOf unit:SEC .
unit:HR_Sidereal qudt:isScalingOf unit:SEC .
unit:MIN_Sidereal qudt:isScalingOf unit:SEC .
unit:DAY qudt:isScalingOf unit:SEC .
unit:DAY_Sidereal qudt:isScalingOf unit:SEC .
unit:WK qudt:isScalingOf unit:SEC .
unit:MO qudt:isScalingOf unit:SEC .
unit:YR qudt:isScalingOf unit:SEC .
unit:KiloYR qudt:isScalingOf unit:SEC .
unit:MegaYR qudt:isScalingOf unit:SEC .
unit:YR_Sidereal qudt:isScalingOf unit:SEC .
unit:YR_TROPICAL qudt:isScalingOf unit:SEC .
unit:EV qudt:isScalingOf unit:J .
unit:HA qudt:isScalingOf unit:M2 .
unit:ARE qudt:isScalingOf unit:M2 .
unit:ElementaryCharge qudt:isScalingOf unit:C .
unit:AU qudt:isScalingOf unit:M .
unit:E_h qudt:isScalingOf unit:J .
unit:R qudt:isScalingOf unit:C-PER-KiloGM .

... in case you are wondering how some of these results are possible.

@steveraysteveray
Copy link
Collaborator

I think this is a great start, and have created PR #653 to include your isUnitOfSystem triples. Thanks so much.

I will give my colleagues a chance to review, of course, before merging. My understanding of your approach is to err on the side of inclusiveness for units like GM and HR being part of SI, and KiloGM and HR being part of CGS. I agree with this.

@steveraysteveray
Copy link
Collaborator

There are still tweaks, of course. For example, I notice that the only time units associated with sou:IMPERIAL are

  • KiloSEC
  • MicroSEC
  • MilliSEC
  • NanoSEC

...but no SEC (or any other time units).

But I feel this is still great progress.

@fkleedorfer
Copy link
Collaborator Author

oh. thanks, will check!

@fkleedorfer
Copy link
Collaborator Author

In that particular case, these 4 units are explicitly associated with the Imperial in QUDT.
We seem to agree that all time units should be associated with Imperial, right?

@fkleedorfer
Copy link
Collaborator Author

next attempt: unit-sou2.txt

@fkleedorfer
Copy link
Collaborator Author

fkleedorfer commented Mar 3, 2023

2 changes:

  • SEC was explicitly associated with Imperial
  • unit:unitOfSystem was included in the query that determines which units and systems are associated - I had overlooked that one. The pattern is now:
        ?unit qudt:isUnitOfSystem
                |qudt:unitOfSystem
                |qudt:systemOfUnit
                |qudt:baseUnitOfSystem
                |qudt:derivedCoherentUnitOfSystem
                |qudt:derivedNonCoherentUnitOfSystem
                |qudt:derivedUnitOfSystem
                |qudt:coherentUnitOfSystem
                |qudt:definedUnitOfSystem
                |qudt:allowedUnitOfSystem
                ?systemOfUnits

that explains how now, we have ~3670 new triples up from 2950 or so

@steveraysteveray
Copy link
Collaborator

Great! I have updated the PR.

@steveraysteveray
Copy link
Collaborator

@fkleedorfer, I just tried the following query and see that we still have some work to do:

SELECT *
WHERE {
?u a qudt:Unit .
FILTER NOT EXISTS {?u qudt:isUnitOfSystem ?anything }
FILTER NOT EXISTS {?u a qudt:CurrencyUnit}
}

@fkleedorfer
Copy link
Collaborator Author

For the record, here is the resultof that query (adding a sort) on my current data.

---------------------------------------------------------
| u                                                     |
=========================================================
| <http://qudt.org/vocab/unit/1000000I>                 |
| <http://qudt.org/vocab/unit/1000I>                    |
| <http://qudt.org/vocab/unit/AMU>                      |
| <http://qudt.org/vocab/unit/ANGSTROM>                 |
| <http://qudt.org/vocab/unit/ATM-M3-PER-MOL>           |
| <http://qudt.org/vocab/unit/A_Reactive>               |
| <http://qudt.org/vocab/unit/B>                        |
| <http://qudt.org/vocab/unit/BAN>                      |
| <http://qudt.org/vocab/unit/BAR-PER-K>                |
| <http://qudt.org/vocab/unit/BARN>                     |
| <http://qudt.org/vocab/unit/BBL_UK_PET>               |
| <http://qudt.org/vocab/unit/BBL_UK_PET-PER-DAY>       |
| <http://qudt.org/vocab/unit/BBL_UK_PET-PER-HR>        |
| <http://qudt.org/vocab/unit/BBL_UK_PET-PER-MIN>       |
| <http://qudt.org/vocab/unit/BBL_UK_PET-PER-SEC>       |
| <http://qudt.org/vocab/unit/BBL_US>                   |
| <http://qudt.org/vocab/unit/BBL_US-PER-DAY>           |
| <http://qudt.org/vocab/unit/BBL_US-PER-MIN>           |
| <http://qudt.org/vocab/unit/BBL_US_DRY>               |
| <http://qudt.org/vocab/unit/BBL_US_PET>               |
| <http://qudt.org/vocab/unit/BBL_US_PET-PER-HR>        |
| <http://qudt.org/vocab/unit/BBL_US_PET-PER-SEC>       |
| <http://qudt.org/vocab/unit/BEAT>                     |
| <http://qudt.org/vocab/unit/BEAT-PER-MIN>             |
| <http://qudt.org/vocab/unit/BFT>                      |
| <http://qudt.org/vocab/unit/BIT>                      |
| <http://qudt.org/vocab/unit/BIT-PER-SEC>              |
| <http://qudt.org/vocab/unit/BREATH>                   |
| <http://qudt.org/vocab/unit/BREATH-PER-MIN>           |
| <http://qudt.org/vocab/unit/BTU_IT-PER-HR-FT2-DEG_R>  |
| <http://qudt.org/vocab/unit/BTU_IT-PER-LB_F-DEG_R>    |
| <http://qudt.org/vocab/unit/BTU_IT-PER-SEC-FT-DEG_R>  |
| <http://qudt.org/vocab/unit/BTU_IT-PER-SEC-FT2-DEG_R> |
| <http://qudt.org/vocab/unit/BTU_MEAN>                 |
| <http://qudt.org/vocab/unit/BU_US_DRY>                |
| <http://qudt.org/vocab/unit/BU_US_DRY-PER-DAY>        |
| <http://qudt.org/vocab/unit/BU_US_DRY-PER-HR>         |
| <http://qudt.org/vocab/unit/BU_US_DRY-PER-MIN>        |
| <http://qudt.org/vocab/unit/BU_US_DRY-PER-SEC>        |
| <http://qudt.org/vocab/unit/BYTE>                     |
| <http://qudt.org/vocab/unit/CAL_15_DEG_C>             |
| <http://qudt.org/vocab/unit/CAL_IT-PER-GM-K>          |
| <http://qudt.org/vocab/unit/CAL_IT-PER-SEC-CentiM-K>  |
| <http://qudt.org/vocab/unit/CAL_IT-PER-SEC-CentiM2-K> |
| <http://qudt.org/vocab/unit/CAL_MEAN>                 |
| <http://qudt.org/vocab/unit/CAL_TH-PER-GM-K>          |
| <http://qudt.org/vocab/unit/CAL_TH-PER-SEC-CentiM-K>  |
| <http://qudt.org/vocab/unit/CAL_TH-PER-SEC-CentiM2-K> |
| <http://qudt.org/vocab/unit/CASES>                    |
| <http://qudt.org/vocab/unit/CASES-PER-1000I-YR>       |
| <http://qudt.org/vocab/unit/CASES-PER-KiloINDIV-YR>   |
| <http://qudt.org/vocab/unit/CD-PER-IN2>               |
| <http://qudt.org/vocab/unit/CFU>                      |
| <http://qudt.org/vocab/unit/CUP_US>                   |
| <http://qudt.org/vocab/unit/CWT_LONG>                 |
| <http://qudt.org/vocab/unit/CentiM_HG>                |
| <http://qudt.org/vocab/unit/DEATHS>                   |
| <http://qudt.org/vocab/unit/DEATHS-PER-1000000I-YR>   |
| <http://qudt.org/vocab/unit/DEATHS-PER-1000I-YR>      |
| <http://qudt.org/vocab/unit/DEATHS-PER-KiloINDIV-YR>  |
| <http://qudt.org/vocab/unit/DEATHS-PER-MegaINDIV-YR>  |
| <http://qudt.org/vocab/unit/DECADE>                   |
| <http://qudt.org/vocab/unit/DEG>                      |
| <http://qudt.org/vocab/unit/DEG-PER-M>                |
| <http://qudt.org/vocab/unit/DEG-PER-MIN>              |
| <http://qudt.org/vocab/unit/DEG2>                     |
| <http://qudt.org/vocab/unit/DEGREE_API>               |
| <http://qudt.org/vocab/unit/DEGREE_BALLING>           |
| <http://qudt.org/vocab/unit/DEGREE_BAUME>             |
| <http://qudt.org/vocab/unit/DEGREE_BAUME_US_HEAVY>    |
| <http://qudt.org/vocab/unit/DEGREE_BAUME_US_LIGHT>    |
| <http://qudt.org/vocab/unit/DEGREE_BRIX>              |
| <http://qudt.org/vocab/unit/DEGREE_OECHSLE>           |
| <http://qudt.org/vocab/unit/DEGREE_PLATO>             |
| <http://qudt.org/vocab/unit/DEGREE_TWADDELL>          |
| <http://qudt.org/vocab/unit/DEG_C_GROWING_CEREAL>     |
| <http://qudt.org/vocab/unit/DEG_C_GROWING_CEREAL-DAY> |
| <http://qudt.org/vocab/unit/DEG_F-PER-K>              |
| <http://qudt.org/vocab/unit/DPI>                      |
| <http://qudt.org/vocab/unit/DRAM_UK>                  |
| <http://qudt.org/vocab/unit/DRAM_US>                  |
| <http://qudt.org/vocab/unit/DeciB>                    |
| <http://qudt.org/vocab/unit/DeciB_C>                  |
| <http://qudt.org/vocab/unit/DeciB_M>                  |
| <http://qudt.org/vocab/unit/Denier>                   |
| <http://qudt.org/vocab/unit/E>                        |
| <http://qudt.org/vocab/unit/ERLANG>                   |
| <http://qudt.org/vocab/unit/EV-PER-ANGSTROM>          |
| <http://qudt.org/vocab/unit/EarthMass>                |
| <http://qudt.org/vocab/unit/ExaBYTE>                  |
| <http://qudt.org/vocab/unit/ExbiBYTE>                 |
| <http://qudt.org/vocab/unit/F>                        |
| <http://qudt.org/vocab/unit/FA>                       |
| <http://qudt.org/vocab/unit/FC>                       |
| <http://qudt.org/vocab/unit/FLIGHT>                   |
| <http://qudt.org/vocab/unit/FR>                       |
| <http://qudt.org/vocab/unit/FRACTION>                 |
| <http://qudt.org/vocab/unit/FRAME>                    |
| <http://qudt.org/vocab/unit/FRAME-PER-SEC>            |
| <http://qudt.org/vocab/unit/FT-LB_F-PER-M2>           |
| <http://qudt.org/vocab/unit/FT_H2O>                   |
| <http://qudt.org/vocab/unit/FT_HG>                    |
| <http://qudt.org/vocab/unit/FUR_Long>                 |
| <http://qudt.org/vocab/unit/Flight>                   |
| <http://qudt.org/vocab/unit/G>                        |
| <http://qudt.org/vocab/unit/GAL>                      |
| <http://qudt.org/vocab/unit/GAL_UK>                   |
| <http://qudt.org/vocab/unit/GAL_UK-PER-DAY>           |
| <http://qudt.org/vocab/unit/GAL_UK-PER-HR>            |
| <http://qudt.org/vocab/unit/GAL_UK-PER-MIN>           |
| <http://qudt.org/vocab/unit/GAL_UK-PER-SEC>           |
| <http://qudt.org/vocab/unit/GAUGE_FR>                 |
| <http://qudt.org/vocab/unit/GAUSS>                    |
| <http://qudt.org/vocab/unit/GI_UK>                    |
| <http://qudt.org/vocab/unit/GI_UK-PER-DAY>            |
| <http://qudt.org/vocab/unit/GI_UK-PER-HR>             |
| <http://qudt.org/vocab/unit/GI_UK-PER-MIN>            |
| <http://qudt.org/vocab/unit/GI_UK-PER-SEC>            |
| <http://qudt.org/vocab/unit/GI_US>                    |
| <http://qudt.org/vocab/unit/GI_US-PER-DAY>            |
| <http://qudt.org/vocab/unit/GI_US-PER-HR>             |
| <http://qudt.org/vocab/unit/GI_US-PER-MIN>            |
| <http://qudt.org/vocab/unit/GI_US-PER-SEC>            |
| <http://qudt.org/vocab/unit/GM_Carbon>                |
| <http://qudt.org/vocab/unit/GM_Carbon-PER-M2-DAY>     |
| <http://qudt.org/vocab/unit/GM_DRY>                   |
| <http://qudt.org/vocab/unit/GM_F>                     |
| <http://qudt.org/vocab/unit/GM_F-PER-CentiM2>         |
| <http://qudt.org/vocab/unit/GM_Nitrogen>              |
| <http://qudt.org/vocab/unit/GM_Nitrogen-PER-M2-DAY>   |
| <http://qudt.org/vocab/unit/GON>                      |
| <http://qudt.org/vocab/unit/GR>                       |
| <http://qudt.org/vocab/unit/GRAD>                     |
| <http://qudt.org/vocab/unit/GT>                       |
| <http://qudt.org/vocab/unit/GibiBYTE>                 |
| <http://qudt.org/vocab/unit/GigaBIT>                  |
| <http://qudt.org/vocab/unit/GigaBIT-PER-SEC>          |
| <http://qudt.org/vocab/unit/GigaBYTE>                 |
| <http://qudt.org/vocab/unit/GigaBasePair>             |
| <http://qudt.org/vocab/unit/HART>                     |
| <http://qudt.org/vocab/unit/HART-PER-SEC>             |
| <http://qudt.org/vocab/unit/HP_Boiler>                |
| <http://qudt.org/vocab/unit/HP_Brake>                 |
| <http://qudt.org/vocab/unit/HP_Electric>              |
| <http://qudt.org/vocab/unit/HP_Metric>                |
| <http://qudt.org/vocab/unit/HeartBeat>                |
| <http://qudt.org/vocab/unit/Hundredweight_UK>         |
| <http://qudt.org/vocab/unit/Hundredweight_US>         |
| <http://qudt.org/vocab/unit/IU>                       |
| <http://qudt.org/vocab/unit/IU-PER-L>                 |
| <http://qudt.org/vocab/unit/IU-PER-MilliGM>           |
| <http://qudt.org/vocab/unit/KIP_F-PER-IN2>            |
| <http://qudt.org/vocab/unit/KibiBYTE>                 |
| <http://qudt.org/vocab/unit/KiloBIT>                  |
| <http://qudt.org/vocab/unit/KiloBIT-PER-SEC>          |
| <http://qudt.org/vocab/unit/KiloBYTE>                 |
| <http://qudt.org/vocab/unit/KiloBYTE-PER-SEC>         |
| <http://qudt.org/vocab/unit/KiloCAL>                  |
| <http://qudt.org/vocab/unit/KiloCAL-PER-CentiM2>      |
| <http://qudt.org/vocab/unit/KiloCAL-PER-CentiM2-MIN>  |
| <http://qudt.org/vocab/unit/KiloCAL-PER-CentiM2-SEC>  |
| <http://qudt.org/vocab/unit/KiloCAL-PER-GM>           |
| <http://qudt.org/vocab/unit/KiloCAL-PER-GM-DEG_C>     |
| <http://qudt.org/vocab/unit/KiloCAL-PER-MOL-DEG_C>    |
| <http://qudt.org/vocab/unit/KiloCAL_Mean>             |
| <http://qudt.org/vocab/unit/KiloGAUSS>                |
| <http://qudt.org/vocab/unit/KiloGM_F>                 |
| <http://qudt.org/vocab/unit/KiloGM_F-M>               |
| <http://qudt.org/vocab/unit/KiloGM_F-M-PER-CentiM2>   |
| <http://qudt.org/vocab/unit/KiloGM_F-M-PER-SEC>       |
| <http://qudt.org/vocab/unit/KiloGM_F-PER-CentiM2>     |
| <http://qudt.org/vocab/unit/KiloGM_F-PER-M2>          |
| <http://qudt.org/vocab/unit/KiloGM_F-PER-MilliM2>     |
| <http://qudt.org/vocab/unit/KiloINDIV>                |
| <http://qudt.org/vocab/unit/KiloLB_F-FT-PER-A>        |
| <http://qudt.org/vocab/unit/KiloPOND>                 |
| <http://qudt.org/vocab/unit/KiloV-A_Reactive>         |
| <http://qudt.org/vocab/unit/KiloV-A_Reactive-HR>      |
| <http://qudt.org/vocab/unit/LB-MOL>                   |
| <http://qudt.org/vocab/unit/LB-MOL-DEG_F>             |
| <http://qudt.org/vocab/unit/LB-PER-GAL_UK>            |
| <http://qudt.org/vocab/unit/LY>                       |
| <http://qudt.org/vocab/unit/LunarMass>                |
| <http://qudt.org/vocab/unit/M2-PER-GM_DRY>            |
| <http://qudt.org/vocab/unit/M2-PER-HZ-DEG>            |
| <http://qudt.org/vocab/unit/MACH>                     |
| <http://qudt.org/vocab/unit/MDOLLAR>                  |
| <http://qudt.org/vocab/unit/MDOLLAR-PER-FLIGHT>       |
| <http://qudt.org/vocab/unit/MESH>                     |
| <http://qudt.org/vocab/unit/MIL>                      |
| <http://qudt.org/vocab/unit/MILLE>                    |
| <http://qudt.org/vocab/unit/MIL_Circ>                 |
| <http://qudt.org/vocab/unit/MIN_Angle>                |
| <http://qudt.org/vocab/unit/MO_MeanGREGORIAN>         |
| <http://qudt.org/vocab/unit/MO_MeanJulian>            |
| <http://qudt.org/vocab/unit/MO_Synodic>               |
| <http://qudt.org/vocab/unit/MebiBYTE>                 |
| <http://qudt.org/vocab/unit/MegaBIT>                  |
| <http://qudt.org/vocab/unit/MegaBIT-PER-SEC>          |
| <http://qudt.org/vocab/unit/MegaBYTE>                 |
| <http://qudt.org/vocab/unit/MegaEV-PER-SpeedOfLight>  |
| <http://qudt.org/vocab/unit/MegaINDIV>                |
| <http://qudt.org/vocab/unit/MegaV-A_Reactive>         |
| <http://qudt.org/vocab/unit/MegaV-A_Reactive-HR>      |
| <http://qudt.org/vocab/unit/MicroG>                   |
| <http://qudt.org/vocab/unit/MicroG-PER-CentiM2>       |
| <http://qudt.org/vocab/unit/MicroGAL>                 |
| <http://qudt.org/vocab/unit/MicroGAL-PER-M>           |
| <http://qudt.org/vocab/unit/MicroTORR>                |
| <http://qudt.org/vocab/unit/MilLength>                |
| <http://qudt.org/vocab/unit/MilliA-PER-IN>            |
| <http://qudt.org/vocab/unit/MilliBAR-PER-K>           |
| <http://qudt.org/vocab/unit/MilliG>                   |
| <http://qudt.org/vocab/unit/MilliGAL>                 |
| <http://qudt.org/vocab/unit/MilliGAL-PER-MO>          |
| <http://qudt.org/vocab/unit/MilliM_H2O>               |
| <http://qudt.org/vocab/unit/MilliR_man>               |
| <http://qudt.org/vocab/unit/MilliTORR>                |
| <http://qudt.org/vocab/unit/MillionUSD-PER-YR>        |
| <http://qudt.org/vocab/unit/NAT>                      |
| <http://qudt.org/vocab/unit/NAT-PER-SEC>              |
| <http://qudt.org/vocab/unit/NUM>                      |
| <http://qudt.org/vocab/unit/NUM-PER-CentiM-KiloYR>    |
| <http://qudt.org/vocab/unit/NUM-PER-GM>               |
| <http://qudt.org/vocab/unit/NUM-PER-HA>               |
| <http://qudt.org/vocab/unit/NUM-PER-HR>               |
| <http://qudt.org/vocab/unit/NUM-PER-HectoGM>          |
| <http://qudt.org/vocab/unit/NUM-PER-KiloM2>           |
| <http://qudt.org/vocab/unit/NUM-PER-L>                |
| <http://qudt.org/vocab/unit/NUM-PER-M>                |
| <http://qudt.org/vocab/unit/NUM-PER-M2>               |
| <http://qudt.org/vocab/unit/NUM-PER-M2-DAY>           |
| <http://qudt.org/vocab/unit/NUM-PER-M3>               |
| <http://qudt.org/vocab/unit/NUM-PER-MicroL>           |
| <http://qudt.org/vocab/unit/NUM-PER-MilliGM>          |
| <http://qudt.org/vocab/unit/NUM-PER-NanoL>            |
| <http://qudt.org/vocab/unit/NUM-PER-SEC>              |
| <http://qudt.org/vocab/unit/NanoM-PER-CentiM-PSI>     |
| <http://qudt.org/vocab/unit/OCT>                      |
| <http://qudt.org/vocab/unit/OZ-PER-GAL_UK>            |
| <http://qudt.org/vocab/unit/OZ_VOL_UK>                |
| <http://qudt.org/vocab/unit/OZ_VOL_UK-PER-DAY>        |
| <http://qudt.org/vocab/unit/OZ_VOL_UK-PER-HR>         |
| <http://qudt.org/vocab/unit/OZ_VOL_UK-PER-MIN>        |
| <http://qudt.org/vocab/unit/OZ_VOL_UK-PER-SEC>        |
| <http://qudt.org/vocab/unit/PARSEC>                   |
| <http://qudt.org/vocab/unit/PCA>                      |
| <http://qudt.org/vocab/unit/PER-ANGSTROM>             |
| <http://qudt.org/vocab/unit/PER-MILLE-PER-PSI>        |
| <http://qudt.org/vocab/unit/PERCENT>                  |
| <http://qudt.org/vocab/unit/PERCENT-PER-DAY>          |
| <http://qudt.org/vocab/unit/PERCENT-PER-HR>           |
| <http://qudt.org/vocab/unit/PERCENT-PER-M>            |
| <http://qudt.org/vocab/unit/PERCENT-PER-WK>           |
| <http://qudt.org/vocab/unit/PERCENT_RH>               |
| <http://qudt.org/vocab/unit/PERM_Metric>              |
| <http://qudt.org/vocab/unit/PERM_US>                  |
| <http://qudt.org/vocab/unit/PH>                       |
| <http://qudt.org/vocab/unit/PINT_UK>                  |
| <http://qudt.org/vocab/unit/PINT_UK-PER-DAY>          |
| <http://qudt.org/vocab/unit/PINT_UK-PER-HR>           |
| <http://qudt.org/vocab/unit/PINT_UK-PER-MIN>          |
| <http://qudt.org/vocab/unit/PINT_UK-PER-SEC>          |
| <http://qudt.org/vocab/unit/PK_UK>                    |
| <http://qudt.org/vocab/unit/PK_UK-PER-DAY>            |
| <http://qudt.org/vocab/unit/PK_UK-PER-HR>             |
| <http://qudt.org/vocab/unit/PK_UK-PER-MIN>            |
| <http://qudt.org/vocab/unit/PK_UK-PER-SEC>            |
| <http://qudt.org/vocab/unit/PPB>                      |
| <http://qudt.org/vocab/unit/PPM>                      |
| <http://qudt.org/vocab/unit/PPM-PER-K>                |
| <http://qudt.org/vocab/unit/PPTH>                     |
| <http://qudt.org/vocab/unit/PPTH-PER-HR>              |
| <http://qudt.org/vocab/unit/PPTM>                     |
| <http://qudt.org/vocab/unit/PPTM-PER-K>               |
| <http://qudt.org/vocab/unit/PPTR>                     |
| <http://qudt.org/vocab/unit/PPTR_VOL>                 |
| <http://qudt.org/vocab/unit/PSI-L-PER-SEC>            |
| <http://qudt.org/vocab/unit/PSI-M3-PER-SEC>           |
| <http://qudt.org/vocab/unit/PSU>                      |
| <http://qudt.org/vocab/unit/PT>                       |
| <http://qudt.org/vocab/unit/PebiBYTE>                 |
| <http://qudt.org/vocab/unit/Pennyweight>              |
| <http://qudt.org/vocab/unit/PetaBYTE>                 |
| <http://qudt.org/vocab/unit/PlanckFrequency_Ang>      |
| <http://qudt.org/vocab/unit/QT_UK>                    |
| <http://qudt.org/vocab/unit/QT_UK-PER-DAY>            |
| <http://qudt.org/vocab/unit/QT_UK-PER-HR>             |
| <http://qudt.org/vocab/unit/QT_UK-PER-MIN>            |
| <http://qudt.org/vocab/unit/QT_UK-PER-SEC>            |
| <http://qudt.org/vocab/unit/Quarter_UK>               |
| <http://qudt.org/vocab/unit/REV>                      |
| <http://qudt.org/vocab/unit/REV-PER-HR>               |
| <http://qudt.org/vocab/unit/REV-PER-MIN>              |
| <http://qudt.org/vocab/unit/REV-PER-SEC>              |
| <http://qudt.org/vocab/unit/RPK>                      |
| <http://qudt.org/vocab/unit/SAMPLE>                   |
| <http://qudt.org/vocab/unit/SAMPLE-PER-SEC>           |
| <http://qudt.org/vocab/unit/SH>                       |
| <http://qudt.org/vocab/unit/SHANNON>                  |
| <http://qudt.org/vocab/unit/SHANNON-PER-SEC>          |
| <http://qudt.org/vocab/unit/STR>                      |
| <http://qudt.org/vocab/unit/SUSCEPTIBILITY_ELEC>      |
| <http://qudt.org/vocab/unit/SUSCEPTIBILITY_MAG>       |
| <http://qudt.org/vocab/unit/SolarMass>                |
| <http://qudt.org/vocab/unit/SpeedOfLight>             |
| <http://qudt.org/vocab/unit/Standard>                 |
| <http://qudt.org/vocab/unit/Stone_UK>                 |
| <http://qudt.org/vocab/unit/TEX>                      |
| <http://qudt.org/vocab/unit/THM_EEC>                  |
| <http://qudt.org/vocab/unit/THM_US>                   |
| <http://qudt.org/vocab/unit/TON_F_US>                 |
| <http://qudt.org/vocab/unit/TON_SHIPPING_US>          |
| <http://qudt.org/vocab/unit/TON_UK>                   |
| <http://qudt.org/vocab/unit/TON_UK-PER-DAY>           |
| <http://qudt.org/vocab/unit/TON_UK-PER-YD3>           |
| <http://qudt.org/vocab/unit/TON_US>                   |
| <http://qudt.org/vocab/unit/TON_US-PER-DAY>           |
| <http://qudt.org/vocab/unit/TON_US-PER-HR>            |
| <http://qudt.org/vocab/unit/TON_US-PER-YD3>           |
| <http://qudt.org/vocab/unit/TORR>                     |
| <http://qudt.org/vocab/unit/TebiBYTE>                 |
| <http://qudt.org/vocab/unit/TeraBYTE>                 |
| <http://qudt.org/vocab/unit/U>                        |
| <http://qudt.org/vocab/unit/V-A_Reactive>             |
| <http://qudt.org/vocab/unit/V-A_Reactive-HR>          |
| <http://qudt.org/vocab/unit/V-PER-IN>                 |
| <http://qudt.org/vocab/unit/YR_Common>                |
| <http://qudt.org/vocab/unit/failures-in-time>         |

@fkleedorfer
Copy link
Collaborator Author

There are multiple things here that need to be done, I believe.
a) some units here just need to be assocated manually with a system (e.g. GAL and friends)
b) some units here need to be made scalings of another unit (parsec, YR_Common, ..)
c) some units may be independent of these systems, such as the information units, PERCENT, NUM, ... - we have to decide what to do with those: add them to all systems, add them to a 'no system' system, leave them as-is, or do something else

@fkleedorfer
Copy link
Collaborator Author

I just tried to tweak the algorithm to associate a unit with a system, if at least one of its factor units is associated with it, and none of the remaining factors is associated with another system, but that generates too many associations, I think. We have to sort things out more manually.

@steveraysteveray
Copy link
Collaborator

steveraysteveray commented Mar 6, 2023

I agree with the direction you are going, to which I would add:

  1. The dimensionless units (except for ratios of dimensioned units) could be associated with all defined systems. I count 90 such units:
SELECT *
WHERE {
  ?u a qudt:Unit .
  ?u qudt:hasDimensionVector qkdv:A0E0L0I0M0H0T0D1 .
  FILTER NOT EXISTS {?u a qudt:CurrencyUnit }
  FILTER NOT EXISTS {?u qudt:qkdvNumerator ?any}
}
  1. The _UK and _US can be assumed to be associated with IMPERIAL and USCS, respectively. I found 111 such units:
SELECT *
WHERE {
  ?u a qudt:Unit .
BIND (afn:localname(?u) AS ?local)
    FILTER (fn:contains (?local, "_UK")||fn:contains (?local, "_US" ))
  }
  1. The Board has already agreed we need a pseudo-system named something like UNKNOWN, UNSTATED or UNCATEGORIZED that could be associated with all the orphan units
  2. After the easy fixes in 1 and 2, I agree it will be a manual process.

Let's see what others think, and then we can execute.

@steveraysteveray
Copy link
Collaborator

After discussion by the Board, we have agreed to proceed, with a few adjustments:

  1. The relation qudt:isUnitOfSystem is deprecated in favor of qudt:applicableSystem. This mirrors the use of qudt:applicableUnit for relating QuantityKinds to Units, and also avoids the impression that a given unit is somehow officially endorsed as part of a system of units by any governing body.
  2. I excluded Units that already referred to a SystemOfUnits in the first query above, i.e.
SELECT *
WHERE {
  ?u a qudt:Unit .
  ?u qudt:hasDimensionVector qkdv:A0E0L0I0M0H0T0D1 .
  FILTER NOT EXISTS {?u a qudt:CurrencyUnit }
  FILTER NOT EXISTS {?u qudt:qkdvNumerator ?any}
  FILTER NOT EXISTS {?u qudt:applicableSystem ?sys }
}
  1. sou:UNSTATED has been defined, to be used as the "owning" system for any Units that don't seem to fit with existing systems of units.
  2. I assigned a few easier ones, so we now have just 154 orphan units, which will need to be considered manually.

Results so far are in PR #656

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants