org.aksw.simba.benchmark.log.operations

## Class VirtuosoLogReader

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

-     public class VirtuosoLogReader
      extends java.lang.Object

  Read Virtuoso Queries log
  Author:
    Saleem

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.Set<java.lang.Long>>>` | `normalizedQueries`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VirtuosoLogReader()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) static java.lang.String` | `getQuery(java.lang.String line)` Parse the log line and get the required SAPARQL query
    `static java.util.HashMap<java.lang.String,java.util.Set<java.lang.String>>` | `getVirtuosoLogQueries(java.lang.String queryLogDir)` Get the set of all distinct queries from the log.
    `java.util.Map<java.lang.String,java.util.Set<java.lang.String>>` | `getVirtuosoQueryExecutions(java.lang.String queryLogDir)` This method reads all the query logs in a directory and returns a map of the query to all its corresponding submissions.
    `static void` | `main(java.lang.String[] args)`
    `static com.hp.hpl.jena.query.Query` | `removeNamedGraphs(com.hp.hpl.jena.query.Query query)` Remove Named Graphs from query

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

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

- - ### Field Detail

    - #### normalizedQueries

          public static java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.Set<java.lang.Long>>> normalizedQueries

  - ### Constructor Detail

    - #### VirtuosoLogReader

          public VirtuosoLogReader()

  - ### Method Detail

    - #### main

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

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

    - #### getVirtuosoLogQueries

          public static java.util.HashMap<java.lang.String,java.util.Set<java.lang.String>> getVirtuosoLogQueries(java.lang.String queryLogDir)
                                                                                                           throws java.io.IOException

      Get the set of all distinct queries from the log.
      Parameters:
        `queryLogDir` - Query Log Directory
      Returns:
        queries A Map of queries. Where keys of the Map are:select, ask, describe, construct
      Throws:
        `java.io.IOException`

    - #### getVirtuosoQueryExecutions

          public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getVirtuosoQueryExecutions(java.lang.String queryLogDir)
                                                                                                     throws java.io.IOException

      This method reads all the query logs in a directory and returns a map of the query to all its corresponding submissions. Where a submission contain the sender IP and the submission date and time
      Parameters:
        `queryLogDir` - Query Log Directory
      Returns:
        Query to corresponding submissions hash map
      Throws:
        `java.io.IOException` - Io exceptions

    - #### removeNamedGraphs

          public static com.hp.hpl.jena.query.Query removeNamedGraphs(com.hp.hpl.jena.query.Query query)

      Remove Named Graphs from query
      Parameters:
        `query` - Jena parsed query
      Returns:
        Jena parsed query with no named graphs

    - #### getQuery

          static java.lang.String getQuery(java.lang.String line)

      Parse the log line and get the required SAPARQL query
      Parameters:
        `line` - Log Line
      Returns:
        query SPARQL quey