[Mulgara-dev] in clauses in trans/walk constraints

Paul Gearon gearon at ieee.org
Fri Jun 15 18:56:37 UTC 2007


I created trans first, and it was the first time I'd ever looked at
SableCC.  In fact, I didn't even look at the documentation.  I just looked
at the existing code, and the existing grammar file, and figured about how
to add trans in.  After all, it's roughly EBNF.  I guess I was too
preoccupied to think about IN.

Andrew did the walk method.  He tells me that he just looked at the trans
code, and copied that.  :-)

Actually, the given syntax has a problem.  It doesn't make sense for the two
constraints to have differing graphs (models), since one of them is just
supposed to mark the starting point on which to apply the second.  So
instead of:
    walk(<a:1> <b:1> $o in <m:1> and $s <b:1> $o in <m:1>)
It should be more like:
    walk(<a:1> <b:1> $o and $s <b:1> $o) in <m:1>

Don't you just hate this syntax?!?  It was the best I could come up with at
the time (remembering that the WHERE clause should stay "triple-oriented" in
structure).  Suggestions  on a better syntax are welcome!  :-)

Actually, I'm considering using code similar to "trans" in order to work out
the distance between any two nodes in a graph, and maybe to return a list of
all nodes "n" relationships away on a graph.  The code for this is
straightforward.  But I'm out of ideas on how to put it into the TQL syntax
such that it looks vaguely like a triple pattern.  Any suggestions on this
would be welcome!!!

Regards,
Paul Gearon

On 6/10/07, Life is hard, and then you die <ronald at innovation.ch> wrote:
>
>
> We just noticed that while the sablecc grammar allows an 'in' clause
> in trans/walk constraints, as in
>
>     walk(<a:1> <b:1> $o in <m:1> and $s <b:1> $o in <m:1>)
>
> the ConstraintExpressionBuilder, line 786, throws an exception if
> there's an 'in' clause. Looking at the code it isn't clear to me why
> this is being prohibited. Any clues? Or can the check be removed?
>
>
>   Cheers,
>
>   Ronald
>
> _______________________________________________
> Mulgara-dev mailing list
> Mulgara-dev at mulgara.org
> http://mulgara.org/mailman/listinfo/mulgara-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mulgara.org/pipermail/mulgara-dev/attachments/20070615/8535797b/attachment.htm>


More information about the Mulgara-dev mailing list