-
Notifications
You must be signed in to change notification settings - Fork 28
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
Data model: dataowner and provider #43
Comments
Grundsätzlich spricht nichts gegen eine solche Umsetzung in QGEP, in der VSA-DSS INTERLIS Version wird es aber nicht so umgesetzt – es überfordert die Leute schon so, diese Daten überhaupt zu liefern. Man müsste das dann einfach beim Export in die VSA-DSS wieder anders abfüllen (also Name des Datenherrn statt FS). Falls du das so willst mit FS für Datenherr / Datenlieferant, schick mir eine Vorlage, wie ich das im SQL Create anpassen soll. |
While I think the idea is basically good in terms of database structure, what do we gain from it? QGIS supports a widget type called |
Andreas provides an example for Stefan how to implement this. |
Here is an example how this would be done for one table (sample od_wastewater_structure). It concerns all od_* tables. ALTER TABLE qgep.od_wastewater_structure ADD COLUMN dataowner integer; ALTER TABLE qgep.od_wastewater_structure ADD CONSTRAINT rel_wastewater_structure_dataowner FOREIGN KEY (dataowner) REFERENCES qgep.od_organisation(obj_id); The constraints can only be added after both tables where created, so better at the end of the SQL. |
Oliver needs to check whether this is implemented in latest version. |
Fehlermeldung: Am Schluss wenn du die Constrain für die Fremdschlüssel hinzufügst, wird zweimal fk_dataowner hinzugefüngt. Müssste einmel fk_provider sein. (issue #43)
|
Waiting for Interlis Import => then update the model to the newest model by @sjib => then import and migrate and verify |
Currently there are two fields for each
Not sure this is what we want? |
I believe the VSA-DSS model has the dataowner field as varchar/text, but we discussed that we would prefer the fk_dataowner foreign key to the organization table. So, we should get rid of the dataowner column and add this to an export view, when we will need the text representation instead of the foreign key. But the export views are not top priority, currently. |
Discuss in meeting 19.10.2015 (https://github.com/QGEP/QGEP/wiki/Meeting-2015-10-19) |
Take out dataowner and dataprovider field in datamodel |
@sjib what would be the delay for this? |
In working on the INTERLIS Export / Import we found out, that it is really challenging, when we always have to link the organization table into all the queries when exporting or importing data. So we think it would be helpful to keep the dataowner / provider as a field that we can fill with the current identifier of the related dataset in organization while exporting or importing and delete it, when we have pre- or postprocessed dataowner and provider an created the necessary fs_* (postprocess while importing) or matched the identifier of organization (preprocess in the export process). Does this disturbs any other development that you are doing? |
In this case, wouldn't it be preferable to either create the field at the start / end of an import/export process and delete it in the end? |
@sjib sorry not following, what prevents from using views for export and trigger for import? |
Adapted in https://raw.githubusercontent.com/QGEP/datamodel Release 26.4.2016 |
commit afdd70ade43516e5c23d66ebaf863334c8a6d87a Author: Matthias Kuhn <matthias@opengis.ch> Date: Wed Sep 21 13:24:36 2016 +0200 Remove dataowner and provider Really fixes QGEP#43 commit debbfd71b9f0a8968f3c3e40b858445470d07a35 Author: Matthias Kuhn <matthias@opengis.ch> Date: Wed Sep 21 12:51:00 2016 +0200 Finalize relativ_path changes commit 599e8fe6995d3120f4b96949dfe6e4526b113bf7 Author: Matthias Kuhn <matthias@opengis.ch> Date: Wed Sep 21 12:45:41 2016 +0200 Fix db_setup commit 7023d7a3d5a81b6bcf94cf6e7fa658b316db4b77 Author: Matthias Kuhn <matthias@opengis.ch> Date: Wed Sep 21 10:50:50 2016 +0200 Followup fix relativ_path commit eda80d9b6ac7e7488546a291282664f9507f2412 Author: Matthias Kuhn <matthias@opengis.ch> Date: Wed Sep 21 10:39:11 2016 +0200 Fix typo in od_file
commit e511805091eb885a118c6c9d095124bfc8389151 Author: Matthias Kuhn <matthias@opengis.ch> Date: Wed Sep 21 16:16:52 2016 +0200 Update tests to vw_qgep_wastewater_structure commit 47bac028a6cd818922193ec4002337e5da3477c3 Author: Matthias Kuhn <matthias@opengis.ch> Date: Wed Sep 21 12:46:06 2016 +0200 Add od_wastewater_structure.main_cover commit 8a9ba10347b1616430c9bc245f729004c0f23f9d Author: Matthias Kuhn <matthias@opengis.ch> Date: Wed Sep 21 12:45:12 2016 +0200 Add vw_qgep_wastewater_structure commit afdd70ade43516e5c23d66ebaf863334c8a6d87a Author: Matthias Kuhn <matthias@opengis.ch> Date: Wed Sep 21 13:24:36 2016 +0200 Remove dataowner and provider Really fixes QGEP#43
Almost any od_xx table has the two attributes "dataowner" and "provider". Currently these are only text fields. I think it would be more elegant if these could be relations to the table "od_organisation" - With the current setup there is a lot of duplication and it is harder to update the information of the dataowner and provider.
Any thoughts?
The text was updated successfully, but these errors were encountered: