def triples(self, pattern: QueryTriple):
        """ Return the triples that match pattern

        :param pattern: `(s, p, o)` tuple, with `None` as wild cards
        :return: Generator for resulting triples
        """
        self.total_calls += 1
        if self.graph_name is not None:
            gn = "?g" if not self.graph_name else self.graph_name
            gquery = f"graph {gn} {{"
            gqueryend = '}'
        else:
            gquery = gqueryend = ''
        if not self.already_resolved(pattern):
            subj = self._repr_element(pattern[0]) if pattern[0] is not None else '?s'
            pred = self._repr_element(pattern[1]) if pattern[1] is not None else '?p'
            obj = self._repr_element(pattern[2]) if pattern[2] is not None else '?o'
            query = f"SELECT ?s ?p ?o {{{gquery}{subj} {pred} {obj}{gqueryend}}}"
            start = time.time()
            if self.debug_slurps:
                print(f"SPARQL: ({query})", end="")
            self.sparql.setQuery(query)
            resp = self.sparql.query().convert()
            elapsed = time.time() - start
            ntriples = len(resp['results']['bindings'])
            self.total_slurptime += elapsed
            self.total_triples += ntriples
            self.total_queries += 1
            if self.debug_slurps:
                print(f" ({round(elapsed, 2)} secs) - {ntriples} triples")
            query_result = self._query_result_hook(self) if self._query_result_hook is not None else None
            for row in resp['results']['bindings']:
                triple = RDFTriple(pattern[0] if pattern[0] is not None else self._map_type(row['s']),
                                   pattern[1] if pattern[1] is not None else self._map_type(row['p']),
                                   pattern[2] if pattern[2] is not None else self._map_type(row['o']))
                self.add(triple)
                if query_result:
                    query_result.add(triple)
            if query_result:
                query_result.done()
            self.resolved_nodes.append(pattern)
        return super().triples(pattern)