public class CleanQueryReader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static java.io.BufferedReader |
br |
static int |
length |
Constructor and Description |
---|
CleanQueryReader() |
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) |
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
public static java.util.Map<java.lang.String,java.lang.Double[]> getNormalizedFeaturesVectors(java.lang.String queryFileWithStats) throws java.io.IOException
queryFileWithStats
- The file containing all the queries along with statsjava.io.IOException
public static double getClauseValue(java.lang.String line)
line
- Line can be like UNION = true so value will be 1 for true and 0 for falsepublic static double getFeatureValue(java.lang.String line)
line
- Line can be like BGPs = 5 so value will be 5public 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)
vectors
- Features vectorsmaxIndexVal
- The max feature valuepublic static int getVectorLength()
public static java.util.Set<java.lang.String> getQueriesWithStats(java.lang.String queryFileWithStats, java.util.Set<java.lang.String> queriesIds) throws java.io.IOException
queryFileWithStats
- Clean queries filequeriesIds
- Set of queries ids for which stats are requiredjava.io.IOException