Skip to content

WIP: optimize change list SPARQL query - #1954

Draft
osma wants to merge 1 commit into
mainfrom
feature-optimize-changelist-skosmos3
Draft

osma wants to merge 1 commit into
mainfrom
feature-optimize-changelist-skosmos3

Conversation

@osma

@osma osma commented Mar 18, 2026

Copy link
Copy Markdown
Member

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

It supersedes PR #1785 which was made for Skosmos 2. This is for Skosmos 3.

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.

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 3.x milestone Mar 18, 2026
@osma osma self-assigned this Mar 18, 2026
@osma
osma force-pushed the feature-optimize-changelist-skosmos3 branch from dc6032b to 7a4f130 Compare March 25, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant