add support for showDeprecated parameter in hierarchy queries; touche…
…s #1143
This draft PR brings support for showDeprecated parameter in multiple hierarchy-related queries. However, implementing this has proven to be a bit difficult and this PR is not yet ready. There seems to be quite a bit of different cases involved and,, thus, open, questions, e.g.,
-
Deprecated concept (attached to hierarchy) is opened, what to do with hierarchy? E.g., https://finto.fi/juho/fi/page/p4304 -- Show it normally -- Show the hierarchy 'till the opened deprecated concept (this is what this draft PR is doing) -- Only show the deprecated concept (and maybe it's non-deprecated children?) -- Previous one combined with "base" hierarchy -- Something else, what?
-
If a concept lies below a deprecated one, what to do with hierarchy? E.g., https://finto.fi/juho/fi/page/p5875 -- Show the whole tree without deprecated ones ("jumping" over deprecated ones) -- Only show the hierarchy 'till there is non-deprecated concepts (current implementation, additionally, breadcrumbs halt at the very same non-deprecated concept) -- Somethings else, what?
-
Deprecated sub-tree -- Show that part, if one of those is chosen?
Requires tests for each of the ones above, both live and PHPUnit. One must pay attention that changing some functions here may affect the input of other queries, too (e.g., queryTransitiveProperty).
Other questions:
- Configurable via REST?
- Utilization of dct:isReplacedBy - direct replacement?
Additional note: after playing a bit back and forth, it seems like it could be possible to just return the states of concepts (whether a concept is deprecated or not) and from there, adjust the hierarchy in either JavaScript or in the transform* function. This would simplify the required code quite a bit compared to what it would have to be - e.g., the deprecatedClauses in files changed may not be complete in many cases. E.g., skipping deprecated broader concepts in hierarchy in cases of non-deprecated subconcepts is not a very easy feat to do directly in SPARQL.
SonarCloud Quality Gate failed.
1 Bug
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication