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

Add SIA405 strings to value lists [WIP/STUB] #334

Merged
merged 25 commits into from
Aug 17, 2021

Conversation

olivierdalang
Copy link
Collaborator

This is needed to import from/to SIA405.

Actual matching is just a stub so far. @sjib Could your metadatabase scripts by any chance help in automating the matching ? Or do we need to do that by hand ?

@olivierdalang
Copy link
Collaborator Author

Added new commits :

  • renamed column sia405_de by sia405code
  • replaced "unbekannt" by NULL when possible (non mandatory fields)
  • did matching for some required value lists

@olivierdalang
Copy link
Collaborator Author

olivierdalang commented Jul 2, 2021

Todo before merging

  • complete matching until we reach an acceptable matching
  • cleanup (remove value_list_sia405.sql and define the sia405codes directly in the vl_*.sql files)

ponceta added 9 commits July 8, 2021 09:42
autre, inconnu, à déterminer - > unbekannt
(commit de test)
To be checked with @sjib and @kandre
Add water quality mapping
Add altimetric precision mapping
Add bedding materials mapping
Add pipe function mapping
Add install method mapping
Add valve function mapping
Add Valve actuation mapping
UPDATE qwat_vl.hydrant_material SET sia405code = 'unbekannt' WHERE value_fr = 'à déterminer';

-- TODO : complete mapping
-- UPDATE qwat_vl.hydrant_model_inf SET sia405code = 'unbekannt' WHERE ???;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all hydrant_model_inf are Hydrant.Art = Oberflurhydrant. We would need to fill in the subvalues in qwat for a detailled matching (einarmig, zweiarmig, dreiarmig, mitEntleerung, ohne. Also we should take the Information about the Hersteller out of these values (e.g. VonRoll)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My question is, whether we invest in the matching here or add addtional columns to qwat_vl.hydrant_model_sup for Art and Hersteller. Online I can find some of e.g. the vonRoll models: https://www.vonroll-hydro.pl/en/hydrants.html e.g 5601 is einarmig

-- UPDATE qwat_vl.hydrant_model_inf SET sia405code = 'unbekannt' WHERE ???;

-- TODO : complete mapping
-- UPDATE qwat_vl.hydrant_model_sup SET sia405code = 'unbekannt' WHERE ???;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all hydrant_model_sup are Hydrant.Art = Unterflurhydrant. We would need to fill in the subvalues in qwat for a detailled matching (einarmig, zweiarmig, mitEntleerung, ohne. Also we should take the Information about the Hersteller out of these values (e.g. VonRoll). My question is, whether we invest in the matching here or add addtional columns to qwat_vl.hydrant_model_sup for Art and Hersteller.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hydrant.Hersteller is already stored separately as hydrant_provider

-- UPDATE qwat_vl.hydrant_model_sup SET sia405code = 'unbekannt' WHERE ???;

-- TODO : complete mapping
-- UPDATE qwat_vl.hydrant_output SET sia405code = 'unbekannt' WHERE ???;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I think I find (hidden) information whether it is einarmig, zweiarmig, dreiarmig: 2x55_1x75 or 3x75 - maybe we have to combine hydrant_model_* and hydrant_output for the Hydrant.Art matching in SIA405 water.

-- UPDATE qwat_vl.hydrant_output SET sia405code = 'unbekannt' WHERE ???;

-- TODO : complete mapping
-- UPDATE qwat_vl.hydrant_provider SET sia405code = 'unbekannt' WHERE ???;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hydrant.Hersteller is stored separately here as hydrant_provider

-- UPDATE qwat_vl.pump_operating SET sia405code = 'unbekannt' WHERE ???;

-- TODO : complete mapping
-- UPDATE qwat_vl.pump_type SET sia405code = 'unbekannt' WHERE ???;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPDATE qwat_vl.pump_type SET sia405code = 'andere' WHERE value_fr = 'autre';
UPDATE qwat_vl.pump_type SET sia405code = 'unbekannt' WHERE value_fr = 'inconnu';
UPDATE qwat_vl.pump_type SET sia405code = 'unbekannt' WHERE value_fr = 'à déterminer';
UPDATE qwat_vl.pump_type SET sia405code = 'Pumpwerk.Druckerhoehungsanlage' WHERE value_fr = 'surpresseur';
UPDATE qwat_vl.pump_type SET sia405code = 'Pumpwerk.Hauptpumpwerk' WHERE value_fr = 'normal';
-- not sure about this matching
UPDATE qwat_vl.pump_type SET sia405code = 'Pumpwerk.Zwischenpumpwerk' WHERE value_fr = 'accélération';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kandre peux-tu nous confirmer Zwischenpumpwerk <-> accélération?

UPDATE qwat_vl.status SET sia405code = 'weitere.Projekt' WHERE value_fr = 'projet en execution';

-- TODO : complete mapping
-- UPDATE qwat_vl.subscriber_type SET sia405code = 'unbekannt' WHERE ???;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see an equivalent in SIA405 water for subscriber_type in the corresponding class Hausanschluss

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add to attribute Hausanschluss.Art (Text attribute)

-- UPDATE qwat_vl.survey_type SET sia405code = 'unbekannt' WHERE ???;

-- TODO : complete mapping
-- UPDATE qwat_vl.tank_firestorage SET sia405code = 'unbekannt' WHERE ???;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see an equivalent in SIA405 water. There is a Loeschwasserreserve: MANDATORY 0.00 .. 10000000.00 [Units.m3]; in Wasserbehaelter as attribute

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tproduit y a-t-il des informations complémentaires pour la base des planifications d'eaux de secours pour le modèle fédéral qui requerraient des ajouts dans QWAT? Volume, ...?

UPDATE qwat_vl.valve_actuation SET sia405code = 'unbekannt' WHERE value_fr = 'inconnu';
UPDATE qwat_vl.valve_actuation SET sia405code = 'unbekannt' WHERE value_fr = 'à déterminer';
UPDATE qwat_vl.valve_actuation SET sia405code = 'mechanisch' WHERE value_fr = 'manuel';
UPDATE qwat_vl.valve_actuation SET sia405code = 'mechanisch' WHERE value_fr = 'manuel à gauche';
Copy link

@sjib sjib Jul 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here also set Absperrorgan.Schliessrichtung = links

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olivierdalang même chose que ci-dessous.

UPDATE qwat_vl.valve_actuation SET sia405code = 'unbekannt' WHERE value_fr = 'autre';
UPDATE qwat_vl.valve_actuation SET sia405code = 'unbekannt' WHERE value_fr = 'inconnu';
UPDATE qwat_vl.valve_actuation SET sia405code = 'unbekannt' WHERE value_fr = 'à déterminer';
UPDATE qwat_vl.valve_actuation SET sia405code = 'mechanisch' WHERE value_fr = 'manuel';
Copy link

@sjib sjib Jul 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here also set Absperrorgan.Schliessrichtung = rechts

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olivierdalang comment faire dans le cas d'un attribut qui renseigne deux attributs dans SIA?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Le plus simple serait d'avoir deux colonnes (p. ex. utiliser sia405code pour Schaltantrieb et ajouter une colonne sia405code_schliessrichtung).

UPDATE qwat_vl.valve_function SET sia405code = 'Schieber.unbekannt' WHERE value_fr = 'jauge';

-- TODO : complete mapping
-- UPDATE qwat_vl.valve_maintenance SET sia405code = 'unbekannt' WHERE ???;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just copy value to Absperrorgan.Zustand (TEXT*30)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olivierdalang
Copy link
Collaborator Author

@ponceta @sjib Hey ! Let me know when you're done with the first pass so that I can merge this. As we discussed, it doesn't need to be perfect, just the minimum for the export to contain useful information. We'll improve incrementally afterwards.

With the current file, I get the following validation errors when exporting the demo data :

Error: line 1770: SIA405_WASSER_2015_LV95.SIA405_Wasser.Leitung: tid ch00000000006265: value Kunststoff is not a member of the enumeration in attribute Material
Error: line 6311: SIA405_WASSER_2015_LV95.SIA405_Wasser.Schadenstelle: tid ch00000000008730: value Bruch.Riss is not a member of the enumeration in attribute Art

I guess we want Riss intead of Bruch.Riss, and some subvalue of Kunststoff

@sjib
Copy link

sjib commented Aug 10, 2021 via email

@ponceta
Copy link
Member

ponceta commented Aug 12, 2021

Indeed, @olivierdalang feel free to adapt what is necessary to have the minimal export running.

@olivierdalang olivierdalang marked this pull request as ready for review August 12, 2021 14:57
Copy link
Collaborator

@m-kuhn m-kuhn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically good
Domain knowhow I trust @sjib and @ponceta

@lbartoletti
Copy link
Collaborator

@olivierdalang is the file update/delta/delta_1.3.6_add_vl_for_SIA_export.sql should be named update/delta/delta_1.3.6_000_add_vl_for_SIA_export.sql ?

@olivierdalang
Copy link
Collaborator Author

@lbartoletti Not sure I understand, what is wrong with delta_1.3.6_add_vl_for_SIA_export.sql ?

@lbartoletti
Copy link
Collaborator

@olivierdalang By convention - don't remember if it was required by pum or the CI - deltas have a 3 digits id to perform update.
IIRC to be performed in a specific order

@olivierdalang
Copy link
Collaborator Author

ah ok, in this case I don't think it's necessary as we're already released 1.3.6 (beta) so that the next would be 1.3.7. It would be useful in the case where we could have multiple deltas in the same version, to ensure they apply in correct order.

@olivierdalang olivierdalang deleted the dev-interlisexport branch September 15, 2021 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants