How does Mozilla manage datasources?
The RDF service manages a table of all loaded datasources. The table is keyed by the datasource’s “URI”, which is either the URL of an RDF/XML file, or a “special” URI starting with rdf: that refers to a built-in datasource. Datasources may be loaded via the RDF service using the GetDataSource() method. If the URI argument refers to an RDF/XML file’s URL, then the RDF service will create an RDF/XML datasource and asynchronously parse it. The datasource will remain “cached” until the last reference to the datasource is released. If the URI argument refers to a built-in datasource, the RDF service will use the XPCOM Component Manager to load a component whose ContractID is constructed using the “special” URI and the well-known prefix@mozilla.org/rdf/datasource;1?name=.