|
Page Updated: January 28, 2002
Latest Version: 0.1.359 |
|
Debug |
Install | File
I/O |
RDF |
Network |
Sound | Utils |
XUL | Zip
|
|
|
Home | Mailing List |
Install |
Source Code |
Downloads | Bugs
| docs
| clients |
RDFBase
RDFBase
RDFBase.prototype.getDatasource |
RDFBase
RDFBase is foundation for all the other RDF classes (in jslib).
Note: This class is not intended to be directly created. RDF, RDFFile or RDFContainer should create this for you. See those classes for an example.
void RDFBase (nsIRDFDataSource aDatasource)
This base creates all the supporting RDF manipulation objects for derived classes to use.
aDatasource - an nsIRDFDataSource object.
RDFBase.prototype.getDatasource
Get the nsIRDFDataSource for the resource.
nsIRDFDataSource getDatasource ()Example:
Usefull if you want to attach this datasource to a tree, or outliner.
var gRDF = new RDFFile(path);
ourlinerbody.database.AddDataSource(gRDF.getDatasource());
RDFBase.prototype.isValid
Check to see if resource valid.
boolean isValid ()Example:
This returns true if this resource is still valid. An invalid state only happens when you remove the resource.
var gRDF = new RDFFile(path );
var node = gRDF.getRootNode("urn:test:bob");
if(node.isValid()) {
dump("node: "+node.getSubject()+"\n");
}
prints:
node: urn:test:bob
RDFBase.prototype.setValid
Change the validity of this resource.
boolean setValid (boolean aTruth)
Sets the truth value for the resource. This can be usefull if you want to make sure that you can't manipulate a resouce.aTruth - true or false.
Example:
var gRDF = new RDFFile(path );
var node = gRDF.getRootNode("urn:test:bob");
node.setValid(false);
RDFBase.prototype.flush
Flush the changes out to file/net/memory.
void flush ()Example:
This call will "flush" the changes that you made to the datasource out to disk or memory.
var gRDF = new RDFFile(path );
var node = gRDF.getRootNode("urn:test:bob");
node.setAttribute("address", "123 somewhere st");
node.flush();