# Reasoning returns no result

**URL:** <https://community.stardog.com/t/reasoning-returns-no-result/1135>\
**Category:** Support\
**Created:** [July 10, 2018, 2:48pm UTC](https://community.stardog.com/t/reasoning-returns-no-result/1135 "2018-07-10T14:48:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![smrati.hans](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@smrati.hans](https://community.stardog.com/u/smrati.hans)\
**Post date:** [July 10, 2018, 2:48pm UTC](https://community.stardog.com/t/reasoning-returns-no-result/1135/1 "2018-07-10T14:48:39Z")

</div>

Hi Team,

I am trying to execute reasoning on the query:

```
select * where {
  ?restriction owl:onProperty ?PROP .  
  ?restriction owl:someValuesFrom ?class .
  ?con rdfs:subClassOf ?restriction .
  }

```

Without reasoning it returns results. As i turn the reasoner on, it returns 0 results and there is this warning in the logs:  
**WARN 2018-07-10 10:44:38,781 [stardog-user-6] com.complexible.stardog.reasoning.blackout.TypeOracle:inferTypes(225): The type of variable [http://www.w3.org/2002/07/owl#someValuesFrom](http://www.w3.org/2002/07/owl#someValuesFrom) is ambiguous; it will be assumed to be PROPERTY.**

Not sure why so. Would you please help me on the same. Kindly let me know if i am doing something wrong.

Thank you!

---

<div class="post-metadata">

**Author:** ![zachary.whitley](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/zachary.whitley/32/94_2.png) [@zachary.whitley](https://community.stardog.com/u/zachary.whitley)\
**Post date:** [July 10, 2018, 4:31pm UTC](https://community.stardog.com/t/reasoning-returns-no-result/1135/2 "2018-07-10T16:31:14Z")

</div>

I _think_ I have some idea what might be going on. You should be seeing two similar warnings for both someValuesFrom and owl:onProperty but I don’t think that is a problem.

I used the dummy data

```
insert data {
  :restriction owl:onProperty :PROP .
  :restriction owl:someValuesFrom :class .
  :con rdfs:subClassOf :restriction .
}

```

try looking at the difference between the query plan with reasoning

`starodg query explain -r test 'select * where { ?restriction owl:onProperty ?PROP . ?restriction owl:someValuesFrom ?class . ?con rdfs:subClassOf ?restriction . }'`

and without reasoning

```
starodg query explain test 'select * where { ?restriction owl:onProperty ?PROP . ?restriction owl:someValuesFrom ?class . ?con rdfs:subClassOf ?restriction . }'

```

The only difference is the reasoning is trying to scan for the subClassOf out of the extracted schema rather than the PSOC index.

If you issue the query and look at the query plan with reasoning for

`select * {?s rdfs:subClassOf ?o}`

you’ll see that it only scans the schema but it will not return :restriction

but if you only load

```
insert data {
  :con rdfs:subClassOf :restriction .
}

```

You’ll see :restriction

So it seems like there is something about the schema extraction that seems to eliminate :restriction. I know that’s not a complete answer but I hope it helps. I tried changing the schema graph from all to some specific but non existent graph but that didn’t change anything.

(Sorry I couldn’t include the query plan output)

PS:

I just tried looking at `stardog reasoning schema test` and it shows that :restriction is _not_ part of the schma. and the subClassOf is being extracted as :con rdfs:subClassOf (:PROP some :class) which would explain why the query with reasoning is failing. (I just noticed for the first time that the schema output is in manchester format, cool) I can’t say I’m totally surprised there are problems here as you’re trying to apply reasoning to a query over the vocabulary that you’re using to model the reasoning. I’m not saying it shouldn’t work just it’s not surprising that things get a little wonky. It’s making my head hurt. 🤨

---

<div class="post-metadata">

**Author:** ![smrati.hans](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@smrati.hans](https://community.stardog.com/u/smrati.hans)\
**Post date:** [July 10, 2018, 6:32pm UTC](https://community.stardog.com/t/reasoning-returns-no-result/1135/3 "2018-07-10T18:32:26Z")

</div>

Thank you so much for the explanation. I did try checking the schema and it makes sense to me (its too much to process and i am still processing it, will take little more time to understand).  
But what confused me more is: the descriptive logic (DL) are restrictions and if restrictions are not picked up in schema then how does reasoning work at all for it?

---

<div class="post-metadata">

**Author:** ![zachary.whitley](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/zachary.whitley/32/94_2.png) [@zachary.whitley](https://community.stardog.com/u/zachary.whitley)\
**Post date:** [July 10, 2018, 7:16pm UTC](https://community.stardog.com/t/reasoning-returns-no-result/1135/4 "2018-07-10T19:16:54Z")

</div>

I’m guessing that owl:onProperty and owl:someValuesFrom aren’t being picked up because they aren’t explicitly typed as owl:Restriction. I never really thought about it but I’m not sure if Stardog applies reasoning to the Schema extraction. (ie. will it infer that it’s an owl:Restriction from the domain of owl:onProperty? I don’t know)  
I think not extracting onPropery and someValuesFrom is a secondary issue and isn’t the reason that you’re seeing no results with reasoning but seeing results without reasoning.

I also don’t know if the data I used matches what you’ve got but it was enough to at least replicate the behavior you were seeing.

Like I mentioned it’s a little difficult to understand or to even talk about for that matter because you’re reasoning over the model. I don’t think there’s any reason why you wouldn’t be able to do it but it’s just very meta…and cool. Hopefully someone that knows more than I do will weigh in and explain it all.

---

<div class="post-metadata">

**Author:** ![smrati.hans](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@smrati.hans](https://community.stardog.com/u/smrati.hans)\
**Post date:** [July 10, 2018, 8:26pm UTC](https://community.stardog.com/t/reasoning-returns-no-result/1135/5 "2018-07-10T20:26:26Z")

</div>

> [@zachary.whitley](#):
>
> because they aren’t explicitly typed as owl:Restriction

How can we explicitly tell its an owl:restriction?  
I am little confused now 🤔 , if stardog will be able to reason other DLs if i upload similar ontology as stardog database.

Thank you!

---

<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:** [July 11, 2018, 6:31am UTC](https://community.stardog.com/t/reasoning-returns-no-result/1135/6 "2018-07-11T06:31:02Z")

</div>

I’d first ask which type of reasoning do you use?  
There is a difference between rule-based reasoning and full OWL DL reasoning which is usually done by tableau algorithm (here by means of the Pellet OWL DL reasoner).

---

<div class="post-metadata">

**Author:** ![smrati.hans](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@smrati.hans](https://community.stardog.com/u/smrati.hans)\
**Post date:** [July 16, 2018, 2:48pm UTC](https://community.stardog.com/t/reasoning-returns-no-result/1135/7 "2018-07-16T14:48:51Z")

</div>

I tried SL reasoning! and in the ontology files I am majorly using DL.

---

<div class="post-metadata">

**Author:** ![zachary.whitley](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/zachary.whitley/32/94_2.png) [@zachary.whitley](https://community.stardog.com/u/zachary.whitley)\
**Post date:** [July 16, 2018, 6:25pm UTC](https://community.stardog.com/t/reasoning-returns-no-result/1135/8 "2018-07-16T18:25:23Z")

</div>

You should see warnings in the logs if you’re using axioms that aren’t supported by your current reasoning profile.

---

<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:** [July 30, 2018, 6:34pm UTC](https://community.stardog.com/t/reasoning-returns-no-result/1135/9 "2018-07-30T18:34:02Z")

</div>

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