|
Page Updated: January 22, 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 |
RDF ( will include rdfContainer.js, rdfBase.js )
RDF
RDF will open and initialize an rdf datasource.
void RDFFile (string aSrc, int aFlags)
Constructs an RDF class based on the flags in aFlag.aSrc - a uri to the rdf file.
aFlags (optional) - defines operations, see below.
Possible aFlags values:
- JS_RDFFILE_FLAG_SYNC - load RDF source synchronously.
Example:
var src = "http://slashdot.org/slashdot.rdf ";or using default namespace:
var gRDF = new RDF(src);
var gRDF = new RDFFile(src);
or to load the rdf at a later time:
var gRDF = new RDFFile(path, JS_RDFFILE_FLAG_DONT_LOAD );
RDF.prototype.getSource
Returns the uri of the created datasource.
uri getSource ()
Example:var gRDF = new RDFFile(path);
var uri = gRDF.src();
dump("uri: " + uri + "\n");
RDF.prototype.getNode
Get a node from the datasource.
RDFResource getNode (string aPath)
Returns a RDFResource for a give resource path in the rdf graph.aPath - Resource path of the node.
Example:
var gRDF = new RDFFile(path);
var node = gRDF.getNode("urn:test:bob");
if(node != null) {
... < see RDFResource for operation on nodes > ...
}
RDF.prototype.addRootSeq
Get a sequence from the rdf datasource.
RDFContainer addRootSeq (string aPath)
Creates and returns an RDFContainer for a given resource path in the rdf graph.aPath - Resource path of the container.
Example:
var gRDF = new RDFFile(path );
var seq = gRDF.addRootSeq("urn:test:bob");
if(seq != null) {
... < see RDFContainer for operation on nodes > ...
}
RDF.prototype.addRootAlt
Get a alt from the rdf datasource.
RDFContainer addRootAlt (string aPath)
Creates and returns an RDFContainer for a given resource path in the rdf graph.aPath - Resource path of the container.
Example:
var gRDF = new RDFFile(path );
var alt = gRDF.addRootAlt("urn:test:bob");
if(alt != null) {
... < see RDFContainer for operation on nodes > ...
}
RDF.prototype.addRootBag
Get a bag from the rdf datasource.
RDFContainer addRootBag (string aPath)
Creates and returns an RDFContainer for a given resource path in the rdf graph.aPath - Resource path of the container.
Example:
var gRDF = new RDFFile(path );
var bag = gRDF.addRootBag("urn:test:bob");
if(bag != null) {
... < see RDFContainer for operation on nodes > ...
}
RDF.prototype.addRootBag
Get a bag from the rdf datasource.
RDFContainer addRootBag (string aPath)
Creates and returns an RDFContainer for a given resource path in the rdf graph.aPath - Resource path of the container.
Example:
var gRDF = new RDFFile(path );
var bag = gRDF.addRootBag("urn:test:bob");
if(bag != null) {
... < see RDFContainer for operation on nodes > ...
}
RDF.prototype.getRootSeq
Get a sequence from the rdf datasource.
RDFContainer getRootSeq (string aPath)
Returns an RDFContainer for a given resource path in the rdf graph.aPath - Resource path of the container.
Example:
var gRDF = new RDFFile(path );
var seq = gRDF.getRootSeq("urn:test:bob");
if(seq != null) {
... < see RDFContainer for operation on nodes > ...
}
RDF.prototype.getRootAlt
Get a alt from the rdf datasource.
RDFContainer getRootAlt (string aPath)
Returns an RDFContainer for a given resource path in the rdf graph.aPath - Resource path of the container.
Example:
var gRDF = new RDFFile(path);
var alt = gRDF.getRootAlt("urn:test:bob");
if(alt != null) {
... < see RDFContainer for operation on nodes > ...
}
RDF.prototype.getRootBag
Get a bag from the rdf datasource.
RDFContainer getRootBag (string aPath)
Returns an RDFContainer for a given resource path in the rdf graph.aPath - Resource path of the container.
Example:
var gRDF = new RDFFile(path);
var bag = gRDF.getRootBag("urn:test:bob");
if(bag != null) {
... < see RDFContainer for operation on nodes > ...
}
RDF.prototype.getRootBag
Get a bag from the rdf datasource.
RDFContainer getRootBag (string aPath)
Returns an RDFContainer for a given resource path in the rdf graph.aPath - Resource path of the container.
Example:
var gRDF = new RDFFile(path);
var bag = gRDF.getRootBag("urn:test:bob");
if(bag != null) {
... < see RDFContainer for operation on nodes > ...
}
RDF.prototype.getAllSeqs
Get all sequences from the rdf datasource.
Array of RDFContainers getAllSeqs ()Example:
Returns an Array of RDFContainers in the rdf graph.
var gRDF = new RDFFile(path);
var seqs = gRDF.getAllSeqs();
for(var i=0; i<seqs.length; i++) {
... < see RDFContainer for operation on nodes > ...
}
RDF.prototype.getAllAlts
Get all alts from the rdf datasource.
Array of RDFContainers getAllAlts ()Example:
Returns an Array of RDFContainers in the rdf graph.
var gRDF = new RDFFile(path);
var alts = gRDF.getAllAlts();
for(var i=0; i<alts.length; i++) {
... < see RDFContainer for operation on nodes > ...
}
RDF.prototype.getAllBags
Get all bags from the rdf datasource.
Array of RDFContainers getAllBags ()Example:
Returns an Array of RDFContainers in the rdf graph.
var gRDF = new RDFFile(path);
var bags = gRDF.getAllBags();
for(var i=0; i<bags.length; i++) {
... < see RDFContainer for operation on nodes > ...
}
RDF.prototype.getAllContainers
Get all containters from the rdf datasource.
Array of RDFContainers getAllContainers ()Example:
Returns an Array of RDFContainers in the rdf graph.
var gRDF = new RDFFile(path);
var containers = gRDF.getAllContainers();
for(var i=0; i<containers.length; i++) {
... < see RDFContainer for operation on nodes > ...
}
RDF.prototype.flush
Flushes the rdf datasource.
void flush ()Example:
Flushes any unsaved data out to the rdf datasource (file in the case of RDFFile).
var gRDF = new RDFFile(path);
var seq = gRDF.addRootSeq("urn:test:bob");
gRDF.flush(); // save it...