org.aksw.simba.benchmark.comparisons

## Class AvgStats

- java.lang.Object
- - org.aksw.simba.benchmark.comparisons.AvgStats

-     public class AvgStats
      extends java.lang.Object

  Get min, max, avg, s.d of the benchmark for different features like triple patterns count, bgps, selectivity etc
  Author:
    Saleem

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `boundObjLiteralCount`
    `static long` | `BoundObjLiteralCount`
    `static long` | `boundObjURICount`
    `static long` | `boundPredCount`
    `static long` | `boundSbjCount`
    `static long` | `endpointSize1`
    `static java.util.Map<java.lang.Integer,java.lang.String>` | `featureDimensions`
    `static long` | `grandTotalTriplePatterns`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AvgStats()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.Map<java.lang.String,java.lang.Double>` | `getAvgLogFeatures(java.util.Set<java.lang.String> queries, java.lang.String endpoint, java.lang.String graph)`
    `static java.util.Map<java.lang.String,java.lang.Double>` | `getAvgLogFeatures(java.lang.String queryFileWithStats)`
    `static java.util.Set<java.lang.String>` | `getbsbmueries(java.lang.String bsbmRunFile)`
    `static java.util.Set<java.lang.String>` | `getDBPSBQueries(java.lang.String dbpediaBenchmarkQueriesFile)`
    `static java.util.List<java.lang.Double[]>` | `getDimensionWiseVectors(java.util.Map<java.lang.String,java.lang.Double[]> normalizedVectors)` Get the dimension-wise vectors of the the normalized vectors
    `static java.lang.Double[]` | `getFeaturesStateVector(java.lang.String query, java.lang.String endpoint, java.lang.String graph, java.lang.String type)` Print query statistics and return them as an array as well
    `static java.util.Map<java.lang.String,java.lang.Double[]>` | `getFeaturesStatsVectors(java.util.Set<java.lang.String> queries, java.lang.String endpoint, java.lang.String graph)`
    `static java.util.HashSet<HyperGraph.Vertex>` | `getJoinVertexCount(java.util.HashSet<HyperGraph.Vertex> Vertices)` Get the the list of join vertices
    `static java.util.Set<java.lang.String>` | `getLineByLineQueries(java.lang.String inputDir)`
    `static java.lang.Double[]` | `getMaxVector(java.util.List<java.lang.Double[]> dimLogVectors)`
    `static java.lang.Double[]` | `getMeanVector(java.util.List<java.lang.Double[]> vectors)` Get vector of Means
    `static java.lang.Double[]` | `getMinVector(java.util.List<java.lang.Double[]> dimLogVectors)`
    `static java.lang.String` | `getObjectVertexLabel(org.openrdf.query.algebra.StatementPattern stmt)` Get label for the object vertex of a triple pattern
    `static java.util.Map<java.lang.String,java.lang.Double>` | `getPercentUsedConstructs(java.util.Set<java.lang.String> queries)`
    `static java.util.Map<java.lang.String,java.lang.Double>` | `getPercentUsedLogConstructs(java.lang.String queryFileWithStats)`
    `static java.lang.String` | `getPredicateVertexLabel(org.openrdf.query.algebra.StatementPattern stmt)` Get label for the predicate vertex of a triple pattern
    `static java.util.Set<java.lang.String>` | `getQueriesFromDirectory(java.lang.String inputDir)`
    `static java.lang.Double[]` | `getStandardDeviationVector(java.util.List<java.lang.Double[]> vectors)` Get vector of S.Ds
    `static java.lang.String` | `getSubjectVertexLabel(org.openrdf.query.algebra.StatementPattern stmt)` Get label for the subject vertex of a triple pattern
    `static HyperGraph.Vertex` | `getVertex(java.lang.String label, java.util.HashSet<HyperGraph.Vertex> V)` Retrieve a vertex having a specific label from a set of Vertrices
    `static void` | `main(java.lang.String[] args)`
    `static void` | `printPercentClauses(java.util.Map<java.lang.String,java.lang.Double> percentClauses)`
    `static boolean` | `vertexExist(HyperGraph.Vertex sbjVertex, java.util.HashSet<HyperGraph.Vertex> V)` Check if a vertex already exists in set of all vertices

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

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

- - ### Field Detail

    - #### boundObjLiteralCount

          public static final int boundObjLiteralCount

      See Also:
        Constant Field Values

    - #### boundSbjCount

          public static long boundSbjCount

    - #### boundPredCount

          public static long boundPredCount

    - #### boundObjURICount

          public static long boundObjURICount

    - #### BoundObjLiteralCount

          public static long BoundObjLiteralCount

    - #### grandTotalTriplePatterns

          public static long grandTotalTriplePatterns

    - #### featureDimensions

          public static java.util.Map<java.lang.Integer,java.lang.String> featureDimensions

    - #### endpointSize1

          public static long endpointSize1

  - ### Constructor Detail

    - #### AvgStats

          public AvgStats()

  - ### Method Detail

    - #### main

          public static void main(java.lang.String[] args)
                           throws org.openrdf.repository.RepositoryException,
                                  org.openrdf.query.MalformedQueryException,
                                  org.openrdf.query.QueryEvaluationException,
                                  java.io.IOException

      Throws:
        `org.openrdf.repository.RepositoryException`
        `org.openrdf.query.MalformedQueryException`
        `org.openrdf.query.QueryEvaluationException`
        `java.io.IOException`

    - #### getbsbmueries

          public static java.util.Set<java.lang.String> getbsbmueries(java.lang.String bsbmRunFile)
                                                               throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getLineByLineQueries

          public static java.util.Set<java.lang.String> getLineByLineQueries(java.lang.String inputDir)
                                                                      throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getAvgLogFeatures

          public static java.util.Map<java.lang.String,java.lang.Double> getAvgLogFeatures(java.util.Set<java.lang.String> queries,
                                                                                           java.lang.String endpoint,
                                                                                           java.lang.String graph)
                                                                                    throws org.openrdf.query.MalformedQueryException,
                                                                                           org.openrdf.repository.RepositoryException,
                                                                                           org.openrdf.query.QueryEvaluationException,
                                                                                           java.io.IOException

      Throws:
        `org.openrdf.query.MalformedQueryException`
        `org.openrdf.repository.RepositoryException`
        `org.openrdf.query.QueryEvaluationException`
        `java.io.IOException`

    - #### getPercentUsedLogConstructs

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

      Throws:
        `java.io.IOException`

    - #### getAvgLogFeatures

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

      Throws:
        `java.io.IOException`

    - #### getMinVector

          public static java.lang.Double[] getMinVector(java.util.List<java.lang.Double[]> dimLogVectors)

    - #### getMaxVector

          public static java.lang.Double[] getMaxVector(java.util.List<java.lang.Double[]> dimLogVectors)

    - #### getStandardDeviationVector

          public static java.lang.Double[] getStandardDeviationVector(java.util.List<java.lang.Double[]> vectors)

      Get vector of S.Ds
      Parameters:
        `vectors` - List of Vectors
      Returns:
        vector of S.Ds

    - #### getMeanVector

          public static java.lang.Double[] getMeanVector(java.util.List<java.lang.Double[]> vectors)

      Get vector of Means
      Parameters:
        `vectors` - List of Vectors
      Returns:
        vector of means

    - #### getDimensionWiseVectors

          public static java.util.List<java.lang.Double[]> getDimensionWiseVectors(java.util.Map<java.lang.String,java.lang.Double[]> normalizedVectors)

      Get the dimension-wise vectors of the the normalized vectors
      Parameters:
        `normalizedVectors` - Map of query ids to corresponding normalized vectors
      Returns:
        List of dimension wise vectors

    - #### getDBPSBQueries

          public static java.util.Set<java.lang.String> getDBPSBQueries(java.lang.String dbpediaBenchmarkQueriesFile)
                                                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### printPercentClauses

          public static void printPercentClauses(java.util.Map<java.lang.String,java.lang.Double> percentClauses)

    - #### getPercentUsedConstructs

          public static java.util.Map<java.lang.String,java.lang.Double> getPercentUsedConstructs(java.util.Set<java.lang.String> queries)

    - #### getQueriesFromDirectory

          public static java.util.Set<java.lang.String> getQueriesFromDirectory(java.lang.String inputDir)
                                                                         throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getFeaturesStatsVectors

          public static java.util.Map<java.lang.String,java.lang.Double[]> getFeaturesStatsVectors(java.util.Set<java.lang.String> queries,
                                                                                                   java.lang.String endpoint,
                                                                                                   java.lang.String graph)
                                                                                            throws org.openrdf.query.MalformedQueryException,
                                                                                                   org.openrdf.repository.RepositoryException,
                                                                                                   org.openrdf.query.QueryEvaluationException,
                                                                                                   java.io.IOException

      Throws:
        `org.openrdf.query.MalformedQueryException`
        `org.openrdf.repository.RepositoryException`
        `org.openrdf.query.QueryEvaluationException`
        `java.io.IOException`

    - #### getFeaturesStateVector

          public static java.lang.Double[] getFeaturesStateVector(java.lang.String query,
                                                                  java.lang.String endpoint,
                                                                  java.lang.String graph,
                                                                  java.lang.String type)
                                                           throws org.openrdf.query.MalformedQueryException,
                                                                  org.openrdf.repository.RepositoryException,
                                                                  org.openrdf.query.QueryEvaluationException,
                                                                  java.io.IOException

      Print query statistics and return them as an array as well
      Parameters:
        `query` - SPARQL query
        `graph` - Named graph
        `endpoint` - endpoint
        `type` -
      Returns:
        Stats vector
      Throws:
        `org.openrdf.query.MalformedQueryException`
        `org.openrdf.query.QueryEvaluationException`
        `org.openrdf.repository.RepositoryException`
        `java.io.IOException`

    - #### getJoinVertexCount

          public static java.util.HashSet<HyperGraph.Vertex> getJoinVertexCount(java.util.HashSet<HyperGraph.Vertex> Vertices)

      Get the the list of join vertices
      Parameters:
        `Vertices` - List of vertices in BGP
      Returns:
        V Collection of join vertices

    - #### getObjectVertexLabel

          public static java.lang.String getObjectVertexLabel(org.openrdf.query.algebra.StatementPattern stmt)

      Get label for the object vertex of a triple pattern
      Parameters:
        `stmt` - triple pattern
      Returns:
        label Vertex label

    - #### getPredicateVertexLabel

          public static java.lang.String getPredicateVertexLabel(org.openrdf.query.algebra.StatementPattern stmt)

      Get label for the predicate vertex of a triple pattern
      Parameters:
        `stmt` - triple pattern
      Returns:
        label Vertex label

    - #### getSubjectVertexLabel

          public static java.lang.String getSubjectVertexLabel(org.openrdf.query.algebra.StatementPattern stmt)

      Get label for the subject vertex of a triple pattern
      Parameters:
        `stmt` - triple pattern
      Returns:
        label Vertex label

    - #### vertexExist

          public static boolean vertexExist(HyperGraph.Vertex sbjVertex,
                                            java.util.HashSet<HyperGraph.Vertex> V)

      Check if a vertex already exists in set of all vertices
      Parameters:
        `sbjVertex` -
        `V` - Set of all vertices
      Returns:

    - #### getVertex

          public static HyperGraph.Vertex getVertex(java.lang.String label,
                                                    java.util.HashSet<HyperGraph.Vertex> V)

      Retrieve a vertex having a specific label from a set of Vertrices
      Parameters:
        `label` - Label of vertex to be retrieved
        `V` - Set of vertices
      Returns:
        Vertex if exist otherwise null