Skip to content

Commit 2802961

Browse files
Refactor code
1 parent ee9baa9 commit 2802961

8 files changed

Lines changed: 601 additions & 288 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,3 @@ jobs:
4343

4444
- name: Check abstract HTML contract pilot
4545
run: python src/main/abstract/validate_abstract_html.py Q315/Q3062/index.html
46-
47-
- name: Check Q3062 Wikibase rendering is current
48-
run: python src/main/abstract/render_q3062_hero.py --check
49-
50-
- name: Check travel content QuickStatements are complete
51-
run: python src/main/abstract/prepare_travel_content.py --check
52-
53-
- name: Check Q315 travel content bindings are current
54-
run: python src/main/abstract/bind_travel_manifest.py --check

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ __pycache__/
99
.venv/
1010
test.py
1111

12+
# Q315 abstract workflow generated artifacts
13+
src/main/abstract/pilots/
14+
src/main/abstract/snapshots/
15+
src/main/abstract/travel-content*.csv
16+
src/main/abstract/travel-content*.quickstatements
17+
1218
.vscode
1319
.obsidian
1420

src/main/abstract/DEVELOPMENT.md

Lines changed: 13 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -80,64 +80,16 @@ The pilot should include:
8080
- navigation and language alternates;
8181
- one shared collection stylesheet.
8282

83-
The content portion begins with the hero description in
84-
`Q315/Q3062/index.html`. Its three sentences have pilot translations in all
85-
eight current languages. The Malayalam, Punjabi, Hindi, and European Portuguese
86-
values were added to the pilot explicitly rather than treating missing content
87-
or copied English as translations.
88-
89-
Prepare the five required Wikibase items—one function, one composed paragraph,
90-
and three sentences—with:
91-
92-
```bash
93-
python src/main/abstract/prepare_q3062_hero.py prepare
94-
```
95-
96-
After importing the generated QuickStatements, enter the returned local QIDs
97-
in `pilots/Q3062-hero-bindings.csv`. Create the three properties listed in
98-
`QUERYING.md` with their declared datatypes, enter their property IDs, and run:
99-
100-
```bash
101-
python src/main/abstract/prepare_q3062_hero.py check-bindings
102-
python src/main/abstract/prepare_q3062_hero.py write-structure
103-
```
104-
105-
Import the generated structural QuickStatements. Only then should the visible
106-
pilot paragraph be replaced by its `<q-call>`.
107-
This gate prevents bootstrap tokens or guessed QIDs from entering canonical
108-
Q315 HTML.
109-
110-
Once the binding check passes and all eight language values are present in the
111-
pilot data, apply the guarded replacement:
112-
113-
```bash
114-
python src/main/abstract/prepare_q3062_hero.py bind
115-
```
116-
117-
`bind` refuses to modify Q315 if a QID is absent, reused, malformed, or if any
118-
sentence translation is missing. It is also safe to run again after binding.
119-
120-
## Rendering from Wikibase
121-
122-
The Q3062 pilot uses a committed, deterministic snapshot rather than contacting
123-
the live Wikibase during every site build:
124-
125-
```bash
126-
# Explicitly refresh after reviewed Wikibase changes.
127-
python src/main/abstract/wikibase_snapshot.py
128-
129-
# Render the eight concrete pages.
130-
python src/main/abstract/render_q3062_hero.py
131-
132-
# CI/no-write mode.
133-
python src/main/abstract/render_q3062_hero.py --check
134-
```
83+
The first Q3062 hero experiment produced local pilot files and snapshots while
84+
the abstract model was being explored. Those generated files are intentionally
85+
not committed. The durable parts are the Q315 HTML contract, the function
86+
registry, the offline Wikibase resolver, and the collection-wide travel
87+
inventory/binding tools.
13588

13689
The resolver reads the constructor from `P41`, finds sentence membership via
13790
`P21`, orders statements by the `P42` qualifier, and selects the requested
13891
language from `P40`. Function implementation bindings are explicit in
139-
`function-implementations.json`. Concrete HTML records Q3838 and Q3837 as
140-
provenance and is never used as the rendering source.
92+
`function-implementations.json`.
14193

14294
## Initial implementation order
14395

@@ -147,7 +99,7 @@ provenance and is never used as the rendering source.
14799
4. Implement typed values and the function registry.
148100
5. Implement label resolution and `concatenate`.
149101
6. Extract the travel style block into canonical CSS.
150-
7. render the four pilot pages into all eight languages;
102+
7. render abstract pages into all eight languages from offline snapshots;
151103
8. compare structure, links, accessibility, and screenshots;
152104
9. add deterministic regeneration to CI.
153105

@@ -205,11 +157,12 @@ sibling `Q42761025` repository:
205157
python src/main/abstract/prepare_travel_content.py
206158
```
207159

208-
This produces unmatched item proposals in
209-
`travel-content.quickstatements`, semantic occurrences in
210-
`travel-content-manifest.csv`, and absent or likely copied translations in
211-
`travel-content-missing.csv`. Regenerate after every offline label export and
212-
before importing a batch, so existing items are never proposed twice.
160+
This produces generated working files such as `travel-content.quickstatements`,
161+
`travel-content-manifest.csv`, `travel-content-pending-manifest.csv`, and
162+
`travel-content-missing.csv`. They depend on the current offline export in
163+
`../Q42761025/data/`, so they are ignored by Git. Regenerate after every offline
164+
label export and before importing a batch, so existing items are never proposed
165+
twice.
213166

214167
Every generated content item carries `P40` (`monolingual content`) values for
215168
all eight working languages. Short content is also used as complete multilingual

src/main/abstract/QUERYING.md

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ Existing local properties are reused:
1616
- `P8`: instance of;
1717
- `P21`: part of.
1818

19-
Three properties must be created once in the local Wikibase and entered in
20-
`pilots/Q3062-hero-bindings.csv`:
19+
Three properties must exist once in the local Wikibase:
2120

2221
| Binding token | Datatype | Purpose |
2322
| --- | --- | --- |
@@ -27,20 +26,9 @@ Three properties must be created once in the local Wikibase and entered in
2726

2827
Property IDs are not guessed because an incorrect datatype cannot be repaired
2928
by changing a QuickStatement. The three class items—abstract function,
30-
abstract paragraph, and abstract sentence—are created by the initial pilot
31-
QuickStatements.
32-
33-
After importing those items and creating the properties:
34-
35-
```bash
36-
python src/main/abstract/prepare_q3062_hero.py prepare
37-
# Fill Q3062-hero-bindings.csv with returned QIDs and property IDs.
38-
python src/main/abstract/prepare_q3062_hero.py check-bindings
39-
python src/main/abstract/prepare_q3062_hero.py write-structure
40-
```
41-
42-
Import `Q3062-hero-structure.quickstatements` to add types, membership,
43-
constructor, ordered composition, and monolingual values.
29+
abstract paragraph, and abstract sentence—are bootstrap concepts in the local
30+
Wikibase. Local pilot QuickStatements and snapshots generated during
31+
experimentation are working artifacts, not repository sources of truth.
4432

4533
## Example SPARQL shapes
4634

0 commit comments

Comments
 (0)