PREFIX  foaf:   <http://xmlns.com/foaf/0.1/>
SELECT ?person ?nick ?page ?img ?name ?firstN
{
    ?person foaf:nick ?nick
    OPTIONAL { ?person foaf:isPrimaryTopicOf ?page }
    OPTIONAL {
        ?person foaf:name ?name
        { ?person foaf:depiction ?img } UNION
        { ?person foaf:firstName ?firstN }
    } FILTER ( bound(?page) || bound(?img) || bound(?firstN) )
} 