I have tried this query on dbpedia.org (copy/paste that pastebin in your address bar)
I get some results, especially a lot of sameAs.
When I uncomment the comment, the query becomes super slow and the results are different.
Most of the sameAs have disappeared.
Can you please describe question you are seeking to receive a response to from DBpedia, using the current SPARQL query, which should enable us to comment on how best to construct a SPARQL query to obtain an optimal solution ?
basically i want to retrieve all resources related to tom cruise, then follow all the sameAs properties for each matched resources, and retrieve also the labels (when available) and types (when available) for all those sameAs resources.