You can also turn this script into a web service which will directly display the table results in the browser.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Scott Henninger Sent: Thursday, October 29, 2009 9:54 AM To: TopBraid Composer Users Subject: [tbc-users] Re: SPARQL -- XML -> Table ? Amrapali; There are a couple of ways to accomplish this. The first part is to use Semantic XML to open the XML file. Place the XML file in your Composer workspace and Open With > TopBraid (Semantic XML Documents). This will open the XML with a default RDF representation. See: Help > Import and Export > Creating, Importing, Querying, Saving XML documents with Semantic XML Using the SPARQL View, you can write queries and get the results, which can be saved as a tab-delimited file with the 'Export results to file…' icon in the upper-right of the SPARQL View. Choose a .txt file format. The above process can easily be converted into a SPARQLMotion script. There are a few ways to do this, but following these steps will get what you want: 1. Create a SPARQLMotion file with New… 2. Create a SPARQLMotion script (Scripts > Create SPARQLMotion Script) 2a. You will be asked to choose a module - choose anything for now 3. Drag-and-drop the XML file on the script workspace. This will add an import module to the script. 4. Add CreateSpreadsheet (in Text processing) to the script 5. Write a SPARQL query to create the spreadsheet - each SELECTed variable with be a column header 6. Add a ExportToTextFile module to the script 6a. Specify the file name to save to 7. Connect the modules - import to CreateSpreadsheet to export You can then run the script and a tab-delimited file will be created. -- Scott On Oct 29, 2:07 am, Amrapali Zaveri <[email protected]> wrote: > Hi, > > I would like to know how I could use a SPARQL query to display XML data as a > table. > > Thanks. > Regards, > - Amrapali --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
