Closed jeffbaumes closed 8 months ago
We will be migrating away from use of a depth 2 slot, towards a depth slot that has subslots for discrete measurements as well as ranges.
The modeling is complete but changes have not been made to MongoDB yet.
Thanks for that info @turbomam. Can you add a "blocked on
We should revisit this some time soon @turbomam @jeffbaumes @naglepuff @pkalita-lbl
@jeffbaumes @naglepuff in mongo prod biosample_set
id
nmdc:bsm-11-2d3eam48
is an example record where a depth range is specified.
The slot depth has a value of QuantityValue relevant slots for data portal ingest are has_minimum_numeric_value
, has_maximum_numeric_value
, has_numeric_value
"depth": { "has_minimum_numeric_value": 0, "has_maximum_numeric_value": 0.1 }
cc @mslarae13
Time permitting adding this ticket to this sprint. NEON will have these min and max values.
Per the meeting today Mongo should be updated soon so that this can be resolved. I'm moving this to the next sprint since schema was just released today. @naglepuff @aclum
There is already data in mongo with the values. This issue is to get the range displayed in the data portal
This wasn't done so will be addressed after ESA. Adding backlog label. @naglepuff @aclum
Should / could this be prioritized? I noticed the NEON samples don't show depth at all.
@mslarae13 Right, no depth is shown when depth is a range in mongo. As much as I would like to get this addressed there are bigger issues I'd like addressed like being able to pass a url with a search parameter. https://github.com/microbiomedata/nmdc-server/issues/1034. Leah and I are starting a around of user research now so part of that will be going through outstanding tickets.
I'm reading up on this issue now.
Here are some references for whoever ends up implementing this:
depth
slotdepth
slot's usage on the Biosample
class (search the web page for "slot_uri: MIXS:0000018
", for example):
depth: name: depth annotations: expected_value: tag: expected_value value: measurement value description: The vertical distance below local surface, e.g. for sediment or soil samples depth is measured from sediment or soil surface, respectively. Depth can be reported as an interval for subsurface samples. title: depth examples: - value: 10 meter from_schema: https://w3id.org/nmdc/nmdc aliases: - depth rank: 1000 is_a: environment field slot_uri: MIXS:0000018 multivalued: false alias: depth owner: Biosample domain_of: - Biosample range: QuantityValue
QuantityValue
rangedepth
property:
db.getCollection("biosample_set").findOne({"depth": {$exists: true}})
depth
value that does not describe a range (this came from the biosample having "_id" : ObjectId("649b003843aa17f5748437d5"), "id" : "gold:Gb0115231"
):
"depth" : {
"has_raw_value" : "0.5",
"has_numeric_value" : 0.5,
"has_unit" : "meter"
},
depth.has_maximum_numeric_value
property:
db.getCollection("biosample_set").findOne({"depth.has_maximum_numeric_value": {$exists: true}})
depth
value that does describe a range (this came from the biosample having "_id" : ObjectId("649b003843aa17f5748439ae"), "id" : "gold:Gb0110680"
):
"depth" : {
"has_maximum_numeric_value" : 0.2,
"has_minimum_numeric_value" : 0.1,
"has_numeric_value" : 0.1,
"has_raw_value" : "0.1 to 0.2 meters",
"has_unit" : "metre"
},
depth.has_maximum_numeric_value
property:
db.getCollection("biosample_set").countDocuments({"depth.has_maximum_numeric_value": {$exists: true}})
Questions I have:
depth
object is stored in a Postgres column called annotations
.I got an nmdc-server
development environment set up on my computer, and I got a copy of the production Postgres database loaded into it (from one of the backups).
I also got the client dev server running on my local machine (not shown here), and confirmed I can edit .vue
files and see the changes in my web browser.
When I visit http://localhost:8080/details/sample/gold:Gb0110680, the web client fetches data from http://localhost:8080/api/biosample/gold:Gb0110680.
The latter request is routed to this endpoint: https://github.com/microbiomedata/nmdc-server/blob/8d99507504e4c9500b742b55ff5b9fe9d901dc82/nmdc_server/api.py#L194-L203
The crud.get_biosample
function is implemented here:
https://github.com/microbiomedata/nmdc-server/blob/8d99507504e4c9500b742b55ff5b9fe9d901dc82/nmdc_server/crud.py#L233-L235
Looks like the "entire biosample" gets returned to the client.
The response body associated with the latter request contains, among other things, the annotations
object:
{
"id": "gold:Gb0110680",
//...
"annotations": {
"elev": 432.0,
"depth": {
"has_unit": "metre",
"has_raw_value": "0.1 to 0.2 meters",
"has_numeric_value": 0.1,
"has_maximum_numeric_value": 0.2,
"has_minimum_numeric_value": 0.1
},
//...
},
//...
Next thing I'll look into is the path from that response body to what gets displayed on the web page.
I think I have found the .vue
file involved here:
web/src/components/Presentation/AttributeItem.vue
I was able to get a range showing. Tomorrow, I'll clean up and the code and run it by someone more familiar with both the Postgres data and Vue.js to see whether there's anything I've overlooked.
@aclum, is the way the range is shown on the left, what you had in mind?
I described the format minimum hyphen maximum space unit
to @aclum verbally and she said it sounded good to her, so I'll move forward with that. I'll tag her in the PR I open, and include a screenshot, for her final approval.
In addition, @aclum wants single values to be followed by the unit also, when the unit is available (if available, it would be in annotations.depth.has_unit
). Currently, the unit is not always available, but the team plans to make it required in the future (possibly back-filling missing ones).
On a side note, she pointed out that, currently, the unit values in the database are pretty heterogeneous (i.e. not consistent) right now (e.g. "m", "meter", "metre"). We'll eventually be implementing something that restricts them.
I opened a PR in which I implemented this functionality. Here's a link to the PR: https://github.com/microbiomedata/nmdc-server/pull/1133
I opened a PR in which I implemented this functionality. Here's a link to the PR: #1133
I'll be able to take a look at this PR next week.
Split out from #740.