2 Replies Latest reply: Mar 27, 2011 11:34 PM by 848682 RSS

    about rule expression

    848682
      hi,i want create an userdefined rule,the following is right
      EXECUTE sem_apis.create_rulebase('user_rulebase');
      INSERT INTO mdsys.semr_user_rulebase VALUES ('purpose_rule',
      '(?stop <u:at> ?home)',
      NULL, '(?stop <u:has_purpose> "gohome")', null);

      but this one doesn't work,is there anything wrong with the second expression?think you!
      EXECUTE sem_apis.create_rulebase('user_rulebase');
      INSERT INTO mdsys.semr_user_rulebase VALUES ('purpose_rule',
      '(?stop <u:at> ?home)(?home <rdf:type> <u:home>)',
      NULL, '(?stop <u:has_purpose> "gohome")', null);
        • 1. Re: about rule expression
          JorgeB-Oracle
          Hi,

          What do you mean by "does not work"?

          The syntax looks good to me, if this is not generating triples:

          1. Make sure you add 'USER_RULES=T' to the CREATE_ENTAILMENT e.g.:

          EXECUTE sem_apis.create_entailment('<ENT_ NAME>', sem_models('<model_name>'), sem_rulebases('OWLPRIME','USER_RULEBASE'), SEM_APIS.REACH_CLOSURE, null, 'USER_RULES=T');

          2. Make sure you have triples like

          <something> <rdf:type> <u:home>

          The conditions in the antecedents part of the rule base are joined by an AND operation:
          meaning both conditions need to be true:

          (?stop <u:at> ?home) AND (?home <rdf:type> <u:home>)

          I am not saying that is the syntax, I am saying both have to be true to generate the triple:

          <something> <u:has_purpose> "gohome"

          Regards!
          Jorge
          • 2. Re: about rule expression
            848682
            thank you, As you said,the reason is the database doesn't contain the triple of <?home> <rdf:type> <u:home>