Repository navigation
feat(yasqe): suggest classes and properties used in the endpoint - #235
Merged
Merged
Conversation
Class and property autocompletion lists the terms the endpoint of the tab uses, most used first with their usage count, before the Linked Open Vocabularies suggestions. MatGUI takes them from the Endpoint overview (VoID partitions, complete Classes/Properties results, or one limited background query cached per endpoint) and inserts prefixed names with the missing PREFIX. The suggestions can be switched off per endpoint in the overview. Closes #195
MathiasVDA
marked this pull request as ready for review
October 19, 2026 16:50
…complete-tnuvox # Conflicts: # docs/user-guide.md # packages/yasgui/src/Tab.ts # packages/yasqe/src/defaults.ts
LOV moved its API from /dataset/lov/api/v2/autocomplete/terms (now 404) to /dataset/api/v2/term/autocomplete and /dataset/api/v2/term/search. IRIs and prefixed names use autocomplete, plain words the full text search. The uri of a result may be a string or a one-item list.
The LOV API is broken (404 on the old path, a search backend error on the new one). Class and property suggestions now search a bundled list of the classes and properties of the most used LOV vocabularies, generated from the LOV N-Quads dump by fetchLovData.js (npm run util:fetchLov) and refreshed monthly by a workflow that opens a pull request. LOV terms are inserted as prefixed names with their PREFIX. The lovTerms option replaces the list or, set to null, leaves out LOV suggestions.
The LOV dump has no graph for the ERA ontology (http://data.europa.eu/949/), so fetchLovData.js now reads its classes and properties from the ontology on GitLab. Namespaces in ALWAYS_INCLUDED are bundled first, regardless of their popularity and the size budget.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Mathias · project thread
Closes #195
Before: class and property autocompletion only asked Linked Open Vocabularies, so railML 3, the ERA ontology or in-house vocabularies got no suggestions, and
Ctrl+Spaceafter?x ashowed nothing.After: the hint list first shows Used in this endpoint, the classes/properties the tab's endpoint uses, most used first with their count, then Linked Open Vocabularies (duplicates dropped). Without input the endpoint's top terms are listed; a plain word matches anywhere in the local name. Picking one inserts
era:OperationalPointand addsPREFIX era: <…>when it is missing, like clicking an IRI in the Endpoint overview. A checkbox at the top of the Endpoint overview switches this off per endpoint.How: the Endpoint overview provides the terms (
getAutocompleteTerms): VoID class/property partitions, the overview's Classes/Properties results when they are complete, otherwise one background query for the 200 most used terms (tab auth, shared concurrency limit, cached per endpoint like other overview results, not retried for an hour after a failure). Autocompletion waits at most 3 s for it. Yasqe gets anendpointTermsconfig option, and hints can carry adetail(count), asectionandprefixesto declare in the same transaction (so the prefix.cc auto-prefixer doesn't add its own).endpointDescribe.autocomplete: falseturns it off for an embedding page.One deliberate choice: when the overview's Classes/Properties result only holds its first page (25 rows, "Load more" available), the 200-row background query still runs, otherwise suggestions would stop at 25 terms.
Tests: new puppeteer tests in
test/run.ts(mocked terms + mocked LOV) andtest/endpoint-describe-browser.ts(mocked endpoint, per-endpoint switch), unit tests for the term collection and the store. The full puppeteer suite passes locally (52);util:validateTsonly shows its two existing errors; eslint/prettier are clean on the changed files.Generated by Claude Code