# Reasoning error

**URL:** https://community.stardog.com/t/reasoning-error/3280
**Category:** Bug
**Created:** [September 23, 2021, 3:17pm UTC](https://community.stardog.com/t/reasoning-error/3280 "2021-09-23T15:17:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mereolog](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@mereolog](https://community.stardog.com/u/mereolog)
#### Post date: [September 23, 2021, 3:17pm UTC](https://community.stardog.com/t/reasoning-error/3280/1 "2021-09-23T15:17:20Z")

</div>

The ontology shown below is inconsistent.

Still running  
`stardogreasoning consistency ***database*** -u ***user*** -p ***password*** `  
reports that it is consistent.  
(Stardog server 7.6.0)

Thanks in advance,

Pawel

```auto
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix : <http://aaa.org/> .

:test_1 rdf:type owl:NamedIndividual, :Account ;
:hasOpenDate :test_2, :test_3 .

:test_2 rdf:type owl:NamedIndividual, :OpenDate .

:test_3 rdf:type owl:NamedIndividual, :OpenDate .

[ rdf:type owl:AllDifferent ;
  owl:distinctMembers ( :test_2
                        :test_3
                      )
] .

:hasOpenDate
        rdf:type owl:ObjectProperty ;
        rdfs:label "has open date" ;
        rdfs:range :OpenDate .

:Account
        rdf:type owl:Class ;
        rdfs:label "account" ;
        rdfs:subClassOf [ rdf:type owl:Restriction ;
                           owl:onClass :OpenDate ;
                           owl:onProperty :hasOpenDate ;
                           owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger
                         ] .

```

---

<div class="post-metadata">

### Author: ![evren](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/evren/32/1515_2.png) [@evren](https://community.stardog.com/u/evren)
#### Post date: [September 23, 2021, 9:37pm UTC](https://community.stardog.com/t/reasoning-error/3280/2 "2021-09-23T21:37:41Z")

</div>

The restriction in your ontology is not supported by the default reasoning level SL in Stardog. You'll notice a message in the stardog.log file that looks like this:

```auto
Not a valid SL axiom: SubClassOf(aaa:Account,cardinality(aaa:hasOpenDate,1,aaa:OpenDate)) 

```

The DL reasoning level would support this but we don't recommend that mode. For this kind of validation task we would recommend the ICV functionality. You can write [cardinality constraints in SHACL](https://www.w3.org/TR/shacl/#core-components-count) and use the `icv report` Stardog command to perform the validation.

Best,  
Evren

---

<div class="post-metadata">

### Author: ![mereolog](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@mereolog](https://community.stardog.com/u/mereolog)
#### Post date: [September 24, 2021, 6:21am UTC](https://community.stardog.com/t/reasoning-error/3280/3 "2021-09-24T06:21:38Z")

</div>

Hi Evren,

Switching to DL showed inconsistency.  
Thanks for you prompt reply.

Regards,

Paweł
