This object represents an RDF datasource. It will load data from an RDF file or URL as needed. To instantiate it, use one of the following forms:
var dsource=new RDFDataSource ( uri );
var dsource=new RDFDataSource ( uri , callbackFn );
This will create a new datasource for the given URI. The URI may be an internal RDF datasource, (such as rdf:bookmarks) or a pointer to an RDF file or URL. If the URI is null, an empty in-memory datasource will be created. If the second argument is null, the datasource is loaded synchronously. If a callback function is supplied as the second argument, the datasource is loaded asynchronously and the function is called when the datasource has finished loading. Note that not all datasources may be loaded synchronously. The callback function is passed the datasource as its first argument.
Copies all of the resources from the datasource and adds them into another. The argument should be the RDFDataSource to copy the resources to.
Deletes a node from the datasource and all resources descending from it in the tree. This only works for datasources that don't have circular references. The node argument may be an RDFNode or a URI.
Returns an RDFEnumerator of all the resources in the datasource.
Returns an RDFNode with a randomly generated URI.
Gets an RDFLiteral of the datasource, identified by URI. It doesn't necessarily have to exist in the datasource.
Gets an RDFNode of the datasource, identified by URI. It doesn't necessarily have to exist in the datasource.
Returns the nsIRDFDataSource object for the datasource.
Takes a string of RDF, parses it, and appends the nodes into the datasource. You must also specify the base URI for the datasource.
Reloads the contents of the datasource from its original RDF file. If sync is set to true, the function does not return until it has completed.
Writes any changes made to the datasource back to its RDF file. This only works for writeable datasources.
Saves a serialized version of the datasource to an nsIOutputStream.
Returns the contents of the datasource, serialized as a string.