A couple of other thoughts. There is a level of discomfort when moving from more familiar procedural languages to query languages. As Holger indicated, feedback is welcomed.
In terms of knowing what triples are available for a given module, using the debug icon is invaluable. When you click on a module, click debug to run the script to the module, then Infer result triples (temporarily), the triples available at that point in the script are inferred into the script model. You can then run queries in the SPARQL tab to make sure the triples you expect are available at that point in the script. Section 4 of the SPARQLMotion Tutorial "Iterative Development of SPARQLMotion Scripts" provides some examples and hints on how to create and debug scripts. -- Scott On Jun 18, 9:27 am, Holger Knublauch <[email protected]> wrote: > Paul, > > doesn't BranchByAsk with ASK WHERE { FILTER (?var = "rdf") } work? > > If others have the same requirement, I welcome suggestions on how to > make this more user friendly. > > Thanks, > Holger > > On Jun 18, 2009, at 3:51 AM, PaulZH wrote: > > > > > Scott, > > > I discovered the reason why the two ASK queries did give different > > results. > > > The collection of triples queried with the ASK within the SPARQLMotion > > script is a filtered version of the full graph and the triples queried > > for do not exist anymore. > > Hence the query always evaluates to false. > > > Anyhow the BranchByAsk felt unnatural for what I need. > > In fact I need a branch functionality based on a variable value. > > if ?var = "rdf" then ... else .... > > > But I do not see a standard module (BranchByValue) that allows me to > > do this. > > Any suggestion? > > > Paul > > > On Jun 17, 10:14 pm, Scott Henninger <[email protected]> > > wrote: > >> Paul; If you look at the console, it will state which modules are > >> being executed. That will provide a direct way of confirming whether > >> or not the 'if' branch is being followed. > > >> -- Scott > > >> On Jun 17, 2:45 pm, PaulZH <[email protected]> wrote: > > >>> Scott, > > >>> On Jun 17, 4:59 pm, Scott Henninger <[email protected]> > >>> wrote: > > >>>> Paul; For the most part his looks OK. I wonder if what you really > >>>> want is to compare the user input directly in a FILTER, i.e.: > >>>> FILTER regex(?ext = "rdf") > > >>> I'm opent o any better suggestion for the test. > > >>>> By "nothing is happening", do you mean that neither the 'if' or > >>>> 'else' > >>>> branches are executing (confirmed via console)? > >>>> -- Scott > > >>> The logic should be: if "rdf" then do the transformation to html, > >>> else > >>> do nothing. > >>> If it is "rdf" the transformation to HTML doesn't happen. > > >>> I'll put tomorrow something in the else branch just to test. > > >>> Paul --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
