SUM is an aggregate function; do mean something like "?oldNumberOfFails + 1"?
Can you post your exact query maybe? I don't think the question is very clear.




> Sent: Wednesday, November 20, 2019 at 3:31 PM
> From: "Bardo Nelgen" <[email protected]>
> To: "[email protected]" <[email protected]>
> Subject: Simple Addition Example ?
>
> Hi all,
> 
> I am really sorry asking for your time to "solve" such ordinary issue, 
> but it seems I am completely incapable of doing a simple addition in 
> SPARQL.
> 
> All I want to do is a loop-iteration to log the number of a procedure’s 
> failed tries, abort if the outcome has finally been successful or mark 
> it „failed“ after 3 attempts.
> 
> To me, the actual problem lies in the counting (second paragraph):
> I know I do get the syntax wrong, but as of now could not figure out the 
> correct approach…
> 
> >     # make result boolean
> >     BIND(IF(?Result = 1 ,true,false)AS?Success).
> >
> >     # calculate number of fails
> >     VALUES ?one {1}
> >     BIND(IF(?Success = 
> > true,?oldNumberOfFails,SUM(?oldNumberOfFails,?one))AS?currentNumberOfFails).
> >
> >     # create current-state IRI
> >     BIND(IF(?Success = true,fac:complete,IF(?numberOfFailsOLD < 
> > 2,fac:requested,fac:failed))AS?currentState). 
> 
> As always, help is highly appreciated !!
> 
> Best,
> 
> Bardo Nelgen
> 
>

Reply via email to