owltools.sim
Class DescriptionTreeSimilarity

java.lang.Object
  extended by owltools.sim.Similarity
      extended by owltools.sim.DescriptionTreeSimilarity

public class DescriptionTreeSimilarity
extends Similarity

A similarity between two entities constructed by threading two description trees together. ALGORITHM:

 
 build(a,b) :
   N = {}
   foreach direct parent edge Ea:
     find closest match for Ea.tgt in all reflexive ancestors of b
     Eb = edge between b and b'
     LCS = all least common reachable ancestors of a,b
     if |LCS| = 0 : n = null
              = 1 : n = < LCS[1] Ea Eb>
              > 1 : n = build(Ea.t,Eb.t)
                    extend n.Ea + Ea
                    extent n.Eb + Eb
      add n to N
      
   N' = map { pathToExpression } N
   if |N| = 0 : return null
          = 1 : return N'[1]
          > 1 : return IntersectionOf(N')
  
  

Author:
cjm

Field Summary
 boolean forceReflexivePropertyCreation
           
 
Fields inherited from class owltools.sim.Similarity
minScore
 
Constructor Summary
DescriptionTreeSimilarity()
           
 
Method Summary
 owltools.sim.DescriptionTreeSimilarity.ConvergentPath buildDescription(org.semanticweb.owlapi.model.OWLObject a, org.semanticweb.owlapi.model.OWLObject b)
          Recursively build a class expression that subsumes a and b.
 owltools.sim.DescriptionTreeSimilarity.ConvergentPath buildDescription(org.semanticweb.owlapi.model.OWLObject a, org.semanticweb.owlapi.model.OWLObject b, Set<org.semanticweb.owlapi.model.OWLObject> fullLCSs)
           
 void calculate(SimEngine simEngine, org.semanticweb.owlapi.model.OWLObject a, org.semanticweb.owlapi.model.OWLObject b)
           
 void print(PrintStream s)
           
 void printX(PrintStream s, org.semanticweb.owlapi.model.OWLObject x)
           
 void printX(PrintStream s, org.semanticweb.owlapi.model.OWLObject x, int depth)
           
 double quickScore(Set<org.semanticweb.owlapi.model.OWLObject> csl, Set<org.semanticweb.owlapi.model.OWLObject> usl)
           
protected  void translateResultsToOWLAxioms(String id, org.semanticweb.owlapi.model.OWLNamedIndividual result, Set<org.semanticweb.owlapi.model.OWLAxiom> axioms)
          adds additional axioms specific to this method.
 
Methods inherited from class owltools.sim.Similarity
addResultsToOWLOntology, annotationIRI, createOWLOntologyFromResults, getScore, isAboveMinScore, print, print, printDescription, printDescription, report, setScore, setScore, splitIRI, toString, translateResultsToOWLAxioms
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

forceReflexivePropertyCreation

public boolean forceReflexivePropertyCreation
Constructor Detail

DescriptionTreeSimilarity

public DescriptionTreeSimilarity()
Method Detail

calculate

public void calculate(SimEngine simEngine,
                      org.semanticweb.owlapi.model.OWLObject a,
                      org.semanticweb.owlapi.model.OWLObject b)
               throws SimEngine.SimilarityAlgorithmException
Specified by:
calculate in class Similarity
Throws:
SimEngine.SimilarityAlgorithmException

quickScore

public double quickScore(Set<org.semanticweb.owlapi.model.OWLObject> csl,
                         Set<org.semanticweb.owlapi.model.OWLObject> usl)

buildDescription

public owltools.sim.DescriptionTreeSimilarity.ConvergentPath buildDescription(org.semanticweb.owlapi.model.OWLObject a,
                                                                              org.semanticweb.owlapi.model.OWLObject b)
Recursively build a class expression that subsumes a and b. Algorithm: traverse description tree a, one edge at a time, finding the best subtree in b that matches. if there are multiple paths from a leading to a LCS, create an intersection expression.


buildDescription

public owltools.sim.DescriptionTreeSimilarity.ConvergentPath buildDescription(org.semanticweb.owlapi.model.OWLObject a,
                                                                              org.semanticweb.owlapi.model.OWLObject b,
                                                                              Set<org.semanticweb.owlapi.model.OWLObject> fullLCSs)

translateResultsToOWLAxioms

protected void translateResultsToOWLAxioms(String id,
                                           org.semanticweb.owlapi.model.OWLNamedIndividual result,
                                           Set<org.semanticweb.owlapi.model.OWLAxiom> axioms)
adds additional axioms specific to this method. Creates a named LCS class equivalent to the generated expression

Specified by:
translateResultsToOWLAxioms in class Similarity
Parameters:
id -
result -
axioms -

print

public void print(PrintStream s)
Overrides:
print in class Similarity

printX

public void printX(PrintStream s,
                   org.semanticweb.owlapi.model.OWLObject x)

printX

public void printX(PrintStream s,
                   org.semanticweb.owlapi.model.OWLObject x,
                   int depth)


Copyright © 2010-2012. All Rights Reserved.