On Feb 18, 2012, at 12:35 AM, Andy Seaborne wrote:
> Another suggestion: put a marker pattern into the query and then you can find 
> it again.
> 
> Put in the triple
>    <tq:holger> <tq:holger> <tq:holger> .

Thanks, Andy, for looking into this. Unfortunately those queries are not 
written by myself, and they might be anything. So I cannot rely on a marker 
triple. It's basically a feature of the SPIN framework in which rules and 
constraints can be attached to classes. The variable ?this is then supposed to 
be (pre) bound to all instances of those classes. My current solution was to 
insert this clause that iterates over all instances where ?SOME_TYPE is 
pre-bound to the class using initial bindings. This works fine in most cases, 
but if some query only uses a function call (and BIND) then the ?this variable 
may not already be bound and the function call fails.

Is there perhaps a way to control the table unit (if that's always there), so 
that this could instead be a BGP? Maybe I could pre-process the ops but I don't 
understand the algebra mechanism well enough on a reliable pattern on what 
replacement I would need to do. A syntactic insertion based on { sounds 
brittle, esp since there are things like GRAPH etc that switch to a completely 
different query graph.

Maybe I need to really do the iteration "outside" for certain rules and 
constraints if there is no simple place for a ?this binding BGP. This will be 
slower but at least correct. Do you have any other ideas?

Thanks a lot
Holger

Reply via email to