- From: <jos.deroo@agfa.com>
- Date: Thu, 28 Sep 2006 22:29:19 +0200
- To: connolly@w3.org
- Cc: "Boley, Harold" <Harold.Boley@nrc-cnrc.gc.ca>, "Public-Rif-Wg (E-mail)" <public-rif-wg@w3.org>, public-rif-wg-request@w3.org
- Message-ID: <OF535B37D8.13FD02E3-ONC12571F7.006EB1CF-C12571F7.00707D04@agfa.com>
That is making real sense to me and all working fine!
I've tried (and attached the resulting file danC.rif)
python /w3ccvs/WWW/2000/10/swap/n3absyn.py
http://eulersharp.sourceforge.net/2004/04test/danC.n3
--rif > danC.rif
and it seems fine with the N3 path expressions too..
Waw!
Also many thanks for the pointer
http://dig.csail.mit.edu/2006/Papers/TPLP/n3absyn.html
--
Jos De Roo, AGFA http://www.agfa.com/w3c/jdroo/
Dan Connolly <connolly@w3.org>
Sent by: public-rif-wg-request@w3.org
25/09/2006 19:37
To: "Boley, Harold" <Harold.Boley@nrc-cnrc.gc.ca>
cc: "Public-Rif-Wg (E-mail)" <public-rif-wg@w3.org>, (bcc: Jos
De Roo/AMDUS/AGFA)
Subject: Re: [RIF] Extensible Design: Horn semantics and
syntax... RDF/OWL integration conventions
On Thu, 2006-09-14 at 13:23 -0400, Boley, Harold wrote:
> Michael & I have completed our Horn semantics and syntax
> actions from Tuesday, as part of the RIF Extensible Design:
> http://www.w3.org/2005/rules/wg/wiki/B._Extension%3A_RIF_Rule_Language
> http://www.w3.org/2005/rules/wg/wiki/B.1_Horn_Rules
The code I wrote to translate N3-rules also translates RDF/XML.
So I can run it on the OWL tests... for example, attached
find ,statecode.xml, the output of running it on...
http://www.w3.org/2002/03owlt/I5.1/premises001
and ,list.xml, the output of running it on
http://www.w3.org/2002/03owlt/I5.5/conclusions005
The RDF parser in swap/cwm treats turns first/rest triples into
something more like a function term. So that's the way I have
written them out in RIF:
<Atom>
<Rel>holds</Rel>
<Ind iri="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" />
<Expr>
<Fun>list</Fun>
<Ind iri="http://www.w3.org/2002/03owlt/I5.5/premises005#a" />
</Expr>
<Ind iri="http://www.w3.org/1999/02/22-rdf-syntax-ns#List" />
</Atom>
Specifying a list function symbol and the relationship to first/rest
involves induction, I suppose. I think it's worth doing, though.
My approach to RDF "triples" is to use a 3-place "holds" relation:
<Atom>
<Rel>holds</Rel>
<Ind iri="http://example.org/vocab#stateCode" />
<Var>g3</Var>
<Data>KS</Data>
</Atom>
This allows us to write rules corresponding to the RDFS semantics
and parts of OWL, as in the owl pD* paper
http://www.websemanticsjournal.org/ps/pub/2005-15
I transcribed those rules into N3 and then played
around with them a bit...
http://www.w3.org/2000/10/swap/util/owlth.n3
Jos has done something similar...
http://www.agfa.com/w3c/euler/rpo-rules.n3
Attached find ,rpo.xml , the output of my N3-to-RIF
translator on that rpo-rules.n3.
For example
{?P rdfs:domain ?C. ?S ?P ?O} => {?S a ?C}.
turns into...
<Implies>
<And>
<Atom>
<Rel>holds</Rel>
<Ind iri="http://www.w3.org/2000/01/rdf-schema#domain" />
<Var>P</Var>
<Var>C</Var>
</Atom>
<Atom>
<Rel>holds</Rel>
<Var>P</Var>
<Var>S</Var>
<Var>O</Var>
</Atom>
</And>
<Atom>
<Rel>holds</Rel>
<Ind iri="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" />
<Var>S</Var>
<Var>C</Var>
</Atom>
</Implies>
FYI, I have a couple versions of RDFS semantics in rules;
one transcribed faithfully from the spec...
http://www.w3.org/2000/10/swap/util/rdfs-rules.n3
and one that omits "boring" rules like "everything is a Resource"...
http://www.w3.org/2000/10/swap/util/rdfs-nice.n3
and for those who want to play along at home, this is the
exact command line I'm using:
~/w3ccvs/WWW/2000/10/swap$ PYTHONPATH=.. python2.4 n3absyn.py
http://www.w3.org/2002/03owlt/I5.1/premises001 --rif |tidy -i -xml
>,statecode.xml
and this assumes you have swap checked out, per
http://www.w3.org/2000/10/swap/doc/cwm#dev
And if you want to use tidy...
http://tidy.sourceforge.net/
--
Dan Connolly, W3C http://www.w3.org/People/Connolly/
D3C2 887B 0F92 6005 C541 0875 0F91 96DE 6E52 C29E
Attachments
- application/octet-stream attachment: _statecode.xml
- application/octet-stream attachment: _rpo.xml
- application/octet-stream attachment: _list.xml
- application/octet-stream attachment: danC.rif
Received on Thursday, 28 September 2006 20:29:39 UTC