Phil;  The IterateOverSelect module will accumulate triples to pass to
the next module.  One way to do what you want is to construct all of
the triples before sending them to Oracle.  If you set replace=true on
the ApplyConstruct, then only the triples that you construct (in that
module) will be accumulated on each iteration.  When the next is
executed, the triples passed will be the accumulated set of
constructed triples from that IterateOverSelect.  The next module
would save the accumulated triples to Oracle.

If my description hasn't been clear, Exercise 4 of the SPARQLMotion
tutorial addresses IterateOverSelect and replace=true, p. 21 in
particular.

-- Scott

On Jun 3, 7:30 am, [email protected] wrote:
> I am writing a sparqlmotion script that iterates over a series of XML
> files containing drug data.  The XML files to processed are listed in
> a master file.  For each XML file listed in the master file, I need to
> convert the XML into RDF and then process that RDF into the desired
> triples I ultimately wish to store in Oracle.
>
> My sparqlmotion script reads in the master file, converts it to RDF,
> then executes an IterateOverSelect to bind the file name to a variable
> that is then passed into the body of the iteration. The iteration body
> is a series of modules that do the following:
>
> - import the XML file (using the variable binding from the
> IterateOverSelect)
> - converts the XML to RDF
> - executes numerous construct modules to build the desired triples
> - exports the desired triples to Oracle
>
> I have completed the script and it runs as desired when the master
> file contains only 1 XML file.  However, when the master file contains
> multiple XML entries, all data from each file gets cascaded to the
> others during process.  For example, assume I have 3 XML files (F1,
> F2, F3) that each contain drug data for a drug (D1, D2, D3).  Let's
> assume that the only data in each file is the drug name.  When the
> script executes, the expected triples to be stored in Oracle are:
>
> D1  :hasDrugName  "Drug 1" .
> D2  :hasDrugName  "Drug 2" .
> D3  :hasDrugName  "Drug 3" .
>
> However, what the actual results I get are:
>
> D1  :hasDrugName  "Drug 1" .
> D1  :hasDrugName  "Drug 2" .
> D1  :hasDrugName  "Drug 3" .
> D2  :hasDrugName  "Drug 1" .
> D2  :hasDrugName  "Drug 2" .
> D2  :hasDrugName  "Drug 3" .
> D3  :hasDrugName  "Drug 1" .
> D3  :hasDrugName  "Drug 2 .
> D3  :hasDrugName  "Drug 3" .
>
> It appears that all the RDF from one iteration of the
> IterateOverSelect is passed into subsequent iterations.  Assuming this
> is true, how do I throw away the RDF from each iteration so that it is
> not carried into subsequent ones?
>
> I considered a FilterByConstruct, but I expect that will also filter
> out the filename triples that were imported from the master file.  Is
> my logic flawed.  Am I doing something wrong?
>
> Any assistance would be greatly appreciated.  Also, I would certainly
> be willing to ake this offline and speak with someone over the phone
> if this posting is a little too complicated to resolve via a
> discussion thread.
>
> Thanks!
>
> Phil
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to