0

次の JessTab ルールによって、家族オントロジーで主張されている人々の平均年齢を見つけようとしています。

(defrule print_people_total_age 
   (object (https://wiki.csc.calpoly.edu/OntologyTutorial/family_example.owl#age ?a1)) 
   => 
   (bind ?s 0) 
   (bind ?num 0) 
   (foreach ?a (create$ ?a1) (+ ?s ?a) (++ ?num) (printout t "Total age " ?s " and average age is " (/ ?s ?num) " of persons" crlf)))

ルールは適切にコンパイルされますが、有効にすると次のエラーが発生します。

Jess reported an error in routine +
    while executing (+ ?s ?a)
    while executing (foreach ?a (create$ ?a1) (+ ?s ?a) (++ ?num) (printout t "Total age " ?s " and average age is " (/ ?s ?num) " of persons" crlf))
    while executing defrule MAIN::print_people_total_ageSSS
    while executing (run).
  Message: Not a number: "~@http://www.w3.org/2001/XMLSchema#integer 20".

どこが間違っていますか?

4

1 に答える 1