Open mwengren opened 7 years ago
This is specific to i52n-sos. I'll take a look.
FYI, I remember seeing that duplication but don't remember why I decided to go with //sml:System/sml:outputs/sml:OutputList
. It's probably b/c it looked simpler to parse, and for my purposes I didn't need or could not profit from the potentially extra detailed information in sml:components/sml:ComponentList/sml:component
(namely, associating specific sweQuantities
with specific "sensors", which in the case of NANOOS are not actually sensors per se, but individual variables/parameters treated as sensors).
SensorML often provides more than one way of encoding things
I'm not saying it's wrong as it is, just wondering why the need for both sections.
The pyoos code FWIW was written to store the extracted variable URI information from sml:components/sml:ComponentList/sml:component
in the DescribeSensor.variables variable, eg:
http://mmisw.org/ont/cf/parameter/air_temperature
http://mmisw.org/ont/cf/parameter/dew_point_temperature
http://mmisw.org/ont/cf/parameter/mass_concentration_of_chlorophyll_in_sea_water
http://mmisw.org/ont/cf/parameter/mass_concentration_of_oxygen_in_sea_water
http://mmisw.org/ont/cf/parameter/mole_concentration_of_nitrate_in_sea_water
http://mmisw.org/ont/cf/parameter/net_downward_shortwave_flux_in_air
http://mmisw.org/ont/cf/parameter/relative_humidity
http://mmisw.org/ont/cf/parameter/sea_water_pressure
http://mmisw.org/ont/cf/parameter/sea_water_salinity
http://mmisw.org/ont/cf/parameter/sea_water_temperature
http://mmisw.org/ont/cf/parameter/sea_water_turbidity
http://mmisw.org/ont/cf/parameter/surface_air_pressure
http://mmisw.org/ont/cf/parameter/wind_from_direction
http://mmisw.org/ont/cf/parameter/wind_speed
Does anyone know why the //sml:output/swe:Quantity elements are repeated at the station and also station-component level in the DescribeSensor responses?
I've been looking into the OWSLib and pyoos code for parsing SensorML responses, and it looks like the pyoos/OWSLib approach is to obtain measured variables via the OWSLib System.components variables, which are obtained from this xpath: sml:components/sml:ComponentList/sml:component, relevant source code link here, and the corresponding pyoos code here.
XML snippit of sml:component:
However, the same swe:Quantity elements are repeated at the //sml:System/sml:outputs/sml:OutputList level, without the level of detail included in the swe:component element:
Why are these repeated? Seems like a duplication. You can get the same information from both. Are they expected to be the same at all times? I didn't see this addressed in the docs at first review.
Specifically I've been looking at examples from NANOOS SOS, but I'm guessing this isn't exclusive to NANOOS. Emilio, I noticed in your code you are parsing the latter to get all of the sweQuantities in your sensorml.py code: https://github.com/nanoos-pnw/ioos-ws/blob/master/sensorml.py.
cc: @kwilcox @shane-axiom @emiliom @abirger