Method to update resources in repository.  Firing this method computes the difference in the local modified graph and the original one,
		creates an instance of SparqlUpdate and builds a sparql query that represents these differences, and sends this as a PATCH request.

		Note: send PATCH request, regardless of RDF or NonRDF, to [uri]/fcr:metadata

		If the resource is NonRDF (Binary), this also method also updates the binary data.

		Args:
			sparql_query_only (bool): If True, returns only the sparql query string and does not perform any actual updates
			auto_refresh (bool): If True, refreshes resource after update. If left None, defaults to repo.default_auto_refresh
			update_binary (bool): If True, and resource is NonRDF, updates binary data as well

		Returns:
			(bool)

def update(self, sparql_query_only=False, auto_refresh=None, update_binary=True):

		'''
		Method to update resources in repository.  Firing this method computes the difference in the local modified graph and the original one,
		creates an instance of SparqlUpdate and builds a sparql query that represents these differences, and sends this as a PATCH request.

		Note: send PATCH request, regardless of RDF or NonRDF, to [uri]/fcr:metadata

		If the resource is NonRDF (Binary), this also method also updates the binary data.

		Args:
			sparql_query_only (bool): If True, returns only the sparql query string and does not perform any actual updates
			auto_refresh (bool): If True, refreshes resource after update. If left None, defaults to repo.default_auto_refresh
			update_binary (bool): If True, and resource is NonRDF, updates binary data as well

		Returns:
			(bool)
		'''

		# run diff on graphs, send as PATCH request
		self._diff_graph()
		sq = SparqlUpdate(self.rdf.prefixes, self.rdf.diffs)
		if sparql_query_only:
			return sq.build_query()
		response = self.repo.api.http_request(
			'PATCH',
			'%s/fcr:metadata' % self.uri, # send RDF updates to URI/fcr:metadata
			data=sq.build_query(),
			headers={'Content-Type':'application/sparql-update'})

		# if RDF update not 204, raise Exception
		if response.status_code != 204:
			logger.debug(response.content)
			raise Exception('HTTP %s, expecting 204' % response.status_code)

		# if NonRDFSource, and self.binary.data is not a Response object, update binary as well
		if type(self) == NonRDFSource and update_binary and type(self.binary.data) != requests.models.Response:
			self.binary._prep_binary()
			binary_data = self.binary.data
			binary_response = self.repo.api.http_request(
				'PUT',
				self.uri,
				data=binary_data,
				headers={'Content-Type':self.binary.mimetype})

			# if not refreshing RDF, still update binary here
			if not auto_refresh and not self.repo.default_auto_refresh:
				logger.debug("not refreshing resource RDF, but updated binary, so must refresh binary data")
				updated_self = self.repo.get_resource(self.uri)
				self.binary.refresh(updated_self)

		# fire optional post-update hook
		if hasattr(self,'_post_update'):
			self._post_update()

		# determine refreshing
		'''
		If not updating binary, pass that bool to refresh as refresh_binary flag to avoid touching binary data
		'''
		if auto_refresh:
			self.refresh(refresh_binary=update_binary)
		elif auto_refresh == None:
			if self.repo.default_auto_refresh:
				self.refresh(refresh_binary=update_binary)
		return True