Hello Scott,
Question #3 was:
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?
And your answer was:
No, you need to use sml:returnModule to link a the
SPIN function to a SPARQLMotion script. Ensemble
uses the name of the function to call the
SPARQLMotion script.
Is that included in any of the documentation that shows how to create
published scripts for Ensemble (SPARQLMotion scripts that are attached
to SPIN functions to enable them to be called from Ensemble)?
I couldn't find anything about what you can or can't do with spin:body
on these types of SPIN functions, but my source was mainly TopBraid's
Developing TBE Applications document. I found the documentation about
creating and executing other SPIN functions such as the Kennedys
examples, but didn't really find anything more on SPIN functions
attached to SPARQLMotion scripts.
My question #4 was:
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?
Your answer:
If the SPIN function is registered, I.e. defined
as a SPIN function, placed in a .spin file, and
the file read into the workspace, then the function
will be available to all models in the workspace.
This works in Ensemble as well as Composer.
I think the answer to my question with my desired example use is
'No'. Am I understanding that correctly?
It sounds like that if I need to call other SPIN functions (where the
return module is not set and my function needs to return something
like an instance of a class or a property value) from a published
SPARQLMotion script, then the other SPIN functions must be put into a
separate file.
In the end I will need at least 2 files:
One file will be an '.sms' file and contain my SPARQLMotion
script attached to a SPIN function that has a sm:returnModule set to a
script module such as an sml:ReturnText module.
The second file will be a '.spin' file and will have to house
some or all of the other SPIN functions that are needed and are not
attached to the script itself via a sm:returnModule (I understand I
can choose to put these in one or more '.spin' files). These types of
functions that I'm referring to are something like the :getCurrentYear
or :getFather SPIN functions. The functions that need to return
something like an instance or literal.
Thanks,
Catrina
On Aug 10, 6:39 pm, Scott Henninger <[email protected]>
wrote:
> Editing out to the responses:
>
> [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.
>
> My Apologies. EnterLiteral is not available for Ensemble. We are
> looking into different ways for user input for 3.2. In the meanwhile,
> please use spl:Argument as in the DBPediaCalling Codes example.
>
> [Catrina2] I mean I created a subclass of spin:Functions and defined
> it using one or more spin:constraints.
>
> Yes, the subclass of spinFunctions is a SPIN function and the
> constraints are arguments passed to the function.
>
> [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.
>
> No, you need to use sml:returnModule to link a the SPIN function to a
> SPARQLMotion script. Ensemble uses the name of the function to call
> the SPARQLMotion script.
>
> [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.
>
> This is also what I envision.
>
> [Catrina2] 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.
>
> If the SPIN function is registered, I.e. defined as a SPIN function,
> placed in a .spin file, and the file read into the workspace, then the
> function will be available to all models in the workspace. This works
> in Ensemble as well as Composer.
>
> Be sure that the SPIN function is being called with the correct URI.
> I.e. you may define the function as :getCurrentYear, but will either
> need to create a prefix or address with the full URL (i.e. <http://
> mustuff.org/functs#getCurrentYear>()) for scripts to use this function
> without importing the file it is defined in.
>
> -- Scott
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---