← every query · class 09 · queries/q1-products-of-portuguese-manufacturers.rq

Q1 · Which products are made by Portuguese manufacturers?

The same answer in both regimes: this query asks only for what was written.

?name?manufacturer
"Mechanical keyboard"@en"Acme Lda"
"Optical mouse"@en"Acme Lda"
"Wireless optical mouse"@en"Acme Lda"
"Teclado mecanico"@pt"Acme Lda"

The query

# Q1. Which products are made by Portuguese manufacturers?
# The query from the slide "The first query".
PREFIX schema:  <https://schema.org/>
PREFIX onto:    <https://data.csoares.me/onto#>
PREFIX country: <https://data.csoares.me/country/>

SELECT ?name ?manufacturer
WHERE {
  # ";" repeats the subject: three triples about the same ?p
  ?p a onto:Product ;
     schema:name ?name ;
     onto:manufacturedBy ?m .

  # ?m is shared with the pattern above: that shared variable is the join
  ?m schema:name ?manufacturer ;
     onto:country country:PT .
}
ORDER BY ?manufacturer ?name
LIMIT 50

Edit it in the query box →