Tim; To remove triples generated om one look, use sml:CollectGarbage after placing the data in the files.  This should remove th references on each interation and not accumulate them.

-- Scott

On 10/14/2013 12:27 PM, Tim Smith wrote:
Hi Bob,

Thanks for the suggestions. 

I must say, this is proving to be rather difficult to implement.

So what I have is a graph (created using SM) with 610 "root nodes" and a bunch of other stuff.  If I export this graph to a file using SM, I can export any one of these graphs using File->Export->XML from RDF/OWL and specifying the root node.

My goal is to put each xml doc in a unique file.

If I do what you mentioned above - using an IterateOverSelect and APPLYCONSTRUCT to go through the docs one-by-one, I run into a couple of issues:

1.  It's a real pain to use CONSTRUCT to pull out the piece of the graph for each doc, especially since I have to include the xml mapping as well.

2.  Using IterateOverSelect (IOS) will not work because it accumulates the triples at the end.  After the IOS, I filter the input graph for the desired triples, this works fine.  However, the second and all suqsequent times through the loop, it appears that the triples from the previous iterations are still present, as one would expect given the behavior of IOS. 

Therefore, I'm getting the same XML in every file even though the unique filename, etc... are generating correctly.  The ConvertRDFtoXML module seems to pick the same one every time.

Any thoughts on how to get around this? 

It would seem that the manual File->Export->XML from RDF/OWL knows how to take a specified root node and export the appropriate XML from the large graph.  How can I duplicate this functionality in SM?

Thanks for your help.

Tim



On Fri, Oct 11, 2013 at 11:44 AM, Bob DuCharme <[email protected]> wrote:
Tim,

The sml:ConvertRDFToXML SPARQLMotion module will create an individual XML file for you to save to disk. For each set of triples that you send to it to be output as a separate document,  the root is specified as an instance of the class sxml:Document, which has an sxml:root property pointing to the root node. 

If you want to output multiple documents, you would have to specify an instance of sxml:Document for each one, with each pointing to the root that you want for that document. You could use an IterateOverSelect to identify the nodes to use as roots then have that call a CONSTRUCT module to isolate the triples that you want to send to each file and to identify the root as described above. 

Bob DuCharme



On Thu, Oct 10, 2013 at 10:44 PM, Tim Smith <[email protected]> wrote:
Hi,

I have a situation where I'm extracting data from a SQL database, converting that to an ontology that was generated from an XSD file.  All of this is done using SPARQLMotion.  The  resulting graph has about 500 xml root nodes.

My objective is to have each XML root node become the root node of an individual file on disk.

Assuming I have SM output that graph to a file in the workspace, I can then open the file in TBC and use the export option to output each xml doc to a file by specifying the root nodes one at a time.

However, this will obviously not work when you have hundreds (thousands when I scale this) of root nodes that must become unique files.

How do I specify a root node when using the RDF to XML SM module just like I can using the manual RDF to XML export functionality in TBC?

If that's not an option, is there another way to do it?

Thanks for your assistance,

Tim

--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages 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 Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages 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 Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages 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 Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages 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 Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to