0

I built a simple ontology to test how SWRL rules infer new relations between individuals in an ontology, but it didn't work. My rule is:

(hasFather(?x, ?y)  ∧  hasMother(?x, ?z) → spouseOf(?y, ?z)

and may be read as

x has a father y, x has mother z → y is spouse of z).

There are three individuals in my ontology: Husband, Wife, and Son. I set child has mother is Wife, has father is Husband. And then my rule is employed in order to set Husband is spouseOf Wife. I used the Jess plugin to test my rule but no result. Why doesn't the rule isn't work? Is there something wrong with my rule, or something wrong with Jess on Protege 3.3?

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
sonvx
  • 411
  • 4
  • 7
  • This question appears to be off-topic because it is about a typo in the OP's code, which was not provided (linked offsite, but link is now dead). Doesn't "include valid code to reproduce" the problem, and is "too localized". – Joshua Taylor Oct 20 '13 at 22:13

2 Answers2

2

What you wrote in your ontology is not the rule you wrote in this question. Your ontology contains the following rule:

hasFather(?y, ?x) ∧ hasMother(?z, ?x) → spouseOf(?y, ?z)

In the RDF/XML file, swap swrl:argument1 with swrl:argument2 and it'll work.

Antoine Zimmermann
  • 5,314
  • 18
  • 36
  • Yes, that's right. Thank you so much. Can i ask you one more thing: do you know what is suitable API like Jess plugin in Java? – sonvx Nov 29 '12 at 00:59
0

Sonvx, Pellet reasoner can be used to test SWRL rules. Pellet reasoner provides Java APIs to test SWRL rules. download pellet here

let me know if you need something else.

Swamy
  • 771
  • 1
  • 8
  • 24