← 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. Switch the regime to see where the difference comes from.

SubjectPredicateObject
manufacturer:12rdf:typeschema:Organization
manufacturer:12schema:name"Nordwind GmbH"
manufacturer:9rdf:typeschema:Organization
manufacturer:9schema:name"Acme Lda"
product:17rdf:typeschema:Product
product:17schema:manufacturermanufacturer:9
product:17schema:name"Mechanical keyboard"@en
product:17schema:price"49.90"^^xsd:decimal
product:23rdf:typeschema:Product
product:23schema:manufacturermanufacturer:9
product:23schema:name"Optical mouse"@en
product:23schema:price"19.90"^^xsd:decimal
product:31rdf:typeschema:Product
product:31schema:manufacturermanufacturer:9
product:31schema:name"Wireless optical mouse"@en
product:31schema:price"29.90"^^xsd:decimal
product:88rdf:typeschema:Product
product:88schema:manufacturermanufacturer:12
product:88schema:name"27-inch monitor"@en
product:88schema: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")
}

Edit it in the query box →