Question: What person who was dating Demi Lovato is a celebrity who had a romantic relationship that ended prior to 18 May 2010?
Answer(s):
answer: Joe Jonas

SPARQL query:
PREFIX ns: <http://rdf.freebase.com/ns/>
SELECT DISTINCT ?x
WHERE {
FILTER (?x != ns:m.02wb6yq)
FILTER (!isLiteral(?x) OR lang(?x) = '' OR langMatches(lang(?x), 'en'))
ns:m.02wb6yq ns:base.popstra.celebrity.dated ?y .
?y ns:base.popstra.dated.participant ?x .
?x ns:celebrities.celebrity.sexual_relationships ?c .
?c ns:celebrities.romantic_relationship.end_date ?num .
FILTER (?num < "2010-05-18"^^xsd:dateTime) . 
}