Duplication in hierarchical dimensions
Concerns test.visualize.admin.ch, with data source INT. For reproduction, look at cube with identifier Jstat_fullHierarchy_C-94 (name is "NFI: All target values by ownership" from the 06.04.2023.
After some internal feedback, we decided to try to add the grandchildren directly to the root. I.e. we have four hierarchies on the dimension nfi:unitOfReference with Root https://ld.admin.ch/country/CHE:
- CH - Cantons
- CH - Production Regions - Economic Regions
- CH - Protection Forest Regions - Economic Regions
- CH - Economics Regions this one is new
They all use the path schema:containsPlace and a sh:targetClass appropriate for the corresponding hierarchical branch.
In the drop-down menu, children and grandchildren of the hierarchy are displayed:

I don't think this is a data issue, as this should demonstrate.
👀 looking at the data published by @kronmar this seems really odd parsing in a very non-conformant way according to the cube spec. (i.e. including some non targetClasses)
potentially related to inference i.e. due to parsing other cubes shapes?
Hi @kronmar, it seems that the duplication of values is present in the data itself, is this correct? For example, when inspecting the result of querying the economics regions hierarchy (Production region - Economic Region), it seems that e.g. Western Jura (https://ld.admin.ch/dimension/bgdi/biota/economicregions/1) is both a child of Jura and a sibling to Jura.
In such case, we don't do any modifications to the data, but show it as it is. I think this might be a valid case (as some values can be shared across different hierarchies), but in the end, when showing charts, we refer to a value of the dimension assigned to some observation – and as the duplicated values share the same iri, chart filtering works as expected.
Could you confirm that this is how it's defined in the data? If so, I believe we handle this case correctly, as otherwise we would need to have some additional logic on how to hide duplicated values 👀
Yes, you are correct. The https://ld.admin.ch/dimension/bgdi/biota/economicregions/xx are indeed both children and siblings to the https://ld.admin.ch/dimension/bgdi/biota/productionregions/xx.
~~Another find that might be unrelated is this:~~
~~You can find it here. You'll see that the root is mentioned four times (number of branches in the hierarchy?). Again, not really sure if this is related or not. If you wish, I'll open a separate issue.~~ Edit: that was unrelated and was an issue on my end!