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

conflated units, weight vs netWeight, xsd:double vs xsd:decimal #532

Open
VladimirAlexiev opened this issue Aug 17, 2022 · 11 comments
Open
Assignees
Labels
post-1.0 This is for issues that are important but should not block 1.0 ready-for-pr

Comments

@VladimirAlexiev
Copy link
Contributor

After #531, I noticed problems in the #395 (comment) example:

        "weight": 1671.9,
        "weightUnit": "KGM",
        "volume": 27.23,
        "volumeUnit": "CBM",
        "numberOfPackages": 245

is translated to

            schema1:unitCode             "CBM" , "KGM" ;
            uncefact:grossVolumeMeasure  2.723E1 ;
            uncefact:netWeightMeasure    1.6719E3 ;
            uncefact:packageQuantity     245

I see these problems:

  1. Both weightUnit, volumeUnit are mapped to unitCode, which conflates them (these are the units of which measure exactly?)
  2. weight is not the same as uncefact:netWeightMeasure IMHO: hwo do you know it's not gross weight
  3. I bet you've declared weight, volume to be xsd:double. That's why they are translated to those inexact scientific notations with exponent. xsd:decimal is infinite precision, but to ensure numbers are carried precisely in JSON, you have to transfer them as strings (eg "1671.9")
@VladimirAlexiev
Copy link
Contributor Author

Note to self: <urn:epc:id:bic:YMLU3380910> is legit, see https://www.gs1.org/sites/default/files/docs/epc/GS1_EPC_TDS_i1_12.pdf page 39

@BenjaminMoe
Copy link
Contributor

@VladimirAlexiev can you make a recommendation for which terms should be used?

@VladimirAlexiev
Copy link
Contributor Author

@BenjaminMoe

  • adopt the schema:StructuredValue Pattern. Put the value and unit in their own node, so they are not confused between different measurements
  • use json terms that correspond to the rdf props fully. "weight" is not the same as "netWeight"
  • declare value to be xsd:decimal and carry it in json as a string, not as json float

@OR13
Copy link
Collaborator

OR13 commented Apr 4, 2023

Blocked by #536

@OR13
Copy link
Collaborator

OR13 commented Apr 4, 2023

Lets to this:

#532 (comment)

We need to determine where the updates need to be made.

First we need to gather the list of all places where this is happening today (where weight is present with underspecified type)

@mkhraisha
Copy link
Collaborator

mkhraisha commented Apr 4, 2023

Concrete actions:

  1. Make an inventory of all items that have the weight and weightUnit or similar structure and use a blank node

Then follow

  • adopt the schema:StructuredValue Pattern. Put the value and unit in their own node, so they are not confused between different measurements
  • use json terms that correspond to the rdf props fully. "weight" is not the same as "netWeight"
  • declare value to be xsd:decimal and carry it in json as a string, not as json float

@nissimsan
Copy link
Collaborator

@OR13
Copy link
Collaborator

OR13 commented Apr 4, 2023

We should strive to include unit and value as blank nodes for predicate related to weight or volume.

@mkhraisha mkhraisha self-assigned this Apr 4, 2023
@mkhraisha
Copy link
Collaborator

All places that use weight can be found here that use MeasuredValue or Quantitative Value:
https://github.com/search?q=repo%3Aw3c-ccg%2Ftraceability-vocab+%22weight%22%3A+%7B&type=code

These should all be correct from a structure perspective. We should only need to change MeasuredValue and Quantitative Value to xsd:Decimal to fix these.

All places that use weightUnit are currently strings, none of them have child nodes, these should all be changed.
https://github.com/search?q=repo%3Aw3c-ccg%2Ftraceability-vocab+%22weightUnit%22&type=code

@BenjaminMoe
Copy link
Contributor

Waiting for bandwidth.

@mkhraisha
Copy link
Collaborator

Discussed on June 20th Call decided to remove the 1.0 label.

@mkhraisha mkhraisha added the post-1.0 This is for issues that are important but should not block 1.0 label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
post-1.0 This is for issues that are important but should not block 1.0 ready-for-pr
Projects
None yet
Development

No branches or pull requests

5 participants