PREFIX foaf: PREFIX : SELECT * { OPTIONAL { ?s :hairColor ?color . FILTER(?color = "brown") } ?s a foaf:Person . FILTER(!bound(?color)) }