-
Notifications
You must be signed in to change notification settings - Fork 5
/
Q3-naive.sparql
50 lines (49 loc) · 1.43 KB
/
Q3-naive.sparql
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
PREFIX dbpp: <http://dbpedia.org/property/>
PREFIX dbpo: <http://dbpedia.org/ontology/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX yagoinfo: <http://yago-knowledge.org/resource/infobox/en/>
PREFIX yago: <http://yago-knowledge.org/resource/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dbpr: <http://dbpedia.org/resource/>
SELECT *
WHERE
{ GRAPH <http://dbpedia.org>
{ { SELECT *
WHERE
{ { SELECT *
WHERE
{ ?film1 dbpp:starring ?actor1 }
}
{ SELECT *
WHERE
{ ?actor1 dbpp:birthPlace ?actor_country1 }
}
{ SELECT *
WHERE
{ ?actor1 dbpp:name ?name }
}
}
}
FILTER regex(str(?actor_country1), "USA")
}
GRAPH <http://yago-knowledge.org/>
{ { SELECT *
WHERE
{ { SELECT *
WHERE
{ ?actor2 yago:actedIn ?film2 }
}
{ SELECT *
WHERE
{ ?actor2 yago:isCitizenOf ?actor_country2 }
}
{ SELECT *
WHERE
{ ?actor2 yagoinfo:name ?name }
}
}
}
FILTER ( ?actor_country2 = yago:United_States )
}
}