In this context, selecting a resource to run a script does not seem to be meaningful. In such situations, you can use a SPARQLMotion relay component in TBE and create a button that will trigger running of a script when clicked. Also, application level scripts (invoked by clicking on the SPARQLMotion cog next to the configuration buttons) do not require selecting a resource.
Selecting a resource becomes useful if you want to do some targeted inferencing, for example, only run SPIN rules associated with a certain resource. From: [email protected] [mailto:[email protected]] On Behalf Of Scott Henninger Sent: Monday, April 05, 2010 3:39 PM To: [email protected] Subject: Re: [topbraid-users] A question about TopBraid Ensemble (Currently Configured Inferences) Stanley; The way to get to most of the features of TopBraid Live (i.e. the internals of Composer) is to develop SPARQLMotion scripts that place triples in Ensemble's session graph, http://tb-session. The general principles are explained in see the Ensemble Application Development Guide (http://www.topquadrant.com/products/TBE-Application-Development-Guide.pdf). BTW, this guide will be updated soon for 3.3. For this question see the chapter on "Integrating SPARQLMotion Scripts with the TBE Applications". Here are the general steps you would need to take to be able to run SPARQL queries on inferred triples from Ensemble. I have also included an example that follows this script. 1. Create a file to store the script (more than one script can be defined per file). Make sure the file has a .sms extension, as seen on the New. SPARQLMotion File dialog. This will register the script with the TBL workspace. 2. Create a named SPIN function as a subclass of spin:Functions (a subclass of spin:Modules). This creates a named entity for a Web service that will be used to call your script from Ensemble. 3. Above the spin:Constraints property of your SPIN function, choose the triangular menu item and choose "Create from SPIN template". In that wizard, choose SelectedResourceArgument and fill the valueType with rdfs:Resource (this defined the type of the selected resource in Ensemble - the menu item will appear if the selected resource's type matches the subsumption hierarchy of the type). 4. Link the SPIN function to the SPARQLMotion script you define using the returnModule property. 5. The SPARQL motion script is rather simple. There are three main modules, but of course you can refine this as needed to do any specialized processing desired: 5a. ImportCurrentRDF (imports whatever is being viewed in Ensemble) 5b. ApplyOWLIM (or ApplyTopSPIN or ApplyPellet or the combination of data processing you need) 5c. use replace=true in the triple stream to avoid re-asserting triples already in ImportCurrentRDF 5d. Assert inferred triples into Ensemble's graph - i.e. http://tb-session. An easy way to do this is with a PerformUpdate module with the following query: INSERT INTO <http://tb-session> <http://tb-session> { ?s ?p ?o . } WHERE { ?s ?p ?o . } 6. Refresh SPARQLMotion scripts in Composer (Scripts > Refresh/Display.) 7. Open Ensemble, choose a resource and choose the named SPIN function. This will be the rdfs:label of your SPIN function and is called "Perform OWL Inferences" in the example provided. After doing this, you will be able to apply SPARQL queries that will be executed against the union of asserted and inferred graphs. -- Scott On 4/5/10 4:53 AM, Stanley wrote: Good day everyone I have a question in TBE I can execute a SPARQL in TBC-ME because I press the button "Use Currently Configured Inferences" but when I use the TBE http://;ocalhost:8083/tbl the SPARQL didn't return any results because there is no button "Use Currently Configured Inferences" how can I solve this problem. -- You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include TopBraid Composer, TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN. 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 To unsubscribe, reply using "remove me" as the subject. -- You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include TopBraid Composer, TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN. 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
