Thanks Holger! That worked perfectly. Is there javadoc available that would have showed me the implementations of IVarValue?
Thanks again, Tim From: [email protected] [mailto:[email protected]] On Behalf Of Holger Knublauch Sent: Tuesday, January 25, 2011 4:56 PM To: [email protected] Subject: Re: [topbraid-users] How to retrieve a bound variable in an SM module? Hi Tim, you are close to the solution. There are various implementations of IVarValue, and one of them is RDFNodeVarValue. So try casting it into that class to get the actual RDFNode: RDFNode rdfNode = ((RDFNodeVarValue)varValue).getRDFNode(); Holger On Jan 26, 2011, at 7:51 AM, Smith, Tim wrote: Hi, I'm having a problem retrieving the resource to which a variable is bound once inside my SM module. In the createGraph method, I make the following call: this.getContext().getVarBindings().getBinding(<var name>); According to the java doc found here<http://www.topquadrant.com/topbraid/composer/javadoc/index.html?org/topbraid/sparqlmotion/modules/IModule.html>, this should return a com.hp.hpl.jena.rdf.model.RDFNode However, TBC thinks it will return an org.topbraid.sparqlmotion.engine.IVarValue which I cannot find in the javadoc anywhere. Any attempt to cast the result of the above call, fails. Any thoughts on how I can retrieve the resource to which the variable is bound? I can see how to do it if the getBinding(...) call returned an RDFNode. Am I looking at the correct javadoc? Thanks for your thoughts, Tim -- 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]<mailto:[email protected]> To unsubscribe from this group, send email to [email protected]<mailto:[email protected]> For more options, visit this group at http://groups.google.com/group/topbraid-users?hl=en -- 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-users?hl=en -- 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-users?hl=en
