Abstract. Knowledge is an important component in many intelligent systems. Since items of knowledge in a knowledge base can be conflicting, especially if there are multiple sources contributing to the knowledge in this base, significant research efforts have been made on developing inconsistency measures for knowledge bases and on developing merging approaches. Most of these efforts start with flat knowledge bases. However, in many real-world applications, items of knowledge are not perceived with equal importance, rather, weights (which can be used to indicate the importance or priority) are associated with items of knowledge. Therefore, measuring the inconsistency of a knowledge base with weighted formulae as well as their merging is an important but difficult task. In this paper, we derive a numerical characteristic function from each knowledge base with weighted formulae, based on the Dempster-Shafer theory of evidence. Using these functions, we are able to measure the inconsistency of the knowledge base in a convenient and rational way, and are able to merge multiple knowledge bases with weighted formulae, even if knowledge in these bases may be inconsistent. Furthermore, by examining whether multiple knowledge bases are dependent or independent, they can be combined in different ways using their characteristic functions, which cannot be handled (or at least have never been considered) in classic knowledge based merging approaches in the literature.