def build_query(self):

		'''
		Using the three graphs derived from self._diff_graph(), build a sparql update query in the format:

		PREFIX foo: <http://foo.com>
		PREFIX bar: <http://bar.com>

		DELETE {...}
		INSERT {...}
		WHERE {...}

		Args:
			None: uses variables from self

		Returns:
			(str) sparql update query as string

		'''

		# derive namespaces to include prefixes in Sparql update query
		self._derive_namespaces()

		sparql_query = ''

		# add prefixes
		for ns_prefix, ns_uri in self.update_prefixes.items():
			sparql_query += "PREFIX %s: <%s>\n" % (ns_prefix, str(ns_uri))

		# deletes
		removed_serialized = self.diffs.removed.serialize(format='nt').decode('utf-8')
		sparql_query += '\nDELETE {\n%s}\n\n' % removed_serialized

		# inserts
		added_serialized = self.diffs.added.serialize(format='nt').decode('utf-8')
		sparql_query += '\nINSERT {\n%s}\n\n' % added_serialized

		# where (not yet implemented)
		sparql_query += 'WHERE {}'

		# debug
		# logger.debug(sparql_query)

		# return query
		return sparql_query
def build_query ( self ) : self . _derive_namespaces ( ) sparql_query = '' for ns_prefix , ns_uri in self . update_prefixes . items ( ) : sparql_query += "PREFIX %s: <%s>\n" % ( ns_prefix , str ( ns_uri ) ) removed_serialized = self . diffs . removed . serialize ( format = 'nt' ) . decode ( 'utf-8' ) sparql_query += '\nDELETE {\n%s}\n\n' % removed_serialized added_serialized = self . diffs . added . serialize ( format = 'nt' ) . decode ( 'utf-8' ) sparql_query += '\nINSERT {\n%s}\n\n' % added_serialized sparql_query += 'WHERE {}' return sparql_query
Using the three graphs derived from self._diff_graph(), build a sparql update query in the format:

		PREFIX foo: <http://foo.com>
		PREFIX bar: <http://bar.com>

		DELETE {...}
		INSERT {...}
		WHERE {...}

		Args:
			None: uses variables from self

		Returns:
			(str) sparql update query as string