# Stardog JS module : reasoning request

**URL:** <https://community.stardog.com/t/stardog-js-module-reasoning-request/749>\
**Category:** Support\
**Created:** [December 28, 2017, 4:05pm UTC](https://community.stardog.com/t/stardog-js-module-reasoning-request/749 "2017-12-28T16:05:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![barbotclem](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/barbotclem/32/183_2.png) [@barbotclem](https://community.stardog.com/u/barbotclem)\
**Post date:** [December 28, 2017, 4:05pm UTC](https://community.stardog.com/t/stardog-js-module-reasoning-request/749/1 "2017-12-28T16:05:13Z")

</div>

Everyone,

I'm here (once again) because I'm used to query my Stardog endpoint with a node.js app.

As you may know, I want to use the reasoning thing.

In your [module documentation](https://www.npmjs.com/package/stardog) you explain very well [how to query a database](https://www.npmjs.com/package/stardog#quick-example), but not how to query a database with "reasoning" enabled.

I do believe it's like an option, that's why I tried to add `reasoning:true,` in the connection but also in the query but none works. I also tried to see the evolution of the github project but I found nothing (just one out to date, in 2012). I also search in the node module, found nothing ☹

Is there any option to enable reasoning in a query ?

Thanks for all, again.

Regards,  
Clément

---

<div class="post-metadata">

**Author:** ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)\
**Post date:** [December 28, 2017, 4:34pm UTC](https://community.stardog.com/t/stardog-js-module-reasoning-request/749/2 "2017-12-28T16:34:47Z")

</div>

It looks like the API docs are a little bit out of sync on the npm module, since we haven’t _quite_ hit 1.0.0 on stardog.js.

To query with reasoning, you’ll need to use the `params` parameter on query.execute, which comes after the optional `options` parameter. So unless you’re specifying an Accept type, you’ll need to pass in an empty object:

```javascript
query.execute(conn, 'myDb', 'select * where {?my ?query ?here}', {}, { reasoning: true });

```

---

<div class="post-metadata">

**Author:** ![barbotclem](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/barbotclem/32/183_2.png) [@barbotclem](https://community.stardog.com/u/barbotclem)\
**Post date:** [December 28, 2017, 4:43pm UTC](https://community.stardog.com/t/stardog-js-module-reasoning-request/749/3 "2017-12-28T16:43:23Z")

</div>

Works like a charm 🙂

Thanks again, you helped me a lot.  
Clément

---

<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:** [January 11, 2018, 4:43pm UTC](https://community.stardog.com/t/stardog-js-module-reasoning-request/749/4 "2018-01-11T16:43:50Z")

</div>

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