Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## pf.matcher.implementations.descriptive
Class DescriptiveMatcher

    java.lang.Object
      pf.matcher.implementations.descriptive.DescriptiveMatcher

All Implemented Interfaces:
  IMatcher

    public class DescriptiveMatcher

extends java.lang.Object
implements IMatcher

Author:
  rodrigo.amorim

Field Summary
`static char` | `ANCESTOR` This constant represents ancestor classes.
`private double` | `ancestorCoefficient` This variable represents the coefficient that will be used to calculate the structural similarity
`private double` | `basicCoefficient` This variable represents the coefficient that will be used to calculate the structural similarity
`private DictionaryReader` | `dictionaryReader` This variable will read the dictionary to calculate the descriptive similarity between the words
`static char` | `IMMEDIATE_CHILD` This constant represents immediate child classes.
`private double` | `immediateChildCoefficient` This variable represents the coefficient that will be used to calculate the structural similarity
`static char` | `INPUT` This constant represents an Input parameters.
`static char` | `LEAF` This constant represents leaf classes.
`private double` | `leafCoefficient` This variable represents the coefficient that will be used to calculate the structural similarity
`private com.hp.hpl.jena.ontology.OntModel` | `model` An inferencing model.
`(package private) com.hp.hpl.jena.ontology.OntModelSpec` | `ontModel` An ontology model
`private java.lang.String` | `ontology` An ontology.
`static char` | `OUTPUT` This Constant represents an Output parameters.
`private java.util.ArrayList<java.net.URI>` | `requestParameters` Attribute that holds all request parameters.
`private java.util.ArrayList<java.util.ArrayList<SimilarityDegree>>` | `resultInputs` An array that holds all correspondences between the inputs.
`private java.util.ArrayList<java.util.ArrayList<SimilarityDegree>>` | `resultOutputs` An array that holds all correspondences between the outputs.
`static char` | `SIBLING` This constant represents sibling classes.
`private double` | `siblingCoefficient` This variable represents the coefficient that will be used to calculate the structural similarity
`private double` | `structuralCoefficient` This variable represents the coefficient that will be used to calculate the structural similarity
`private double` | `threshold` This variable represents the threshold required by the user.

Constructor Summary
`DescriptiveMatcher(double basicCoefficient, double structuralCoefficient, double ancestorCoefficient, double immediateChldCoefficient, double leafCoefficient, double siblingCoefficient, double threshold, java.lang.String fileName)` Default construct of of the class.

Method Summary
`private double` | `caculateStructuralSimilarity(java.net.URI requestParameter, java.net.URI responseParameter, char owlProperty)` Method that calculates the descriptive similarity among the ancestors of the classes specified by the request and presented by the service
`private double` | `calculateAggStructuralSimilarity(java.net.URI serviceParameter, java.net.URI requestParameter)` Method that calculates the aggregation of the structural similarity.
`private double` | `calculateArithmeticMean(java.util.ArrayList<java.lang.Double> values)` Method that calculates the arithmetic mean of the elements from the matrix.
`private double` | `calculateBasicSimilarity(java.net.URI requestParameter, java.net.URI responseParameter)` Method that calculates the basic descriptive similarity between the words.
`private java.util.ArrayList<SimilarityDegree>` | `calculateDescriptiveMatcherSimilarity(java.util.ArrayList<java.net.URI> serviceParameters, char typeOfParameters)` Method that performs the matching among the words (basic and structural).
`private double` | `calculateDescriptiveSimilarity(java.net.URI requestParameter, java.net.URI serviceParameter)` Method that calculates the descriptive similarity.
`private double` | `calculateStandardDeviation(java.util.ArrayList<java.lang.Double> values, double arithmeticMean)` Method that calculates the arithmetic mean of the elements from the matrix.
`private SimilarityDegree` | `calculateTotalSimilarity(java.net.URI serviceParameter, java.net.URI requestParameter, double basicSimilarity, double structuralSimilarity)` Method that creates an object SimilarityDegree with the parameters matched.
`private java.util.List<java.net.URI>` | `getListOfClasses(java.net.URI parameter, char owlProperty)` Method that return the list of classes based on the property specified as parameter.
`java.util.ArrayList<java.util.ArrayList<SimilarityDegree>>` | `getResultInputs()`
`java.util.ArrayList<java.util.ArrayList<SimilarityDegree>>` | `getResultOutputs()`
`private boolean` | `hasSameOntology(java.net.URI requestParameter, java.net.URI serviceParameter)` Method that verify if the parameters have the same source/Ontology.
`private void` | `loadOntology(java.lang.String localOntology)` Method that test if the new ontology is equal the one loaded before.
`void` | `matcher(java.util.ArrayList<Service> services, Query request)` Method that has to be implemented due the interface.
`private boolean` | `verifyIfitsLeaf(com.hp.hpl.jena.ontology.OntClass ontClass)` Method that verifies if the class is a leaf in the ontology

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ANCESTOR

    public static final char ANCESTOR

  This constant represents ancestor classes.

  See Also:
    Constant Field Values

### SIBLING

    public static final char SIBLING

  This constant represents sibling classes.

  See Also:
    Constant Field Values

### LEAF

    public static final char LEAF

  This constant represents leaf classes.

  See Also:
    Constant Field Values

### IMMEDIATE_CHILD

    public static final char IMMEDIATE_CHILD

  This constant represents immediate child classes.

  See Also:
    Constant Field Values

### threshold

    private double threshold

  This variable represents the threshold required by the user.

### immediateChildCoefficient

    private double immediateChildCoefficient

  This variable represents the coefficient that will be used to calculate the structural similarity

### leafCoefficient

    private double leafCoefficient

  This variable represents the coefficient that will be used to calculate the structural similarity

### ancestorCoefficient

    private double ancestorCoefficient

  This variable represents the coefficient that will be used to calculate the structural similarity

### siblingCoefficient

    private double siblingCoefficient

  This variable represents the coefficient that will be used to calculate the structural similarity

### basicCoefficient

    private double basicCoefficient

  This variable represents the coefficient that will be used to calculate the structural similarity

### structuralCoefficient

    private double structuralCoefficient

  This variable represents the coefficient that will be used to calculate the structural similarity

### dictionaryReader

    private DictionaryReader dictionaryReader

  This variable will read the dictionary to calculate the descriptive similarity between the words

### ontology

    private java.lang.String ontology

  An ontology.

### INPUT

    public static final char INPUT

  This constant represents an Input parameters.

  See Also:
    Constant Field Values

### OUTPUT

    public static final char OUTPUT

  This Constant represents an Output parameters.

  See Also:
    Constant Field Values

### model

    private com.hp.hpl.jena.ontology.OntModel model

  An inferencing model.

### ontModel

    com.hp.hpl.jena.ontology.OntModelSpec ontModel

  An ontology model

### requestParameters

    private java.util.ArrayList<java.net.URI> requestParameters

  Attribute that holds all request parameters.

### resultInputs

    private java.util.ArrayList<java.util.ArrayList<SimilarityDegree>> resultInputs

  An array that holds all correspondences between the inputs.

### resultOutputs

    private java.util.ArrayList<java.util.ArrayList<SimilarityDegree>> resultOutputs

  An array that holds all correspondences between the outputs.

Constructor Detail

### DescriptiveMatcher

    public DescriptiveMatcher(double basicCoefficient,
                              double structuralCoefficient,
                              double ancestorCoefficient,
                              double immediateChldCoefficient,
                              double leafCoefficient,
                              double siblingCoefficient,
                              double threshold,
                              java.lang.String fileName)

  Default construct of of the class.

  Parameters:
    `basicCoefficient` - - coefficient of the basic similarity.
    `structuralCoefficient` - - coefficient of the structural similarity.
    `ancestorCoefficient` - - coefficient used in the structural similarity, it corresponds ancestors similarity
    `immediateChldCoefficient` - - coefficient used in the structural similarity, it corresponds immediate children similarity
    `leafCoefficient` - - coefficient used in the structural similarity, it corresponds leaves similarity
    `siblingCoefficient` - - coefficient used in the structural similarity, it corresponds siblings similarity
    `threshold` - - level of accuracy requested.

Method Detail

### getListOfClasses

    private java.util.List<java.net.URI> getListOfClasses(java.net.URI parameter,
                                                          char owlProperty)

  Method that return the list of classes based on the property specified as parameter.

  Parameters:
    `parameter` - - URI that contains the class of the ontology
    `resource` - -
    `owlProperty` -
  Returns:

### verifyIfitsLeaf

    private boolean verifyIfitsLeaf(com.hp.hpl.jena.ontology.OntClass ontClass)

  Method that verifies if the class is a leaf in the ontology

  Parameters:
    `ontClass` - - class that will be analyzed
  Returns:
    Return true if the class is a leaf and false otherwise.

### caculateStructuralSimilarity

    private double caculateStructuralSimilarity(java.net.URI requestParameter,
                                                java.net.URI responseParameter,
                                                char owlProperty)

  Method that calculates the descriptive similarity among the ancestors of the classes specified by the request and presented by the service

  Parameters:
    `requestParameter` - - A request parameter.
    `responseParameter` - - A response parameter.
  Returns:
    A value that represents the descriptive similarity among the ancestors classes.

### calculateDescriptiveSimilarity

    private double calculateDescriptiveSimilarity(java.net.URI requestParameter,
                                                  java.net.URI serviceParameter)

  Method that calculates the descriptive similarity.

  Parameters:
    `requestParameter` - - A request parameter.
    `responseParameter` - - A response parameter.
  Returns:
    SimilarityDegree - An object who holds informations about the similarity.

### calculateArithmeticMean

    private double calculateArithmeticMean(java.util.ArrayList<java.lang.Double> values)

  Method that calculates the arithmetic mean of the elements from the matrix.

  Parameters:
    `values` - - ArrayList with the elements from the matrix.
  Returns:
    An arithmetic mean of the elements.

### calculateStandardDeviation

    private double calculateStandardDeviation(java.util.ArrayList<java.lang.Double> values,
                                              double arithmeticMean)

  Method that calculates the arithmetic mean of the elements from the matrix.

  Parameters:
    `values` - - ArrayList with the elements from the matrix.
    `arithmeticMean` - - Element that holds the arithmetic mean calculated before.
  Returns:
    The standard deviation from the values from the matrix.

### calculateBasicSimilarity

    private double calculateBasicSimilarity(java.net.URI requestParameter,
                                            java.net.URI responseParameter)

  Method that calculates the basic descriptive similarity between the words.

  Parameters:
    `requestParameter` - - A request parameter.
    `responseParameter` - - A response parameter.
  Returns:
    Return the basic descriptive similarity

### calculateAggStructuralSimilarity

    private double calculateAggStructuralSimilarity(java.net.URI serviceParameter,
                                                    java.net.URI requestParameter)

  Method that calculates the aggregation of the structural similarity. (ancestors, immediate children, sibling and leaves).

  Parameters:
    `serviceParameter` - - A request parameter.
    `requestParameter` - - A response parameter.
  Returns:
    - Return the aggregation of the structural similarity.

### calculateTotalSimilarity

    private SimilarityDegree calculateTotalSimilarity(java.net.URI serviceParameter,
                                                      java.net.URI requestParameter,
                                                      double basicSimilarity,
                                                      double structuralSimilarity)

  Method that creates an object SimilarityDegree with the parameters matched.

  Parameters:
    `serviceParameter` - - A service parameter.
    `requestParameter` - - A request parameter.
    `basicSimilarity` - - Basic similarity calculated.
    `structuralSimilarity` - - Structural similarity calculated.
  Returns:
    - Return an SimilarityDegree object with the parameters previous matched.

### calculateDescriptiveMatcherSimilarity

    private java.util.ArrayList<SimilarityDegree> calculateDescriptiveMatcherSimilarity(java.util.ArrayList<java.net.URI> serviceParameters,
                                                                                        char typeOfParameters)

  Method that performs the matching among the words (basic and structural).

  Parameters:
    `serviceParameters` - - An ArrayList with all service parameters.
    `typeOfParameters` - - Type of parameters, Input or Output.
  Returns:
    - return an ArrayList with all correspondences matched.

### matcher

    public void matcher(java.util.ArrayList<Service> services,
                        Query request)

  Method that has to be implemented due the interface. It manager all the methods in the class FunctionalMatcher.

  Specified by:
    `matcher` in interface `IMatcher`
  Parameters:
    `services` - - An ArrayList with all services loaded.
    `request` - - A Query with data from request loaded.

### hasSameOntology

    private boolean hasSameOntology(java.net.URI requestParameter,
                                    java.net.URI serviceParameter)

  Method that verify if the parameters have the same source/Ontology.

  Parameters:
    `requestParameter` - - A request parameter.
    `serviceParameter` - - A service parameter.
  Returns:
    true/false - return true if the sources are the same and false if they are different.

### loadOntology

    private void loadOntology(java.lang.String localOntology)

  Method that test if the new ontology is equal the one loaded before.

  Parameters:
    `localOntology` - - New ontology to be tested.

### getResultInputs

    public java.util.ArrayList<java.util.ArrayList<SimilarityDegree>> getResultInputs()

  Returns:
    the resultInputs

### getResultOutputs

    public java.util.ArrayList<java.util.ArrayList<SimilarityDegree>> getResultOutputs()

  Returns:
    the resultOutputs

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD