@Override
	public ImmutableList<TargetAtom> parse(String input) throws TargetQueryParserException {
		StringBuffer bf = new StringBuffer(input.trim());
		if (!bf.substring(bf.length() - 2, bf.length()).equals(" .")) {
			bf.insert(bf.length() - 1, ' ');
		}
		if (!prefixes.isEmpty()) {
			// Update the input by appending the directives
			appendDirectives(bf);
		}		
		try {
			CharStream inputStream = CharStreams.fromString(bf.toString());
			TurtleOBDALexer lexer = new TurtleOBDALexer(inputStream);

			//substitute the standard ConsoleErrorListener (simply print out the error) with ThrowingErrorListener
            lexer.removeErrorListeners();
			lexer.addErrorListener(ThrowingErrorListener.INSTANCE);

			CommonTokenStream tokenStream = new CommonTokenStream(lexer);
			TurtleOBDAParser parser = new TurtleOBDAParser(tokenStream);
            //substitute the standard ConsoleErrorListener (simply print out the error) with ThrowingErrorListener
			parser.removeErrorListeners();
			parser.addErrorListener(ThrowingErrorListener.INSTANCE);

			return (ImmutableList<TargetAtom>)visitor.visitParse(parser.parse());
		} catch (RuntimeException e) {
			throw new TargetQueryParserException(e.getMessage(), e);
		}
	}
@ Override public ImmutableList < TargetAtom > parse ( String input ) throws TargetQueryParserException { StringBuffer bf = new StringBuffer ( input . trim ( ) ) ; if ( ! bf . substring ( bf . length ( ) - 2 , bf . length ( ) ) . equals ( " ." ) ) { bf . insert ( bf . length ( ) - 1 , ' ' ) ; } if ( ! prefixes . isEmpty ( ) ) { appendDirectives ( bf ) ; } try { CharStream inputStream = CharStreams . fromString ( bf . toString ( ) ) ; TurtleOBDALexer lexer = new TurtleOBDALexer ( inputStream ) ; lexer . removeErrorListeners ( ) ; lexer . addErrorListener ( ThrowingErrorListener . INSTANCE ) ; CommonTokenStream tokenStream = new CommonTokenStream ( lexer ) ; TurtleOBDAParser parser = new TurtleOBDAParser ( tokenStream ) ; parser . removeErrorListeners ( ) ; parser . addErrorListener ( ThrowingErrorListener . INSTANCE ) ; return ( ImmutableList < TargetAtom > ) visitor . visitParse ( parser . parse ( ) ) ; } catch ( RuntimeException e ) { throw new TargetQueryParserException ( e . getMessage ( ) , e ) ; } }
Returns the CQIE object from the input string. If the input prefix
manager is null then no directive header will be appended.

@param input
A target query string written in Turtle syntax.
@return A CQIE object.