@ Override public MarkLogicQuery prepareQuery ( QueryLanguage queryLanguage , String queryString , String baseURI ) throws RepositoryException , MalformedQueryException { // function routing based on query form if ( SPARQL . equals ( queryLanguage ) ) { String queryStringWithoutProlog = QueryParserUtil . removeSPARQLQueryProlog ( queryString ) . toUpperCase ( ) ; if ( queryStringWithoutProlog . startsWith ( "SELECT" ) ) { return prepareTupleQuery ( queryLanguage , queryString , baseURI ) ; //must be a TupleQuery } else if ( queryStringWithoutProlog . startsWith ( "ASK" ) ) { return prepareBooleanQuery ( queryLanguage , queryString , baseURI ) ; //must be a BooleanQuery } else { return prepareGraphQuery ( queryLanguage , queryString , baseURI ) ; //all the rest use GraphQuery } } throw new UnsupportedQueryLanguageException ( "Unsupported query language " + queryLanguage . getName ( ) ) ; }
base method for prepareQuery