-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Improvement of Project Creation with extended INTERLIS Models #61
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
signedav
changed the title
testdata (ili-models) for the use cases
Improvement of Project Creation with extended INTERLIS Models
Jul 14, 2023
signedav
force-pushed
the
extended-models
branch
from
July 14, 2023 11:34
06a6b4c
to
8b26c10
Compare
signedav
force-pushed
the
extended-models
branch
from
July 16, 2023 08:51
482c69d
to
cddc71c
Compare
…he topic and . as prefix and when still there are duplicates add model and . as prefix
…is relevant in current project
…id - this only leads to the situation that many-to-many with geometry layers cannot be added. This fixes opengisch/QgisModelBaker#826 But we do need to consider, that talbes can be purelinking tables with additional links to basket-table. This has not been considered before.
… (so the subquery returned multiple entries), if one of them is bigger 1 its fulfilled
domi4484
approved these changes
Sep 25, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Just as discussed I would put the base layers
ad system
groups into an another Extra
group to keep the project even cleaner
Co-authored-by: Damiano Lombardi <[email protected]>
…he same layer (because of multi-geometry)
domi4484
approved these changes
Oct 3, 2023
This was referenced Oct 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important note (esp. for documenters)
Conceptional thoughts
Assumptions
Since it appears almost impossible to care for all the cases, I need to make some assumptions what mostly would be the case.
ABSTRACT
).Leads to
And this means
Table is irrelevant when:
We find the table as baseClass with same named extension in another model OR we find the table in the baseClass with multiple extensions in another topic but the same or the extended model.
Smartness
This implementation concerns mostly smart 2 inheritance strategy. With smart 1 there could be the optimization that the relevant layer is set as default
t_type
, but this is not scope of this PR.Limitations
There will be issues with the optimization. For example:
What to do then? You have always the option for the NONE-strategy :-)
Backwards compatibility
Will there be issues with backwards compatibility since we do in every case a layer rename in case of multiple same named classes? - Yes, but this would only concern cases, where you already had troubles because of same named layers (e.g. UsabILIty Hub or
get_feature
-expressions.Deliverables
No ambiguous layers anymore
Independently from extended models (but pretty much connected to it), we eliminate ambiguous layer naming in general. This is done in two steps:
In case we use the
OptimizeStrategy.HIDE
we don't rename ambiguous layers, when they will be hidden later on anyway.With the Example Use Case Polymorphic below the result will look like this:
Emitting the "irrelevant" layers
The "irrelevant" layers are emitted in the backend even when not used according to the strategies influencing the layer tree, the relations and the basket fields.
The three strategies
You can set the strategy in the
generator
:Layer tree according to three optimize-stategies
Example NONE:
Example GROUP:
Example HIDE:
Here we see as well that on this strategy the renaming of ambiguous layers concerns if the layer will be hidden later (like Firma).
Relations according to two optimize-stategies (hide and rename/group)
Relations and widgets should be created or not (concerning the strategies):
NONE Strategy
Create relations of irrelevant layers and add relation editors to the form.
GROUP Strategy
Create relations of irrelevant layers BUT don't add relation editors to the form.
HIDE layer strategy
Don't create relation on irrelevant layers.
Basket Stretch Goal
Only the backend implementation could be done in this project. Here we get three information:
To have it fully integrated, this needs to be done: opengisch/QgisModelBaker#827
Relevance of topics
In the backend (QgisModelBakerLibrary) we detect the "relevance" of a topic. Means as long as it's not extended it is relevant, otherwise it's not (since it's extension is the relevant one). This is not used in frontend, but provides the possiblity for improvements (e.g. not creating irrelevant baskets.
Relevant topics in layer
This evaluates all the topics the layers are relevant. If it's not the topic the class is designed in (then this value would be empty), then it's a list of all the topics that are most extended (could be multiple).
Example Use Cases:
1. Ortsplanung
What is it about
More or less reallive example with 3 levels and multiple extensions. Level 2 extends level 1 and level 3 extends parts of level 2 and parts of level 1.
Ortsplanung_V1_1
using (not extending)Infrastruktur_V1
.Kantonale_Ortsplanung_V1_1
extendingOrtsplanung_V1_1
(TOPICKonstruktionen
).Gewerbe_V1
.Staedtisches_Gewerbe_V1
extendingGewerbe_V1
.Staedtische_Ortsplanung_V1_1
extendingKantonale_Otsplanung_V1_1
(TOPICKonstruktionen
) and usingStaedtisches_Gewerbe_V1
.Goals
This a creation in the 3 versions. The renaming of the layer has been done manually.
Gebaeude
(from base) should be hiddenGebaeude
(from base) /Gebaeude kantnl_ng...
/Firma
(from base) should be hidden2. Polymorphic
What is it about
Polymorphic_Ortsplanung_V1_1
extendingOrtsplanung_V1_1
(TOPICKonstruktionen
) multiple times.IndustrieGewerbe
) and extending classes for multiple purposes (in TOPICHallen
)Konstruktionen
with a classGebaeude
that stands independently and is not an extension of anything.Goals
(The renaming of the layer
Gebaeude
has been done manually)Freizeit.Gebaeude
andGewerbe.Gebaeude
etc. Means in this example above:Gebaeude
(from base) should be hidden or groupedGebaeude polymrpgn_v1_1gewerbe_gebaeude
orGebaeude polymrpgn_v1_1hallen_gebaeude
might be not used, but still we cannot hide it because we don't know. If it would be ABSTRACT, then it would be hidden already (not created by ili2db - likeTurnhalle
). We optimize per Model and not per Topic, so it stays.Gebauede
are ambiguous, so they should be renamed3. Associations and Structures
What is it about
Bauplanung_V1_1
using (not extending)Infrastruktur_V1
having STRUCTUREMaterial
and a many-to-many ASSOCIATION toStrassen
as well a TOPICNatur
with two associated classes.Kantonale_Bauplanung_V1_1
extendingBauplanung_V1_1
(STRUCTURE and adding attribute in Class, so there is a link on base structure and another to extended structure) and theNatur
TOPIC just to another attribute to the classes.Goal
Material
from base model is still needed, so it should not be hidden but renamed (not sure if possible and really nice practice like it's modelled)Strassen_Gebaeude
(from base model) should be hiddenPark
(from base model) should be hidden.Bruttstelle
(from base model) should be visible (since it's not extended)Buntbrache
(from base model) should be visible (since it's renamed)Feld
(from base model) should not be visible (since it's extended multiple times)Tierart
(from base model) be visible?Brutstelle
references to it in the base model, but since it's extended, I'm not sure if it should still reference to it but to it's extension...Further informations
SQL to achieve that
Examples:
1. Ortsplanung on level 3 (
Staedtische...
)Gebaeude
(from base) /Gebaeude kantnl_ng...
/Firma
(from base) should be hidden:In this case we could just hide all the ones listet in
baseClass
2. Polymorphic
Gebaeude polymrpgn_v1_1gewerbe_gebaeude
orGebaeude polymrpgn_v1_1hallen_gebaeude
might be not used, but still we cannot hide it because we don't know. If it would be ABSTRACT, then it would be hidden already (not created by ili2db - likeTurnhalle
). We optimize per Model and not per Topic, so it stays.In this case all the ones listed in
baseClass
(except the one being in the same model) could be hidden.3. Associations and Structures
Since
Material
andTierart
from the base model is still needed, so it should not be hidden but renamed (but this is the special case), so we want to hidePark
,Gebaude
,Tierart
,Material
and the assocStrassen_Gebaeude
from the base model.In this case all teh ones listed in
baseClass
being extended with the same classname could be hidden (Bauplanung_V1_1.Konstruktionen.Material, Bauplanung_V1_1.Konstruktionen.Gebaeude, Bauplanung_V1_1.Natur.Tierart, Bauplanung_V1_1.Natur.Park
) and "Bauplanung_V1_1.Natur.Feld" since it has multiple extensions with another name in another model.Special case
Material
from base model is still needed, so it should not be hidden but renamed - but here I am not sure if this is really bad practice to still use the baseClass but not having the extension renamed...Tierart
(from base model) be visible?Brutstelle
references to it in the base model, but since it's extended, it would be hidden. I'm not sure if it's correct. When I extend a class, should the other baseClasses reference to the extension instead?Extended approach (obsolete)
Obsolete but considering the special case
baseClass
int_ili2db_inheritance
(means there exists none extension of it)?t_ili2db_column_prop.tablename
(as a child) or int_ili2db_column_prop.settings
andt_ili2db_column_prop.tag
is 'ch.ehi.ili2db.foreignKey' and thet_ili2db_column_prop.setting
/t_ili2db_column_prop.tablename
contains a relevant table that is not extended?SQL to achieve that
Statement to check 3 and 4 of table
fauna
Old stuff (for archive)
Examples:
1. Ortsplanung on level 3 (
Staedtische...
)Gebaeude
(from base) /Gebaeude kantnl_ng...
/Firma
(from base) should be hidden:In this case we could just hide all the ones listet in
baseClass
2. Polymorphic
Gebaeude polymrpgn_v1_1gewerbe_gebaeude
orGebaeude polymrpgn_v1_1hallen_gebaeude
might be not used, but still we cannot hide it because we don't know. If it would be ABSTRACT, then it would be hidden already (not created by ili2db - likeTurnhalle
). We optimize per Model and not per Topic, so it stays.In this case all the ones listed in
baseClass
(except the one being in the same model) could be hidden.3. Associations and Structures
Since
Material
from base model is still needed, so it should not be hidden but renamedMeans we cannot hide all those from
baseClass
, when it's listed int_ili2db_column_prop.tablename
with an FK to a relevant table.Other models