# Error with the REASONER ON

**URL:** https://community.stardog.com/t/error-with-the-reasoner-on/4415
**Category:** Bug
**Created:** [June 7, 2023, 9:49am UTC](https://community.stardog.com/t/error-with-the-reasoner-on/4415 "2023-06-07T09:49:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hmuhajab](https://avatars.discourse-cdn.com/v4/letter/h/b77776/32.png) [@hmuhajab](https://community.stardog.com/u/hmuhajab)
#### Post date: [June 7, 2023, 9:49am UTC](https://community.stardog.com/t/error-with-the-reasoner-on/4415/1 "2023-06-07T09:49:54Z")

</div>

I am trying to run this query, but with the reasoner ON, it gives this error

Failed to run query: com.complexible.stardog.plan.eval.operator.OperatorException: Uncaught error during query evaluation: ArrayIndexOutOfBoundsException:

With the reasoner OFF.. it runs correctly... Any help?

Here is the Query:  
PREFIX owl: [http://www.w3.org/2002/07/owl#](http://www.w3.org/2002/07/owl#)

PREFIX geom: [http://www.semanticweb.org/hn/geom#](http://www.semanticweb.org/hn/geom#)

PREFIX geos: [http://www.opengis.net/ont/geosparql#](http://www.opengis.net/ont/geosparql#)

PREFIX rdf: [http://www.w3.org/1999/02/22-rdf-syntax-ns#](http://www.w3.org/1999/02/22-rdf-syntax-ns#)

SELECT (COUNT(?o1) as ?count)

WHERE {

geom:Caerffili\_\_\_Caerphilly ?p1 ?o1 .

}

---

<div class="post-metadata">

### Author: ![albaker](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/albaker/32/632_2.png) [@albaker](https://community.stardog.com/u/albaker)
#### Post date: [June 7, 2023, 2:58pm UTC](https://community.stardog.com/t/error-with-the-reasoner-on/4415/2 "2023-06-07T14:58:22Z")

</div>

Typically using a variable in a predicate position is an anti-pattern, as this query would balloon out all possible predicate axioms and inferences to try and satisfy the semantics.

A way to work around this would be to introduce a parent predicate, that all of the properties are subPropertyOf, and then use that in place of ?p1 here. Referring to open ontologies, you could place this parent property and the subproperty definitions in your own ontology/named graph, and include the lot of them together with reasoning.schema administration to keep the queries simple.
