Skip to content

feat(yasqe): suggest classes and properties used in the endpoint - #235

Merged
MathiasVDA merged 10 commits into
mainfrom
claude/issue-195-autocomplete-tnuvox
Oct 19, 2026
Merged

MathiasVDA merged 10 commits into
mainfrom
claude/issue-195-autocomplete-tnuvox

Conversation

@MathiasVDA

Copy link
Copy Markdown
Collaborator

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+Space after ?x a showed 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:OperationalPoint and adds PREFIX 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 an endpointTerms config option, and hints can carry a detail (count), a section and prefixes to declare in the same transaction (so the prefix.cc auto-prefixer doesn't add its own). endpointDescribe.autocomplete: false turns 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) and test/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:validateTs only shows its two existing errors; eslint/prettier are clean on the changed files.


Generated by Claude Code

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 MathiasVDA self-assigned this Oct 19, 2026
@MathiasVDA
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.
@MathiasVDA
MathiasVDA merged commit 0cf1f51 into main Oct 19, 2026
2 checks passed
@MathiasVDA
MathiasVDA deleted the claude/issue-195-autocomplete-tnuvox branch October 19, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autocomplete classes and properties from the current endpoint

1 participant