Re: Solving Sudoku with OWL

--- Jeremy Wong 黃泓量 <jeremy@miko.hk> wrote:

> Aditya,
> 
> I have checked your ontology and saw the online
> demonstration. It took 
> 1.6 second for your problem.
> 
> I changed my modelling work of sudoku and submitted
> it to the online 
> Pellet. It gave me nothing. I am not sure if it is a
> problem of my 
> modelling work. Attached is my latest work of
> Sudoku.

hmm, Pellet finds the ontology inconsistent probably
because you have one of the allDifferent assertions
incorrect. I'm afraid its difficult to debug your
example given the size. Assuming your using some sort
of script to generate the example, I would start with
a smaller puzzle (say of size 4 X 4) to see if there's
a bug in the script.

On another note, I've improved the example at [1]
using a full Sudoku grid instead of the sub-grid I had
encoded earlier, however the example is still simple
enough that Pellet can solve it in under 2.5s. 

Aditya

[1] http://www.mindswap.org/~aditkal/sudoku
> 
> 
> Jeremy Wong 黃泓量
> 
> --
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE rdf:RDF [
> <!ENTITY rdf
> "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> <!ENTITY rdfs
> "http://www.w3.org/2000/01/rdf-schema#">
> <!ENTITY owl "http://www.w3.org/2002/07/owl#">
> <!ENTITY sudoku "http://sw.1980.hk/2006/sudoku#">
> ]>
> <rdf:RDF xmlns:rdf="&rdf;" xmlns:rdfs="&rdfs;"
> xmlns="&owl;" 
> xmlns:sudoku="&sudoku;" xml:base="&sudoku;">
> <Ontology rdf:about=""/>
> <rdf:List rdf:nodeID="ValueCollection">
> <rdf:first>
> <Thing rdf:ID="A"/>
> </rdf:first>
> <rdf:rest rdf:parseType="Collection">
> <Thing rdf:ID="B"/>
> <Thing rdf:ID="C"/>
> <Thing rdf:ID="D"/>
> <Thing rdf:ID="E"/>
> <Thing rdf:ID="F"/>
> <Thing rdf:ID="G"/>
> <Thing rdf:ID="H"/>
> <Thing rdf:ID="I"/>
> </rdf:rest>
> </rdf:List>
> <Class rdf:ID="Cell">
> <oneOf rdf:nodeID="ValueCollection"/>
> </Class>
> <AllDifferent>
> <distinctMembers rdf:nodeID="ValueCollection"/>
> </AllDifferent>
> <AllDifferent>
> <distinctMembers rdf:parseType="Collection">
> <sudoku:Cell rdf:ID="AA11"/>
> <sudoku:Cell rdf:ID="AA12"/>
> <sudoku:Cell rdf:ID="AA13"/>
> <sudoku:Cell rdf:ID="AA21"/>
> <sudoku:Cell rdf:ID="AA22"/>
> <sudoku:Cell rdf:ID="AA23"/>
> <sudoku:Cell rdf:ID="AA31"/>
> <sudoku:Cell rdf:ID="AA32"/>
> <sudoku:Cell rdf:ID="AA33"/>
> </distinctMembers>
> </AllDifferent>
> <AllDifferent>
> <distinctMembers rdf:parseType="Collection">
> <sudoku:Cell rdf:ID="AB11"/>
> <sudoku:Cell rdf:ID="AB12"/>
> <sudoku:Cell rdf:ID="AB13"/>
> <sudoku:Cell rdf:ID="AB21"/>
> <sudoku:Cell rdf:ID="AB22"/>
> <sudoku:Cell rdf:ID="AB23"/>
> <sudoku:Cell rdf:ID="AB31"/>
> <sudoku:Cell rdf:ID="AB32"/>
> <sudoku:Cell rdf:ID="AB33"/>
> </distinctMembers>
> </AllDifferent>
> <AllDifferent>
> <distinctMembers rdf:parseType="Collection">
> <sudoku:Cell rdf:ID="AC11"/>
> <sudoku:Cell rdf:ID="AC12"/>
> <sudoku:Cell rdf:ID="AC13"/>
> <sudoku:Cell rdf:ID="AC21"/>
> <sudoku:Cell rdf:ID="AC22"/>
> <sudoku:Cell rdf:ID="AC23"/>
> <sudoku:Cell rdf:ID="AC31"/>
> <sudoku:Cell rdf:ID="AC32"/>
> <sudoku:Cell rdf:ID="AC33"/>
> </distinctMembers>
> </AllDifferent>
> <AllDifferent>
> <distinctMembers rdf:parseType="Collection">
> <sudoku:Cell rdf:ID="BA11"/>
> <sudoku:Cell rdf:ID="BA12"/>
> <sudoku:Cell rdf:ID="BA13"/>
> <sudoku:Cell rdf:ID="BA21"/>
> <sudoku:Cell rdf:ID="BA22"/>
> <sudoku:Cell rdf:ID="BA23"/>
> <sudoku:Cell rdf:ID="BA31"/>
> <sudoku:Cell rdf:ID="BA32"/>
> <sudoku:Cell rdf:ID="BA33"/>
> </distinctMembers>
> </AllDifferent>
> <AllDifferent>
> <distinctMembers rdf:parseType="Collection">
> <sudoku:Cell rdf:ID="BB11"/>
> <sudoku:Cell rdf:ID="BB12"/>
> <sudoku:Cell rdf:ID="BB13"/>
> <sudoku:Cell rdf:ID="BB21"/>
> <sudoku:Cell rdf:ID="BB22"/>
> <sudoku:Cell rdf:ID="BB23"/>
> <sudoku:Cell rdf:ID="BB31"/>
> <sudoku:Cell rdf:ID="BB32"/>
> <sudoku:Cell rdf:ID="BB33"/>
> </distinctMembers>
> </AllDifferent>
> <AllDifferent>
> <distinctMembers rdf:parseType="Collection">
> <sudoku:Cell rdf:ID="BC11"/>
> <sudoku:Cell rdf:ID="BC12"/>
> <sudoku:Cell rdf:ID="BC13"/>
> <sudoku:Cell rdf:ID="BC21"/>
> <sudoku:Cell rdf:ID="BC22"/>
> <sudoku:Cell rdf:ID="BC23"/>
> <sudoku:Cell rdf:ID="BC31"/>
> <sudoku:Cell rdf:ID="BC32"/>
> <sudoku:Cell rdf:ID="BC33"/>
> </distinctMembers>
> </AllDifferent>
> <AllDifferent>
> <distinctMembers rdf:parseType="Collection">
> <sudoku:Cell rdf:ID="CA11"/>
> <sudoku:Cell rdf:ID="CA12"/>
> <sudoku:Cell rdf:ID="CA13"/>
> <sudoku:Cell rdf:ID="CA21"/>
> <sudoku:Cell rdf:ID="CA22"/>
> <sudoku:Cell rdf:ID="CA23"/>
> <sudoku:Cell rdf:ID="CA31"/>
> <sudoku:Cell rdf:ID="CA32"/>
> <sudoku:Cell rdf:ID="CA33"/>
> </distinctMembers>
> </AllDifferent>
> <AllDifferent>
> <distinctMembers rdf:parseType="Collection">
> <sudoku:Cell rdf:ID="CB11"/>
> <sudoku:Cell rdf:ID="CB12"/>
> <sudoku:Cell rdf:ID="CB13"/>
> <sudoku:Cell rdf:ID="CB21"/>
> <sudoku:Cell rdf:ID="CB22"/>
> <sudoku:Cell rdf:ID="CB23"/>
> <sudoku:Cell rdf:ID="CB31"/>
> <sudoku:Cell rdf:ID="CB32"/>
> <sudoku:Cell rdf:ID="CB33"/>
> </distinctMembers>
> </AllDifferent>
> <AllDifferent>
> <distinctMembers rdf:parseType="Collection">
> <sudoku:Cell rdf:ID="CC11"/>
> <sudoku:Cell rdf:ID="CC12"/>
> <sudoku:Cell rdf:ID="CC13"/>
> <sudoku:Cell rdf:ID="CC21"/>
> <sudoku:Cell rdf:ID="CC22"/>
> <sudoku:Cell rdf:ID="CC23"/>
> <sudoku:Cell rdf:ID="CC31"/>
> <sudoku:Cell rdf:ID="CC32"/>
> <sudoku:Cell rdf:ID="CC33"/>
> </distinctMembers>
> </AllDifferent>
> <AllDifferent>
> <distinctMembers rdf:parseType="Collection">
> <sudoku:Cell rdf:about="#AA11"/>
> <sudoku:Cell rdf:about="#AA12"/>
> <sudoku:Cell rdf:about="#AA13"/>
> <sudoku:Cell rdf:about="#AB11"/>
> <sudoku:Cell rdf:about="#AB12"/>
> <sudoku:Cell rdf:about="#AB13"/>
> <sudoku:Cell rdf:about="#AC11"/>
> <sudoku:Cell rdf:about="#AC12"/>
> <sudoku:Cell rdf:about="#AC13"/>
> </distinctMembers>
> </AllDifferent>
> <AllDifferent>
> <distinctMembers rdf:parseType="Collection">
> <sudoku:Cell rdf:about="#AA21"/>
> <sudoku:Cell rdf:about="#AA22"/>
> <sudoku:Cell rdf:about="#AA23"/>
> <sudoku:Cell rdf:about="#AB21"/>
> <sudoku:Cell rdf:about="#AB22"/>
> <sudoku:Cell rdf:about="#AB23"/>
> <sudoku:Cell rdf:about="#AC21"/>
> <sudoku:Cell rdf:about="#AC22"/>
> <sudoku:Cell rdf:about="#AC23"/>
> </distinctMembers>
> </AllDifferent>
> <AllDifferent>
> <distinctMembers rdf:parseType="Collection">
> <sudoku:Cell rdf:about="#AA31"/>
> <sudoku:Cell rdf:about="#AA32"/>
> <sudoku:Cell rdf:about="#AA33"/>
> <sudoku:Cell rdf:about="#AB31"/>
> <sudoku:Cell rdf:about="#AB32"/>
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Received on Tuesday, 10 January 2006 19:58:41 UTC