Surface data access in the UI: Data tab export links and RDF autodiscovery#1097
Merged
JeroenDeDauw merged 2 commits intoJul 19, 2026
Merged
Conversation
…overy Fixes #1095 Stacked on #1090, whose per-subject RDF endpoint these menus link to; based on feature/subject-rdf-export so the diff is only this work. GitHub retargets to master once #1090 merges. The REST API served a page's RDF, its Subjects as JSON, a Subject as JSON, and (via #1090) a Subject's RDF, in native or ontology-mapped projections — none of it reachable from the UI. This adds three things: - A per-subject export menu in each expanded Data tab row, beside the ID: JSON, then Turtle and TriG for each readable projection. - A page-level export menu in the Data tab header: page-subjects JSON, then per-projection Turtle/TriG of the page RDF. The two menus share one labelling scheme so they read as one system. - `<link rel="alternate">` autodiscovery tags (Turtle + TriG, native projection) in the head of pages that carry NeoWiki data. The menus are driven by the projections the viewing user may read. SubjectsAction exposes that list as the `wgNeoWikiRdfProjections` JS config var, filtered server-side by filterReadableProjectionNames() so a restricted Mapping page title never reaches a reader who cannot see it. A later per-wiki choice to hide a projection then becomes a server-side filter with no UI change. Menu item URLs carry explicit `format=` parameters and percent-encode the projection name; each opens in a new tab so the Data tab state is not lost (Codex 1.14 menu-item anchors cannot set a target, so navigation happens on selection). Autodiscovery links are emitted only when the page has Subjects, so the advertised endpoint never 404s. Tests: Vitest covers the URL/label derivation (ordering, native-vs-mapping labels, projection encoding). PHP integration covers the config var and its permission filtering, and the head tags being present on a page with Subjects and absent on one without. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The head-tag test matched only the path substring, so a regression dropping the PROTO_CANONICAL expansion to a relative href would have shipped silently. Assert the hrefs are absolute so the canonical-URL behavior is locked. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
JeroenDeDauw
marked this pull request as ready for review
July 19, 2026 22:31
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.
Fixes #1095
Stacked on #1090, whose per-subject RDF endpoint these menus link to; based on
feature/subject-rdf-exportso the diff is only this work. GitHub retargets tomaster once #1090 merges.
The REST API served a page's RDF, its Subjects as JSON, a Subject as JSON, and
(via #1090) a Subject's RDF, in native or ontology-mapped projections — none of
it reachable from the UI. This adds three things:
then Turtle and TriG for each readable projection.
per-projection Turtle/TriG of the page RDF. The two menus share one labelling
scheme so they read as one system.
<link rel="alternate">autodiscovery tags (Turtle + TriG, native projection)in the head of pages that carry NeoWiki data.
The menus are driven by the projections the viewing user may read.
SubjectsActionexposes that list as the
wgNeoWikiRdfProjectionsJS config var, filteredserver-side by
filterReadableProjectionNames()so a restricted Mapping page titlenever reaches a reader who cannot see it. A later per-wiki choice to hide a
projection then becomes a server-side filter with no UI change.
Menu item URLs carry explicit
format=parameters and percent-encode the projectionname; each opens in a new tab so the Data tab state is not lost (Codex 1.14 menu-item
anchors cannot set a target, so navigation happens on selection). Autodiscovery links
are emitted only when the page has Subjects, so the advertised endpoint never 404s.
Tests: Vitest covers the URL/label derivation (ordering, native-vs-mapping labels,
projection encoding). PHP integration covers the config var and its permission
filtering, and the head tags being present on a page with Subjects and absent on one
without.
UI check: the Data tab (
?action=subjects) of a page with subjects and an ontologymapping — e.g. the demo Pablo Picasso page. Expand a subject row for the per-row
Export menu; use the header Export for the whole page.