How to open "file://"-RDF, change it and flush it to somewhere else?

Manuel Reimer <[email protected]>
Newsgroups gmane.comp.mozilla.devel.rdf
Organization Newsoffice.de - http://www.newsoffice.de
Message-ID <[email protected]>
Hello,

what do I have to do to open a "file://"-RDF and save it, after 
changing, to somewhere else *without* changing the initially opened 
file?

Currently I use this code:

| var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].
|                    getService(Components.interfaces.nsIRDFService);
| 
| var ds=rdfService.GetDataSourceBlocking("file:///tmp/inputtest.rdf");
| 
| var subject = rdfService.GetResource("http://www.example.com/test");
| var predicate = 
|      rdfService.GetResource("http://www.example.com/rdf#name");
| var name = rdfService.GetLiteral("This is a test");
| 
| ds.Assert(subject, predicate, name, true);
| 
| ds.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
| ds.FlushTo("file:///tmp/outtest.rdf");
| rdfService.UnregisterDataSource(ds);

This saves my output file, but always changes the input file, too.

Thank you very much in advance

CU

Manuel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.