Stardog rule with "min", "max", "count" in IF statement

Hi Stardog Team,

Does this kind of rule where “min”, “max”, “count” operation
inside IF statement work?

I have three persons, each of which is 20, 21, and 25 years old.
SL reasoner gives that all of those persons are the youngest.

Any advice would be appreciated…

insert {
          :RULE a stardog:rule:SPARQLRule ;
             stardog:rule:content """
                 IF {
                         ?x <http://abc/AGE> ?minage .
                         {
	                         select (min(?y) as ?minage)
	                         where
	                         {
		                         ?s a <http://abc/PERSON> .
		                         ?s <http://abc/AGE> ?y.
		                       }
		                     }
                 }
                 THEN {
                        ?x <http://abc/YOUNGEST>  "True" .
                 }""" .
  }
where {
  }
select ?x
where {
?x <http://abc/YOUNGEST>  "True" .
}

No. Aggregation is not supported in rules, you’ll have to do these computations in queries.

Best,
Pavel

Thank you for the prompt reply!

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