# Show Your Working: the worked examples

Thirty worked examples from the Semantechs articles on knowledge graphs: the
invented glen and its estate, the real Dingle and its visitors, and the data,
queries, shapes and rules behind each illustration. Every example opens in the
**[Turtle Editor Viewer](https://semantechs.co.uk/turtle-editor-viewer/)** with
one link, and every one has been run with the engines the editor uses and its
result checked against what its header says.

They are laid out like the
[SPARQL course](https://www.semantechs.co.uk/SPARQL_Course/) and the
[SHACL course](https://www.semantechs.co.uk/SHACL_Course/), and numbered the same
way: those courses number their lessons q01 and s01; these are W01 to W30.

## Using them

1. Press **open** in the table below. The editor opens with the example's data
   loaded and, for shapes and rules, the shapes file in a second tab, already
   chosen for validation, with the Inference dropdown set where the example needs
   it.
2. **Shapes and rules:** press **Validate**. The report should match the
   example's REPORTS line.
3. **Queries:** open the `.rq` file, paste it into the SPARQL panel and press
   **Execute**. The table should match the example's RETURNS line.
4. Then do what the example's **TRY IT** says: change one thing and run it again.
   Each TRY IT has been checked too.

Each file starts with a header: what the example asks, checks or derives, how
it works, a diagram, what to take away, the TRY IT, the data it needs, the link,
the specification it uses, and the result it should give.

## From the command line

The same engines run in Node: [HOLOS](https://github.com/pwin/triplestore)
(`holos-wasm-node`) for queries and the
[SHACL engine](https://github.com/pwin/SHACL_Engine) (`shacl-wasm-node`) for
shapes and rules, the builds the editor runs.

```
cd scripts
npm install
node check.mjs           # every example and every TRY IT, against its header
node check.mjs w05       # one example, with its rows or results printed
```

## The examples

### Joining the Dots

[Joining the Dots](https://www.semantechs.co.uk/articles/joining-the-dots/), 4 November 2026. Data: [`investigation.ttl`](01-joining-the-dots/investigation.ttl). Invented for this collection from the article's three sentences.

| | Example | Kind | Result | |
|---|---|---|---|---|
| W01 | [A director, a company in Cyprus, a flat in London and a minister](01-joining-the-dots/w01-the-question.rq) | query | 1 row | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F01-joining-the-dots%2Finvestigation.ttl) |
| W02 | [Checking the goods coming in](01-joining-the-dots/w02-checking-the-goods-coming-in.ttl) | shapes | 3 violations | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F01-joining-the-dots%2Finvestigation.ttl&shapes=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F01-joining-the-dots%2Fw02-checking-the-goods-coming-in.ttl) |
| W03 | [Control through any number of shell companies](01-joining-the-dots/w03-control-through-the-shells.ttl) | rules, to a fixpoint | 3 warnings, 6 inferences | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F01-joining-the-dots%2Finvestigation.ttl&shapes=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F01-joining-the-dots%2Fw03-control-through-the-shells.ttl&inference=rules-iterated) |
| W04 | [The recall question](01-joining-the-dots/w04-the-recall-question.rq) | query | 5 rows | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F01-joining-the-dots%2Finvestigation.ttl) |

### Who Owns the Glen?

[Who Owns the Glen?](https://www.semantechs.co.uk/articles/who-owns-the-glen/), 8 November 2026. Data: [`glen-titles.ttl`](02-who-owns-the-glen/glen-titles.ttl). Invented for this collection from the article's four sentences.

| | Example | Kind | Result | |
|---|---|---|---|---|
| W05 | [Holdings in scope: a question with a map attached](02-who-owns-the-glen/w05-holdings-in-scope.rq) | query | 1 row | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F02-who-owns-the-glen%2Fglen-titles.ttl) |
| W06 | [Inspecting the records](02-who-owns-the-glen/w06-inspecting-the-records.ttl) | shapes | 3 violations, 1 warning | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F02-who-owns-the-glen%2Fglen-titles.ttl&shapes=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F02-who-owns-the-glen%2Fw06-inspecting-the-records.ttl) |
| W07 | [Who stands behind a piece of ground](02-who-owns-the-glen/w07-who-stands-behind-the-ground.ttl) | rules, to a fixpoint | 6 inferences | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F02-who-owns-the-glen%2Fglen-titles.ttl&shapes=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F02-who-owns-the-glen%2Fw07-who-stands-behind-the-ground.ttl&inference=rules-iterated) |

### Field to Fork and Back Again

[Field to Fork and Back Again](https://www.semantechs.co.uk/articles/field-to-fork/), 10 November 2026. Data: [`porridge.ttl`](03-field-to-fork/porridge.ttl). Invented for this collection from the article's oats and milk.

| | Example | Kind | Result | |
|---|---|---|---|---|
| W08 | [Everything from the catchment](03-field-to-fork/w08-everything-from-the-catchment.rq) | query | 2 rows | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F03-field-to-fork%2Fporridge.ttl) |
| W09 | [Checking the goods coming in, and the open world](03-field-to-fork/w09-checking-the-goods-coming-in.ttl) | shapes | 3 violations | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F03-field-to-fork%2Fporridge.ttl&shapes=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F03-field-to-fork%2Fw09-checking-the-goods-coming-in.ttl) |
| W10 | [Which farm did this cheese come from?](03-field-to-fork/w10-which-farm-did-this-come-from.rq) | query | 5 rows | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F03-field-to-fork%2Fporridge.ttl) |
| W11 | [A rule anyone can argue with](03-field-to-fork/w11-a-rule-anyone-can-argue-with.ttl) | rules, one pass | 2 inferences | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F03-field-to-fork%2Fporridge.ttl&shapes=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F03-field-to-fork%2Fw11-a-rule-anyone-can-argue-with.ttl&inference=rules) |

### The Wood and the Trees

[The Wood and the Trees](https://www.semantechs.co.uk/articles/the-wood-and-the-trees/), 11 November 2026. Data: [`glenmeadhanach-forest.ttl`](04-the-wood-and-the-trees/glenmeadhanach-forest.ttl). The article's own example.

| | Example | Kind | Result | |
|---|---|---|---|---|
| W12 | [Certification as shapes](04-the-wood-and-the-trees/w12-certification-as-shapes.ttl) | shapes | 2 violations | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F04-the-wood-and-the-trees%2Fglenmeadhanach-forest.ttl&shapes=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F04-the-wood-and-the-trees%2Fw12-certification-as-shapes.ttl) |

### Down the Line

[Down the Line](https://www.semantechs.co.uk/articles/down-the-line/), 12 November 2026. Data: [`glen-line.ttl`](05-down-the-line/glen-line.ttl), [`connection-applications.ttl`](05-down-the-line/connection-applications.ttl). The article's own examples.

| | Example | Kind | Result | |
|---|---|---|---|---|
| W13 | [Homes within 500 metres of a new line](05-down-the-line/w13-homes-within-500-metres.rq) | query | 2 rows | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F05-down-the-line%2Fglen-line.ttl) |
| W14 | [Gate 2: secured land rights](05-down-the-line/w14-gate-2-land-rights.ttl) | shapes | 1 violation | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F05-down-the-line%2Fconnection-applications.ttl&shapes=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F05-down-the-line%2Fw14-gate-2-land-rights.ttl) |

### Across the Water

[Across the Water](https://www.semantechs.co.uk/articles/across-the-water/), 12 November 2026. Data: [`journey.ttl`](06-across-the-water/journey.ttl). The article's own example.

| | Example | Kind | Result | |
|---|---|---|---|---|
| W15 | [Connections as shapes](06-across-the-water/w15-connections-as-shapes.ttl) | shapes | 2 violations | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F06-across-the-water%2Fjourney.ttl&shapes=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F06-across-the-water%2Fw15-connections-as-shapes.ttl) |
| W16 | [Names along the way](06-across-the-water/w16-names-along-the-way.rq) | query | 9 rows | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F06-across-the-water%2Fjourney.ttl) |

### Off the Beaten Track

[Off the Beaten Track](https://www.semantechs.co.uk/articles/off-the-beaten-track/), 13 November 2026. Data: [`dingle-visit.ttl`](07-off-the-beaten-track/dingle-visit.ttl). The article's two example files in one; nine real listings from Fáilte Ireland's open data.

| | Example | Kind | Result | |
|---|---|---|---|---|
| W17 | [Seasons and limits as shapes](07-off-the-beaten-track/w17-seasons-and-limits.ttl) | shapes | 14 violations | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F07-off-the-beaten-track%2Fdingle-visit.ttl&shapes=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F07-off-the-beaten-track%2Fw17-seasons-and-limits.ttl) |
| W18 | [Open on the day](07-off-the-beaten-track/w18-open-on-the-day.rq) | query | 9 rows | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F07-off-the-beaten-track%2Fdingle-visit.ttl) |

### Ebb and Flow

[Ebb and Flow](https://www.semantechs.co.uk/articles/ebb-and-flow/), 14 November 2026. Data: [`dingle-year.ttl`](08-ebb-and-flow/dingle-year.ttl). The article's five example files in one; real figures from the EEA, Eurostat and gist's reference data.

| | Example | Kind | Result | |
|---|---|---|---|---|
| W19 | [Peaks as shapes](08-ebb-and-flow/w19-peaks-as-shapes.ttl) | shapes | 8 violations, 2 warnings | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F08-ebb-and-flow%2Fdingle-year.ttl&shapes=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F08-ebb-and-flow%2Fw19-peaks-as-shapes.ttl) |
| W20 | [The peak, and the peak spread out](08-ebb-and-flow/w20-peak-and-spread.rq) | query | 12 rows | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F08-ebb-and-flow%2Fdingle-year.ttl) |
| W21 | [Flows that are out of step](08-ebb-and-flow/w21-complementary-flows.rq) | query | 1 row | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F08-ebb-and-flow%2Fdingle-year.ttl) |
| W22 | [In other units](08-ebb-and-flow/w22-in-other-units.rq) | query | 12 rows | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F08-ebb-and-flow%2Fdingle-year.ttl) |

### Chapter and Verse

[Chapter and Verse](https://www.semantechs.co.uk/articles/chapter-and-verse/), 17 November 2026. Data: [`family.ttl`](09-chapter-and-verse/family.ttl), [`inquiry.ttl`](09-chapter-and-verse/inquiry.ttl). The article's own examples, in RDF 1.2.

| | Example | Kind | Result | |
|---|---|---|---|---|
| W23 | [The citation rule as a shape](09-chapter-and-verse/w23-family-shapes.ttl) | shapes | conforms | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F09-chapter-and-verse%2Ffamily.ttl&shapes=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F09-chapter-and-verse%2Fw23-family-shapes.ttl) |
| W24 | [Where the sources disagree](09-chapter-and-verse/w24-competing-claims.rq) | query | 2 rows | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F09-chapter-and-verse%2Ffamily.ttl) |
| W25 | [The recall question, for a family tree](09-chapter-and-verse/w25-recall.rq) | query | 2 rows | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F09-chapter-and-verse%2Ffamily.ttl) |
| W26 | [Stance, standing and a protected witness](09-chapter-and-verse/w26-inquiry-shapes.ttl) | shapes | conforms | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F09-chapter-and-verse%2Finquiry.ttl&shapes=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F09-chapter-and-verse%2Fw26-inquiry-shapes.ttl) |
| W27 | [Who knew what, and when](09-chapter-and-verse/w27-who-knew-when.rq) | query | 5 rows | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F09-chapter-and-verse%2Finquiry.ttl) |
| W28 | [What had been said by a given day](09-chapter-and-verse/w28-as-of.rq) | query | 2 rows | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F09-chapter-and-verse%2Finquiry.ttl) |
| W29 | [Contradictions, both sides kept](09-chapter-and-verse/w29-contradictions.rq) | query | 1 row | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F09-chapter-and-verse%2Finquiry.ttl) |
| W30 | [Open questions](09-chapter-and-verse/w30-open-questions.rq) | query | 1 row | [open](https://semantechs.co.uk/turtle-editor-viewer/?dot=https%3A%2F%2Fwww.semantechs.co.uk%2Farticles%2Fshow-your-working%2Fdemos%2F09-chapter-and-verse%2Finquiry.ttl) |

## Notes on the engines

- **Versions.** The examples need HOLOS 0.26.3 and the SHACL engine 0.3.7 or
  later, the versions the editor runs. Before those, a comparison between two
  `xsd:date` values was an error, and a FILTER that errors removes the row, so
  W01, W05, W06, W09 and W18 found nothing or the wrong thing; running these
  examples is what found it. Before HOLOS 0.26.2 and the SHACL engine 0.3.6, a
  decimal product needing more than 18 places was an error too.
- **Arithmetic.** The shapes keep their arithmetic in whole numbers until a final
  division (`20 * ABS(?stated - ?sum) > ?stated` rather than a ratio over 0.05).
  Every engine then gives the same answer to the last digit.
- **Rules.** SHACL-AF defines one pass of the rules. The editor's
  "rules, iterated" setting repeats them until nothing new appears, which a
  transitive rule needs; W03 shows the difference.
- **Shape counts.** The REPORTS lines give the number of shapes the engine
  compiled, which counts property shapes and constraints as well as node shapes.

## Real and invented

The glen, its estates, companies, people, titles, lots, legs, lets, boats and
inquiry are invented and describe no real person or organisation. Real data,
with values unchanged: Fáilte Ireland's open data (CC BY 4.0) in
`07-off-the-beaten-track`; the European Environment Agency's wastewater data,
Eurostat's guest nights and Semantic Arts' gist reference data (CC BY 4.0) in
`08-ebb-and-flow`. Each file's own header says which is which.
