PREFIX  foaf:   <http://xmlns.com/foaf/0.1/>
PREFIX    ex:   <http://example.org/things#>
SELECT ?name ?nick ?plan ?dept
WHERE 
{ 
    ?person 
        a foaf:Person;
        foaf:name ?name . 
    GRAPH ?x { 
        [] foaf:name ?name;
           foaf:nick ?nick
    } 
    OPTIONAL { 
        ?person ex:healthplan ?plan 
        OPTIONAL { ?person ex:department ?dept } 
    } 
}