程序代写代做代考 BASE

BASE
prefix xs:

#———————————————————————————————————————————————-
#Q1 (1 mark): countries that have created at least 5 movies, where the average IMDB score of the movies created in that country is at least 7.5.
#select ?country {
# ?movie ?country ; ?imdb .
#} group by ?country having (avg(xs:float(?imdb)) >= 7.5 && count(?imdb) >=5)
#———————————————————————————————————————————————-
#Q2 (1 mark): names of the movies (except horror movies) and their corresponding IMDB scores, where the score is at least 8.5 based on a minimum of 1,500,000 votes.
#select ?name ?imdb {
# ?movie ?name .
# ?movie ?imdb filter (xs:float(?imdb)>=8.5) .
# ?movie ?vote filter (xs:float(?vote)>=1500000) .
# filter not exists {?movie ?name ; ?genre filter regex(?genre,”Horror”,”i”)} .
#}
#———————————————————————————————————————————————-
#Q3 (1 mark): Name, title_year, and imdb_score of the movies with actor “Brad Pitt”. Also include the movie_imdb_link of those movies if they belong to “Family” or “Drama” genres AND have imdb_score of at least 8.
#select ?name ?year ?imdb ?imdb_link {
# ?movie ?name ; ?imdb ; ?year .
# {{?movie ?actor_1_name filter (?actor_1_name=”Brad Pitt”)} union
# {?movie ?actor_2_name filter (?actor_2_name=”Brad Pitt”)} union
# {?movie ?actor_3_name filter (?actor_3_name=”Brad Pitt”)}} .
# optional
# {
# ?movie ?genre filter regex(?genre,”Family|Drama”) .
# ?movie ?imdb filter (xs:float(?imdb)>=8) .
# ?movie ?imdb_link .
# }
#}
#———————————————————————————————————————————————-
#Q4 (1.5 marks): The Name, country, imdb_score, and budget of the top 10 most expensive color movies with imdb_score of at least 7. Sort the results based on budget and then imdb-score.
#select ?name ?country ?budget ?imdb where {
# ?movie ?name .
# ?movie ?imdb filter (xs:float(?imdb)>=7).
# ?movie ?budget .
# ?movie ?country.
# ?movie ?color filter (?color=”Color”).
#} order by desc(xs:float(?budget)) (?imdb) limit 10
#———————————————————————————————————————————————-
#Q5 (1.5 marks): the most expensive “Animation” movie created from 2016 to 2020 with imdb_score less than the average imdb_score of all movies of all times is created in the USA or the UK. (hint: the query must return Yes or No only).
#ask {
# {
# select * {
# ?movie ?country.
# ?movie ?name .
# ?movie ?genre filter regex(?genre,”Animation”,”i”).
# ?movie ?year filter (xs:float(?year)<=2020 && xs:float(?year)>=2016).
# ?movie ?imdb filter (xs:float(?imdb) ?budget .
# {
# select (avg(xs:float(?imdb)) as ?imdb_av){
# ?movie ?imdb .
# }
# }
# } orderby desc(xs:float(?budget)) limit 1
# } filter (?country=”UK” || ?country=”USA”)
#}
#
#———————————————————————————————————————————————-
#Q6 (1 mark): Name, title_year, and imdb_score of the movies with actor “Brad Pitt”, which are created after 2015 or have an IMDB score of at least 8.
#select ?name ?year ?imdb {
# ?movie ?name ; ?year; ?imdb filter(xs:float(?year)>= 2015 || xs:float(?imdb)>=8)
# {{?movie ?actor_1_name filter (?actor_1_name=”Brad Pitt”)} union
# {?movie ?actor_2_name filter (?actor_2_name=”Brad Pitt”)} union
# {?movie ?actor_3_name filter (?actor_3_name=”Brad Pitt”)}} .
#}
##———————————————————————————————————————————————-