Hi,
SPARQL works at the RDF level, so it does not consider OWL constructs, including equivalentClasses.
When you run the reasoner, it infers additional RDF triples stating that instances of entity1 are also instances of entity2.
Here, the inference are rather trivial, so you may also use a more complex SPARQL query that takes into account equivalence, such as:
q = default_world.sparql_query("""
PREFIX owl: <
http://www.w3.org/2002/07/owl#>
PREFIX onto: <
http://test.org/onto.owl#>
SELECT ?i {
?i a ?c .
?c (rdfs:subClassOf|owl:equivalentClass|^owl:equivalentClass)* onto:entity2 .
}""")
Jiba