-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
add Unit
read API for loading by symbol rather than fully-qualified record UUID
#387
base: sprout
Are you sure you want to change the base?
Conversation
I don't think VF should care, seems to me that retrieval by whatever is cleanest should be done, and really whatever people prefer. And noting that id's will be different things in different technical ecosystems, although there should be a unique URL id for each unit in OM2. I don't think all the units in OM2 have symbols, you'll probably have to substitute whatever seems best. |
Hrmm, there may be some additions or revisions needed for the GraphQL Problem 1: equivalence There currently cannot be any guarantee of equivalence or availability of different However this does also mean that we cannot know that an 'hours' Problem 2: grammar standardisation
This is currently the case per network but presents an issue with associating units back to OM. To avoid falsely indicating equivalence between units and to enable referential integrity checks against the zome, unit IDs are returned as universally-unique strings which include the I was going to currently specify associations to OM2 by By providing such associations to external vocabs we would be able to solve equivalence since two different 'hour's can be said to be equivalent if they both correspond to http://www.ontology-of-units-of-measure.org/resource/om-2/hour. Question 1: how to associate units with OM2? Should we have a better way of making this association? Some field on Question 2: how to load selections of available units in applications? App developers are likely to want to be able to perform logic such as, "Does the 'hours' This PR was an attempt to facilitate that by allowing units to be queried directly by symbol (hopefully the unique part of a unit) for retrieval, without modifying the GraphQL spec. However maybe it's not the best approach. Better may be adding Further work may involve integration of the OM ontology more directly into applications. For example, we might want to deny creating custom units with any OM Either this kind of validation, or we could add a filter parameter for |
I wonder if we (meaning you of course :) in the graphql ) could add a field to Unit just for the OM2 url? Use label for the actual short label. Maybe also VF itself could put a recommendation for that into one of those kinds of sections, especially once it is tried.
This is a hard one. And yes, different networks will want different sets of units. I have always pictured some kind of utility for populating OM2 units into a DNA/DHT, where any network who needs units for whatever reason could pick out what they want from some big query-able list. What you are suggesting also makes sense because they will run into needing new ones as they work. Just making sure you know about these references:
|
Thanks for that second link, it was worth taking the time to look through the exported definitions. Not all units having a What do you think of this, as an example of inserting core time-based units? const timeUnits = {
hours: {
label: 'hour',
symbol: 'h',
description: 'The hour is a unit of time defined as 3600 second.',
classifiedAs: ['http://www.ontology-of-units-of-measure.org/resource/om-2/hour'],
},
minutes: {
label: 'minute',
symbol: 'min',
description: 'The minute (time) is a unit of time defined as 60 second.',
classifiedAs: ['http://www.ontology-of-units-of-measure.org/resource/om-2/minute-Time'],
},
seconds: {
label: 'second',
symbol: 's',
description: 'The second is a unit of time defined as the duration of 9 192 631 770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the cesium 133 atom.',
classifiedAs: ['http://www.ontology-of-units-of-measure.org/resource/om-2/second-Time'],
},
} I think the best thing to do in terms of indexing might actually be to re-key on |
Could also consider ommitting |
I want to point out that there's a lot more to the OM2 model than any of us have referenced in the code (and more than I've actually seen documented anywhere). Each unit has a well known key as its ID such as Each unit has a mapping to the UCUM ontology defined in https://github.com/HajoRijgersberg/OM/blob/master/om-2-ucum.ttl. There is the first most straightforward hierarchy of 161 objects that subclass
One possible traversal down this chain of subclassing looks like: Mathematical relationships can be defined between
The spec defines a hierarchy of prefixes:
There is enough information to use a symbolic system to perform dimensional analysis and convert between units based on the dimensions of each measurement used in a calculation in order to normalize the results. This does exempt the units starting at The spec defines 24
There are groupings of 76 different This means there's enough data in the ontology to both allow narrowing down and selecting units based on application area and dimension type. My suggestion would be to have some configuration mechanism of configuring which units are used by the particular organizations/groups/agents. We could also allow aliases for all units and conversions for the unit-less units (eg. It's funny, OM2 seems to have everything but the |
Maybe I left this comment in the wrong place, so referencing it here. Sorry for any confusion over many issues in different places.
Something like that makes sense to me. Suggest:
I like having the description handy (maybe useful for mouse-overs), although in OM2 it looks like they use |
I'm not sure how you might feel about this addition; but it seems like a necessary bit of ergonomics for hREA-based apps.
I want to be able to declare this as a data dependency in my view component(s):
The key parameter is the
id
in each query. The only way of interacting currently is to pass the values directly; i.e. the universally-unique combination of(DnaHash, String)
, which necessitates query variables:Where would
dnaHashB64
come from? This seems like an implementation detail of the Valueflows network, which client applications should not have to interact with at all. So, we should be able to refer to units by well-known strings for simplified retrieval. I think with this addition to the top-level query we can take the wrappedUnitIds
from this request and link to other records as needed in mutations.