The web of linked data represents a globally distributed dataspace. It can be queried with SPARQL whose execution takes place by asynchronously traversing the RDF links to discover data sources at run-time. However, the optimization of SPARQL queries over the web of data remains a challenge and in this paper the authors present an approach addressing this problem. The proposed approach papers in two-phases to optimize the SPARQL queries. It analyzes the query before its execution and discovers classes of data that do not contribute towards answering it which can then be prevented from being fetched.