I have in Java the following code, that uses the Virtuoso Jena provider API. I would like to do a query using an alias. I tried putting parenthesis but nothing worked. If I put the same query in the endpoint directly it works.

```
    query = "select ?a AS ?count where {?a <uri> ?b.} limit 10";        
    VirtGraph set = new VirtGraph (url, "user", "pass");
    Query sparql = QueryFactory.create(query);
    VirtuosoQueryExecution vqe = VirtuosoQueryExecutionFactory.create(sparql, set);
    vqe.execSelect();

```

I recieve this error:

```
  com.hp.hpl.jena.query.QueryParseException:
    Lexical error at line 1, column 13.  Encountered: " " (32), after : "AS"
    at com.hp.hpl.jena.sparql.lang.ParserSPARQL.perform(ParserSPARQL.java:99)

```

> 
> The SPARQL syntax for an alias is: (?var AS ?alias)
> 
> 
> 

What syntax should I use in the query to make it work with an alias?

Thanks.