qudt / qudt-public-repo

QUDT -Quantities, Units, Dimensions and dataTypes - public repository
Other
114 stars 71 forks source link

pH is defined incorrectly #891

Closed ghost closed 5 months ago

ghost commented 6 months ago

There is an inconsistent definition of pH

http://qudt.org/vocab/unit/PH

In the body you define that the units of the quantity pH are mol/L but you define pH as a unit.

Additionally definitions from IUPAC https://doi.org/10.1039/9781847557889 Section 2.13. would use an alternate definition of the quantity.

steveraysteveray commented 5 months ago

The current description for unit:PH is "the negative decadic logarithmus of the concentration of free protons (or hydronium ions) expressed in 1 mol/l." Other than the extra "1" that should not be there, the intention of the description is that the concentration of the free protons should be expressed in moles per litre, and then take the negative logarithm (base 10) of that number to give you the pH value. That still seems to be a valid description to us.

Meanwhile, we also have a quantitykind:PH, primarily because common usage is for a person to ask "What is the pH of this liquid?" That usage is much like someone saying "What is the temperature of this liquid," where temperature and pH are quantity kinds. In the case of pH, the only valid unit to use for that quantity kind is unit:PH.

ghost commented 5 months ago

Can I use any unit for any quantitykind or is there a forced association?

Then it does not matter that there is a unit that I don't think is valid.

Additionally, you use the imprecise definition, how to cover the IUPAC definition?

steveraysteveray commented 5 months ago

The short answer is that if you are simply using the QUDT vocabularies, nothing (currently) stops you from specifying a quantitykind:Temperature with a unit of, say, unit:M (the metre) in your application.

The longer answer: Within the QUDT vocabularies themselves, we use SHACL validation rules stored in collections/COLLECTION_QUDT_QA_TESTS_ALL-v2.1.ttl to ensure that the units and associated quantity kinds in our vocabularies have the same dimension vectors (see qudt:InconsistentUnitAndDimensionVectorConstraint in that file).

In your application, you could use SHACL validation rules to check if a given unit is listed as a qudt:applicableUnit for a given quantity kind, if you wanted to do that. Or more generally, you could check that your unit and quantity kind have the same dimension vector, even if the unit isn't specifically called out as an applicable unit.

Your question makes me think that it might be appropriate for us to add a SHACL SPARQL constraint using something like the code below for instances of qudt:Quantity, to help users from inadvertent errors.

SELECT $this
   WHERE 
{
      $this qudt:hasQuantityKind/qudt:hasDimensionVector ?qkdv1 .
      $this qudt:hasUnit/qudt:hasDimensionVector ?qkdv2 .
FILTER (?qkdv1 != ?qkdv2) .
}

Regarding the IUPAC definition, I cannot look at it without buying the publication. Can you share the definition?

ghost commented 5 months ago

I check out the 1st topic in some more details and ask another question if I have one.

Here is the IUPAC definition, the imprecise one is true for a low concentration where aH+ ≂ [H+], e.g. 1 mol/L HCl has pH of 0, however you can get 12 mol/L HCl then it does not work anymore but the material still has a pH.

Screenshot 2024-04-17 170031

My general observation is people confuse terms unit and the symbol

steveraysteveray commented 5 months ago

The validation test mentioned above has been added in PR #901.

steveraysteveray commented 5 months ago

This has been handled by #906 and #907.