Skip to content

Conversation

@osma
Copy link
Member

@osma osma commented Apr 17, 2025

This is work in progress. It's not yet functional.

Reasons for creating this PR

I'm trying to optimize the "New" / "New and Deprecated" tab that shows the recently added (or deprecated) concepts. It is very slow, especially in the case of a large vocabulary such as KANTO/finaf.

The optimized SPARQL query in this PR introduces a cutoff date, by default 1 year in the past. Only concepts whose timestamp (created or modified, depending on circumstances) is after this cutoff date are included in the query results. This drastically reduces the number of concepts to consider and so speeds up the query by a factor of approximately 10 (yso) to 15 (finaf).

Link to relevant issue(s), if any

n/a

Description of the changes in this PR

  • optimize the SPARQL query that queries the new and deprecated concepts, introducing a cutoff date
  • try to fix the unit tests that broke due to the above

Known problems or uncertainties in this PR

Unfortunately, this change causes problems for the unit tests. The test data is much older than 1 year, so a lot of tests will fail because the time stamps are older than the default cutoff date. I tried to fix this by making the cutoff date into a parameter, but this makes the code more complicated, and I didn't yet get it working. I wonder if another mechanism - for example a configuration setting that sets the cutoff date - would work better for this.

This PR is against skosmos-2, because the functionality would be useful in current (Skosmos 2.x) based Finto. However, the same change should be made to Skosmos 3 (main) as well.

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)

@osma osma added this to the 2.x milestone Apr 17, 2025
@osma osma self-assigned this Apr 17, 2025
@sonarqubecloud
Copy link

@osma osma added the Skosmos 2.X Relevant for Skosmos 2 label Apr 17, 2025
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

Development

Successfully merging this pull request may close these issues.

1 participant