# Help needed to get equivalentClass and intersectionOf inferences working

**URL:** <https://community.stardog.com/t/help-needed-to-get-equivalentclass-and-intersectionof-inferences-working/5408>\
**Category:** Support\
**Created:** [July 1, 2025, 6:38pm UTC](https://community.stardog.com/t/help-needed-to-get-equivalentclass-and-intersectionof-inferences-working/5408 "2025-07-01T18:38:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![huylenguyen](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@huylenguyen](https://community.stardog.com/u/huylenguyen)\
**Post date:** [July 1, 2025, 6:38pm UTC](https://community.stardog.com/t/help-needed-to-get-equivalentclass-and-intersectionof-inferences-working/5408/1 "2025-07-01T18:38:51Z")

</div>

I am evaluating virtual graph functionalities Stardog with a simple proof of concept ontology and a single MySQL database table. I have managed to write a mapping in SMS2 (Stardog Studio cloud does not seem to accept R2RML files exported from Protege) to map the data, which appears to be mostly correct, however my inferencing does not appear to as I would expect, which makes me suspect there being parts of the axiom that is not covered by the reasoner. In the `equivalentClass` axiom below, should Stardog's SL reasoner be able to handle this, or would I need a reasoner that can handle OWL DL?

The data model is a simple systems control process, wherein process hasEvent event instances and event hasCode code. The inference is simply to classify FailedProcess as process having events with the code "OFF".

```auto
### http://www.semanticweb.org/huylenguyen/ontologies/2025/5/uncommanded_v3#FailedProcess
umc:FailedProcess rdf:type owl:Class ;
  owl:equivalentClass [
    owl:intersectionOf (
      umc:ControlProcess
      [
        rdf:type owl:Restriction ;
        owl:onProperty umc:hasEvent ;
        owl:someValuesFrom [
          owl:intersectionOf (
            umc:OperatingEvent
            [
              rdf:type owl:Restriction ;
              owl:onProperty umc:hasCode ;
              owl:someValuesFrom [
                owl:intersectionOf (
                  umc:OperatingCode
                  [
                    rdf:type owl:Restriction ;
                    owl:onProperty umc:hasText ;
                    owl:hasValue "OFF"
                  ]
                ) ;
                rdf:type owl:Class
              ]
            ]
          ) ;
          rdf:type owl:Class
        ]
      ]
    ) ;
    rdf:type owl:Class
  ] .

```

Additionally to the above query, I am seeing something strange in the SMS2 mapping process, where there are duplicate entities with the same IRI. I was under the impression that in the SPARQL mapping, IRIs are unique and should always refer to the same entity. Is this not the case with Stardog? the mappings worked fine in Ontop.

---

<div class="post-metadata">

**Author:** ![Joe\_Fagan](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/joe_fagan/32/1400_2.png) [@Joe\_Fagan](https://community.stardog.com/u/Joe_Fagan)\
**Post date:** [August 1, 2025, 12:25pm UTC](https://community.stardog.com/t/help-needed-to-get-equivalentclass-and-intersectionof-inferences-working/5408/2 "2025-08-01T12:25:51Z")

</div>

Please note the docs at [Advanced Reasoning Features | Stardog Documentation Latest](https://docs.stardog.com/inference-engine/advanced-reasoning-features#same-as-reasoning)

You can write the equivalent Stardog Rule as follows.

```auto
prefix umc: <urn:yourNamespace> 

IF {
  ?process a umc:ControlProcess ;
           umc:hasEvent ?event .

  ?event a umc:OperatingEvent ;
         umc:hasCode ?code .

  ?code a umc:OperatingCode ;
        umc:hasText "OFF" .
}
THEN {
  ?process a umc:FailedProcess .
}

```

The rule can be written with the Rule Builder in Designer as

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/e37fba30dd1f5a56390198b2423800207a615e92.png)

and in Explorer we can see the appropriate Control Processes classified as FailedProcess

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/c/c37ed89bb8f1dc99b39b67ed8cec6a2237725f8c.png)

---

<div class="post-metadata">

**Author:** ![Joe\_Fagan](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/joe_fagan/32/1400_2.png) [@Joe\_Fagan](https://community.stardog.com/u/Joe_Fagan)\
**Post date:** [August 2, 2025, 8:52am UTC](https://community.stardog.com/t/help-needed-to-get-equivalentclass-and-intersectionof-inferences-working/5408/3 "2025-08-02T08:52:34Z")

</div>

> [@huylenguyen](#):
>
> I am seeing something strange in the SMS2 mapping process, where there are duplicate entities with the same IRI. I was under the impression that in the SPARQL mapping, IRIs are unique and should always refer to the same entity. Is this not the case with Stardog? the mappings worked fine in Ontop.

Huy,

It would be great to see the SMS2 file and sample data.

Stardog doesn’t create the IRIs per se. I mean Stardog doesn’t decide the IRIs. Stardog only follows the template rule and uses the rule and the data to generate an IRI.

`BIND(TEMPLATE("urn:{ID}") AS ?ID_iri) # read value in {ID} column and append to urn:`

If the ID column has value `1234` then the IRI will be `urn:1234`

It would be great to see the mapping and sample data that is causing the problem

---

<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:** [March 25, 2026, 1:54pm UTC](https://community.stardog.com/t/help-needed-to-get-equivalentclass-and-intersectionof-inferences-working/5408/4 "2026-03-25T13:54:51Z")

</div>


