prefix mon: select ?N ?P from where { {?C a mon:City; mon:name ?N . OPTIONAL { ?C mon:population ?P } } # FILTER ((?P > 10000)) # try this also FILTER (!(?P > 10000)) }