This weekend, swimmers Mack Horton from Australia and China's Sun Yang are expected to race each other in the 1500m freestyle final, an event that is shaping up to be one of the big moments of the Rio Olympics with a nationalist focus that goes well beyond the pool.

On day one of the Games, Chinese social networking sites and state-owned media lit up with negative comments after Horton described Sun Yang as a 'drug cheat'. Netizens were angry not only at Horton's words but also more widely at a perceived notion that Australia is 'racist'. The unfolding of this sporting spat reveals how China wishes to be perceived by its international peers.

Following Horton's gold medal in the 400m freestyle event and his consequent comments about Sun Yang, Chinese netizens were quick to criticise him. Weibo user 琳琳懵萌哒 wrote, 'in fact, Horton is scared of Sun Yang. Even if he had a victory today, it is only short-lived. He is unable to ignore the strength of Sun Yang! He can only shoot his mouth off.'

In addition to criticising Horton, many other netizens were critical of the Australian culture that engendered his comments. As Weibo user TKO-贾贾贾贾T wrote, garnering over 9000 'likes', '[Horton] won the contest but lost his moral standing...when Australian media broadcast the opening ceremony, as soon as the Chinese delegation entered they showed a MacDonald's advertisement – my god! Next year I was going to go to Australia, but I would be a moron to contribute to their GDP!'

Comments such as these mirror the recent negative campaign by state-owned media against Australia. This started with an editorial in both the English and Chinese language Global Times newspapers criticising Australia for its support of the ruling by the International Court of Arbitration. In addition to calling Australia a 'paper cat' it also remarked upon Australia's 'inglorious history' in which it was 'established through uncivilised means'.

Horton's comments have allowed the editors at Global Times to warm to Australia's 'inglorious' history theme.

In an editorial following the 400m relay, the editors accused Australia of being 'second-class citizen in the West' with 'Horton and his backers representing the dark side of Australian society.' In a similar editorial published in the Chinese language Global Times, the author described Australia as 'inferior to other Western countries. According to the author, this inferiority to other Western countries has led Australia to adopt a feeling of superiority and look down upon its Asian neighbours.

In contrast, China is presented as morally superior with its people fully united behind Yang. China's unified stance is clearly evident on social media sites, with a hashtag #Apologisetosunyang one of the top trending topics on Weibo.

Although Australia is savaged in the Chinese media, as Peter Cai wrote on The Interpreter, these attacks 'lack real substance.' Why this storm in a swimming pool is interesting is because it reveals China's changing perception of itself and how it wishes to be viewed by other countries. As Merriden Varrall has previously written, China and Chinese policymakers view the world in a distinctly different way to the West through what she calls 'Chinese Worldviews'. These worldviews can be used to explain why Horton's comments have caused so much offense in China.

According to the first worldview, China has suffered a Century of Humiliation at the hands of foreign imperialists. Seen in this light, many Chinese, viewed Horton's comments as another attempt by the West to subdue China and contain its rise.

Horton's comments also reflect another worldview, that 'history is destiny'. Following this reasoning, China was once a leader in Asia and it will be a leader again. Sun Yang's domination in the swimming pool represents the domination China wishes to emulate on the global stage. Horton winning the 400m event was an upset to the natural order that China should be a leader. Indeed, Sun Yang's own comments in the press conference following his victory in the 200m demonstrate this. Reflecting on the growing place of China in the world, Sun Yang stated 'I represent the new world.'

The fact that China united behind Sun Yang reflects another worldview: China is family. The simultaneous universal condemnation of Horton and admiration of Sun Yang indicates that the Chinese are fiercely proud of their culture and national identity and will not accept any outside criticism of it.

Ultimately, the Horton-Yang battle is one that will be decided in the pool, not in the media or on social networking sites. However, understanding the source of Chinese perceptions can help explain why the Chinese reacted so strongly to what many Australians saw as a bit of friendly, sporting rivalry. As China continues to rise, its citizens and media will continue to defend itself from outside criticisms. Australians should take note of the underlying reasons behind China's reaction and the wider implications for Australian-China relations.