An alternative would be to name the variable for your string ?url, instead of ?evriSentUri.
-- Scott On Oct 29, 9:56 pm, Holger Knublauch <[email protected]> wrote: > Hi Darin, > > sorry to cause more confusion than necessary - my example below was > testing a separate case. Your case was to insert the variable using > the {?...} notation in sml:url. This has still some limitations, and > it's too late to change now directly before the build. However, there > is a simple work-around: instead of using the {?...} notation, insert > an sml:CloneVariable before the ImportXMLFromURL module. The input > variable would be the url and the output variable must be called "url" > to match the expected parameter sml:url in the module. The system will > then pick up the value correctly. > > Holger > > On Oct 29, 2009, at 5:28 PM, Holger Knublauch wrote: > > > Hi Darin, > > > what version of TBC are you using? From my SVN log, I can see that > > there were some bug fixes related to this earlier this year. If I try > > your scenario with the 3.2 release candidate, then I do not see any > > error. Please try the attached script which works for me. If it does > > not work for you then we know that the 3.2 update (hopefully tomorrow) > > will fix the issue for you. The problem might have been that the > > engine was removing everything after the ? in your url. > > > Thanks > > Holger > > > On Oct 29, 2009, at 5:00 PM, Darin wrote: > > >> I am trying to retrieve some xml from a URL but seem to be having an > >> issue. > > >> SparqlMotion outline: > >> 1 - sml:ImportXMLFromURL > >> fromhttp://api.evri.com/v1/entities/find?name=Genuine_Parts_Company > >> - this works fine, returning the appropriate xml. > >> 2 - sml:BindByXpath - I use this to get the ID of the entity returned > >> in xml(//entity/@href) - this works fine > >> 3 - smf:buildString - I build another URL base on this extracted > >> string, from step 2 - > >>http://api.evri.com/v1/sentiment/about?sentimentSource={?evriID}&sentimentType=positive&sort=date > >> - this works fine > >> 4 - sml:ImportXMLFromURL - This is where I have an issue. This is > >> what > >> I have set in the module: > >> sm:outputVariable: xmlSent > >> sml:url {?evriSentUri} > > >> The evriSentUri is the text sting that I constructed in step 3 > > >> However, when I debug this module I get and error message from Evri > >> shown below in the console output, (in the xmlSent variable output). > > >> If you copy and paste the evriSenUri shown below, you will see that > >> it > >> definitely works and returns what it should (see the proper evri > >> xmlSent below). > > >> ***********Consle output***************** > > >> Result variables of Import XMLFrom URL_2: > >> - evriID (xsd:string) = /organization/genuine-parts-company-0x4eb8d > >> - evriSentUri = > >>http://api.evri.com/v1/sentiment/about?sentimentSource=/organization/... > >> - xml = <evriThing requestedUrl="/v1/entities/find" status="OK" > >> version="1"> > >> <messages> > >> <message code="0">More information on the Evri API can be > >> found at:http://www.evri.com/developer/index.html. By using or > >> accessing the Evri API, you are agreeing to be bound by our Terms of > >> Use which are specified at:http://www.evri.com/developer/tos.html</ > >> message> > >> </messages> > >> <entities> > >> <entity href="/organization/genuine-parts-company-0x4eb8d" > >> id="322445" score="1.0"> > >> <facets> > >> <facet count="0"> > >> <name>Company</name> > >> </facet> > >> </facets> > >> <name>Genuine Parts Company</name> > >> <properties> > >> <property> > >> <name>wikipedia_paragraph</name> > >> <value>Genuine Parts Company (NYSE: GPC) is a > >> Fortune 1000 company that was founded in 1928. Based in Georgia with > >> large operations in Alabama, the company employs 31,700 people. It > >> specializes in replacement parts for cars and other industrial > >> machines and is the largest member of the National Automotive Parts > >> Association(NAPA). Approximately 5,800 NAPA Auto Part stores, around > >> 1,000 of which are company owned, are serviced by the auto parts > >> segment of the company, which accounted for 51% of their profits in > >> 2005.</value> > >> </property> > >> </properties> > >> <type>ORGANIZATION</type> > >> </entity> > >> </entities> > >> </evriThing> > > >> - xmlSent = <evriThing requestedUrl="/v1/sentiment/about" > >> status="ERROR" version="1"> > >> <messages> > >> <message code="0">More information on the Evri API can be > >> found at:http://www.evri.com/developer/index.html. By using or > >> accessing the Evri API, you are agreeing to be bound by our Terms of > >> Use which are specified at:http://www.evri.com/developer/tos.html</ > >> message> > >> <message code="412">The sentiment source, the subject, or > >> both, must be provided</message> > >> </messages> > >> </evriThing> > > >> **********Proper evri xmlSent should look like this************** > > >> <?xml version="1.0" encoding="UTF-8"?> > >> <evriThing status="OK" version="1" requestedUrl="/v1/sentiment/ > >> about"> > >> <messages> > >> <message code="0">More information on the Evri API can be found > >> at:http://www.evri.com/developer/index.html. By using or accessing > >> the Evri API, you are agreeing to be bound by our Terms of Use which > >> are specified at:http://www.evri.com/developer/tos.html</message> > >> </messages><mediaResult> > >> <sentimentList currentResult="0" totalResults="0"> > >> <sentiment type="positive"> > >> <article> > >> <author>Seeking Alpha</author> > >> <link href="/log/click?url=http%3A%2F%2Fseekingalpha.com > >> %2Farticle%2F140787-gm-bankruptcy-time-for-new-era-auto-opportunities > >> %3Fsource%3Dfeed" type="UNKNOWN" hostName="seekingalpha.com" path="/ > >> article/140787-gm-bankruptcy-time-for-new-era-auto-opportunities"/> > >> <published>2 Jun 2009 07:05:17 GMT</published> > >> <title>GM Bankruptcy: Time for New-Era Auto Opportunities</ > >> title> > >> <content>In auto parts, that's the kind of stature enjoyed by > >> GPC....</content> > >> </article> > >> </sentiment> > >> </sentimentList> > >> </mediaResult> > >> </evriThing> > > > <importXMLBug.n3> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
