Yes, this is the overall pattern you would use.  Use IterateOverSelect
to get all XML files.  Then process the XML files (this is where the
previous posts have been focused).  Saving in a spreadsheet
(delimited file) is a matter of creating a SELECT query that chooses
the columns you want and a WHERE clause that selects the rows you
want.

-- Scott

On Feb 23, 1:13 pm, sue <vk.ontolog...@gmail.com> wrote:
> Hi,
> I came across one more post on conversion (but from RDF to CSV) and it seems
> the attached image is most likely what I am looking for, but I am not sure
> whether it works for XML conversions ?
>
> I can set the "root folder" which contains my hundreds of XML files and then
> it "Iterates over file" and "imports to ??" and "creates spreadsheet" and
> "exports to text"
>
> Again the challenge I see here is, in general while working with a single
> XML file ( I usually import it to the folder on workspace and then
> rightclick on the file and open with "TopBraid (Semantic XML Documents)")
> how does the same thing will work if I set up a root folder which has all my
> XML files?
>
> I hope I am on right track and hope this isn't too noobie of a question.
> Pls Guide :)
> Thanks
> Sue
>
> On Tue, Feb 23, 2010 at 12:45 PM, sue <vk.ontolog...@gmail.com> wrote:
> > Hi,
> > Thank you for guidance. I am able to catch up little bit.
> > The following query works great when selecting Abstract Text.
> > SELECT ?doc ?abstract
> > WHERE {
> >     ?doc a :Abstract .
> >     ?doc composite:child ?absText .
> >     ?absText composite:child ?txtNode .
> >    ?txtNode sxml:text ?abstract
> > }
>
> > One question here though, the variables ?doc, ?absText ?txtNode are user
> > defined or its predefine (XML tags) ?
>
> > My main goal is to convert the XML file into CSV or an Excel file (Export
> > the data into Excel file).
>
> > I was wondering in order to select all data from the XML file the following
> > query  should be good
>
> > SELECT ?a ?b ?c
> > WHERE {
> > ?a ?b ?c
> > }
> > *or *
> > Do I have to type all the variables in where clause like
>
> > SELECT *
> > WHERE {
> > ?abstract
> > ?abstractText
> > ?author
> > ?article
> > (and so on)
> > }
>
> > Pls guide :)
> > Thank you!!
>
> > On Mon, Feb 22, 2010 at 12:12 PM, Scott Henninger <
> > shennin...@topquadrant.com> wrote:
>
> >>  Sue; Your XML file does not declare use of any of the properties
> >> (dcterms:abstract, etc) that you mention.  You'd need to map the current
> >> file's terms to the properties you want (more later).
>
> >> For example, abstracts in your XML are found by traversing the XML tree as
> >> follows:
> >>  PubmedArticleSet/PubmedArticle/MedlineCitation/Article/Abstract
>
> >> Semantic XML follows this tree structure, creating RDF triples to define
> >> the XML tree.  The attached image shows the tree structure starting at the
> >> Abstract tag.  Use this to show how to access the data as in the following
> >> query, which will find all abstracts (note I could have started from
> >> instances of :AbstractText, but I wanted to show some triple traversal):
>
> >> SELECT ?doc ?abstract
> >> WHERE {
> >>     ?doc a :Abstract .
> >>     ?doc composite:child ?absText .
> >>     ?absText composite:child ?txtNode .
> >>    ?txtNode sxml:text ?abstract
> >> }
>
> >>  Next installment later this afternoon, but let me know if there are
> >> questions
> >> -- Scott
>
> >> On 2/22/10 10:36 AM, sue wrote:
>
> >> Thank you Scott for your quick reply.
> >> Sure you can go ahead and convert my question into tutorial. Sounds
> >> wonderful to me.
>
> >> I was just googling on how to write sparql query for selecting data
> >> and I came across a post on this group and it had some query
> >> so I was wondering how will I know what are the prefixes (dc, dcterms,
> >> prism) which I have to use for selecting the variables to write the
> >> query.
>
> >> I would go through the Help section as advised by you and will wait
> >> for your next post (mini tutorial) .
>
> >> Thanks once again :)
>
> >> On Feb 22, 10:22 am, Scott Henninger <shennin...@topquadrant.com> 
> >> <shennin...@topquadrant.com>
> >> wrote:
>
> >>  Sue;  There are quite a few issues here.  It's a common example and
> >> I'd like to turn this into an example for our Web page 
> >> (http://www.topquadrant.com/products/SPARQLMotion.html)  Would that be OK 
> >> with
> >> you?
>
> >> Let's start with Semantic XML. See Help > Import and Export >
> >> Creating, Importing, Querying, Saving XML documents with Semantic XML
>
> >> Semantic XML applies a default RDF form to XML files.  Each XML
> >> element/tag name is mapped into an OWL class, attributes are mapped to
> >> OWL datatype properties, parent-child relationships between the XML
> >> elements are expressed with composite:child, composite:index is used
> >> to order sibling tags, etc. (see the Help file).
>
> >> Can I get you to clarify what you mean by "Example is a sample from
> >> the google: " and the purpose of the SPARQL query.  I.e. is the query
> >> of the form you would like to transform the XML into?
>
> >> As I said this is a nice example, on a common topic, and I'd like to
> >> step through this as a mini-tutorial in a series of posts.  Next will
> >> be on extracting data from the XML file.
>
> >> -- Scott
>
> >> On Feb 21, 11:22 pm, sue <vk.ontolog...@gmail.com> 
> >> <vk.ontolog...@gmail.com> wrote:
>
> >>  On Sun, Feb 21, 2010 at 11:14 PM, sue <vk.ontolog...@gmail.com> 
> >> <vk.ontolog...@gmail.com> wrote:
>
> >>  hi,
> >> I am still new to this TBC/Semantics and Sparql,
> >> and I am working on conversion of XML documents and export it to CSV
> >> or TXT
>
> >>       I open the XML file (sample attached) using the Semantic XML 
> >> Documents
> >> and then I can see all the classes and instances,
> >> the process flow will be selecting a file (later root folder and then
> >> iterating it) and then converting it to spreadsheet and hten exporting
> >> it to text/xls.
>
> >>       while converting it to spreasheet I am finding hard time to write the
> >> sparql query for selecting the tags.
>
> >>       Example is a sample from the google:
> >> SELECT *
> >> WHERE {
> >>    ?var dcterms:abstract ?abstract .
> >>    ?var dcterms:author ?author.
> >>    ?var dc:title ?title .
>
> >>       }
> >> I am not sure how this works. I mean how do I know what are the tag
> >> types (dcterms, dc, prism)
>
> >>       Pls guide me.
>
> >>       Thanks
>
> >>        Publisher.xml
> >> 39KViewDownload
>
> >>      --
> >> You received this message because you are subscribed to the Google Groups
> >> "TopBraid Composer Users" group.
> >> To post to this group, send email to
> >> topbraid-composer-us...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> topbraid-composer-users+unsubscr...@googlegroups.com<topbraid-composer-users%2bunsubscr...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/topbraid-composer-users?hl=en.
>
>
>
>  CreateReportSpreadsheets.png
> 28KViewDownload

-- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Composer Users" group.
To post to this group, send email to topbraid-composer-us...@googlegroups.com.
To unsubscribe from this group, send email to 
topbraid-composer-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/topbraid-composer-users?hl=en.

Reply via email to