Question: Which show has more seasons, Beauty and the Beast (the one whose number of seasons is 3) or Battlestar Galactica (the one that has Mary McDonnell as a cast member)?
Choices: American Horror Story
Bleak House
Beauty and the Beast
Game of Thrones
Seinfeld
Saturday Night's Main Event
Battlestar Galactica
Six Feet Under
Dancing with the Stars
Phineas and Ferb
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Beauty and the Beast" . ?e <number_of_seasons> ?pv_1 . ?pv_1 <pred:unit> "1" . ?pv_1 <pred:value> "3"^^xsd:double . } UNION { ?e <pred:name> "Battlestar Galactica" . ?e <cast_member> ?e_1 . ?e_1 <pred:name> "Mary McDonnell" . } ?e <number_of_seasons> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Program:
function: Find
inputs: Beauty and the Beast
function: FilterNum
dependencies: 0
inputs: number of seasons
3
=
function: Find
inputs: Mary McDonnell
function: Relate
dependencies: 2
inputs: cast member
backward
function: Find
inputs: Battlestar Galactica
function: And
dependencies: 3
4
function: SelectBetween
dependencies: 1
5
inputs: number of seasons
greater
Answer: Battlestar Galactica