← every query · class 09 · queries/construct-public-catalogue.rq
CONSTRUCT · The public catalogue, in schema.org only
20 triples without the reasoner, 24 triples with it. The highlighted rows exist only under OWL 2 RL.
| Subject | Predicate | Object |
|---|---|---|
| manufacturer:12 | rdf:type | schema:Organization |
| manufacturer:12 | schema:name | "Nordwind GmbH" |
| manufacturer:9 | rdf:type | schema:Organization |
| manufacturer:9 | schema:name | "Acme Lda" |
| product:17 | rdf:type | schema:Product |
| product:17 | schema:manufacturer | manufacturer:9 |
| product:17 | schema:name | "Mechanical keyboard"@en |
| product:17 | schema:price | "49.90"^^xsd:decimal |
| product:23 | rdf:type | schema:Product |
| product:23 | schema:manufacturer | manufacturer:9 |
| product:23 | schema:name | "Optical mouse"@en |
| product:23 | schema:price | "19.90"^^xsd:decimal |
| product:31 | rdf:type | schema:Product |
| product:31 | schema:manufacturer | manufacturer:9 |
| product:31 | schema:name | "Wireless optical mouse"@en |
| product:31 | schema:price | "29.90"^^xsd:decimal |
| product:52 | rdf:type | schema:Product |
| product:52 | schema:manufacturer | manufacturer:12 |
| product:52 | schema:name | "Firmware licence"@en |
| product:52 | schema:price | "12.00"^^xsd:decimal |
| product:88 | rdf:type | schema:Product |
| product:88 | schema:manufacturer | manufacturer:12 |
| product:88 | schema:name | "27-inch monitor"@en |
| product:88 | schema:price | "249.00"^^xsd:decimal |
The query
# CONSTRUCT: derive a new graph, in pure schema.org, ready to publish.
# It is the form used in class 10 to align vocabularies.
PREFIX schema: <https://schema.org/>
PREFIX onto: <https://data.csoares.me/onto#>
# The CONSTRUCT block is a template: for every solution of the WHERE, its
# triples are written out with the variables replaced by their values.
CONSTRUCT {
?p a schema:Product ;
schema:name ?name ;
schema:manufacturer ?m ;
schema:price ?price .
?m a schema:Organization ;
schema:name ?manufacturerName .
}
WHERE {
?p a onto:Product ;
schema:name ?name ;
onto:manufacturedBy ?m ;
schema:offers/schema:price ?price .
?m schema:name ?manufacturerName .
# only the English name, so that each product gets one schema:name
FILTER (LANG(?name) = "en")
}