# Stardog Rule with multiple filter conditions

**URL:** <https://community.stardog.com/t/stardog-rule-with-multiple-filter-conditions/650>\
**Category:** Support\
**Created:** [October 24, 2017, 4:11pm UTC](https://community.stardog.com/t/stardog-rule-with-multiple-filter-conditions/650 "2017-10-24T16:11:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ko3nig](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/ko3nig/32/180_2.png) [@ko3nig](https://community.stardog.com/u/ko3nig)\
**Post date:** [October 24, 2017, 4:11pm UTC](https://community.stardog.com/t/stardog-rule-with-multiple-filter-conditions/650/1 "2017-10-24T16:11:45Z")

</div>

Hey,  
i’m experiencing some trouble with the Stardog Rules.  
Assert I have this Rule:

```
IF {

        ?c a sick:Component ; 
           sosa:isFeatureOfInterestOf [
                sosa:hasFeatureOfInterest ?c ;
                a sosa:Observation ;
                sosa:observedProperty aoi:x-shift ;
                sosa:hasSimpleResult ?x 
           ] , [
                sosa:hasFeatureOfInterest ?c ;
                a sosa:Observation ;
                sosa:observedProperty aoi:y-shift ;
                sosa:hasSimpleResult ?y 
           ] .

        aoi:thresholds sick:x-shift-threshold ?x_thres ;
                       sick:y-shift-threshold ?y_thres .

        FILTER (?x > ?x_thres )    

    } THEN {
    	?c a aoi:BadComponent-X
    
    }

```

With an Observation being:

```
<http://localhost/concept/observations/1> rdf:type owl:NamedIndividual ,
                                               sosa:Observation ;
                                      sosa:hasFeatureOfInterest <http://localhost/concept/material/component#c1-1> ;
                                      sosa:madeBySensor <http://localhost/concept/equipment/AOI_SMD407> ;
                                      sosa:observedProperty aoi:x-shift ;
                                      sosa:hasSimpleResult 3 ;
                                      sosa:resultTime "2016-05-18T12:55:27.954"^^xsd:dateTime .

```

And a component:

```
<http://localhost/concept/material/component#c1-1> rdf:type owl:NamedIndividual , 
                                                   sick:Component .

```

One can assume that

```
sosa:isFeatureOfInterestOf is the inverse of sosa:hasFeatureOfInterest

```

and this is inferred.

Still the rule execution triggers this

```
WARN 2017-10-24 18:02:31,086 [XNIO-1 task-3] com.clarkparsia.pellet.rules.FilterBindingHelper:rebind(53): 
Function evaluation error
java.lang.ClassCastException: null

```

I don’t get it.

As target I want to increase the FILTER condition with additional statements, like y-shift \> someThreshold. Still, that doesn’t work.

Thanks, I appreciate every help!

---

<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:** [October 24, 2017, 7:00pm UTC](https://community.stardog.com/t/stardog-rule-with-multiple-filter-conditions/650/2 "2017-10-24T19:00:12Z")

</div>

Hi,

Is there a more detailed error in stardog.log?

---

<div class="post-metadata">

**Author:** ![ko3nig](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/ko3nig/32/180_2.png) [@ko3nig](https://community.stardog.com/u/ko3nig)\
**Post date:** [October 24, 2017, 7:02pm UTC](https://community.stardog.com/t/stardog-rule-with-multiple-filter-conditions/650/3 "2017-10-24T19:02:16Z")

</div>

Nope, unfortunately not.

But there’s one thing:  
I do need DL Reasoning… is Stardog rule reasoning fully compatible with DL reasoning?  
Or do I need to use SL?

---

<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:** [October 24, 2017, 7:12pm UTC](https://community.stardog.com/t/stardog-rule-with-multiple-filter-conditions/650/4 "2017-10-24T19:12:50Z")

</div>

Stardog (and SWRL) rules are only available when the reasoning type is SL

---

<div class="post-metadata">

**Author:** ![ko3nig](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/ko3nig/32/180_2.png) [@ko3nig](https://community.stardog.com/u/ko3nig)\
**Post date:** [October 25, 2017, 2:04pm UTC](https://community.stardog.com/t/stardog-rule-with-multiple-filter-conditions/650/5 "2017-10-25T14:04:18Z")

</div>

Hey, so I changed my ontology to be conform with OWL 2 RL (some axioms still not adopted, but reasoning takes place).

But I still experience some problems regarding rule reasoning:

```
IF {

      ?c a sick:Component ; 
          sosa:isFeatureOfInterestOf [
            a sosa:Observation ;
            sosa:hasFeatureOfInterest ?c ;
            sosa:observedProperty aoi:x-shift ;
            sosa:hasSimpleResult ?x          
          ] , [
            a sosa:Observation ;
            sosa:hasFeatureOfInterest ?c ;
            sosa:observedProperty aoi:y-shift ;
            sosa:hasSimpleResult ?y
          ] , [
            a sosa:Observation ;
            sosa:hasFeatureOfInterest ?c ;
            sosa:observedProperty aoi:twisting ;
            sosa:hasSimpleResult ?z
          ] .  

        
      FILTER (?x > 0 && ?y > 0 && ?z > 0)    

    } THEN {
        ?c a aoi:BadComponent .
    
    }

```

If the rule contains only two (filter) conditions, everything works fine and the rule gets fired.  
If I add the third (?z) condition, the rule doesnt fire.

The stardog.log file sometimes mentions this part:

```
WARN 2017-10-25 15:56:41,735 [XNIO-1 task-7] com.clarkparsia.blackout.Saturator:saturate(104): Saturation was interrupted. Query results might be incomplete.

```

Seems as the computation takes too long or sth… any tipps how to increase the performance?

As I mentioned, stardog.log warns about some axioms being not conform with SL, but they dont conflict with the  
rule and they should be in OWL 2 RL. So I don’t get it, again, where’s the poop? 🙂

Thanks!

---

<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:** [November 8, 2017, 2:04pm UTC](https://community.stardog.com/t/stardog-rule-with-multiple-filter-conditions/650/6 "2017-11-08T14:04:19Z")

</div>

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