Hi Ayushi,

(as you have probably seen, this mailing list requires an approval step before messages by new users are posted. As a result there are often delays before you will see your message).

On your specific question, in general, SPARQLMotion modules can have multiple sm:next modules - it basically means that the execution branches off. In this particular case though you are trying to connect a module of the surrounding script into a sub-script, and this can only be done via sm:if/else.

So we need to figure out why the variable ?xmlStringInput is not visible for the MapToEpic module. It should. I have attached a script that looks similar to your, and which has ?xmlStringInput visible in the else branch:



Could you compare this with what you did. I would need to see the full file (in TTL format) to help further.

Regards
Holger


On 2/11/2017 7:07, Ayushi Singh wrote:
Hi,

I am working on a project with Prof. Steve (CMU faculty) where our installation of TBL is called by a system that expects to issue SPARQL queries to an endpoint, rather than calling a SPARQLMotion module as a web service. I am using BranchByAsk to get the desired output based upon a condition. Mentioned below is the flow.

I am passing input string to "ConvertXMLToRDF" module, which then passed to "branchByAsk". In "BranchByAsk" whole input string is present. When "BranchbyAsk" module gives false as an answer then it passes control to "MapToEpic" module which is associated with the else condition of "BranchByAsk".I have attached a picture of the flow for better understanding.
 But when the control is passed to "MapToEpic" the input string is not present. We tried to associate "ConvertXMLToRDF" module to "MapToEpic" in order to pass the input string as shown below. But this is giving us "Null Pointer Exception".




​
Is it not possible for a module to have 2 or more "next" modules?
Please share how can we pass input information from "BrankByAsk" to "MapToEpic" module.

Thanks,
Ayushi Singh
--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "TopBraid 
Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
# baseURI: http://example.org/elseVariableTest
# imports: http://topbraid.org/sparqlmotionfunctions
# imports: http://topbraid.org/sparqlmotionlib-tbc
# prefix: elseVariableTest

@prefix elseVariableTest: <http://example.org/elseVariableTest#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sm: <http://topbraid.org/sparqlmotion#> .
@prefix smf: <http://topbraid.org/sparqlmotionfunctions#> .
@prefix sml: <http://topbraid.org/sparqlmotionlib#> .
@prefix sp: <http://spinrdf.org/sp#> .
@prefix spin: <http://spinrdf.org/spin#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://example.org/elseVariableTest>
  rdf:type owl:Ontology ;
  owl:imports <http://topbraid.org/sparqlmotionfunctions> ;
  owl:imports <http://topbraid.org/sparqlmotionlib-tbc> ;
  owl:versionInfo "Created with TopBraid Composer" ;
.
elseVariableTest:AssertTrue_1
  rdf:type sml:AssertTrue ;
  sml:askQuery [
      rdf:type sp:Ask ;
      sp:where (
          [
            rdf:type sp:Bind ;
            sp:expression [
                rdf:type smf:trace ;
                sp:arg1 "Value of ?xmlStringInput: {?1}" ;
                sp:arg2 [
                    sp:varName "xmlStringInput" ;
                  ] ;
              ] ;
            sp:variable [
                sp:varName "dummy" ;
              ] ;
          ]
          [
            rdf:type sp:Filter ;
            sp:expression [
                rdf:type sp:bound ;
                sp:arg1 [
                    sp:varName "xmlStringInput" ;
                  ] ;
              ] ;
          ]
        ) ;
    ] ;
  rdfs:label "Assert true 1" ;
.
elseVariableTest:BindBySelect_1
  rdf:type sml:BindBySelect ;
  sm:next elseVariableTest:BranchByAsk_1 ;
  sm:nodeX 283 ;
  sm:nodeY 108 ;
  sml:selectQuery [
      rdf:type sp:Select ;
      sp:resultVariables (
          [
            sp:varName "world" ;
          ]
        ) ;
      sp:where (
          [
            rdf:type sp:Bind ;
            sp:expression "World" ;
            sp:variable [
                sp:varName "world" ;
              ] ;
          ]
        ) ;
    ] ;
  rdfs:label "Bind by select 1" ;
.
elseVariableTest:BindWithConstant_1
  rdf:type sml:BindWithConstant ;
  sm:next elseVariableTest:BindBySelect_1 ;
  sm:nodeX 63 ;
  sm:nodeY 16 ;
  sm:outputVariable "xmlStringInput" ;
  sml:value "Hello" ;
  rdfs:label "Bind with constant 1" ;
.
elseVariableTest:BranchByAsk_1
  rdf:type sml:BranchByAsk ;
  sm:else elseVariableTest:AssertTrue_1 ;
  sm:nodeX 286 ;
  sm:nodeY 234 ;
  sml:askQuery [
      rdf:type sp:Ask ;
      sp:where (
          [
            rdf:type sp:Filter ;
            sp:expression [
                rdf:type sp:not ;
                sp:arg1 [
                    rdf:type sp:bound ;
                    sp:arg1 [
                        sp:varName "xmlStringInput" ;
                      ] ;
                  ] ;
              ] ;
          ]
        ) ;
    ] ;
  rdfs:label "Branch by ask 1" ;
.
<http://example.org/elseVariableTest#Import-kennedys.ttl_1>
  rdf:type sml:ImportRDFFromWorkspace ;
  sm:next elseVariableTest:AssertTrue_1 ;
  sm:nodeX 45 ;
  sm:nodeY 158 ;
  sml:baseURI "http://topbraid.org/examples/kennedys"; ;
  rdfs:label "Import kennedys.ttl" ;
.

Reply via email to