if ( syntaxURI == null )
syntaxURI = query.getSyntax() ;
else
query.setSyntax(syntaxURI) ;
Parser parser = Parser.createParser(syntaxURI) ;
if ( parser == null )
throw new UnsupportedOperationException("Unrecognized syntax for parsing: "+syntaxURI) ;
if ( query.getResolver() == null )
{
// Sort out the baseURI - if that fails, dump in a dummy one and continue.
try { baseURI = IRIResolver.chooseBaseURI(baseURI) ; }
catch (Exception ex)
{ baseURI = "http://localhost/defaultBase#" ; }
query.setResolver(new IRIResolver(baseURI)) ;
}
return parser.parse(query, queryString) ;
}