Check if serviceUrl was really set, if not, use null

In case the sparqlservices extension is not in use
the serviceUrl is not set. To avoid warnings about
unset array keys, these checks were added.