Re: N3 in JSON, euler.py, euler.js, unify() was: euler state of the art?

> On Sat, 2006-12-09 at 01:25 +0100, jos.deroo@agfa.com wrote:
> [...]
> > > I'm making some notes on goals in 
> > > http://www.w3.org/2000/10/swap/doc/plans.html
> > > v 1.118 2006/12/08 21:19:33
> > 
> > Right and I'm happy to do that, be it that I will have to
> > study the js and py code again.. am to much involved with
> > the yap code and I'm really most happy with the latter..
> > and we actually have a maturing clinical pi (calculus)
> > N3 ruleset plus a sound bayesian inferencing which is
> > pure logical when the belief factors are 0's and 1's.
> > 
> > For the py code maybe first try to run the few test cases
> > in test.sh after checking out
> > http://eulersharp.cvs.sourceforge.net/eulersharp/2005/11swap/ 
>
> OK, I spent some time on that code today. Attached find
> what I've got so far. I made an hg repository in order
> to track changes...
> http://homer.w3.org:8765/?fa=d04b80a1aa19;file=euler.py
>
> I'm particularly interested in
>  - finding a good JSON representation of N3 formulas
>  - learning how much of N3 your .py and .js unify() routines cover

Excellent; right now it gives for
python euler.py -why http://eulersharp.sourceforge.net/2005/11swap/tree.n3

@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix : <http://eulersharp.sourceforge.net/2005/11swap/tree#>.

{{:Frans :father :Jos} => {:Frans :parent :Jos}} => {:Frans :ancestor 
:Jos}.
{{{:Frans :father :Jos} => {:Frans :parent :Jos}} => {:Frans :ancestor 
:Jos}. {{:Jos :father :Goedele} => {:Jos :parent :Goedele}} => {:Jos 
:ancestor :Goedele}} => {:Frans :ancestor :Goedele}.
{{{:Frans :father :Jos} => {:Frans :parent :Jos}} => {:Frans :ancestor 
:Jos}. {{:Jos :father :Veerle} => {:Jos :parent :Veerle}} => {:Jos 
:ancestor :Veerle}} => {:Frans :ancestor :Veerle}.
{{{:Frans :father :Jos} => {:Frans :parent :Jos}} => {:Frans :ancestor 
:Jos}. {{:Jos :father :Nele} => {:Jos :parent :Nele}} => {:Jos :ancestor 
:Nele}} => {:Frans :ancestor :Nele}.
{{{:Frans :father :Jos} => {:Frans :parent :Jos}} => {:Frans :ancestor 
:Jos}. {{:Jos :father :Karel} => {:Jos :parent :Karel}} => {:Jos :ancestor 
:Karel}} => {:Frans :ancestor :Karel}.

{{{:Jos :father :Veerle} => {:Jos :parent :Veerle}} => {:Jos :ancestor 
:Veerle}} => {:Veerle :descendant :Jos}.
{{{:Maaike :mother :Veerle} => {:Maaike :parent :Veerle}} => {:Maaike 
:ancestor :Veerle}} => {:Veerle :descendant :Maaike}.
{{{{:Frans :father :Jos} => {:Frans :parent :Jos}} => {:Frans :ancestor 
:Jos}. {{:Jos :father :Veerle} => {:Jos :parent :Veerle}} => {:Jos 
:ancestor :Veerle}} => {:Frans :ancestor :Veerle}} => {:Veerle :descendant 
:Frans}.
{{{{:Maria :mother :Jos} => {:Maria :parent :Jos}} => {:Maria :ancestor 
:Jos}. {{:Jos :father :Veerle} => {:Jos :parent :Veerle}} => {:Jos 
:ancestor :Veerle}} => {:Maria :ancestor :Veerle}} => {:Veerle :descendant 
:Maria}.


which is of course not the final proof format that we want :-)
(it was the nth trial and I was and am still learning Python..)

>From the top of my head I think that the main challenge for
unify is the "variable predicates" and you know that I prefer a
prolog like =.. univ design (versus a "holds" predicate design).

Unifying () terms seems to be fine,
{{{:Frans :father :Jos} => {:Frans :parent :Jos}} => {:Frans :ancestor 
:Jos}. {{:Jos :father (:Karel :our :son)} => {:Jos :parent (:Karel :our 
:son)}} => {:Jos :ancestor (:Karel :our :son)}} => {:Frans :ancestor 
(:Karel :our :son)}.
but I see there is an issue with unification of {} tems; hm..
I will look to that tomorrow as it is now 3am here...

Thanks Dan and have a nice weekend and good family time!

-- 
Jos De Roo, AGFA http://www.agfa.com/w3c/jdroo/

Received on Saturday, 16 December 2006 02:05:58 UTC