Scott,

Thanks for your quick response.  Here are some further questions or
clarifications.

[Catrina]> 2)  Is it possible to prompt the user for various inputs,
where the
> various inputs that are needed aren't determined until run time?



[Scott]Yes, there are a couple of modules that will do this.  One is
sml:EnterLiteral.  Another is to define an argument specifying an xsd
literal as the value type.  The property name will be the label
displayed in the text box.  The DBPediaCallingCodes example script at
http://www.topquadrant.com/products/SPARQLMotion.html has an example.

[Scott] Either of these modules can be placed anywhere in a script.

[Catrina2]  Just as a reminder, I'm creating a SPARQLMotion script
that is to be executed from Ensemble.  I don't think sml:EnterLiteral
will work.  Should it?  I get an error.

----------------------------------------------------
[Catrina]> 3)  When a SPIN function is created in order to set a
SPARQLMotion
> script available for use by Ensemble, is it possible to have a
> spin:body value on this SPIN function?


> For example, a subclass of spin:Functions is generated that contains
> one or more spin:constraints.



[Scott]spin:constraint's on a SPIN function are the parameters passed
to the
function.  By "generated" do you mean "defined"?

[Catrina2] I mean I created a subclass of spin:Functions and defined
it using one or more spin:constraints.

[Catrina]> The sm:returnModule is set to an
> instance of the  sml:ReturnText module.


[Scott]Things are getting a little mixed here.  SPIN functions live
outside
of the scope of SM scripts.  I.e. if you define a SPIN function, then
the function is available in any sparql context, as long as the
function definition is available (model opened or imported).

To have a way in which an entity can call a script, Composer/Live
uses
SPIN functions to link a function to the script.



[Catrina]> Can I also set a spin:body
> value on my subclass of spin:Functions and have it execute when the
> script is run from Ensemble?


[Scott]Yes, any defined SPIN function (which is what I believe you
mean by
"subclass of spin:Functions") can define a spin:body, which is a
SPARQL query that returns a bound value.


[Catrina]>If so, how do I capture the value from a
> select query in that spin:body?


[Scott]The variable in the SELECT statement of a SPIN function's body
is the
return value from the function.  Since it defines a function, only
one
value is passed.

As an example, look at the :getFather function in kennedysSPIN.  This
function specifies that a member of kennedys:Person is passed to the
function and bound as the argument ?arg1.  The query in spin:body is
executed and the binding for ?father is returned.  Hence:
    LET (?dad := :getFather (kennedys:CarolineKennedy))
will return kennedys:JohnKennedy

[Catrina2] I want to know if I can set the spin:body on a subclass of
spin:Functions that was created to link a script to be called from
Ensemble.

----------------------------------------------------------------
[Catrina]> 4)  Is is possible to have a SPARQLMotion file publish as
both .sms
> and .spin?


> For example, if I have a SPARQLMotion script that contains a script
> that is to be executed from Ensemble and the script itself needs to
> call a SPIN function local to the current SPARQLMotion script file,
> how can I have both the sms and spin published and available from
> Ensemble?



[Scott]Yes.  In the scenario you give, this is already done.  When you
create
a SPARQLMotion file, SPIN is already imported.  This means you can
create the SPIN functions, attach them to SM scripts via
sm:returnModule, and the scripts are registered.  If the SPIN
functions need to be registered separately for some reason, then
import the .spin files.

[Catrina2] I'm looking for a little bit of a different scenario than
what I think you visualize.  I have a script that has a SPIN function
that is set with a return module in order to get the script executable
from Ensemble.  My script then needs to do some processing by another
different SPIN function.  Ensemble does not seem to be able to find
this other function when I execute from Ensemble.  The second function
is defined in the same script that is shown from Ensemble.

Thanks,
Catrina

On Aug 10, 3:06 pm, Scott Henninger <[email protected]>
wrote:
> On Aug 10, 12:46 pm, Catrina <[email protected]>
> wrote:
>
> > We are creating SPIN functions for SPARQLMotion scripts that will be
> > kicked off from Ensemble.
>
> > 1)  Is it possible to nest the SPIN functions?
>
> > For example, we want a main function that will be displayed in
> > Ensemble.  Then, based on the hierarchy (we have various different
> > hierarchies), we want to define some sort of like sub-functions of the
> > main spin function and call them in order to prompt the user for
> > further information.
>
> Yes, once a SPIN function is created, it is available in any SPARQL
> query.  E.g. :getCurrentYear is a spin function in kennedysSPIN.owl
> (available in Examples folder of a Composer installation).  You could
> write a new function, say :myNewFunct that specifies :getCurrentYear
> in the body - e.g. LET (?age := :getCurrentYear() - ?birthYear)
>
>
>
> > 2)  Is it possible to prompt the user for various inputs, where the
> > various inputs that are needed aren't determined until run time?
>
> Yes, there are a couple of modules that will do this.  One is
> sml:EnterLiteral.  Another is to define an argument specifying an xsd
> literal as the value type.  The property name will be the label
> displayed in the text box.  The DBPediaCallingCodes example script 
> athttp://www.topquadrant.com/products/SPARQLMotion.htmlhas an example.
>
> Either of these modules can be placed anywhere in a script.
>
>
>
> > 3)  When a SPIN function is created in order to set a SPARQLMotion
> > script available for use by Ensemble, is it possible to have a
> > spin:body value on this SPIN function?
>
> > For example, a subclass of spin:Functions is generated that contains
> > one or more spin:constraints.  
>
> spin:constraint's on a SPIN function are the parameters passed to the
> function.  By "generated" do you mean "defined"?
>
> > The sm:returnModule is set to an
> > instance of the  sml:ReturnText module.  
>
> Things are getting a little mixed here.  SPIN functions live outside
> of the scope of SM scripts.  I.e. if you define a SPIN function, then
> the function is available in any sparql context, as long as the
> function definition is available (model opened or imported).
>
> To have a way in which an entity can call a script, Composer/Live uses
> SPIN functions to link a function to the script.
>
> > Can I also set a spin:body
> > value on my subclass of spin:Functions and have it execute when the
> > script is run from Ensemble?  
>
> Yes, any defined SPIN function (which is what I believe you mean by
> "subclass of spin:Functions") can define a spin:body, which is a
> SPARQL query that returns a bound value.
>
> >If so, how do I capture the value from a
> > select query in that spin:body?
>
> The variable in the SELECT statement of a SPIN function's body is the
> return value from the function.  Since it defines a function, only one
> value is passed.
>
> As an example, look at the :getFather function in kennedysSPIN.  This
> function specifies that a member of kennedys:Person is passed to the
> function and bound as the argument ?arg1.  The query in spin:body is
> executed and the binding for ?father is returned.  Hence:
>     LET (?dad := :getFather (kennedys:CarolineKennedy))
> will return kennedys:JohnKennedy
>
>
>
> > 4)  Is is possible to have a SPARQLMotion file publish as both .sms
> > and .spin?
>
> > For example, if I have a SPARQLMotion script that contains a script
> > that is to be executed from Ensemble and the script itself needs to
> > call a SPIN function local to the current SPARQLMotion script file,
> > how can I have both the sms and spin published and available from
> > Ensemble?
>
> Yes.  In the scenario you give, this is already done.  When you create
> a SPARQLMotion file, SPIN is already imported.  This means you can
> create the SPIN functions, attach them to SM scripts via
> sm:returnModule, and the scripts are registered.  If the SPIN
> functions need to be registered separately for some reason, then
> import the .spin files.
>
>
>
>
>
> > Thanks,
> > Catrina- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TopBraid Composer Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/topbraid-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to