# Construct a path query

**URL:** <https://community.stardog.com/t/construct-a-path-query/1730>\
**Category:** Support\
**Created:** [June 10, 2019, 8:18pm UTC](https://community.stardog.com/t/construct-a-path-query/1730 "2019-06-10T20:18:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@Jean](https://community.stardog.com/u/Jean)\
**Post date:** [June 10, 2019, 8:18pm UTC](https://community.stardog.com/t/construct-a-path-query/1730/1 "2019-06-10T20:18:52Z")

</div>

I can't get the construct query works for a path query. This is what I have:

CONSTRUCT  
{ ?x ?p ?y }  
WHERE {  
PATHS start ?x = sample:CL129548 END ?y VIA ?p  
}

What did I miss?

---

<div class="post-metadata">

**Author:** ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)\
**Post date:** [June 10, 2019, 8:22pm UTC](https://community.stardog.com/t/construct-a-path-query/1730/2 "2019-06-10T20:22:21Z")

</div>

Hi Jean,

`PATHS` is an alternate query form to `CONSTRUCT` and `SELECT`. Try executing it without embedding it in another query, e.g.: `PATHS start ?x = sample:CL129548 END ?y VIA ?p`.

Jess

---

<div class="post-metadata">

**Author:** ![Jean](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@Jean](https://community.stardog.com/u/Jean)\
**Post date:** [June 10, 2019, 10:29pm UTC](https://community.stardog.com/t/construct-a-path-query/1730/3 "2019-06-10T22:29:10Z")

</div>

Hi Jess, Thanks for the rapid reply.The reason I embeded it in a construct query is to be able to see the graphical view or a json-ld output in Stardog Studio. There seems no other ways to get that kind of feature if running just the PATHS query. Or is there?

---

<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:** [June 11, 2019, 4:19pm UTC](https://community.stardog.com/t/construct-a-path-query/1730/4 "2019-06-11T16:19:40Z")

</div>

Hi Jean,

We already have some simple visualisation of paths in Stardog Studio where each path is rendered sequentially as a sequence of path edges. You can see all attributes for each edge, too.

I understand that you want to visualise paths as RDF, is that correct? We don't support that yet but we're considering a couple of possibilities. This should be relatively straightforward for queries like `paths ... via ?p` where all path edges are edges in the graph. It's somewhat trickier in the general case, like in our actors & movies examples, where actors are connected by tuples which aren't edges in the graph (rather each path edge represents a connection between two actors via a movie, i.e. 2 graph edges).

Also a typical issue with browsing path query results is seeing the same nodes many times (if many paths pass through them). We're considering various options to render them once and highlighting "important" nodes.

Let us know if you have wishes or thoughts.

Best,  
Pavel

---

<div class="post-metadata">

**Author:** ![Jean](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@Jean](https://community.stardog.com/u/Jean)\
**Post date:** [June 12, 2019, 7:04am UTC](https://community.stardog.com/t/construct-a-path-query/1730/5 "2019-06-12T07:04:16Z")

</div>

Hi Pavel, that makes sense. Thanks for the explanation. PATHS is a great feature. Thanks for implementing it. Now that we know how to fire off a query to recursively traverse the graph and use PATHS to find the relationships, next is to figure out how best to present them.

---

<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:** [June 26, 2019, 7:04am UTC](https://community.stardog.com/t/construct-a-path-query/1730/6 "2019-06-26T07:04:20Z")

</div>

Closed on June 26, 2019, 7:04am UTC

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