[Mulgara-dev] Krule updates

Alex Hall alexhall at revelytix.com
Wed May 27 16:00:22 UTC 2009


Alex Hall wrote:
> Paul Gearon wrote:
> [snip]
>>> apply <ruleGraph> to <graphA> or <graphB> or <graphC> <graphD>
>>>
>>> Now that's not exactly self-explanatory.
>> That's my problem. The fact that the final graph just "hangs" off the
>> back there has always bothered me. OTOH, it worked when there was only
>> one other graph.
> 
> Yes, that's exactly what I was thinking but couldn't quite find the
> words to express.  The destination graph just hangs off the end there.
> 
>>>  I suppose there are things you
>>> could do to clean it up.  One thing that comes to mind is introducing a
>>> keyword -- "into" or "destination" seem like logical candidates -- to
>>> separate the graph expression from the destination graph.
>> I was originally going to do this, but it felt too much like syntactic
>> sugar at the time, so I just added the graph on the end. It would
>> *still* be syntactic sugar, but now it would add significantly to the
>> readability.
> 
> I think this is the approach I will take, then.  If necessary, the new
> keyword might be made optional if we decide it's important for the
> grammar to be backwards-compatible with existing commands.

I've made the appropriate changes locally to the TQL grammar to enable
applying rules to complex graph expressions.  I'm trying to settle on a
keyword to use as syntactic sugar to denote the destination graph in an
apply command.  I've chosen "destination" as the keyword, but am open to
other suggestions.  So at the moment, a command to apply rules to the
union of two graphs will look like:

apply <rules:rdfs> to <graph:a> or <graph:b> destination <graph:output>;

I'm making the "destination" keyword optional so that existing TQL
commands will still work.  The entire destination clause is optional as
well.  If no destination is chosen, then the destination will be the
base graph it is a simple graph URI, or the new <sys:default> graph if
the base graph is a complex graph expression (union or intersection).

Sound good to everybody?

Alex



More information about the Mulgara-dev mailing list