- From: <jos.deroo@agfa.com>
- Date: Tue, 15 Feb 2005 18:39:28 +0100
- To: henry.story@bblfish.net
- Cc: danbri@w3.org, semantic-web@w3.org, semantic-web-request@w3.org
Hi, Henry
Using Turtle data
:a :r1 :b.
:a :r2 :c.
:a :r3 :d.
:a :r4 :e.
:a :r5 :f.
:g :r1 :b.
:g :r2 :c.
:g :r3 :d.
:g :r4 :e.
:g :r5 :f.
:p :cifp (:r1 :r2 :r3 :r4 :r5).
and N3 rules
{?C :cifp ?L.
(?X ?Y) :cifpForAllOf ?L}
=>
{?X owl:sameAs ?Y}.
{}
=>
{(?X ?Y) :cifpForAllOf rdf:nil}.
{?L rdf:first ?A.
?X ?A ?O.
?Y ?A ?O.
?L rdf:rest ?B.
(?X ?Y) :cifpForAllOf ?B}
=>
{(?X ?Y) :cifpForAllOf ?L}.
asking N3QL query
[] q:select {?X owl:sameAs ?Y}; q:where {?X owl:sameAs ?Y}.
gave same results
:a owl:sameAs :a.
:a owl:sameAs :g.
:g owl:sameAs :a.
:g owl:sameAs :g.
Couldn't test it with Cwm, but is what was answer of Euler :)
--
Jos De Roo, AGFA http://www.agfa.com/w3c/jdroo/
Henry Story <henry.story@bblfish.net>
15/02/2005 15:51
To: Jos De_Roo/AMDUS/MOR/Agfa-NV/BE/BAYER@AGFA
cc: semantic-web@w3.org, danbri@w3.org, semantic-web-request@w3.org
Subject: Re: Combined Inverse Functional Properties
Thanks. That's perfect. That has helped me both learn N3 and is a nice
solution.
All we need is to generalize this to CIFPs of any size and we have a
really useful concept, ready to go up on the wiki :-)
Henry Story
On 15 Feb 2005, at 14:35, jos.deroo@agfa.com wrote:
> Hi, Dan
>
> I did just a 5 min test with Cwm and Euler :)
>
> given data
>
> :a :r1 :b.
> :a :r2 :c.
> :g :r1 :b.
> :g :r2 :c.
> :p :cifp (:r1 :r2).
>
>
> and some rules capturing only cases for 1, 2 and 3 cifp properties
>
> {?C :cifp ?L.
> ?L rdf:first ?P;
> rdf:rest rdf:nil.
> ?A ?P ?X.
> ?B ?P ?X}
> =>
> {?A owl:sameAs ?B}.
>
> {?C :cifp ?L.
> ?L rdf:first ?P;
> rdf:rest ?M.
> ?M rdf:first ?Q;
> rdf:rest rdf:nil.
> ?A ?P ?X;
> ?Q ?Y.
> ?B ?P ?X;
> ?Q ?Y}
> =>
> {?A owl:sameAs ?B}.
>
> {?C :cifp ?L.
> ?L rdf:first ?P;
> rdf:rest ?M.
> ?M rdf:first ?Q;
> rdf:rest ?N.
> ?N rdf:first ?R;
> rdf:rest rdf:nil.
> ?A ?P ?X;
> ?Q ?Y;
> ?R ?Z.
> ?B ?P ?X;
> ?Q ?Y;
> ?R ?Z}
> =>
> {?A owl:sameAs ?B}.
>
>
> the N3QL query
>
> [] q:select {?X owl:sameAs ?Y}; q:where {?X owl:sameAs ?Y}.
>
> gave us
>
> :a owl:sameAs :a.
> :a owl:sameAs :g.
> :g owl:sameAs :a.
> :g owl:sameAs :g.
>
Received on Tuesday, 15 February 2005 17:40:17 UTC