# Construct query fails in Java API but not in Admin Console

**URL:** <https://community.stardog.com/t/construct-query-fails-in-java-api-but-not-in-admin-console/911>\
**Category:** Support\
**Created:** [April 4, 2018, 1:59pm UTC](https://community.stardog.com/t/construct-query-fails-in-java-api-but-not-in-admin-console/911 "2018-04-04T13:59:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jss1clist](https://avatars.discourse-cdn.com/v4/letter/j/48db29/32.png) [@jss1clist](https://community.stardog.com/u/jss1clist)\
**Post date:** [April 4, 2018, 1:59pm UTC](https://community.stardog.com/t/construct-query-fails-in-java-api-but-not-in-admin-console/911/1 "2018-04-04T13:59:09Z")

</div>

Hi there,

I created a database and loaded [https://github.com/stardog-union/stardog-examples/blob/develop/examples/api/data/catalog.rdf](https://github.com/stardog-union/stardog-examples/blob/develop/examples/api/data/catalog.rdf). Stardog version 5.2.2.

Then ran the following code

> GraphQueryResult gqr = conn.graph("construct {?s ?p ?o} where {?s ?p ?o}").execute();

which failed with the following stacktrace.

> 2018-04-03 17:26:47.803 WARN 11248 --- [reamProcessor-0] c.c.common.rdf.rio.RDFStreamProcessor : Error during loading TriGStream: IRI included an unencoded space: '32' [line 116908]  
> 2018-04-03 17:26:47.815 WARN 11248 --- [reamProcessor-0] c.c.common.rdf.rio.RDFStreamProcessor : Parse process creator:
> 
> java.lang.Exception: null  
> at com.complexible.common.rdf.rio.RDFStreamProcessor.(RDFStreamProcessor.java:129) ~[stardog-utils-rdf-5.2.2.jar:na]  
> at com.complexible.common.rdf.rio.RDFStreamProcessor.create(RDFStreamProcessor.java:105) ~[stardog-utils-rdf-5.2.2.jar:na]  
> at com.complexible.common.rdf.rio.RDFStreamProcessor.iteration(RDFStreamProcessor.java:110) ~[stardog-utils-rdf-5.2.2.jar:na]  
> at com.complexible.common.rdf.impl.StreamStatementIterator.(StreamStatementIterator.java:52) ~[stardog-utils-rdf-5.2.2.jar:na]  
> at com.complexible.common.rdf.impl.StatementIterators.create(StatementIterators.java:62) ~[stardog-utils-rdf-5.2.2.jar:na]  
> at com.complexible.common.rdf.impl.StatementIterators.create(StatementIterators.java:58) ~[stardog-utils-rdf-5.2.2.jar:na]  
> at com.complexible.stardog.protocols.http.client.HttpClientImpl.graph(HttpClientImpl.java:335) ~[stardog-protocols-http-client-5.2.2.jar:na]  
> at com.complexible.stardog.protocols.http.client.HttpConnection.\_graph(HttpConnection.java:161) ~[stardog-protocols-http-client-5.2.2.jar:na]  
> at com.complexible.stardog.api.impl.AbstractConnection.executeGraph(AbstractConnection.java:440) ~[stardog-api-5.2.2.jar:na]  
> at com.complexible.stardog.api.impl.GraphQueryImpl.execute(GraphQueryImpl.java:33) ~[stardog-api-5.2.2.jar:na]  
> at com.complexible.stardog.api.impl.GraphQueryImpl.execute(GraphQueryImpl.java:23) ~[stardog-api-5.2.2.jar:na]

I ran the same query on the Query tab in admin console and it returned a result with no error in stardog.log.

Please advise!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [April 18, 2018, 2:00pm UTC](https://community.stardog.com/t/construct-query-fails-in-java-api-but-not-in-admin-console/911/2 "2018-04-18T14:00:54Z")

</div>

Closed on April 18, 2018, 2:00pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
