Re: [topbraid-users] does anyone have a good example of the SWP ui:functionCall for a js function that maintains a value

2015-03-15 Thread Jack Hodges
I found an example in the SWP manual that made me think about what ui:tempGraph is doing. It seemed to me that I could just create a node in the current graph and set/get values from it using ui:update and spl:object without using tempGraph (not that I had gotten it to work anyway). So I

Re: [topbraid-users] does anyone have a good example of the SWP ui:functionCall for a js function that maintains a value

2015-03-15 Thread Holger Knublauch
Hi Jack, what you are looking for is some kind of global variable mechanism. The SWP variable scoping mechanism doesn't have this built-in, and I have not run into a use case for them yet, but I can see that this should be easier. So I have added a couple of helper modules in the attached

Re: [topbraid-users] does anyone have a good example of the SWP ui:functionCall for a js function that maintains a value

2015-03-13 Thread Jack Hodges
Is these (both the INSERT and the SELECT something that would be embedded inside my SWP forEach? Even if it is its going to be messy and ugly. Can I take the ui:update block and the other code and put them into SPIN functions or magic properties to unclutter the SWP? So far it isn't working...

Re: [topbraid-users] does anyone have a good example of the SWP ui:functionCall for a js function that maintains a value

2015-03-13 Thread Jack Hodges
I tried several things, including embedding the INSERT into an SWP function (setLocalVariable) and the SELECT into a normal SPIN function (getLocalVariable). But they didn't work. I also tried it with the spl:objectInGraph followed with a call to my SWP function but that didn't work. Then I

Re: [topbraid-users] does anyone have a good example of the SWP ui:functionCall for a js function that maintains a value

2015-03-12 Thread Jack Hodges
I'll try it, but my original question did state that I was trying to remember a value between iterations through a foreach... That said, I reread the SPINx documentation and it is unfortunate that the name of the file in the example was the same as the namespace prefix when it didn't have to

Re: [topbraid-users] does anyone have a good example of the SWP ui:functionCall for a js function that maintains a value

2015-03-12 Thread Jack Hodges
Does the root name of the javascript file have to be the same as the prefix for the namespace of the SPIN file? That doesn't seem to work either. Jack On Thursday, March 12, 2015 at 3:24:09 PM UTC-7, Jack Hodges wrote: This seems like a good idea but it isn't working out so nicely. If I use

Re: [topbraid-users] does anyone have a good example of the SWP ui:functionCall for a js function that maintains a value

2015-03-12 Thread Holger Knublauch
I don't think SPINX would be helping you, even with a stand-alone file - each invocation of such a SPIN function would get its own JavaScript engine, and all intermediate values will be lost. Your computation below looks like easily done in SPARQL. All you need to do is remember the

[topbraid-users] does anyone have a good example of the SWP ui:functionCall for a js function that maintains a value

2015-03-10 Thread Jack Hodges
and performs some calculation? I am trying to calculate a display position for part of a graphic inside a ui:foreach. The position is based on the position of the previous item in the iteration. It is easy enough to write a js function that will maintain the variables and their values, and

Re: [topbraid-users] does anyone have a good example of the SWP ui:functionCall for a js function that maintains a value

2015-03-10 Thread Holger Knublauch
ui:functionCall is only producing JavaScript source code that would be executed client-side. If you want server-side execution of JavaScript logic, you could use SPINx http://spinrdf.org/spinx.html HTH Holger On 3/11/15 7:11 AM, Jack Hodges wrote: and performs some calculation? I am