<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_opposite(self, ns1, id1, ns2, id2):
 """Return True if two entities are in an "is_opposite" relationship Parameters ns1 : str Namespace code for an entity. id1 : str URI for an entity. ns2 : str Namespace code for an entity. id2 : str URI for an entity. Returns ------- bool True if t1 has an "is_opposite" relationship with t2. """

        u1 = self.get_uri(ns1, id1)
        u2 = self.get_uri(ns2, id2)
        t1 = rdflib.term.URIRef(u1)
        t2 = rdflib.term.URIRef(u2)

        rel = rdflib.term.URIRef(self.relations_prefix + 'is_opposite')
        to = self.graph.objects(t1, rel)
        if t2 in to:
            return True
        return False