-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqueries.txt
More file actions
50 lines (42 loc) · 1.4 KB
/
Copy pathqueries.txt
File metadata and controls
50 lines (42 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Query to select all souvenirs bought in 'Paris'
PREFIX schema: <http://schema.org/>
PREFIX my: <https://themn.github.io/semantic-souvenir-catalog/vocabulary.ttl#>
SELECT ?souvenir ?name
WHERE {
?souvenir a my:Souvenir ;
schema:name ?name ;
my:boughtIn ?cityNode .
?cityNode schema:name "Paris" .
}
# Query to select all souvenirs bought after 2020
PREFIX schema: <http://schema.org/>
PREFIX my: <https://themn.github.io/semantic-souvenir-catalog/vocabulary.ttl#>
SELECT ?name ?date
WHERE {
?souvenir a my:Souvenir ;
schema:name ?name ;
my:tripDate ?date .
# Simple string comparison (Works for ISO dates)
FILTER (STR(?date) > "2020-12-31")
}
# Query to select all souvenirs that are "Clothing"
PREFIX schema: <http://schema.org/>
PREFIX my: <https://themn.github.io/semantic-souvenir-catalog/vocabulary.ttl#>
SELECT ?souvenir ?name
WHERE {
?souvenir a my:Souvenir ;
schema:name ?name ;
schema:genre "Clothing" .
}
# Query to select name and city of souvenirs bought by "Alice"
PREFIX schema: <http://schema.org/>
PREFIX my: <https://themn.github.io/semantic-souvenir-catalog/vocabulary.ttl#>
SELECT ?souvenir ?name ?city
WHERE {
?souvenir a my:Souvenir ;
schema:name ?name ;
my:buyer ?buyerNode ;
my:boughtIn ?cityNode .
?buyerNode schema:name "Alice" .
?cityNode schema:name ?city .
}