-
Notifications
You must be signed in to change notification settings - Fork 5
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
New model for tags #192
Comments
Small question (or correction?): the |
Correct. Updated. |
Important to note: dbGetQuery(con, glue_sql("
SELECT acoustic_tag.tag_full_id, tag_type.name
FROM acoustic.tags AS acoustic_tag
LEFT JOIN common.tag_device AS tag_device
ON acoustic_tag.tag_device_fk = tag_device.id_pk
LEFT JOIN common.tag_device_type AS tag_type
ON tag_device.tag_device_type_fk = tag_type.id_pk
WHERE tag_type.name = 'sensor-tag'
"))
tag_full_id name
1 A69-9006-10572 sensor-tag
2 A69-9002-16200 sensor-tag
3 A69-1105-1 sensor-tag
4 A69-1105-2 sensor-tag
5 A69-1105-3 sensor-tag
6 A69-1105-4 sensor-tag
7 A69-9002-6814 sensor-tag
8 A69-9002-13731 sensor-tag
9 A69-9002-13730 sensor-tag
10 A69-1105-211 sensor-tag
11 A69-1105-212 sensor-tag
|
Here I am a bit confused, because an acoustic tag can have sensors as well. So is the mentioned |
@PieterjanVerhelst the confusion is exactly why the model should be adapted. Currently we have 2 tables which both contain mixed types. We need a single table with all the tag (for lack of a better word) "identifiers", and what that identifier carries, e.g. for a single (super) tag:
|
Aha, I'll start to get it. Indeed, the field Your suggestion can work, but would replace 'broadcasts' by 'emits'. At this time, I can't come up with something better. Can it be integrated that certain fields are not returned following the |
@PieterjanVerhelst, there are 3 type fields for a tag:
The current design choice is to have a single |
ok, that is clear. No further questions or suggestions, except that it would indeed be good common practice to fill in the full sensor type (so e.g. 'pressure' instead of 'P') to make it more self-explanatory. |
@peterdesmet Is it ok to close this? |
Yeah, I think so |
@jreubens and I discussed the data model on the phone and we think it should be updated so that:
tag_device
should only contain unique serial numbers: one device = one serial number = one rowtags
contains one or more identifiers associated with thetag_device
. It is a combination of the current tablesacoustic.tags
andsensor.tags
, but also allows to store acoustic archival tags. This table also contains thetype
(archival/acoustic) andsubtype
, which are no longer associated withtag_device
(since a tag_device can have more than one type).Examples:
tag_device
row - 1tag
row, withtype=acoustic
and anacoustic_tag_id
that can be found in detections.tag_device
row - 2tag
rows, withsensor_type=depth
andsensor_type=temp
and both withtype=archival
. There are no associated detections, only associated readings.tag_device
row - 4tag
rows, 2archival
ones (for both sensors) and 2acoustic
ones, with differentacoustic_tag_id
s. There are associated detections (for bothacoustic_tag_id
) and readings.Schema:
@aubrivliz Note that this is just an idea that should be discussed further. It should not be implemented yet.
The text was updated successfully, but these errors were encountered: