<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def query(self, q, format="", convert=True):
 		""" 		Generic SELECT query structure. 'q' is the main body of the query. 		The results passed out are not converted yet: see the 'format' method 		Results could be iterated using the idiom: for l in obj : do_something_with_line(l) 		If convert is False, we return the collection of rdflib instances 		"""


		lines = ["PREFIX %s: <%s>" % (k, r) for k, r in self.prefixes.iteritems()]
		lines.extend(q.split("\n"))
		query = "\n".join(lines)

		if self.verbose:
			print(query, "\n\n")

		return self.__doQuery(query, format, convert)