-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy path6-recommender_model.sparql
57 lines (54 loc) · 2.9 KB
/
6-recommender_model.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
51
52
53
54
55
56
57
prefix : <http://schema.org/>
prefix t: <http://www.imdb.com/title/>
prefix spa: <tag:stardog:api:analytics:>
INSERT {
graph spa:model {
:c1 a spa:ClassificationModel ;
spa:parameters [
spa:b 22 ;
spa:l 1 ;
spa:l1 0.000001
] ;
spa:arguments (?actors ?writers ?directors ?genres ?producers ?keywords ?languages ?contentRating ?year ?metaCritic ?rating) ;
spa:predict ?rec ;
spa:overwrite True .
}
}
WHERE {
SELECT
(spa:set(?actor) as ?actors)
(spa:set(?writer) as ?writers)
(spa:set(?director) as ?directors)
(spa:set(?genre) as ?genres)
(spa:set(?producer) as ?producers)
(spa:set(?keyword) as ?keywords)
(spa:set(?language) as ?languages)
?contentRating
?year
?metaCritic
?storyline
?rating
?rec
{
?movie :recommendation ?recommendation ;
:actor ?actor ;
:author ?writer ;
:director ?director ;
:genre ?genre ;
:contentRating ?contentRating ;
:copyrightYear ?year ;
:keyword ?keyword ;
:language ?language ;
:storyline ?storyline ;
:rating ?rating .
?recommendation rdfs:label ?rec .
OPTIONAL {
?movie :productionCompany ?producer .
}
OPTIONAL {
?movie :metaCritic ?metaCritic .
}
FILTER (?recommendation in (t:tt0137523, t:tt1375666, t:tt0105236, t:tt1228705, t:tt0126029, t:tt1591095, t:tt1637725, t:tt0102926, t:tt0251127, t:tt0133093, t:tt0382932, t:tt1853728, t:tt0389860, t:tt1232829, t:tt1129442, t:tt1300854, t:tt0104431, t:tt0762107, t:tt0327084, t:tt0167260, t:tt0448157, t:tt0816711, t:tt0145487, t:tt0332280, t:tt0364725, t:tt0117060, t:tt0088763, t:tt1285016, t:tt0454876, t:tt2562232, t:tt1877832, t:tt0400717, t:tt0436697, t:tt0114369, t:tt0281358, t:tt0120611, t:tt0266697, t:tt0280590, t:tt0351283, t:tt1320253, t:tt0080684, t:tt0854678, t:tt1454468, t:tt1375670, t:tt0398165, t:tt0211915, t:tt0361862, t:tt0359013, t:tt0901476, t:tt0361748, t:tt0993846, t:tt1631867, t:tt0181689, t:tt0887883, t:tt1033643, t:tt0120737, t:tt0107290, t:tt1606389, t:tt0454848, t:tt0240772, t:tt0765429, t:tt0343818, t:tt0212720, t:tt1632708, t:tt0844471, t:tt3498820, t:tt0077651, t:tt0099685, t:tt0405422, t:tt0073486, t:tt0082971, t:tt0497465, t:tt0167404, t:tt0450278, t:tt1323594, t:tt0120783, t:tt0243155, t:tt1798709, t:tt1489889, t:tt1690953, t:tt1010048, t:tt0337563, t:tt0120660, t:tt0989757, t:tt1277953, t:tt0429591, t:tt0095016, t:tt0388789, t:tt1646987, t:tt0112508, t:tt0415306, t:tt0320691, t:tt0212338, t:tt0382628, t:tt0265086, t:tt0117438, t:tt1392190, t:tt0362227, t:tt0368933, t:tt1431045))
}
GROUP BY ?movie ?year ?contentRating ?metaCritic ?storyline ?rating ?rec
}