org.aksw.simba.benchmark.log.operations

## Class LogRDFizer

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

-     public class LogRDFizer
      extends java.lang.Object

  Generat Linked Log RDF dataset
  Author:
    Saleem

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.io.BufferedWriter` | `bw`
    `org.openrdf.repository.RepositoryConnection` | `con`
    `long` | `endpointSize`
    `static int` | `maxRunTime`
    `static long` | `queryNo`
    `int` | `runtimeErrorCount`
    `static java.io.BufferedWriter` | `tobw`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LogRDFizer()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getQueryResultSize(java.lang.String queryStr, java.lang.String localEndpoint, java.lang.String sesameQueryType)` Get result size of the given query
    `java.lang.String` | `getRDFUserExecutions(com.hp.hpl.jena.query.Query query, java.util.Set<java.lang.String> submissions, java.lang.String separator)` Get all executions (IP,Time) of the given query
    `void` | `initializeRepoConnection(java.lang.String endpointUrl)` Initialize repository for a SPARQL endpoint
    `static void` | `main(java.lang.String[] args)`
    `void` | `RDFizeASK(com.hp.hpl.jena.query.Query query, java.lang.String localEndpoint, java.lang.String graph, java.util.Set<java.lang.String> submissions, java.lang.String separator, java.lang.String baseURI)` RDFized ASK query
    `void` | `RDFizeConstruct(com.hp.hpl.jena.query.Query query, java.lang.String localEndpoint, java.lang.String graph, java.util.Set<java.lang.String> submissions, java.lang.String separator, java.lang.String baseURI)` RDFized CONSTRUCT query
    `void` | `RDFizeDescribe(com.hp.hpl.jena.query.Query query, java.lang.String localEndpoint, java.lang.String graph, java.util.Set<java.lang.String> submissions, java.lang.String separator, java.lang.String baseURI)` RDFized DESCRIBE query
    `void` | `rdfizeLog(java.util.Map<java.lang.String,java.util.Set<java.lang.String>> queryToSubmissions, java.lang.String localEndpoint, java.lang.String publicEndpoint, java.lang.String graph, java.lang.String baseURI, java.lang.String outputFile, java.lang.String separator)`
    RDFize Log
    `void` | `RDFizeSelect(com.hp.hpl.jena.query.Query query, java.lang.String localEndpoint, java.lang.String graph, java.util.Set<java.lang.String> submissions, java.lang.String separator, java.lang.String baseURI)` RDFized SELECT query
    `void` | `writePrefixes(java.lang.String baseURI)` Write RDF Prefixes

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

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

- - ### Field Detail

    - #### bw

          public static java.io.BufferedWriter bw

    - #### con

          public org.openrdf.repository.RepositoryConnection con

    - #### tobw

          public static java.io.BufferedWriter tobw

    - #### queryNo

          public static long queryNo

    - #### maxRunTime

          public static int maxRunTime

    - #### runtimeErrorCount

          public int runtimeErrorCount

    - #### endpointSize

          public long endpointSize

  - ### Constructor Detail

    - #### LogRDFizer

          public LogRDFizer()

  - ### Method Detail

    - #### main

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

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

    - #### rdfizeLog

          public void rdfizeLog(java.util.Map<java.lang.String,java.util.Set<java.lang.String>> queryToSubmissions,
                                java.lang.String localEndpoint,
                                java.lang.String publicEndpoint,
                                java.lang.String graph,
                                java.lang.String baseURI,
                                java.lang.String outputFile,
                                java.lang.String separator)
                         throws java.io.IOException,
                                org.openrdf.repository.RepositoryException,
                                org.openrdf.query.MalformedQueryException,
                                org.openrdf.query.QueryEvaluationException

      RDFize Log
      Parameters:
        `queryToSubmissions` - A map which store a query string (single line) as key and all the corresponding submissions as List. Where a submission is a combination of User encrypted ip and the data,time of the query request. The I.P and the time is separated by a separator
        `localEndpoint` - Endpoint which will be used for feature generation
        `publicEndpoint` - Public endpoint of the log
        `graph` - named Graph, can be null
        `baseURI` - Base URI of the log dataset
        `outputFile` - The output RDF file
        `separator` - Submission separator. Explained above
      Throws:
        `java.io.IOException`
        `org.openrdf.repository.RepositoryException`
        `org.openrdf.query.MalformedQueryException`
        `org.openrdf.query.QueryEvaluationException`

    - #### RDFizeSelect

          public void RDFizeSelect(com.hp.hpl.jena.query.Query query,
                                   java.lang.String localEndpoint,
                                   java.lang.String graph,
                                   java.util.Set<java.lang.String> submissions,
                                   java.lang.String separator,
                                   java.lang.String baseURI)
                            throws java.io.IOException,
                                   org.openrdf.repository.RepositoryException,
                                   org.openrdf.query.MalformedQueryException

      RDFized SELECT query
      Parameters:
        `query` - Query
        `localEndpoint` - Local endpoint
        `graph` - Named Graph, can be null
        `submissions` - List of all submissions (I.P:ExecutionTime) of the given query
        `separator` - Separator string between I.P and execution time
        `baseURI` - Base URI
      Throws:
        `java.io.IOException`
        `org.openrdf.repository.RepositoryException`
        `org.openrdf.query.MalformedQueryException`

    - #### RDFizeDescribe

          public void RDFizeDescribe(com.hp.hpl.jena.query.Query query,
                                     java.lang.String localEndpoint,
                                     java.lang.String graph,
                                     java.util.Set<java.lang.String> submissions,
                                     java.lang.String separator,
                                     java.lang.String baseURI)
                              throws java.io.IOException,
                                     org.openrdf.repository.RepositoryException,
                                     org.openrdf.query.MalformedQueryException

      RDFized DESCRIBE query
      Parameters:
        `query` - Query
        `localEndpoint` - Local endpoint
        `graph` - Named Graph, can be null
        `submissions` - List of all submissions (I.P:ExecutionTime) of the given query
        `separator` - Separator string between I.P and execution time
        `baseURI` - Base Uri
      Throws:
        `java.io.IOException`
        `org.openrdf.repository.RepositoryException`
        `org.openrdf.query.MalformedQueryException`

    - #### RDFizeConstruct

          public void RDFizeConstruct(com.hp.hpl.jena.query.Query query,
                                      java.lang.String localEndpoint,
                                      java.lang.String graph,
                                      java.util.Set<java.lang.String> submissions,
                                      java.lang.String separator,
                                      java.lang.String baseURI)
                               throws java.io.IOException,
                                      org.openrdf.repository.RepositoryException,
                                      org.openrdf.query.MalformedQueryException

      RDFized CONSTRUCT query
      Parameters:
        `query` - Query
        `localEndpoint` - Local endpoint
        `graph` - Named Graph, can be null
        `submissions` - List of all submissions (I.P:ExecutionTime) of the given query
        `separator` - Separator string between I.P and execution time
        `baseURI` - Base URI
      Throws:
        `java.io.IOException`
        `org.openrdf.repository.RepositoryException`
        `org.openrdf.query.MalformedQueryException`

    - #### RDFizeASK

          public void RDFizeASK(com.hp.hpl.jena.query.Query query,
                                java.lang.String localEndpoint,
                                java.lang.String graph,
                                java.util.Set<java.lang.String> submissions,
                                java.lang.String separator,
                                java.lang.String baseURI)
                         throws java.io.IOException,
                                org.openrdf.repository.RepositoryException,
                                org.openrdf.query.MalformedQueryException

      RDFized ASK query
      Parameters:
        `query` - Query
        `localEndpoint` - Local endpoint
        `graph` - Named Graph, can be null
        `submissions` - List of all submissions (I.P:ExecutionTime) of the given query
        `separator` - Separator string between I.P and execution time
        `baseURI` - Base URI
      Throws:
        `java.io.IOException`
        `org.openrdf.repository.RepositoryException`
        `org.openrdf.query.MalformedQueryException`

    - #### getRDFUserExecutions

          public java.lang.String getRDFUserExecutions(com.hp.hpl.jena.query.Query query,
                                                       java.util.Set<java.lang.String> submissions,
                                                       java.lang.String separator)

      Get all executions (IP,Time) of the given query
      Parameters:
        `query` - Query
        `submissions` - Query submissions in form of IP:Time
        `separator` - String separator between IP:Time
      Returns:
        Stats

    - #### getQueryResultSize

          public long getQueryResultSize(java.lang.String queryStr,
                                         java.lang.String localEndpoint,
                                         java.lang.String sesameQueryType)
                                  throws org.openrdf.repository.RepositoryException,
                                         org.openrdf.query.MalformedQueryException,
                                         java.io.IOException

      Get result size of the given query
      Parameters:
        `queryStr` - Query
        `localEndpoint` - Endpoint url where this query has to be executed
        `sesameQueryType` - Query type {SELECT, ASK, CONSTRUCT, DESCRIBE}
      Returns:
        ResultSize
      Throws:
        `org.openrdf.repository.RepositoryException`
        `org.openrdf.query.MalformedQueryException`
        `java.io.IOException`

    - #### writePrefixes

          public void writePrefixes(java.lang.String baseURI)
                             throws java.io.IOException

      Write RDF Prefixes
      Parameters:
        `baseURI` - Base URI of the log dataset
      Throws:
        `java.io.IOException`

    - #### initializeRepoConnection

          public void initializeRepoConnection(java.lang.String endpointUrl)
                                        throws org.openrdf.repository.RepositoryException

      Initialize repository for a SPARQL endpoint
      Parameters:
        `endpointUrl` - Endpoint Url
      Throws:
        `org.openrdf.repository.RepositoryException`