PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
PREFIX ex:      <http://example.org/things#> 

SELECT ?name ?emp
WHERE { ?x foaf:name ?name ; 
           ex:empId ?emp 
      }
ORDER BY ?name DESC(?emp)
