Skip to content

Commit 0110222

Browse files
namedgraphclaude
andcommitted
Migrate from type-based templates to property-based inverse views in Northwind ontology
Replace `ldh:template` on RDF types (schema:Person, schema:Corporation, schema:Place, schema:Product) with `ldh:inverseView` on the relevant properties (schema:broker, schema:customer, schema:provider, schema:containedInPlace, schema:orderedItem). Update README to reflect the new ldh:view / ldh:inverseView terminology. Remove empty categories container.ttl. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ddf64e9 commit 0110222

3 files changed

Lines changed: 14 additions & 11 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Packages provide ontology imports and custom XSLT templates for rendering specif
106106
### Structure
107107

108108
Each package consists of:
109-
- **`ns.ttl`** - Ontology with vocabulary imports (`owl:imports`) and template blocks (`ldh:template`)
109+
- **`ns.ttl`** - Ontology with vocabulary imports (`owl:imports`) and property views (`ldh:view` / `ldh:inverseView`)
110110
- **`layout.xsl`** - XSLT stylesheet with custom rendering templates using system modes
111111

112112
### Installation
@@ -135,7 +135,7 @@ Installation integrates the package by:
135135

136136
- **Declarative only** - RDF + XSLT, no Java code
137137
- **Installation-time composition** - Pre-composed before loading, no runtime overhead
138-
- **Template blocks** (`ldh:template`) - SPARQL-based views attached to RDF types
138+
- **Property views** (`ldh:view` / `ldh:inverseView`) - SPARQL-based views attached to properties
139139
- **XSLT overrides** - Custom rendering using system modes (`bs2:*`, `xhtml:*`, etc.)
140140

141141
[Read the full packages documentation →](packages/README.md)

demo/northwind-traders/admin/model/ns.ttl

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ schema:sponsor a owl:ObjectProperty ;
130130

131131
schema:orderedItem a owl:ObjectProperty ;
132132
rdfs:label "Ordered item" ;
133+
rdfs:range schema:Product ;
133134
rdfs:isDefinedBy : .
134135

135136
schema:name a owl:DatatypeProperty ;
@@ -253,11 +254,11 @@ schema:location a owl:ObjectProperty ;
253254
owl:maxCardinality 1 ;
254255
rdfs:isDefinedBy : .
255256

256-
# Person
257+
# broker
257258

258259
# orders handled by this employee
259260

260-
schema:Person ldh:template :OrdersHandledByEmployee .
261+
schema:broker ldh:inverseView :OrdersHandledByEmployee .
261262

262263
:OrdersHandledByEmployee a ldh:View ;
263264
dct:title "Orders handled by this employee" ;
@@ -278,11 +279,11 @@ ORDER BY DESC(?order)
278279
""" ;
279280
rdfs:isDefinedBy : .
280281

281-
# Corporation
282+
# customer
282283

283284
# orders from this customer
284285

285-
schema:Corporation ldh:template :OrdersFromCustomer .
286+
schema:customer ldh:inverseView :OrdersFromCustomer .
286287

287288
:OrdersFromCustomer a ldh:View ;
288289
dct:title "Orders from this customer" ;
@@ -303,9 +304,11 @@ ORDER BY DESC(?order)
303304
""" ;
304305
rdfs:isDefinedBy : .
305306

307+
# provider
308+
306309
# products supplied by this supplier
307310

308-
schema:Corporation ldh:template :ProductsFromSupplier .
311+
schema:provider ldh:inverseView :ProductsFromSupplier .
309312

310313
:ProductsFromSupplier a ldh:View ;
311314
dct:title "Products supplied by this supplier" ;
@@ -326,11 +329,11 @@ ORDER BY ?product
326329
""" ;
327330
rdfs:isDefinedBy : .
328331

329-
# Place
332+
# containedInPlace
330333

331334
# cities in this region
332335

333-
schema:Place ldh:template :CitiesInRegion .
336+
schema:containedInPlace ldh:inverseView :CitiesInRegion .
334337

335338
:CitiesInRegion a ldh:View ;
336339
dct:title "Cities in this region" ;
@@ -351,11 +354,11 @@ ORDER BY ?city
351354
""" ;
352355
rdfs:isDefinedBy : .
353356

354-
# Product
357+
# orderedItem
355358

356359
# orders containing this product
357360

358-
schema:Product ldh:template :OrdersContainingProduct .
361+
schema:orderedItem ldh:inverseView :OrdersContainingProduct .
359362

360363
:OrdersContainingProduct a ldh:View ;
361364
dct:title "Orders containing this product" ;

demo/northwind-traders/categories/container.ttl

Whitespace-only changes.

0 commit comments

Comments
 (0)