Question: Which show has more seasons, Salem (the one that has Xander Berkeley as a cast member) or The Tudors?
Choices:
Dancing with the Stars
Saturday Night's Main Event
Phineas and Ferb
The Tudors
Robot Chicken
American Horror Story
Six Feet Under
Seinfeld
Bleak House
Salem
Program:
function: Find
inputs: Xander Berkeley
function: Relate
dependencies: 0
inputs: cast member
backward
function: Find
inputs: Salem
function: And
dependencies: 1
2
function: Find
inputs: The Tudors
function: SelectBetween
dependencies: 3
4
inputs: number of seasons
greater
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Salem" . ?e <cast_member> ?e_1 . ?e_1 <pred:name> "Xander Berkeley" .   } UNION { ?e <pred:name> "The Tudors" .  } ?e <number_of_seasons> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: The Tudors