Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[p4-feedback] Why does the expression editor remove essential parentheses?

Nick Drummond nick.drummond at cs.manchester.ac.uk
Tue Apr 28 07:48:16 PDT 2009


Hi Shahim,

Yes, the description editor treats OR as higher precedence.
The parser used is the OWL API Manchester Syntax parser and is not
consistent with the Manchester OWL Syntax BNF and paper.
I'll raise this with Matthew and see if we can come to an agreement about
which should hold.

Nick


2009/4/27 S Essaid <sielists at gmail.com>

> Hi Nick,
>
> I just came across this same issue. If I understood your previous post
> correctly you are saying that OR has a higher precedence than AND but my
> understanding is the opposite. The description editor is behaving as if
> OR has a higher precedence than AND but this is not what the Manchester
> syntax says. Is this discrepancy intentional or am I misunderstanding
> the syntaxes?
>
> The current W3 BNF for the syntax
> http://www.w3.org/TR/2009/WD-owl2-manchester-syntax-20090421/#Descriptions
> shows that A AND B OR C will be first parsed as (A AND B) OR (C) instead
> of the other way around (A) AND (B OR C) (the way the description editor
> is parsing the text).
>
> The precedence order is described more clearly in your paper about the
> Manchester syntax "The Manchester OWL Syntax" at
> http://www.webont.org/owled/2006/acceptedLong/submission_9.pdf
>
> > Precedence The Manchester OWL Syntax encourages the minimisation of the
> > number of brackets that are used. This is achieved using operator
> > precedence for
> > class descriptions. The following list summarises operator precedence
> > – operators
> > are shown from highest precedece to lowest precedence.
> > – SOME, ALL, VALUE, MIN, MAX, EXACTLY, THAT
> > – NOT
> > – AND
> > – OR
>
> This was described as a bug in this post
> https://mailman.stanford.edu/pipermail/p4-feedback/2007-May/000108.html
> but I didn't find a bug report for it.
>
> Thanks,
> Shahim
>
> > Hi Patrick,
> >
> > I just looked at this and I think the issue is just the rendering. Or
> > appears to have greater precedence than and in the Man Syntax.
> >
> > A and B or C is parsed as
> >
> > A and (B or C)
> >
> > We should probably retain the brackets to make this clearer (as it
> depends
> > what your background is whether this is intuitive - C has && as higher
> > precedence for example).
> >
> > The reason the rendering changes on a reload is p4 remembers the
> expression
> > as you typed it until it is restarted.
> >
> > Nick
> >
>
> _______________________________________________
> p4-feedback mailing list
> p4-feedback at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/p4-feedback/attachments/20090428/abdf848a/attachment.html>


More information about the p4-feedback mailing list