Abstract:
A method assigns importance ranks to documents within repositories or databases, such as any database of documents such as books or other printed material, electronic documentation, and pages within the world-wide web. The method uses a corpus of indexed documents that has been annotated to the terms of one or more ontologies in order to assign a semantic similarity score to queries based on terms taken from the ontologies. A statistical model is used to test the significance of matches between query terms and documents or categories. The method results in an acceleration of over 10,000-fold for realistic queries and ontologies, and makes it practicable to calculate P-values dynamically or to keep database annotations and the related P-value distributions up to date by frequent recalculation.

Description:
BACKGROUND 
       [0001]    The invention provides techniques for indexing and searching in databases using ontologies. Categories or individual documents within the database that are annotated to the terms of the ontology can be searched and prioritized using statistical models to test for significance of the similarity scores of queries against the database. The database can be any repository of documents such as books, articles, internal company documentation, or web pages. One or more domain-specific ontologies can be used to annotate the categories or a subset of the documents in the repository. A method is presented to calculate the score distribution that is required for this search in a streamlined manner that results in a great savings in computational time and effort. The disclosed method can be used for assigning ranks for documents such as books in a repository, items in online auction websites, documents within a repository of a company, or web pages. 
         [0002]    The amount of documents available for searches has grown enormously over the last decades, so that methods for performing intelligent searches among such documents have become very important. A very well-known method for searching in hyperlinked documents is the PageRank algorithm as implemented by Google (U.S. Pat. No. 6,285,999). In essence, the PageRank algorithm has been so successful because it capitalizes on the structure of the web of hyperlinks to better identify relevant, high-quality web pages based on features such as the number of other web pages that link to a given page. However, the amount of other types of documents such as books or other forms of document that are not linked to one another (e.g., by hyperlinks as in the WWW) is steadily increasing. The PageRank algorithm per se cannot be used to search such documents. The disclosed methods can search both in web pages and in documents that do not have hyperlinks. 
         [0003]    In order to explain the invention, some concepts concerning ontologies, distributions, and statistics that are needed to understand it are first reviewed. 
         [0004]    In Philosophy, ontology is the discipline which aims to understand how things in the world are divided into categories and how these categories are related to one another. In Computer Science, the word ontology is used with a related meaning to describe a structured, automated representation of the knowledge within a certain domain in fields such as science, government, industry, and healthcare. An ontology provides a classification of the entities within a domain. Each entity is said to make up a term of the ontology. Furthermore, an ontology must specify the semantic relationships between the entities. Thus, an ontology can be used to define a standard, controlled vocabulary for any field of knowledge. Ontologies are commonly represented in the form of directed acyclic graphs (DAGs). A graph is a set of nodes (also called vertices) and edges (also called links) between the nodes. In directed graphs, the edges are one-way and go from one node to another. A cycle in a directed graph is a path along a series of two or more edges that leads back to the initial node in the path. Therefore, a DAG is a directed graph that has no cycles. The nodes of the DAG, which correspond to the terms of the ontology, are assigned to entities in the domain and the edges between the nodes represent semantic relationships. Ontologies are designed such that terms closer to the root are more general than their descendant terms. For many ontologies, the true-path rule applies, that is, entities are annotated to the most specific term possible but are assumed to be implicitly annotated to all ancestors of that term (This is one reason why cycles are not permitted in graphs used to represent ontologies).  FIG. 1  shows an excerpt of an ontology displayed in the form of a DAG. 
         [0005]    Ontologies are used in artificial intelligence, the Semantic Web, biomedical research, and many other areas as a form of knowledge representation about the world or some part of it. One of the advantages of ontologies is that they allow searches to include semantically related descendent terms, which can increase the number of documents found as compared to methods that merely take the search term as a text string. 
         [0006]    As mentioned above, ontologies consist of well-defined concepts that are connected to one another by semantic relationships. This has inspired a number of algorithms that exploit these relationships in order to define similarity measures for terms or groups of terms in ontologies. All of the algorithms require, in addition to the ontology, an annotated corpus of information. The information content of a term is commonly defined as the negative logarithm of its probability (this is related to the use of −log 2 (p) in the definition of uncertainty or “surprisal” used in information theory). According to this definition, ontology terms that are used to annotate many items have a low information content. For instance, assuming that all items are annotated to the root (the most general term) of the ontology, the information content of the root is −log 2 (1)=0. Intuitively, this means that if an item is chosen at random and discovers that it is annotated to the root term, this is not at all surprising because all items are annotated to the root. On the other hand, assuming there are 256 annotated items in a corpus of information, the information content of a term used to annotate only one item is −log 2 (1/256)=8 (recall that 2 8 =256), the information content of a term used to annotate two items is −log 2 (2/256)=7, and so on. Intuitively, if an item is chosen at random and find it is annotated to a term with a high information content, we are in some sense “surprised”.  FIG. 2  illustrates the relationship between information content and annotation frequency of ontology terms. Other definitions of information content, for instance with logarithms to other bases, or the frequency, or the number of children terms a term has, can also be used. 
         [0007]    This definition can be used in order to calculate the semantic similarity between two terms of an ontology. A simple and effective measure is the one originally proposed by Resnik (Resnik, P. Using information content to evaluate semantic similarity in a taxonomy. In Proceedings of the 14th International Joint Conference on Artificial Intelligence, 1995, pp. 448-453), whereby the similarity between two nodes is defined as the maximum information content among all common ancestors. Denoting the set of all common ancestor terms of terms t 1  and t 2  as A(t 1 ,t 2 ), the similarity between two terms t 1  and t 2  can be calculated as 
         [0000]    
       
         
           
             
               
                 
                   
                     sim 
                      
                     
                       ( 
                       
                         
                           t 
                           1 
                         
                         , 
                         
                           t 
                           2 
                         
                       
                       ) 
                     
                   
                   = 
                   
                     max 
                     - 
                     
                       
                         
                           log 
                            
                           
                               
                           
                            
                           p 
                         
                         
                           a 
                           ∈ 
                           
                             A 
                              
                             
                               ( 
                               
                                 
                                   t 
                                   1 
                                 
                                 , 
                                 
                                   t 
                                   2 
                                 
                               
                               ) 
                             
                           
                         
                       
                        
                       
                         ( 
                         a 
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
         [0008]    An example of this is shown in  FIG. 3 . Several variations on the original semantic similarity measure described above have been presented, all of which are applicable to the invention presented below. Prominent examples of other information-theory based similarity metrics are (Lin D, An Information-Theoretic Definition of Similarity. In: Proc. of the 15th International Conference on Machine Learning. San Francisco, Calif.: Morgan Kaufmann, pp. 296-304) and (Jiang J and Conrath D, Semantic similarity based on corpus statistics and lexical taxonomy. In: Proc. of the 10th International Conference on Research on Computational Linguistics, Taiwan), and these and other similar metrics can be used as components of the disclosed methods. 
         [0009]    In (Robinson et al., The Human Phenotype Ontology: a tool for annotating and analyzing human hereditary disease. Am J Hum Genet, 2008, 83:610-5), this measure was extended to investigate the semantic similarity between a set of query terms and an object that is annotated with the terms of an ontology. For instance, a query Q might consist of the terms t 1 , t 2 , and t 3 , whereas an object in a database D might be annotated by terms t 2  and t 4 . In order to calculate a similarity between query and object, a method is needed for combining pairwise term similarities. A number of ways of doing this for comparing pairs of objects in databases have been proposed (e.g. Lord et al., Investigating semantic similarity measures across the Gene Ontology: the relationship between sequence and annotation. Bioinformatics, 2003, 19:1275-1283). This was extended in (Robinson et al., 2008) to use terms of an attribute ontology to search for the items in a database that best match the query term. There are several ways of doing this, but perhaps the simplest is to take for each query term the best matching term used to annotate the object and to average the corresponding pairwise similarity scores. To do this, each ontology term from the query Q is matched with the most similar term from the database object item D and the average is taken over all such pairs: 
         [0000]    
       
         
           
             
               
                 
                   
                     sim 
                      
                     
                       ( 
                       
                         Q 
                         → 
                         D 
                       
                       ) 
                     
                   
                   = 
                   
                     avg 
                     [ 
                     
                       
                         ∑ 
                         
                           s 
                           ∈ 
                           Q 
                         
                       
                        
                       
                           
                       
                        
                       
                         
                           max 
                           
                             t 
                             ∈ 
                             D 
                           
                         
                          
                         
                           sim 
                            
                           
                             ( 
                             
                               s 
                               , 
                               t 
                             
                             ) 
                           
                         
                       
                     
                     ] 
                   
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0010]    In (Robinson et al., 2008), this was used to search for differential diagnoses in a medical setting. This scheme can also be used together with the more recent developments (see below) to define the semantic similarity of each item in a database or other collection of items to the terms of the query, and to rank these items according to the similarity score. 
         [0011]    In statistics, the P-value is defined as the probability, under the assumption of no effect or no difference (the null hypothesis), of obtaining a result equal to or more extreme than what was actually observed. The P-value is often used in science and medicine as an informal index as a measure of discrepancy between the data and the null hypothesis (although this is not entirely accurate from a statistical point of view). One way of assigning a P-value to a score from a discrete distribution is to calculate the distribution of all possible scores. Assuming that higher scores are better, the P-value of any given score is simply the proportion of scores that are equal to or higher than this score. Such a distribution can be calculated for similarity searches in ontologies by exhaustively calculating the score for all possible combinations of terms in the ontology. Since this approach requires a lot of computational effort, permutation approaches can also be used, whereby a large number (e.g., 100,000) of combinations of terms are chosen at random. The resulting distribution of scores is an approximation to the true score distribution if enough permutations are performed. The permutation approach is computationally costly. 
         [0012]    Ontologies can be used to classify and describe the items (entities) of a domain. For instance, an ontology can be used to classify European wines ( FIG. 4 ). 
         [0013]    Domain ontologies represent the kind of ontology that have been in wide use up to the present. One can use domain ontologies to improve searches by linking the ontology terms that are semantically linked. For instance, if a user is searching an online wine catalog for “white wine”, the wine ontology can be used to return not only catalog items listed as “white wine” but also items listed as “Riesling”, “Sauvignon Blanc”, or “Grauer Burgunder”. 
         [0014]    A second kind of ontology can be used to describe the attributes (or characteristics) of the items in a domain. Staying with the wine example, an ontology can be imagined that describes the attributes of wine including its color, smell, taste, acidity, and so on ( FIG. 5 ). 
         [0015]    This kind of ontology can be used to annotate various kinds of wine in a catalog. For instance, a Riesling might be annotated with the terms white, dry, and lemon, and a Rioja might be annotated with the terms red, dry, and almond scent. Now, users of the online wine catalog can enter the characteristics they prefer in wine, say red, nutty, and medium dry. The semantic similarity algorithms presented in this invention can be used to identify the catalog items (wines) that best match the user&#39;s query. Similar to this, clinical features can be regarded as attributes of diseases. Physicians can enter the clinical features they have observed in their patients and use the semantic similarity algorithm to identify the best matches among a database of diseases that have been annotated with a set of clinical features such as those in the Human Phenotype Ontology (Robinson et al., 2008). 
       SUMMARY 
       [0016]    The several aspects of the present invention provide methods for identifying semantically relevant documents in a database and ordering them by a rank of semantic relevance. A P-value for query results is provided which serves as an index and ranking according to the semantic relevance. Another important aspect of the invention is the application of algorithms for rapidly computing the exact distribution of similarity scores in ontologies, which makes it practicable to index large corpora of information and to keep the index up to date by regularly recalculating the score distribution in a time- and cost-efficient way. 
         [0017]    Previously, ontologies have been used in searches to extend keyword searches by including semantically related words drawn from terms in the ontology that are descendents of the term corresponding to the keyword (This is termed the “domain ontology” approach). However, this kind of search does not allow a statistical significance to be assigned to query results. The present invention makes use of the “attribute ontology” approach. The ontology is used to describe attributes of entities (items) of a domain that can be shared by multiple items. Then the terms of the entities of the domain are annotated using terms of the ontology. For instance, speaking of the medical domain, the attributes could be signs or symptoms of disease, and the entities of the domains would be diseases (diagnoses). Then, each entity in the domain can be annotated with a different sets of ontology terms. The initial annotation of entities in a domain will usually be performed by experts, although computational techniques such as text-mining can be used to create or extend annotations. Although an example from medicine and from an imaginary online wine catalog is disclosed, the entities can be from any field of knowledge or commerce, such as categories of books, categories of auction items, fields of knowledge such as science and engineering, or areas of business that are relevant to a company. 
         [0018]    One or more ontologies can be used to index a set of entities in this way. A query can be performed using terms from the ontologies. For each match of one or more terms, a similarity score is calculated as defined in equation (2) or a related scheme. The query is performed to identify entities that have been annotating using terms from one or more of the ontologies that are similar to the query. A P-value (either calculated dynamically or taken from a precalculated table) is assigned to each similarity score for each entity annotated by the ontology or ontologies being used. The P-values are used to rank the search results according to relevance. If multiple ontologies have been used (for instance, one ontology for each of the categories presented for online auctions), then the significance level associated with the P-value can be taken as a measure of which of the categories (one or more) is most appropriate for placing an item to be auctioned. 
         [0019]    Another aspect of the present invention is a rapid method for calculating similarity score distributions in ontologies. This method represents an acceleration of many thousand fold and makes the use of ontological similarity searches using statistical significance practicable for the first time. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0020]      FIG. 1  shows an excerpt of an ontology displayed in the form of a directed acycylic graph (DAG). 
           [0021]      FIG. 2  illustrates the relationship between information content and annotation frequency of ontology terms. 
           [0022]      FIG. 3  shows a measure of semantic similarity between terms. 
           [0023]      FIG. 4  shows an example of a domain ontology for classifying European wines. 
           [0024]      FIG. 5  shows an example of an ontology used to show the attributes on an item in a domain. 
           [0025]      FIG. 6  shows an example computation of a similarity measure for sets of terms. 
           [0026]      FIG. 7  is a depiction of an algorithm for computing an attribute of an ontology. 
           [0027]      FIG. 8  is a depiction of an algorithm for computing the score distribution for an ontology. 
       
    
    
     DETAILED DESCRIPTION 
       [0028]    The methods described herein utilize similarity measures in ontologies. One aspect of the methods is to use an ontology that describes the attributes of objects in a domain together with annotations of many domain objects to the terms of the ontology. For instance, if the domain is wine, a domain object could be a Riesling white wine. Attributes could be used to describe the color, taste, and other characteristics of the wine. Each object in the domain would be annotated to various combinations of the terms of the attribute ontology. 
         [0029]    The similarity between two terms in an ontology can be calculated as the IC of their most informative common ancestor (MICA) (Resnik, P., 1995. Using information content to evaluate semantic similarity in a taxonomy. In Proceedings of the 14th International Joint Conference on Artificial Intelligence) which is taken to be the negative logarithm of its probability, 
         [0000]        IC ( n )=−log  p ( n ),   (3)
 
         [0030]    where p(n) denotes the frequency of annotations of n among all items in the domain. For instance, the probability can be estimated by the frequency with which the term is used to annotate objects of a domain (if 7 objects from a domain containing 100 objects are annotated with some term a, then p(a)=0.07 and IC(a)=−log 0.07). Other probability measures can also be used. 
         [0031]    Denoting the set of all common ancestor terms of terms t 1  and t 2  as A(t 1 ,t 2 ), one may define the similarity between two terms t 1  and t 2  as 
         [0000]    
       
         
           
             
               
                 
                   
                     sim 
                      
                     
                       ( 
                       
                         
                           t 
                           1 
                         
                         , 
                         
                           t 
                           2 
                         
                       
                       ) 
                     
                   
                   = 
                   
                     
                       max 
                       
                         a 
                         ∈ 
                         
                           A 
                            
                           
                             ( 
                             
                               
                                 t 
                                 1 
                               
                               , 
                               
                                 t 
                                 2 
                               
                             
                             ) 
                           
                         
                       
                     
                      
                     
                       
                         - 
                         log 
                       
                        
                       
                           
                       
                        
                       
                         
                           p 
                            
                           
                             ( 
                             a 
                             ) 
                           
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
         [0032]    This measure is adapted to calculate the similarity between a set of query terms and all items in a domain. The query terms are used to describe the attributes of an object being sought after. For instance, if a customer is looking to find a dry fruity German white wine from an online catalog, he or she might search with the attribute ontology terms ‘white’, ‘fruity’, and ‘German’. A computer program or other tool would calculate the similarity between these query terms and the ontology terms used to annotate the objects of the domain (in this case, wines). There might be a high similarity between these query terms and say a Riesling wine which is annotated to ‘white’, ‘lemony taste’ and ‘German’, but a low similarity to a Lambrusco wine, which is annotated to ‘red’, ‘sweet’, and ‘Italian’. 
         [0033]    In order to calculate the similarity as described above, i.e. a set of query terms A and a set of terms B used to annotated an object in a domain, one needs to combine the pairwise similarities between pairs of ontology terms. A way of doing this is to take the average similarity of all possible pairwise combinations between the sets A and B (see equation 7), but many other ways are possible, such as taking the maximum pair similarity between any pair (see equation 8). 
         [0034]    The result of such a similarity search will be a score S that quantifies the similarity between the query set A and the domain object B. This score can be used to rank the relevance of the objects in a domain. For instance, if a customer is searching a catalog for wines, as described above, using an online catalog, a ranked list of links to the most relevant wines could be returned to the user according to the similarity score of each domain object (wine) with the query terms. A similar scheme could be used to rank the relevance of any kind of items in catalogs, archives, libraries, collections of documents, databases, and similar things. 
         [0035]    The aspect of the disclosed invention described in the previous section applies to attribute ontologies. The following aspects can be applied to any kind of ontology, including attribute and domain ontologies as described them in the Background section of this document. 
         [0036]    Dependent on the similarity measures used, the raw score is not expressive of the significance of the search. That is, a given raw score may represent a good match for one particular domain object, and a poor match for another. This represents a drawback of searching using the raw semantic similarity scores that are addressed with the following aspects of the disclosed invention. The P-value of a similarity search is defined as the probability to get a certain score S or better under a random model. Such a random model could be to consider drawing independently from all terms of the ontology or to draw terms with a specific hierarchical concept in mind. For a given score S the P-value can be easily computed from the complete score distribution, where one generates all possible queries, tabulates their scores, and calculates the number of queries Q that have a score≧S. 
         [0037]    For instance, if the ontology has V terms, and the query Q is made up of q ontology terms, then one can define the P-value of obtaining a certain score or better with a random query to some domain object A as follows: 
         [0000]    
       
         
           
             
               
                 
                   
                     P 
                      
                     
                       ( 
                       
                         S 
                         ≥ 
                         s 
                       
                       ) 
                     
                   
                   = 
                   
                     
                       
                         Number 
                          
                         
                             
                         
                          
                         of 
                          
                         
                             
                         
                          
                         queries 
                          
                         
                             
                         
                          
                         such 
                          
                         
                             
                         
                          
                         that 
                          
                         
                           
                               
                           
                            
                           
                               
                           
                         
                          
                         
                           sim 
                            
                           
                             ( 
                             
                               Q 
                               , 
                               A 
                             
                             ) 
                           
                         
                       
                       ≥ 
                       s 
                     
                     
                       Total 
                        
                       
                           
                       
                        
                       number 
                        
                       
                           
                       
                        
                       of 
                        
                       
                           
                       
                        
                       possible 
                        
                       
                           
                       
                        
                       queries 
                     
                   
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
         [0038]    The total number of possible queries depends on the way valid queries are defined. In one simple case (where any combination of q query terms without replacement is allowed), if the ontology has V terms, the total number of possible queries is: 
         [0000]    
       
         
           
             
               
                 
                   ( 
                   
                     
                       
                         V 
                       
                     
                     
                       
                         q 
                       
                     
                   
                   ) 
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
         [0039]    However, it is also possible to disallow certain combinations of terms. For instance, one could disallow queries containing a parent and child term. In this case, the numerator and denominator of equation (5) are changed accordingly. It is also possible to weight the probability with which a particular set of query terms is drawn. This could be reflected by using weighted sums in equation (5). Depending on the application, a multiple-testing correction may be applied to the raw P-values returned by the algorithm. 
         [0040]    The P-value is specified above in reference to an object A, but one might also define the P-value according to all objects that have been annotated with an ontology. 
         [0041]    Another way of obtaining P-values is to simulate many random queries and tabulate the resulting distribution of scores. For instance, to use a computer program to generate many thousands of random queries and record the scores. Yet another approach could be to use statistical methods to approximate the shape or tail of the score distribution and from that derive a P-value. 
         [0042]    This aspect of the disclosed invention can be used with any kind of ontology. The goal of the method is to exploit the structure of the ontology (that is, the data structure that is used to represent the ontology), in order to calculate the complete or partial score distribution without having to calculate a score for each possible set of query terms explicitly. Once the distribution of scores is known, it can then be used to calculate P-values for queries using equation (5). 
         [0043]    There are several ways of exploiting the structure of the ontology in order to do this using computer algorithms. In the following, an algorithm is presented in detail, but this algorithm should be taken to be representative of a class of algorithms that can be used for this purpose. 
         [0044]    An ontology O is considered composed of a set of terms that are linked via an is-a or part-of or other relationships. The ontology O can then be represented by a directed acyclic graph (DAG) D=(V,E), where every term is a node in V and every link is a directed edge in E. A directed edge going from node n 1  to n 2  is denoted e 1,2 . An item i is defined as an abstract entity to which terms of the ontology are annotated. 
         [0045]    Let Anc(n) be defined as the ancestors of n, i.e., the nodes that are found on all paths from node n to the root of D, including n. It is noted that the true-path rule states that if an item is explicitly annotated to a term n, it is implicitly annotated to Anc(n). In order to describe the implicit annotations annot S  is defined. Let S be the set of terms that has been explicitly annotated to item i, then annot S ={Anc(n)|n ∈ S}, namely all terms that are annotated to item i and all their ancestors in D. Let the set of common ancestors of two nodes n 1  and n 2  be defined as ComAnc(n1,n2)=Anc(n1)∩Anc(n2). Let Desc(n) be the set of descendant nodes of n, again including n. Note that in this notation descendant nodes are considered only once, even if there are multiple paths leading to them. A number of different pairwise term similarity measures can be used. In the following, one of them will be used (as described in equation 3). 
         [0046]    The information content is a nondecreasing function on the nodes of D as we descend in the hierarchy and therefore it is monotonic. The similarity between two nodes is defined in equation (4). 
         [0047]    In the following two definitions of similarity measures are introduced between two sets of terms I 1  and I 2 : 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       sim 
                       max 
                     
                      
                     
                       ( 
                       
                         
                           I 
                           1 
                         
                         , 
                         
                           I 
                           2 
                         
                       
                       ) 
                     
                   
                   = 
                   
                     
                       max 
                       
                         
                           
                             n 
                             1 
                           
                           ∈ 
                           
                             I 
                             1 
                           
                         
                         , 
                         
                             
                         
                          
                         
                           
                             n 
                              
                             
                                 
                             
                              
                             2 
                           
                           ∈ 
                           
                               
                           
                            
                           
                             I 
                             2 
                           
                         
                       
                     
                      
                     
                       sim 
                        
                       
                         ( 
                         
                           
                             n 
                             1 
                           
                           , 
                           
                             n 
                             2 
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   7 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       sim 
                       avg 
                     
                      
                     
                       ( 
                       
                         
                           I 
                           1 
                         
                         , 
                         
                           I 
                           2 
                         
                       
                       ) 
                     
                   
                   = 
                   
                     
                       1 
                       
                          
                         
                           I 
                           1 
                         
                          
                       
                     
                      
                     
                       
                         max 
                         
                           
                             
                               n 
                               1 
                             
                             ∈ 
                             
                               I 
                               1 
                             
                           
                           , 
                           
                               
                           
                            
                           
                             
                               n 
                               2 
                             
                             ∈ 
                             
                                 
                             
                              
                             
                               I 
                               2 
                             
                           
                         
                       
                        
                       
                         sim 
                          
                         
                           ( 
                           
                             
                               n 
                               1 
                             
                             , 
                             
                               n 
                               2 
                             
                           
                           ) 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
           
         
       
     
         [0048]    Note that Eq. (7) is not symmetric, i.e., it must not necessarily be true that sim avg (I 1 ,I 2 )=sim avg (I 2 ,I 1 ). See  FIG. 6  for an example computation of sim avg . Here, the target set TS={B,C} is shown as black nodes and the query set Q={D,F} is shown as nodes surrounded by dashed lines. Under the assumption that IC(C)≧IC(B) we have 
         [0000]    
       
         
           
             
               
                 sim 
                 avg 
               
                
               
                 ( 
                 
                   Q 
                   , 
                   TS 
                 
                 ) 
               
             
             = 
             
               
                 
                   
                     sim 
                      
                     
                       ( 
                       
                         D 
                         , 
                         B 
                       
                       ) 
                     
                   
                   + 
                   
                     sim 
                      
                     
                       ( 
                       
                         F 
                         , 
                         C 
                       
                       ) 
                     
                   
                 
                 2 
               
               = 
               
                 
                   
                     IC 
                      
                     
                       ( 
                       B 
                       ) 
                     
                   
                   + 
                   
                     IC 
                      
                     
                       ( 
                       C 
                       ) 
                     
                   
                 
                 2 
               
             
           
         
       
     
         [0049]    In what follows there is a need to compute the similarity also between a multiset and a set of terms. The concept of multisets (Blizard, W. D., Multiset theory. Notre Dame Journal of Formal Logic 1989, 30:36-66) is a generalization of the concept of sets. In contrast to sets, in which elements can only have a single membership, the elements of multisets may appear more than once. Therefore, all sets are multisets, while a multiset is not a set if an element appears more than once. 
         [0050]    Formally, a multiset M is a set of pairs, M={(u 1 ,M 1 ), . . . , (u d ,M d )}, in which u i  ∈ U={u 1 , . . . , u d } are the elements of the underlying set U, with U  ⊂  V. M i  defines the multiplicity of u i  in the multiset and the sum of the multiplicities of M is called the cardinality of M, denoted |M|. Note that only multiplicities in the domain of positive integers are considered. 
         [0051]    Denote the similarity for a multiset M compared to a set of terms I 1 , with a slight abuse of notation, as (similar equation for sim max  not shown) 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       sim 
                       avg 
                     
                      
                     
                       ( 
                       
                         M 
                         , 
                         
                           I 
                           1 
                         
                       
                       ) 
                     
                   
                   = 
                   
                     
                       1 
                       
                          
                         M 
                          
                       
                     
                      
                     
                       
                         ∑ 
                         
                           
                             ( 
                             
                               
                                 u 
                                 i 
                               
                               , 
                               
                                 M 
                                 i 
                               
                             
                             ) 
                           
                           ∈ 
                           M 
                         
                       
                        
                       
                           
                       
                        
                       
                         
                           M 
                           i 
                         
                         · 
                         
                           
                             max 
                             
                               
                                 n 
                                 j 
                               
                               ∈ 
                               
                                 I 
                                 1 
                               
                             
                           
                            
                           
                             
                               sim 
                                
                               
                                 ( 
                                 
                                   
                                     u 
                                     i 
                                   
                                   , 
                                   
                                     n 
                                     j 
                                   
                                 
                                 ) 
                               
                             
                             . 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   9 
                   ) 
                 
               
             
           
         
       
     
         [0052]    The multiset coefficient M(n,q)=binom(n+q−1,q) denotes the number of distinct multisets of cardinality q, with elements taken from a finite set of cardinality n. (Note that binom(n,m)=n!/m!(n−m)! denotes the binomial coefficient). The multiset coefficient describes how many ways there are to choose q elements from a set of n elements if repetitions are allowed. 
         [0053]    The algorithm will be used to calculate a P-value for the null hypothesis that a similarity score of S or greater for a set of q query terms Q and a target set TS has been observed by chance. This P-value is defined as: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       P 
                       
                         q 
                         , 
                         TS 
                       
                       sim 
                     
                      
                     
                       ( 
                       
                         S 
                         ≥ 
                         s 
                       
                       ) 
                     
                   
                    
                   
                     
                       
                         
                            
                           
                             
                               
                                 
                                   { 
                                   Q 
                                    
                                 
                                  
                                 
                                   sim 
                                    
                                   
                                     ( 
                                     
                                       Q 
                                       , 
                                       TS 
                                     
                                     ) 
                                   
                                 
                               
                               ≥ 
                               s 
                             
                             , 
                             
                               Q 
                               = 
                               
                                 
                                   { 
                                   
                                     
                                       n 
                                       1 
                                     
                                     , 
                                     … 
                                      
                                     
                                         
                                     
                                     , 
                                     
                                       n 
                                       q 
                                     
                                   
                                   } 
                                 
                                 ⊆ 
                                 V 
                               
                             
                           
                           } 
                         
                          
                       
                       
                         ( 
                         
                           
                             
                               
                                  
                                 V 
                                  
                               
                             
                           
                           
                             
                               q 
                             
                           
                         
                         ) 
                       
                     
                     . 
                   
                 
               
               
                 
                   ( 
                   10 
                   ) 
                 
               
             
           
         
       
     
         [0054]    Note that equation 10 defines one type of P-value and query model that satisfies equation 5, but other definitions that reflect different ways of weighting individual queries or query combinations, apply equally to the disclosed invention. 
         [0055]    No an is presented regarding how the complexity of a DAG D to a tree is reduced by exploiting the maximization step in the definition of similarity (see equation 7 and equation 8). Recall that all nodes that are annotated with terms from the target set TS are contained in annot TS . It can be shown that only the IC values of nodes in annot TS  are relevant for the score distribution computation. Put differently, D can be collapsed into subtrees that summarize all nodes in V which contribute the same score to the score distribution. In order to explain the property of these subtrees the most informative annotated ancestor (MIA) of a node n 1  ∈ V is defined as: 
         [0000]      MIA( n 1)={ n   2   |IC ( n   2 )=max sim( n   1   ,n   2 )}.   (11)
 
         [0056]    In words, it is considered for each node in V which annotated node in annot TS  will be selected in the maximization step over n 2  ∈ I 2  in Eq. (8) and Eq. (7). If several nodes n 2  ∈ annot TS  share the maximum information content with sim(n 1 ,n 2 ) in Eq. 11, then one node n 2  is arbitrarily selected, i.e., always |MIA(n 1 )|=1. Also it is defined that 
         [0000]      MIA( a )= a, ∀ a  ∈ annot TS .
 
         [0057]    The definition resolves the problems with nodes that have more than one parent and is the basic property exploited in the disclosed algorithm. Now all nodes in V that have the same MIA can be summarized. For all nodes a ∈ annot TS  the set of associated descendants (AD) of a is defined as: 
         [0000]      AD( a )={ n|n ∈ V :MIA( n )= a}   (12)
 
         [0058]    Example 1 If it is assumed that IC(C)≧IC(B) for the DAG in  FIG. 6 , then AD(A)={A}, AD(B)={B,D} and AD(C)={C,E,F}. Node F belongs to AD(C), because IC(C)=max n     1      ∈{A,B,C} sim(n 1 ,F), see Eq. (11). Note that all nodes in annot TS  belong to their own set of ADs. 
         [0059]    It will now be shown how to compute the subtrees in which all nodes are connected to their MIA by computing a maximum spanning tree. First, edge weights w i,j  to the edges of D are introduced. Let 
         [0000]    
       
         
           
             
               
                 
                   
                     w 
                     
                       i 
                       , 
                       j 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             
                               IC 
                                
                               
                                 ( 
                                 
                                   n 
                                   i 
                                 
                                 ) 
                               
                             
                             , 
                           
                         
                         
                           
                             
                               if 
                                
                               
                                   
                               
                                
                               
                                 n 
                                 i 
                               
                             
                             ∈ 
                             
                               annot 
                               TS 
                             
                           
                         
                       
                       
                         
                           
                             
                               max 
                                
                               
                                 { 
                                 
                                   
                                     w 
                                     
                                       h 
                                       , 
                                       i 
                                     
                                   
                                    
                                   
                                     
                                       e 
                                       
                                         h 
                                         , 
                                         i 
                                       
                                     
                                     ∈ 
                                     E 
                                   
                                 
                                 } 
                               
                             
                             , 
                           
                         
                         
                           otherwise 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   13 
                   ) 
                 
               
             
           
         
       
     
         [0060]    The edge weights are defined in a recursive manner. First, all weights of edges emerging from nodes in annot TS  are set. Then the maximum edge weight of all incoming edges for each node not in annot TS  are propagated to all outgoing edges of the node, and as such propagated throughout the graph. Computing the edge weights is efficiently done after the nodes of D have been sorted in topological order, see Alg. 3.1 that is depicted in  FIG. 7 . 
         [0061]    It can now be explained how to compute AD(n i ) for every n i  ∈ annot TS . To do so, the directed edges in E will be converted into undirected edges and introduce symmetric edge weights, i.e., w i,j =w j,i . It is denoted as D′=(V′,E′) the modified graph of D with undirected edges and edge weights. 
         [0062]    Let MST be the maximum spanning tree of D′. Let MST′ be the graph when all edges e i, j  ∈ MST for which n i ,n j  ∈ annot TS  holds are cut. MST′ has exactly |annot TS | connected components. The MST algorithm is applied in order to remove edges for every node n ∈ V with multiple parent terms in such a way to keep only the edge to the parent term that is connected to MIA(n). It can be shown that AD(n i )=C i  for each n i  ∈ annot TS , where C i  is the connected component in MST′ to which n i  belongs. 
         [0063]    The size of the sets AD(n i ) for each n i  ∈ annot TS  are the important quantities that are sought, that is the size of the different connected components of MST′. For each n i  ∈ annot TS  let C i  be the connected component in MST′ to which n i  belongs. It is defined that: 
         [0000]      Children( n   i )=| C   i |.   (14)
 
         [0064]    All these steps are summarized in Alg. 3.1 (see  FIG. 7 ). 
         [0065]    A naive approach to calculating the complete score distribution is to determine the similarity of each possible term combination Q  ⊂  V of size q with the fixed target set TS. The intuition behind the disclosed algorithm is that instead of selecting all combinations of all nodes of V and constructing the score distribution one by one, the combinations of nodes in annot TS  with identical scores are focused on, and the score frequencies are calculated by taking advantage of the nodes&#39; Children attribute. 
         [0066]    In order to compute the score distribution using only nodes in annot TS  for a fixed q, it is needed to consider combinations in which the same collapsed node can appear multiple times, regardless of the order. The total count of nodes with repetition has to be q. The properties of these types of combinations have been formalized in the theory of multisets (see above). 
         [0067]    Instead of considering sets of nodes in V the multisets M of nodes in annot TS  will now be considered. Clearly, U ∈ annot TS  for any such multiset M with underlying set U. The similarity score computed for M is the same for all of the sets of nodes that correspond to M. Therefore, if the number of such sets as well as the score corresponding to each multiset M of nodes in annot TS  can be calculated, the distribution of similarity scores over the original graph can easily be determined. The number of ways of drawing M i  nodes from a component of size Children(u i ) can be calculated using the binomial coefficient. The total number of combinations is then simply the product of all binomial coefficients, denoted as the multiset frequency for a multiset M: 
         [0000]    
       
         
           
             
               
                 
                   
                     freq 
                      
                     
                       ( 
                       M 
                       ) 
                     
                   
                   = 
                   
                     
                       ∏ 
                       
                         ( 
                         
                           
                             u 
                             i 
                           
                           , 
                           
                             M 
                             i 
                           
                         
                         ) 
                       
                     
                      
                     
                         
                     
                      
                     
                       ( 
                       
                         
                           
                             
                               Children 
                                
                               
                                 ( 
                                 
                                   u 
                                   i 
                                 
                                 ) 
                               
                             
                           
                         
                         
                           
                             
                               M 
                               i 
                             
                           
                         
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   15 
                   ) 
                 
               
             
           
         
       
     
         [0068]    The score distribution is represented as SD={(s 1 ,f 1 ), . . . , (s k ,f k )}. Every pair (s i ,f i ) ∈ SD contains a unique score s i  and a count f i  that defines its frequency within the distribution. 
         [0069]    The algorithm requires two basic operations that are applied to the set SD. The first operation called getScorePair returns the pair that represents the given score or nil in case the entry does not exist. The second operation denoted putScorePair puts the given pair into the set SD, overwriting any previously added pair with the same score. 
         [0070]    The complete procedure is shown in Algorithm 3.2 (see  FIG. 8 ). Distinct multisets are all enumerated instead of iterating over all sets of size q. Thereby the number of operations is reduced by many orders of magnitude. In order to compute the score distribution for other score models (for instance Eq. 7), the similarity measure in line 3 of Alg. 3.2 (see  FIG. 8 ) just needs to be replaced. 
         [0071]    The disclosed methods can be used for searching in different fields. The idea of searching with attribute ontologies using similarity scores and searching in any ontology using P-value based methods can be used to search in catalogs, databases, collections of documents or archives, and internet servers, among others. Our algorithm that allows rapid calculation of score distributions allows great savings in computational time that would otherwise be required to calculate the score distribution using other methods. 
         [0072]    Our methods can be used to search using a raw score for items annotated by an attribute ontology or using the P-value approach in any ontology. One score or P-value can calculated for each item in a database, catalog, collection or documents, etc. The items can be returned to the user with a ranking based on the score or P-value. It is possible to filter the items by P-value, such that only items that achieve a certain P-value threshold (say, above 0.05) are displayed to the user. 
         [0073]    The method described in section 3.4.1 can be used as a part of a method to search using multiple ontologies. For example, one can use different ontologies to annotate object from different domains. The user might want to know which ontology matches their query best, and which annotated objects from the domains represent the best matches. For instance, one might use one ontology to describe the attributes of books in computer science, a second ontology to describe the attributes of books in engineering, and a third to describe the attributes of books on mathematics. The terms of the ontologies could be used to annotate books or categories from a catalog of books on these subjects. These three topics overlap to some extent, and it may not always be obvious to a user whether to search for computer science, engineering, or mathematics books. A user can then enter query terms describing the kind of book they would like to find, and one could use the methods in section 3.4.1 to determine if there is a significant match to any book annotated by each of the three ontologies, and to return both which ontologies have relevant results as well as the best matches from the ontologies. 
         [0074]    This approach could be extended to any number of ontologies. A computer program could search the ontologies either one after the other or using other methods such as parallel computing. The results of searched such as this could help users both to identify the domains that are most relevant to a set of query terms (i.e., all ontologies that are associated with annotated objects that achieve some threshold score or P-value), and also to identify the annotated objects with the most significant result. 
         [0075]    A heuristic can be used to decide which ontologies to analyze in detail. Such heuristic can be implemented by various computational methods including using a hashtable to check whether words from the query are represented in the terms of an ontology and only then continuing with the ontological search method. 
         [0076]    It will be clear to one skilled in the state of the art that the above algorithms and methods may be altered in many ways without departing from the score of the invention. Accordingly, the scope of the invention should be determined by the following claims and their legal equivalents. 
         [0077]    In the following text some exemplary tasks which can be performed using the methods of this invention are presented. 
         [0078]    Companies with archives of documents can use company-specific ontologies to annotate business-relevant categories. Then, archives of documents could be scanned to identify documents that show the best match, or significant matches, to one or more categories. This would enable documents relevant to individual departments in a company such as Marketing or Logistics to be identified. A P-value cutoff can be chosen such that a computer program would forward the document to a given department only if a given level of statistical significance is achieved. 
         [0079]    Web sites offering online auctions or classified services can use different ontologies to describe the attributes of the wares or services they are offering for sale. 
         [0080]    Different ontologies can be used to describe different classifications of the wares or services depending on the business model of the web site. An ontological similarity search using the methods presented in this invention can be used to find the best category for the item to be placed on sale. Internet-based business that sell wares or that provide a platform for merchants or individuals to sell their wares that belong to certain categories (e.g., televisions or books) can also use one or more ontologies to annotate the offers with the ontology terms. The shop offers clients that are interested in a purchasing product a way to specify some of the attributes they desire. An ontological similarity search using our methods of claims can be used to find specific products satisfying these attributes which then can be presented to the client by the web server. If a user of an online store has found one item that is of interest (for instance, a book), the description of that item can be used with our methods to identify ontology terms for a query that will identify all categories that have similar items, in addition to the category that the item has originally been classified to, if any. 
         [0081]    The ontological search methods are used to determine the categories that show the best matches for the documents. The results of the search can be used to determine how to further process the document. For instance, if a significant match is found for one or several categories, the document could be sent to corresponding experts for further processing. If an online store organizes its wares (books or other items) into categories, the description sent by the manufacturer could be used to determine the categories and web pages under which the item would be presented for sale. 
         [0082]    Internet-based companies that offer users a portal to find other users that will likely fit for online dating or a personal romantic relationship can use ontologies as vocabularies to describe the user&#39;s personal characteristics such as preferences, appearance, wishes, dreams, and life plans. A database could comprise a collection of other users who have entered their personal data. 
         [0083]    A job agency or an operator of a job exchange can categorize individuals that are seeking work according to attributes relevant to the job market. They also can apply a similar scheme for the demands of specific vacant jobs of participating companies. Then the methods of our invention can be used to find the best candidates for vacant job position. 
         [0084]    Travel agencies or tour operators can describe the properties of their products using terms to describe the attributes of specific vacation offers such as location, type of hotel, and so on. The methods of our invention can be used to provide customers quick access to travel offers and especially to find vacations which fulfill the demands of the customer. 
         [0085]    Ontologies can be used to formulate queries in the semantic web. Resource Description Framework (RDF) and other interfaces of the semantic web are employed to identify semantic meanings of websites, which are used to annotate the websites with ontologies. These ontologies, and annotations, are used to search for content using the methods of our invention.