You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Model Northwind prices and deliveries with in-domain schema.org terms
Several schema.org properties were carrying values outside their declared
domains. Each is moved to the term the vocabulary actually provides:
- Order lines are now schema:OrderItem *and* schema:Offer. schema:OrderItem
has no price properties at all, so schema:price/schema:priceCurrency were
off-domain; typing the line as the offer that was accepted for it makes
them legal without splitting the line across two nodes.
- schema:Offer's own schema:price is the price of the offer as a whole, so it
replaces schema:totalPrice (a Reservation/Ticket property) as the line
total. The historical unit price moves to a schema:UnitPriceSpecification
with schema:priceType schema:ListPrice.
- schema:discount is dropped. It is an Order-level property in schema.org,
and the list price, quantity and line total already pin the per-line rate
exactly - unlike a stored rate, they cannot disagree with each other.
- Product prices move from schema:Product to a schema:Offer reached through
schema:offers. A product is not an offer, so this one needs its own node.
- Freight moves off schema:ParcelDelivery, which has no price property, onto
a schema:DeliveryChargeSpecification reached via schema:priceSpecification
from a shipping schema:Offer.
- The dispatch date moves off schema:availableFrom (a DeliveryEvent property
borrowed onto a ParcelDelivery, and meaning "available for pickup" rather
than "dispatched") onto a real schema:DeliveryEvent hanging off
schema:deliveryStatus. Orders never dispatched get no event at all.
- schema:orderedItem loses its rdfs:domain/rdfs:range. schema.org allows
Order|OrderItem -> OrderItem|Product|Service, which a single domain/range
pair cannot express; the narrowed pair entailed every OrderItem is a
Product.
Also fixes a pre-existing import bug: shipPostalCode sat in the required BGP
but 19 orders have none, so those orders never entered the graph at all.
Making it OPTIONAL restores them, taking the import from 811 to 830 orders
and revenue from 1,215,812 to 1,265,792 - the canonical Northwind figure.
Consuming queries follow the new structure. The six revenue queries drop
their ?quantity * ?price * (1 - ?discount) recomputation for the materialised
line total, which also settles a 0.1 discrepancy between the carrier chart
and the rest. SelectProductsFromSupplier traverses schema:offers/schema:price.
Verified by running all eleven import queries over the real CSVs and all 28
view and chart queries against the resulting graph: 830 orders, 2155 lines,
freight totalling 64,943, and top product/employee/customer/category all
matching canonical Northwind.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SYifJzEkGsTcJsuB4fGRAc
0 commit comments