-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmerge_freebase.rq
30 lines (30 loc) · 1.29 KB
/
merge_freebase.rq
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
INSERT {
?freebase <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://ldmc.org/ontology/freebase_film> .
}
WHERE
{ ?film <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://ldmc.org/ontology/selected_film> .
?film <http://www.w3.org/2002/07/owl#sameAs> ?freebase
FILTER regex(str(?freebase), "rdf\\.freebase\\.com")
} ;
INSERT {
?p <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://ldmc.org/ontology/keep_freebase> .
}
WHERE
{ ?freebase <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://ldmc.org/ontology/freebase_film> .
?freebase ?p ?o
FILTER regex(str(?p), "\\/film|award|media_common\\.netflix_genre\\.titles")
} ;
INSERT DATA {
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://ldmc.org/ontology/keep_freebase> .
};
INSERT {
?film ?p ?o .
}
WHERE
{ ?film <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://ldmc.org/ontology/selected_film> .
?film <http://ldmc.org/p/id> ?id .
?film <http://www.w3.org/2002/07/owl#sameAs> ?freebase .
?freebase <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://ldmc.org/ontology/freebase_film> .
?freebase ?p ?o
FILTER EXISTS {?p <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://ldmc.org/ontology/keep_freebase>}
}