0

I'm trying to create an ontology of latin squares and make the reasoner solve it (starting with a simple 2x2 square and going from there) without much success.

The major problem I'm having is writing a rule in a way that sees what values are missing from the square. I'm using dataProperty hasValue as an integer. Something like:

Cell(?cell1) ^ hasValue(?cell1,?number1) ^ 
Cell(?cell2) ^ hasValue(?cell2,?number2) ^ 
Cell(?cell3) ^ hasValue(?cell3,?number3) ^
Cell(?cell4) ^ differentFrom(?number1, ?number2)
=>
hasValue(?Cell4,"desired result")

Thanks in advance.

  • in the head of the rule you wrote `?Cell4` but in the body you're using `?cell4` . Is it just a typo here? Do you get an error? How do you apply the SWRL rule? Which reasoner or API do you use? Can you share instance data? – UninformedUser May 31 '17 at 07:29
  • Yes, it was a typo. I'm using hermit reasoner. I don't get an error as I don't know how to complete the right side of the rule. – Tiago Teixeira May 31 '17 at 22:41
  • Have you looked at [this question](https://stackoverflow.com/questions/44004882/protege-owl-class-must-have-one-of-each-value)? There was also file named 'sudaku.owl' somewhere in Pellet forks on Github. – Stanislav Kralin Jun 01 '17 at 08:24

0 Answers0