[Attempto] if - then sentences with Ace View

Kaarel Kaljurand kaljurand at gmail.com
Mon Mar 15 01:32:11 CET 2010


Hi,

On Tue, Mar 9, 2010 at 20:26, Jean-Marc Vanel <jeanmarc.vanel at gmail.com> wrote:
> Not without trials and errors, I wrote this ACE sentence that
> represents a rule that a site like FaceBook might use for friend
> proposals:
>
> If the current-user C knows a person X and a person Y
> and X is different from Y
> and X knows Z
> and Y knows Z
> and Z is different from C
> then Z is a friend-proposal for C .

The problem here is that ACE View (i.e. ACE->OWL/SWRL) does not support
NP conjunctions (NP and NP), i.e. things like "a person X and a person Y",
i.e. you have
to "expand" the verb (`knows'). Also, ACE->OWL/SWRL does not support
prepositions (`from', `for'), the workaround is to hyphenate them to the
preceding noun or adjective to create a "transitive verb".

E.g. like this:

If a user U knows a person X and knows a person Y and X is not Y and X
knows Z and Y knows Z and Z is not U then Z is-a-proposed-friend-for
U.

Equality is simply "is" and "different from" is simply "is not".

> The first version had commas at every end of line that make it clearer
> for the human reader, but ACE dislikes them :( .

Commas are OK in ACE:

If a user U knows a person X, and knows a person Y, and X is not Y,
and X knows Z, and Y knows Z, and Z is not U then Z
is-a-proposed-friend-for U.

> Then Ace View says:
>
> The snippet contains no Ace syntax errors, but cannot be expressed in OWL/SWRL .
>
> And the Ace Feedback panel says twice about "person" :
> A reference to this noun either does not exist or is illegal.

Yes, the error messages are not very good, this is future work. :)

> ( hard to read BTW, because the columns are too narrow, and there is
> no way to select the message, and no tooltip )

I think you can "float" the window and widen the columns (I didn't
test it now though). Do you need to copy-paste the message? Why?
What tooltip do you need?

Btw, you can file these complaints via:

http://code.google.com/p/aceview/issues/list

I'll take a closer look at them when I'll have the time.

> Then I removed "person" like this :
>
> If the current-user C knows X
> and Y
> and X is different from Y
> and X knows Z
> and Y knows Z
> and Z is different from C
> then Z is a friend-proposal for C .
>
> Then the Ace Feedback panel says again twice the message, but this
> time about  "something" :

Yes, there is always the "hidden" something when you use a bare variable.

> Since I have (AFAIK) no way in ACE to parenthesize things, I remove some and's :

Yes, ACE does not support parentheses for grouping phrases.

> I hoped that using variables would ease the analysis. But no !
>
> Now there are 3 errors:
> - Subject or Object of this verb makes an illegal reference. --> for
> "know" and "be"
> - Adjectives are not supported.
>
> I give up for now, and I 'll read Kaarel's thesis .

In the nutshell: the error messages in ACE View are not very good.
AceWiki chose to solve this problem by using predictive editing, i.e.
the user cannot create syntax errors. ACE View will also have predictive editing
one day (optionally) but the error messages will need to get better as well.

> How can I run in Prolog command line the ACE to OWL+SWRL translator ?

Find a Prolog program ace_to_owl.pl attached to this mail. It demonstrates
how you can do it. Look e.g. at the predicate t/2.

Btw, the SWRL-representation of your Facebook sentence would be
(this is not the official SWRL functional syntax, but should be close):

   Implies(
      Antecedent(
         description(
            Class(:user)
            I-variable(1)
         )
         description(
            Class(:person)
            I-variable(2)
         )
         description(
            ObjectProperty(:know)
            I-variable(1)
            I-variable(2)
         )
         description(
            Class(:person)
            I-variable(4)
         )
         description(
            ObjectProperty(:know)
            I-variable(1)
            I-variable(4)
         )
         differentFrom(
            I-variable(2)
            I-variable(4)
         )
         description(
            Class(owl:Thing)
            I-variable(7)
         )
         description(
            ObjectProperty(:know)
            I-variable(2)
            I-variable(7)
         )
         description(
            ObjectProperty(:know)
            I-variable(4)
            I-variable(7)
         )
         differentFrom(
            I-variable(7)
            I-variable(1)
         )
      )
      Consequent(
         description(
            ObjectProperty(:is-a-proposed-friend-for)
            I-variable(7)
            I-variable(1)
         )
      )
   )

--
kaarel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ace_to_owl.pl
Type: application/octet-stream
Size: 2268 bytes
Desc: not available
URL: <http://lists.ifi.uzh.ch/pipermail/attempto/attachments/20100315/c3d40243/attachment.obj>


More information about the attempto mailing list