Semantic Web and Web 3.0 · class 09 · demo
The graph answers, and defends itself
The graph of the class, queried with SPARQL with and without a reasoner, and checked with SHACL. «The same query returns 40 results on your engine and 62 on a colleague's» — here is why, on real data.
Same data, same queries, two regimes. A count in orange changes when the reasoner is on — a result published without its regime means nothing.
The five competency questions
| Query | No reasoner | OWL 2 RL |
|---|---|---|
| Q1 · Which products are made by Portuguese manufacturers? | 4 rows | 4 rows |
| Q2 · Which orders contain products from more than one manufacturer? | 1 row | 1 row |
| Q3 · Which products replace a discontinued product? | 1 row | 1 row |
| Q4 · Which customers ordered peripherals last month? | 1 row | 1 row |
| Q5 · Which products share components with product 17? | 3 rows | 3 rows |
With and without a reasoner
| Query | No reasoner | OWL 2 RL |
|---|---|---|
| Every product (example 05) | 4 rows | 5 rows |
| What manufacturer 9 makes, through the inverse (example 05) | 0 rows | 3 rows |
| Portuguese products, by the defined class alone | 0 rows | 3 rows |
| Large orders, as a FILTER — outside OWL 2 RL | 1 row | 1 row |
The rest of the class: filters, aggregation, paths and the other three forms
| Query | No reasoner | OWL 2 RL |
|---|---|---|
| Filters, optionals and negation | 2 rows | 2 rows |
| Products with no manufacturer (FILTER NOT EXISTS) | 0 rows | 0 rows |
| Products per manufacturer, and their average price | 2 rows | 2 rows |
| The components of product 17, at any depth (hasPart+) | 3 rows | 3 rows |
| Alternative and sequence in one path | 5 rows | 10 rows |
| ASK · Is there a discontinued product nothing replaces? | false | false |
| CONSTRUCT · The public catalogue, in schema.org only | 20 triples | 24 triples |
| DESCRIBE · product:17 | 15 triples | 40 triples |
Ask your own
A free query box over the read-only endpoint, the prefixes already written →
Check what comes in
The SHACL shapes over the good data and over the bad data: the report, readable →
The endpoint
The same protocol as Fuseki and as example 06: GET or POST on /sparql with
query=, answers in application/sparql-results+json (text/csv if the Accept header asks),
CONSTRUCT and DESCRIBE in Turtle. Add regime=owl for the closure. Read only: an update gets a 403.
curl --get --data-urlencode 'query=SELECT (COUNT(*) AS ?n) WHERE { ?s ?p ?o }' 'http://demo.csoares.me/class09/sparql'