# CONSTRUCT query wrongly rejected

**URL:** <https://community.stardog.com/t/construct-query-wrongly-rejected/503>\
**Category:** Bug\
**Created:** [August 10, 2017, 8:26am UTC](https://community.stardog.com/t/construct-query-wrongly-rejected/503 "2017-08-10T08:26:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorenz\_b](https://avatars.discourse-cdn.com/v4/letter/l/d78d45/32.png) [@lorenz\_b](https://community.stardog.com/u/lorenz_b)\
**Post date:** [August 10, 2017, 8:26am UTC](https://community.stardog.com/t/construct-query-wrongly-rejected/503/1 "2017-08-10T08:26:46Z")

</div>

It looks like a minor bug in the query parser for `CONSTRUCT` queries, but any usage of the short form `CONSTRUCT WHERE` leads to a parser error although the pattern is a BGP:

Version: Stardog 5.0.2

* * *

Query:

```
PREFIX : <http://example.com/>
CONSTRUCT WHERE {
    :s ?p ?o 
}

```

* * *

Exception:

```
Error!

{"message":"can not use shorthand CONSTRUCT: graph pattern in WHERE clause is not a basic pattern.","code":"MalformedQuery"}
```

---

<div class="post-metadata">

**Author:** ![pavel](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pavel/32/18_2.png) [@pavel](https://community.stardog.com/u/pavel)\
**Post date:** [August 10, 2017, 8:51am UTC](https://community.stardog.com/t/construct-query-wrongly-rejected/503/2 "2017-08-10T08:51:54Z")

</div>

Hm, that’s weird, I can’t reproduce this with 5.0.2, running the query from the command line.

How do you run it? Can you double check the Stardog version and the query?

Thanks,  
Pavel

---

<div class="post-metadata">

**Author:** ![lorenz\_b](https://avatars.discourse-cdn.com/v4/letter/l/d78d45/32.png) [@lorenz\_b](https://community.stardog.com/u/lorenz_b)\
**Post date:** [August 10, 2017, 10:38am UTC](https://community.stardog.com/t/construct-query-wrongly-rejected/503/3 "2017-08-10T10:38:56Z")

</div>

Hi Pavel,

hm ok. I'm just running it in the WebUI, see

* * *

 ![stardog](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/1X/a7d40b2a43aa5c4d34ef0ad64cb9c40e884132c5.png)

* * *

It happens for both, version 5.0.1 and 5.0.2 (which I downloaded in the morning and setup in a different directory)

Thank you!

---

<div class="post-metadata">

**Author:** ![pavel](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pavel/32/18_2.png) [@pavel](https://community.stardog.com/u/pavel)\
**Post date:** [August 10, 2017, 10:49am UTC](https://community.stardog.com/t/construct-query-wrongly-rejected/503/4 "2017-08-10T10:49:05Z")

</div>

OK, I didn’t realize it was run via the Web console. Now I see the problem, thanks!

Cheers,  
Pavel

---

<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:** [August 24, 2017, 10:49am UTC](https://community.stardog.com/t/construct-query-wrongly-rejected/503/5 "2017-08-24T10:49:13Z")

</div>

Closed on August 24, 2017, 10:49am UTC

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