Collaborative tagging systems such as Delicious provide a new means of organizing and sharing resources. They also allow users to search for documents relevant to a particular topic or for other users who are experts in a particular domain. Nevertheless, identifying relevant documents and knowledgeable users is not a trivial task, especially when the volume of documents is huge and there exist spamming activities. In this paper, we discuss the notions of experts and expertise in the context of collaborative tagging systems. We propose that the level of expertise of a user in a particular topic is mainly determined by two factors: (1) there should be a relationship of mutual reinforcement between the expertise of a user and the quality of a document; and (2) an expert should be one who tends to identify useful documents before other users discover them. We propose a graph-based algorithm, SPEAR (SPamming-resistant Expertise Analysis and Ranking), which implements the above ideas for ranking users in a collaborative tagging system. We carry out experiments on both simulated data sets and real-world data sets obtained from Delicious, and show that SPEAR is more resistant to spammers than other methods such as the HITS algorithm and simple statistical measures.