Re: Combine two RDF datasets

Axel Hecht <[email protected]> Fri, 30 Jan 2009 09:37:29 +0100
Newsgroups gmane.comp.mozilla.devel.rdf
Message-ID <[email protected]>
You want to put your xml datasource into a composite datasource, and add 
your in-memory one to the composite one. The composite datasource well 
then have the triples of both, live, as it just wraps both.

HTH

Axel

On 30.01.2009 5:46 Uhr, Mark wrote:
> Hi,
>
> Is there any way to combine two RDF datasets? I have one XML-file
> dataset which I load at startup. I want to add additional triples
> during runtime. The easiest way for me to create these triples is
> using a string, e.g.,
>
> ==================================
> var strRDFData1 = '\
> <?xml version="1.0" encoding="utf-8"?>\
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\
>           xmlns:email="abc://my/car#"\
>           xmlns:attachment="abc://my/part#">\
> <rdf:Description>\
>    <car:model>Chevy</car:model>\
>    <car:parts>\
>      <rdf:Bag>\
>        <rdf:li>\
>          <rdf:Description>\
>            <part:name>Some part name</part:name>\
>            <part:size>12</part:size>\
>          </rdf:Description>\
>        </rdf:li>\
>      </rdf:Bag>\
>    </car:parts>\
> </rdf:Description>\
> </rdf:RDF>';
> ==================================
>
> Then parse the string into a in memory data set. However,  I see no
> way how to combine such in memory DS with the XML-file data set (which
> is composed of triples like the above).
>
> If I try to use the current XML-file data set as the destination of
> the parser, the current data in the XML-file data set is __erased__
> before the data in the in-memory dataset is appended. I do not want
> such a thing. Could someone please help?
>
> Thanks