Users of ambient intelligence environments have been overwhelmed by the huge numbers of social media available, thus identifying the social media tailored to the user's need is becoming an important question to be discussed. This paper adapts the Katz proximity measure, for the use in social tagging system, to help users in ambient environment find relevant media suited to their interests. The method models the ternary relations among user, resource and tag as a weighted, undirected tripartite graph, then apply the Katz proximity measure to tripartite graph. Experiments on two real datasets are implemented and compared with many state-of-the-art algorithms. The experimental results prove that the adaptation of the Katz algorithm with the tripartite structure yields a significant improvement, and successfully ranks relevant search results according to the user's interests.