public class CleanQueryWriter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.io.BufferedWriter |
bw |
static long |
count |
static long |
datasetSize |
static long |
errorCount |
static long |
timeOutCount |
static long |
zeroCount |
Constructor and Description |
---|
CleanQueryWriter() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
decodeQuery(java.lang.String query)
Decode query
|
static java.lang.String |
encodeQuery(java.lang.String query)
Encode query
|
static void |
main(java.lang.String[] args) |
static void |
writeAskQueries(java.lang.String query,
java.lang.String endpoint,
java.lang.String graph)
Write SPARQL ASK queries into file
|
static void |
writeCleanQueriesFromQueryFiles(java.lang.String inputFile,
java.lang.String endpoint,
java.lang.String graph,
java.lang.String outputQueryFile)
This will read queries (one per line) from the file and write into another file with stats
|
static void |
writeCleanQueriesWithStats(java.util.HashMap<java.lang.String,java.util.Set<java.lang.String>> queries,
java.lang.String endpoint,
java.lang.String graph,
java.lang.String outputQueryFile)
Write clean queries with stats into file
|
static void |
writeConstructQueries(java.lang.String query,
java.lang.String endpoint,
java.lang.String graph)
Wrtie CONSTRUCT queries in to file
|
static void |
writeDescribeQueries(java.lang.String query,
java.lang.String endpoint,
java.lang.String graph)
Wrtie DESCRIBE queries in to file
|
static void |
writeSelectQueries(java.lang.String query,
java.lang.String endpoint,
java.lang.String graph)
Wrtie SELECT queries in to file
|
public static long count
public static long zeroCount
public static long errorCount
public static long timeOutCount
public static java.io.BufferedWriter bw
public static long datasetSize
public static void main(java.lang.String[] args) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException, org.openrdf.query.QueryEvaluationException, java.io.IOException
org.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
org.openrdf.query.QueryEvaluationException
java.io.IOException
public static void writeCleanQueriesFromQueryFiles(java.lang.String inputFile, java.lang.String endpoint, java.lang.String graph, java.lang.String outputQueryFile) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException, org.openrdf.query.QueryEvaluationException, java.io.IOException
inputFile
- Input query fileendpoint
- SPARQL endpointgraph
- Named Graph. Can be nulloutputQueryFile
- org.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
org.openrdf.query.QueryEvaluationException
java.io.IOException
public static java.lang.String encodeQuery(java.lang.String query)
query
- query stringpublic static void writeCleanQueriesWithStats(java.util.HashMap<java.lang.String,java.util.Set<java.lang.String>> queries, java.lang.String endpoint, java.lang.String graph, java.lang.String outputQueryFile) throws org.openrdf.query.QueryEvaluationException, org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException, java.io.IOException
queries
- Set of queriesendpoint
- the SPARQL endpoint to be used for calculating the results size and selectivities of queriesgraph
- Default named graph can be null as well where complete SPARQL endpoint will be queriedoutputQueryFile
- Output file to store the clean queries with statsorg.openrdf.query.QueryEvaluationException
org.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
java.io.IOException
public static java.lang.String decodeQuery(java.lang.String query)
query
- query stringpublic static void writeDescribeQueries(java.lang.String query, java.lang.String endpoint, java.lang.String graph) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException, java.io.IOException
query
- SPARQL DESCRIBE queryendpoint
- SPARQL endpointgraph
- Named Graph, cann be nullorg.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
java.io.IOException
public static void writeAskQueries(java.lang.String query, java.lang.String endpoint, java.lang.String graph) throws org.openrdf.query.MalformedQueryException, org.openrdf.repository.RepositoryException, org.openrdf.query.QueryEvaluationException, java.io.IOException
query
- SPARQL ASK queryendpoint
- SPARQL endpointgraph
- Named Graph, can be null as wellorg.openrdf.query.MalformedQueryException
org.openrdf.repository.RepositoryException
org.openrdf.query.QueryEvaluationException
java.io.IOException
public static void writeConstructQueries(java.lang.String query, java.lang.String endpoint, java.lang.String graph) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException, java.io.IOException
query
- SPARQL queryendpoint
- SPARQL endpointgraph
- Named Graph, can be nullorg.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
java.io.IOException
public static void writeSelectQueries(java.lang.String query, java.lang.String endpoint, java.lang.String graph) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException, org.openrdf.query.QueryEvaluationException, java.io.IOException
query
- queryendpoint
- SPARQL endpointgraph
- Named Graph, cann be nullorg.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
org.openrdf.query.QueryEvaluationException
java.io.IOException