private QueryData analyzeQuery ( String annisQuery , String queryFunction ) { QueryData queryData ; log . debug ( "analyze query for " + queryFunction + " function" ) ; if ( queryFunction != null && ! queryFunction . matches ( "(sql_)?subgraph" ) ) { queryData = queryDao . parseAQL ( annisQuery , corpusList ) ; } else { queryData = GraphHelper . createQueryData ( MatchGroup . parseString ( annisQuery ) , queryDao ) ; } queryData . setCorpusConfiguration ( queryDao . getCorpusConfiguration ( ) ) ; // filter by meta data queryData . setDocuments ( metaDataFilter . getDocumentsForMetadata ( queryData ) ) ; if ( queryFunction != null && queryFunction . matches ( "(sql_)?(annotate|find)" ) ) { queryData . addExtension ( new AnnotateQueryData ( left , right , segmentationLayer , filter ) ) ; queryData . addExtension ( new LimitOffsetQueryData ( offset , limit , order ) ) ; } else if ( queryFunction != null && queryFunction . matches ( "(sql_)?subgraph" ) ) { queryData . addExtension ( new AnnotateQueryData ( left , right , segmentationLayer , filter ) ) ; } else if ( queryFunction != null && queryFunction . matches ( "(sql_)?frequency" ) ) { if ( frequencyDef == null ) { out . println ( "You have to set the 'freq-def' property first" ) ; } else { queryData . addExtension ( frequencyDef ) ; } } if ( annisQuery != null ) { if ( benchmarkName == null ) { benchmarkName = "auto_" + benchmarks . size ( ) ; } Benchmark b = new AnnisRunner . Benchmark ( queryFunction + " " + annisQuery , queryData ) ; b . name = benchmarkName ; benchmarks . add ( b ) ; benchmarkName = null ; } // printing of NOTICE conflicts with benchmarkFile // out.println("NOTICE: corpus = " + queryData.getCorpusList()); return queryData ; }
Does the setup for the QueryData object .