Marbled from a knowledge graph
Bookshop Trail Endpapers
The graph behind the SPARQL course, marbled the way a binder marbles the papers inside a book's covers. Every bookshop drops ink where it stands, in the year it opened. Every event leaves a ring inside its shop. Then the walking trail combs the ink along its route.
The inks
How it was made
Drops. Each shop drops ink at its place on the map, oldest first. The drop's size follows the shop's floor area and its colour the shop's specialist genre, from the course's genre scheme. Each new drop pushes the older ink aside, so the oldest shops are the most stretched.
Rings. Each event of 2025 drops a smaller ring inside its shop, sized by attendance: chalk for launches, readings and signings, bone black for lectures, panels, workshops and book clubs.
Combs. Last, a stylus follows the trail, stretch by stretch, in the order the course lists it, and drags the ink along the route. Waymarked stretches pull harder. This is what draws the rings into hearts and points.
Disagreements. Where the graph contradicts itself, the ink falls twice. Four shops have two founding years, and two launches have two attendance figures.
The map moves too. Every shop's position and every bend in the trail is carried along by the ink, so nothing ends up where an atlas would put it. Show the trail to see where it went.
The four SPARQL queries
Run in HOLOS over bookshop-trail-1.2.ttl, 5,037 triples. The page holds their results and nothing else.
Shops: place, founding years, floor area, specialism and stock
PREFIX bs: <https://example.org/bookshop-trail/schema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX wgs84: <http://www.w3.org/2003/01/geo/wgs84_pos#>
SELECT ?shop ?name ?town ?localTown ?bookTown ?lat ?long ?founded ?area ?staff
?genre ?genreLabel ?branch ?secondHand ?cafe ?stock ?titles
WHERE {
?shop a bs:Bookshop ; rdfs:label ?name ; wgs84:lat ?lat ; wgs84:long ?long ;
bs:founded ?founded ; bs:floorArea ?area ; bs:staffCount ?staff ;
bs:locatedIn ?place .
?place rdfs:label ?town . FILTER (lang(?town) = "en")
OPTIONAL { SELECT ?place (SAMPLE(?l) AS ?localTown) WHERE {
?place rdfs:label ?l . FILTER (lang(?l) IN ("gd", "cy")) } GROUP BY ?place }
OPTIONAL { ?place bs:isBookTown ?bookTown }
OPTIONAL { ?shop bs:sellsSecondHand ?secondHand }
OPTIONAL { ?shop bs:hasCafe ?cafe }
{ SELECT ?shop (SAMPLE(?g) AS ?genre) WHERE { ?shop bs:specialises ?g } GROUP BY ?shop }
?genre skos:prefLabel ?genreLabel . FILTER (lang(?genreLabel) = "en")
OPTIONAL { ?genre skos:broader* ?branch .
?branch skos:broader <https://example.org/bookshop-trail/genre-literature> }
OPTIONAL { SELECT ?shop (SUM(?c) AS ?stock) (COUNT(?w) AS ?titles) WHERE {
?r bs:atShop ?shop ; bs:ofWork ?w ; bs:copies ?c } GROUP BY ?shop }
}
ORDER BY ?founded ?nameEvents: date, kind and attendance
PREFIX bs: <https://example.org/bookshop-trail/schema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?event ?label ?shop ?date ?kind ?attendance (SAMPLE(?w) AS ?who) WHERE {
?event a bs:Event ; rdfs:label ?label ; bs:heldAt ?shop ; bs:eventDate ?date ;
bs:eventKind ?kind ; bs:attendance ?attendance .
OPTIONAL { ?event bs:featuring/rdfs:label ?w }
} GROUP BY ?event ?label ?shop ?date ?kind ?attendance
ORDER BY ?date ?eventTrail: each stretch and its route
PREFIX bs: <https://example.org/bookshop-trail/schema#>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
SELECT ?seg ?from ?to ?km ?waymarked ?wkt WHERE {
?seg a bs:TrailSegment ; bs:segmentFrom ?from ; bs:segmentTo ?to ; bs:distanceKm ?km ;
geo:hasGeometry/geo:asWKT ?wkt .
OPTIONAL { ?seg bs:waymarked ?waymarked }
} ORDER BY ?segGenres: the SKOS scheme
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT ?genre ?label ?broader WHERE {
?genre a skos:Concept ; skos:prefLabel ?label . FILTER (lang(?label) = "en")
OPTIONAL { ?genre skos:broader ?broader }
} ORDER BY ?broader ?labelData from The Bookshop Trail, the teaching dataset of the Semantechs SPARQL course: invented shops, people and events in real towns. Marbling after Lu, Jaffer and others, Mathematical Marbling (2012).