org.aksw.simba.benchmark.log.operations

## Class CleanQueryReader

- java.lang.Object
- - org.aksw.simba.benchmark.log.operations.CleanQueryReader

-     public class CleanQueryReader
      extends java.lang.Object

  Read Clean Queries (containing stats) from File
  Author:
    Saleem

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) static java.io.BufferedReader` | `br`
    `static int` | `length`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CleanQueryReader()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static double` | `getClauseValue(java.lang.String line)` Get the SPARQL clause value i.e.
    `static double` | `getFeatureValue(java.lang.String line)` Get the SPARQL feature value
    `static java.util.Map<java.lang.String,java.lang.Double[]>` | `getNormalizedFeaturesVectors(java.lang.String queryFileWithStats)` Get the normalized features vectors of the queries.
    `static java.util.Map<java.lang.String,java.lang.Double[]>` | `getNormalizedVectors(java.util.Map<java.lang.String,java.lang.Double[]> vectors, java.lang.Double[] maxIndexVal)` Get normalized vectors from the given vectors
    `static java.util.Set<java.lang.String>` | `getQueriesWithStats(java.lang.String queryFileWithStats, java.util.Set<java.lang.String> queriesIds)` Get the queries along with stats from clean queries file
    `static int` | `getVectorLength()` Get the length of the vectors or dimensions
    `static void` | `main(java.lang.String[] args)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### length

          public static int length

    - #### br

          static java.io.BufferedReader br

  - ### Constructor Detail

    - #### CleanQueryReader

          public CleanQueryReader()

  - ### Method Detail

    - #### main

          public static void main(java.lang.String[] args)
                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getNormalizedFeaturesVectors

          public static java.util.Map<java.lang.String,java.lang.Double[]> getNormalizedFeaturesVectors(java.lang.String queryFileWithStats)
                                                                                                 throws java.io.IOException

      Get the normalized features vectors of the queries.
      Parameters:
        `queryFileWithStats` - The file containing all the queries along with stats
      Returns:
        Normalized Vectors
      Throws:
        `java.io.IOException`

    - #### getClauseValue

          public static double getClauseValue(java.lang.String line)

      Get the SPARQL clause value i.e. 1 or 0
      Parameters:
        `line` - Line can be like UNION = true so value will be 1 for true and 0 for false
      Returns:
        boolean value

    - #### getFeatureValue

          public static double getFeatureValue(java.lang.String line)

      Get the SPARQL feature value
      Parameters:
        `line` - Line can be like BGPs = 5 so value will be 5
      Returns:
        double value of the feature

    - #### getNormalizedVectors

          public static java.util.Map<java.lang.String,java.lang.Double[]> getNormalizedVectors(java.util.Map<java.lang.String,java.lang.Double[]> vectors,
                                                                                                java.lang.Double[] maxIndexVal)

      Get normalized vectors from the given vectors
      Parameters:
        `vectors` - Features vectors
        `maxIndexVal` - The max feature value
      Returns:
        normalizedVectors

    - #### getVectorLength

          public static int getVectorLength()

      Get the length of the vectors or dimensions
      Returns:
        lenght lenght of the vectors

    - #### getQueriesWithStats

          public static java.util.Set<java.lang.String> getQueriesWithStats(java.lang.String queryFileWithStats,
                                                                            java.util.Set<java.lang.String> queriesIds)
                                                                     throws java.io.IOException

      Get the queries along with stats from clean queries file
      Parameters:
        `queryFileWithStats` - Clean queries file
        `queriesIds` - Set of queries ids for which stats are required
      Returns:
        Queries with stats
      Throws:
        `java.io.IOException`