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

Show only mainConceptScheme in hierarchy #1540

Open
wants to merge 1 commit into
base: skosmos-2
Choose a base branch
from

Conversation

osma
Copy link
Member

@osma osma commented Oct 31, 2023

Reasons for creating this PR

Attempt to fix #1396 i.e. make it possible to limit the hierarchy display to a single ConceptScheme by setting skosmos:mainConceptScheme in the vocabulary configuration.

I tried loading the INRAE Thesaurus (version without dc:subject triples for microthesauri from @saubin78's comment #1396 (comment)) into a local Fuseki and configured it like this in config.ttl:

:inrae a skosmos:Vocabulary, void:Dataset ;
    skosmos:shortName "INRAE" ;
    dc:title "INRAE Thesaurus"@fi ;
    dc:subject :cat_general ;
    void:uriSpace "http://opendata.inrae.fr/thesaurusINRAE/";
    skosmos:language "en", "fr";
    skosmos:defaultLanguage "fr";
    skosmos:showTopConcepts true ;
    skosmos:mainConceptScheme <http://opendata.inrae.fr/thesaurusINRAE/thesaurusINRAE> ;
    void:sparqlEndpoint <http://localhost:3030/ds/sparql> ;
    skosmos:sparqlGraph <http://opendata.inrae.fr/thesaurusINRAE/> ;
    skosmos:sparqlDialect "Generic" .

This is how the hierarchy looks like when I go to http://localhost/Skosmos2/inrae/en/?clang=fr and open the Hierarchy tab:

image

I must say I'm a little confused by the structure in the INRAE Thesaurus. It seems to me that you have two kinds of top concepts under the main concept scheme ("INRAE Thesaurus"): the numbered ones that seem to be topical divisions (e.g. "01. ENVIRONNEMENT") as well as what look like regular concepts intended for subject indexing (e.g. "abattage de bétail"). So Skosmos will display them both. Is this what you intended @dipso-num4sci @saubin78?

Link to relevant issue(s), if any

Description of the changes in this PR

  • make the REST API vocabulary URL return the value of the skosmos:mainConceptScheme setting
  • in the frontend JS code for the hierarchy display, check if mainConceptScheme is set, and if it is, display only the top concepts of that ConceptScheme at the top level of the hierarchy, instead of showing all concept schemes

Known problems or uncertainties in this PR

Not sure that I handled all cases. For instance, is the hierarchy correct when opening a concept page directly via URL?

This may affect other vocabularies with more than one ConceptScheme. For example IPTC and all the YSO based domain ontologies in Finto. Careful testing has to be done before merging so that we don't break existing usage of these.

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@sonarcloud
Copy link

sonarcloud bot commented Oct 31, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability E 1 Vulnerability
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@osma osma changed the title show only mainConceptScheme in hierarchy Show only mainConceptScheme in hierarchy Oct 31, 2023
@codecov
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (a1cd362) 70.33% compared to head (51eb5c0) 70.25%.

Files Patch % Lines
controller/RestController.php 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1540      +/-   ##
============================================
- Coverage     70.33%   70.25%   -0.09%     
  Complexity     1669     1669              
============================================
  Files            32       32              
  Lines          4305     4310       +5     
============================================
  Hits           3028     3028              
- Misses         1277     1282       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@saubin78
Copy link

saubin78 commented Nov 9, 2023

Hi Osma. Thanks a lot for considering our need.
What we want is to display the hierarchy for the main ConceptScheme only, i.e. "INRAE Thesaurus".
Let me provide you a more recent version of the data which includes clues to better see what is displayed in the hierarchy :
thesaurusINRAE_skos_2023_restruc_rename.zip
The first level should look like this:
image
The topConcept of the other conceptSchemes (=micorthesauri) are not diplayed
When opened, the hierarchy should look like that:
image

@osma osma added the Skosmos 2.X Relevant for Skosmos 2 label Dec 5, 2023
@osma osma modified the milestones: 2.17, Next Tasks Dec 5, 2023
@osma osma force-pushed the issue1396-hierarchy-mainConceptScheme branch from d1c848f to 51eb5c0 Compare December 5, 2023 13:44
Copy link

sonarcloud bot commented Dec 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@osma
Copy link
Member Author

osma commented Dec 5, 2023

I rebased the issue1396-hierarchy-mainConceptScheme to current master so it now includes all the fixes and changes that went into the Skosmos 2.17 release.

I also tested this with the new data from #1540 (comment) .
In the configuration, I set it up like this:

 skosmos:mainConceptScheme <http://opendata.inrae.fr/thesaurusINRAE/thesaurusINRAE>;

This is how the top-level hierarchy looks now:

image

If I open ENVIRONMENT and then water management, I get this:

image

Apart from minor styling (colors etc.) this matches pretty much exactly what @saubin78 requested.

However, if I open a specific concept such as "water management", the hierarchy doesn't open at the correct point as it should. Also the "INRAE Thesaurus" is now again appearing at the bottom, after all domains:

image

But at least this is getting closer, right?

Regarding further development: We just released Skosmos 2.17, most likely the last release in the Skosmos 2 series; thus, it is unlikely that this pull request will be merged and included in a release. Even if this PR might fix things in your case, I believe it may have side effects on other vocabularies.

We are now focusing on Skosmos 3 development. You can of course keep running Skosmos 2 as long as you want, and you can use the code on this branch if that's helpful.

More generally, I think we need better specifications for how the hierarchy should look like in Skosmos 3 and how it should behave in different scenarios. I will open a new issue for specifying complex behaviours and configuration of the hierarchy. INRAE Thesaurus is certainly a complicated case and should be considered as an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Skosmos 2.X Relevant for Skosmos 2
Projects
Status: Not selected
Development

Successfully merging this pull request may close these issues.

How indicate the main thesaurus to be displayed in the hierarchical view ?
2 participants